diff options
Diffstat (limited to 'app/Template')
197 files changed, 2801 insertions, 1623 deletions
diff --git a/app/Template/action/event.php b/app/Template/action/event.php index 7f968a97..b4741a98 100644 --- a/app/Template/action/event.php +++ b/app/Template/action/event.php @@ -11,7 +11,7 @@ <?= $this->form->hidden('action_name', $values) ?> <?= $this->form->label(t('Event'), 'event_name') ?> - <?= $this->form->select('event_name', $events, $values) ?><br/> + <?= $this->form->select('event_name', $events, $values) ?> <div class="form-help"> <?= t('When the selected event occurs execute the corresponding action.') ?> diff --git a/app/Template/action/index.php b/app/Template/action/index.php index bf2f7475..66cfed77 100644 --- a/app/Template/action/index.php +++ b/app/Template/action/index.php @@ -28,24 +28,24 @@ </td> <td> <ul> - <?php foreach ($action['params'] as $param): ?> + <?php foreach ($action['params'] as $param_name => $param_value): ?> <li> - <?= $this->text->in($param['name'], $available_params) ?> = + <?= $this->text->in($param_name, $available_params[$action['action_name']]) ?> = <strong> - <?php if ($this->text->contains($param['name'], 'column_id')): ?> - <?= $this->text->in($param['value'], $columns_list) ?> - <?php elseif ($this->text->contains($param['name'], 'user_id')): ?> - <?= $this->text->in($param['value'], $users_list) ?> - <?php elseif ($this->text->contains($param['name'], 'project_id')): ?> - <?= $this->text->in($param['value'], $projects_list) ?> - <?php elseif ($this->text->contains($param['name'], 'color_id')): ?> - <?= $this->text->in($param['value'], $colors_list) ?> - <?php elseif ($this->text->contains($param['name'], 'category_id')): ?> - <?= $this->text->in($param['value'], $categories_list) ?> - <?php elseif ($this->text->contains($param['name'], 'link_id')): ?> - <?= $this->text->in($param['value'], $links_list) ?> + <?php if ($this->text->contains($param_name, 'column_id')): ?> + <?= $this->text->in($param_value, $columns_list) ?> + <?php elseif ($this->text->contains($param_name, 'user_id')): ?> + <?= $this->text->in($param_value, $users_list) ?> + <?php elseif ($this->text->contains($param_name, 'project_id')): ?> + <?= $this->text->in($param_value, $projects_list) ?> + <?php elseif ($this->text->contains($param_name, 'color_id')): ?> + <?= $this->text->in($param_value, $colors_list) ?> + <?php elseif ($this->text->contains($param_name, 'category_id')): ?> + <?= $this->text->in($param_value, $categories_list) ?> + <?php elseif ($this->text->contains($param_name, 'link_id')): ?> + <?= $this->text->in($param_value, $links_list) ?> <?php else: ?> - <?= $this->e($param['value']) ?> + <?= $this->e($param_value) ?> <?php endif ?> </strong> </li> @@ -53,7 +53,7 @@ </ul> </td> <td> - <?= $this->url->link(t('Remove'), 'action', 'confirm', array('project_id' => $project['id'], 'action_id' => $action['id'])) ?> + <?= $this->url->link(t('Remove'), 'action', 'confirm', array('project_id' => $project['id'], 'action_id' => $action['id']), false, 'popover') ?> </td> </tr> <?php endforeach ?> @@ -67,9 +67,9 @@ <?= $this->form->hidden('project_id', $values) ?> <?= $this->form->label(t('Action'), 'action_name') ?> - <?= $this->form->select('action_name', $available_actions, $values) ?><br/> + <?= $this->form->select('action_name', $available_actions, $values) ?> <div class="form-actions"> - <input type="submit" value="<?= t('Next step') ?>" class="btn btn-blue"/> + <input type="submit" value="<?= t('Next step') ?>" class="btn btn-blue"> </div> </form>
\ No newline at end of file diff --git a/app/Template/action/params.php b/app/Template/action/params.php index dcfaa9cc..a2350dea 100644 --- a/app/Template/action/params.php +++ b/app/Template/action/params.php @@ -15,22 +15,25 @@ <?php if ($this->text->contains($param_name, 'column_id')): ?> <?= $this->form->label($param_desc, $param_name) ?> - <?= $this->form->select('params['.$param_name.']', $columns_list, $values) ?><br/> + <?= $this->form->select('params['.$param_name.']', $columns_list, $values) ?> <?php elseif ($this->text->contains($param_name, 'user_id')): ?> <?= $this->form->label($param_desc, $param_name) ?> - <?= $this->form->select('params['.$param_name.']', $users_list, $values) ?><br/> + <?= $this->form->select('params['.$param_name.']', $users_list, $values) ?> <?php elseif ($this->text->contains($param_name, 'project_id')): ?> <?= $this->form->label($param_desc, $param_name) ?> - <?= $this->form->select('params['.$param_name.']', $projects_list, $values) ?><br/> + <?= $this->form->select('params['.$param_name.']', $projects_list, $values) ?> <?php elseif ($this->text->contains($param_name, 'color_id')): ?> <?= $this->form->label($param_desc, $param_name) ?> - <?= $this->form->select('params['.$param_name.']', $colors_list, $values) ?><br/> + <?= $this->form->select('params['.$param_name.']', $colors_list, $values) ?> <?php elseif ($this->text->contains($param_name, 'category_id')): ?> <?= $this->form->label($param_desc, $param_name) ?> - <?= $this->form->select('params['.$param_name.']', $categories_list, $values) ?><br/> + <?= $this->form->select('params['.$param_name.']', $categories_list, $values) ?> <?php elseif ($this->text->contains($param_name, 'link_id')): ?> <?= $this->form->label($param_desc, $param_name) ?> - <?= $this->form->select('params['.$param_name.']', $links_list, $values) ?><br/> + <?= $this->form->select('params['.$param_name.']', $links_list, $values) ?> + <?php elseif ($this->text->contains($param_name, 'duration')): ?> + <?= $this->form->label($param_desc, $param_name) ?> + <?= $this->form->number('params['.$param_name.']', $values) ?> <?php else: ?> <?= $this->form->label($param_desc, $param_name) ?> <?= $this->form->text('params['.$param_name.']', $values) ?> diff --git a/app/Template/action/remove.php b/app/Template/action/remove.php index c8d4dfe4..070a7918 100644 --- a/app/Template/action/remove.php +++ b/app/Template/action/remove.php @@ -10,6 +10,6 @@ <div class="form-actions"> <?= $this->url->link(t('Yes'), 'action', 'remove', array('project_id' => $project['id'], 'action_id' => $action['id']), true, 'btn btn-red') ?> <?= t('or') ?> - <?= $this->url->link(t('cancel'), 'action', 'index', array('project_id' => $project['id'])) ?> + <?= $this->url->link(t('cancel'), 'action', 'index', array('project_id' => $project['id']), false, 'close-popover') ?> </div> </div>
\ No newline at end of file diff --git a/app/Template/activity/project.php b/app/Template/activity/project.php index bc585212..ba6d6629 100644 --- a/app/Template/activity/project.php +++ b/app/Template/activity/project.php @@ -19,7 +19,7 @@ <i class="fa fa-calendar fa-fw"></i> <?= $this->url->link(t('Back to the calendar'), 'calendar', 'show', array('project_id' => $project['id'])) ?> </li> - <?php if ($this->user->isProjectManagementAllowed($project['id'])): ?> + <?php if ($this->user->hasProjectAccess('ProjectEdit', 'edit', $project['id'])): ?> <li> <i class="fa fa-cog fa-fw"></i> <?= $this->url->link(t('Project settings'), 'project', 'show', array('project_id' => $project['id'])) ?> diff --git a/app/Template/analytic/compare_hours.php b/app/Template/analytic/compare_hours.php new file mode 100644 index 00000000..bb145d61 --- /dev/null +++ b/app/Template/analytic/compare_hours.php @@ -0,0 +1,62 @@ +<div class="page-header"> + <h2><?= t('Compare Estimated Time vs Actual Time') ?></h2> +</div> + +<div class="listing"> + <ul> + <li><?= t('Estimated hours: ').'<strong>'.$this->e($metrics['open']['time_estimated'] + $metrics['closed']['time_estimated']) ?></strong></li> + <li><?= t('Actual hours: ').'<strong>'.$this->e($metrics['open']['time_spent'] + $metrics['closed']['time_spent']) ?></strong></li> + </ul> +</div> + +<?php if (empty($metrics)): ?> + <p class="alert"><?= t('Not enough data to show the graph.') ?></p> +<?php else: ?> +<section id="analytic-compare-hours"> + <div id="chart" + data-metrics='<?= json_encode($metrics, JSON_HEX_APOS)?>' + data-label-spent="<?= t('Hours Spent') ?>" + data-label-estimated="<?= t('Hours Estimated') ?>" + data-label-closed="<?= t('Closed') ?>" + data-label-open="<?= t('Open') ?>"></div> + + <?php if ($paginator->isEmpty()): ?> + <p class="alert"><?= t('No tasks found.') ?></p> + <?php elseif (! $paginator->isEmpty()): ?> + <table class="table-fixed table-small"> + <tr> + <th class="column-5"><?= $paginator->order(t('Id'), 'tasks.id') ?></th> + <th><?= $paginator->order(t('Title'), 'tasks.title') ?></th> + <th class="column-5"><?= $paginator->order(t('Status'), 'tasks.is_active') ?></th> + <th class="column-10"><?= $paginator->order(t('Estimated Time'), 'tasks.time_estimated') ?></th> + <th class="column-10"><?= $paginator->order(t('Actual Time'), 'tasks.time_spent') ?></th> + </tr> + <?php foreach ($paginator->getCollection() as $task): ?> + <tr> + <td class="task-table color-<?= $task['color_id'] ?>"> + <?= $this->url->link('#'.$this->e($task['id']), 'task', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id']), false, '', t('View this task')) ?> + </td> + <td> + <?= $this->url->link($this->e($task['title']), 'task', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id']), false, '', t('View this task')) ?> + </td> + <td> + <?php if ($task['is_active'] == \Kanboard\Model\Task::STATUS_OPEN): ?> + <?= t('Open') ?> + <?php else: ?> + <?= t('Closed') ?> + <?php endif ?> + </td> + <td> + <?= $this->e($task['time_estimated']) ?> + </td> + <td> + <?= $this->e($task['time_spent']) ?> + </td> + </tr> + <?php endforeach ?> + </table> + + <?= $paginator ?> + <?php endif ?> +</section> +<?php endif ?> diff --git a/app/Template/analytic/layout.php b/app/Template/analytic/layout.php index fd2090ae..f1dba552 100644 --- a/app/Template/analytic/layout.php +++ b/app/Template/analytic/layout.php @@ -19,7 +19,7 @@ <i class="fa fa-calendar fa-fw"></i> <?= $this->url->link(t('Back to the calendar'), 'calendar', 'show', array('project_id' => $project['id'])) ?> </li> - <?php if ($this->user->isProjectManagementAllowed($project['id'])): ?> + <?php if ($this->user->hasProjectAccess('ProjectEdit', 'edit', $project['id'])): ?> <li> <i class="fa fa-cog fa-fw"></i> <?= $this->url->link(t('Project settings'), 'project', 'show', array('project_id' => $project['id'])) ?> @@ -31,9 +31,8 @@ </li> </ul> </div> - <section class="sidebar-container" id="analytic-section"> - - <?= $this->render('analytic/sidebar', array('project' => $project)) ?> + <section class="sidebar-container"> + <?= $this->render($sidebar_template, array('project' => $project)) ?> <div class="sidebar-content"> <?= $content_for_sublayout ?> diff --git a/app/Template/analytic/sidebar.php b/app/Template/analytic/sidebar.php index c942f7ed..76289b9f 100644 --- a/app/Template/analytic/sidebar.php +++ b/app/Template/analytic/sidebar.php @@ -1,25 +1,29 @@ <div class="sidebar"> <h2><?= t('Reportings') ?></h2> <ul> - <li <?= $this->app->getRouterAction() === 'tasks' ? 'class="active"' : '' ?>> + <li <?= $this->app->checkMenuSelection('analytic', 'tasks') ?>> <?= $this->url->link(t('Task distribution'), 'analytic', 'tasks', array('project_id' => $project['id'])) ?> </li> - <li <?= $this->app->getRouterAction() === 'users' ? 'class="active"' : '' ?>> + <li <?= $this->app->checkMenuSelection('analytic', 'users') ?>> <?= $this->url->link(t('User repartition'), 'analytic', 'users', array('project_id' => $project['id'])) ?> </li> - <li <?= $this->app->getRouterAction() === 'cfd' ? 'class="active"' : '' ?>> + <li <?= $this->app->checkMenuSelection('analytic', 'cfd') ?>> <?= $this->url->link(t('Cumulative flow diagram'), 'analytic', 'cfd', array('project_id' => $project['id'])) ?> </li> - <li <?= $this->app->getRouterAction() === 'burndown' ? 'class="active"' : '' ?>> + <li <?= $this->app->checkMenuSelection('analytic', 'burndown') ?>> <?= $this->url->link(t('Burndown chart'), 'analytic', 'burndown', array('project_id' => $project['id'])) ?> </li> - <li <?= $this->app->getRouterAction() === 'averagetimebycolumn' ? 'class="active"' : '' ?>> + <li <?= $this->app->checkMenuSelection('analytic', 'averageTimeByColumn') ?>> <?= $this->url->link(t('Average time into each column'), 'analytic', 'averageTimeByColumn', array('project_id' => $project['id'])) ?> </li> - <li <?= $this->app->getRouterAction() === 'leadandcycletime' ? 'class="active"' : '' ?>> + <li <?= $this->app->checkMenuSelection('analytic', 'leadAndCycleTime') ?>> <?= $this->url->link(t('Lead and cycle time'), 'analytic', 'leadAndCycleTime', array('project_id' => $project['id'])) ?> </li> + <li <?= $this->app->checkMenuSelection('analytic', 'compareHours') ?>> + <?= $this->url->link(t('Estimated vs actual time'), 'analytic', 'compareHours', array('project_id' => $project['id'])) ?> + </li> + + <?= $this->hook->render('template:analytic:sidebar', array('project' => $project)) ?> + </ul> - <div class="sidebar-collapse"><a href="#" title="<?= t('Hide sidebar') ?>"><i class="fa fa-chevron-left"></i></a></div> - <div class="sidebar-expand" style="display: none"><a href="#" title="<?= t('Expand sidebar') ?>"><i class="fa fa-chevron-right"></i></a></div> -</div>
\ No newline at end of file +</div> diff --git a/app/Template/app/filters_helper.php b/app/Template/app/filters_helper.php index 71b57a8c..c16c2251 100644 --- a/app/Template/app/filters_helper.php +++ b/app/Template/app/filters_helper.php @@ -1,5 +1,6 @@ -<div class="dropdown filters"> - <i class="fa fa-caret-down"></i> <a href="#" class="dropdown-menu"><?= t('Filters') ?></a> +<?= $this->hook->render('template:app:filters-helper:before', isset($project) ? array('project' => $project) : array()) ?> +<div class="dropdown"> + <a href="#" class="dropdown-menu dropdown-menu-link-icon" title="<?= t('Default filters') ?>"><i class="fa fa-filter fa-fw"></i><i class="fa fa-caret-down"></i></a> <ul> <li><a href="#" class="filter-helper filter-reset" data-filter="<?= isset($reset) ? $reset : '' ?>" title="<?= t('Keyboard shortcut: "%s"', 'r') ?>"><?= t('Reset filters') ?></a></li> <li><a href="#" class="filter-helper" data-filter="status:open assignee:me"><?= t('My tasks') ?></a></li> @@ -15,4 +16,5 @@ <?= $this->url->doc(t('View advanced search syntax'), 'search') ?> </li> </ul> -</div>
\ No newline at end of file +</div> +<?= $this->hook->render('template:app:filters-helper:after', isset($project) ? array('project' => $project) : array()) ?>
\ No newline at end of file diff --git a/app/Template/app/layout.php b/app/Template/app/layout.php index 4f82121e..200cb0d7 100644 --- a/app/Template/app/layout.php +++ b/app/Template/app/layout.php @@ -1,16 +1,18 @@ <section id="main"> <div class="page-header page-header-mobile"> <ul> - <?php if ($this->user->isProjectAdmin() || $this->user->isAdmin()): ?> + <?php if ($this->user->hasAccess('ProjectCreation', 'create')): ?> <li> <i class="fa fa-plus fa-fw"></i> - <?= $this->url->link(t('New project'), 'project', 'create') ?> + <?= $this->url->link(t('New project'), 'ProjectCreation', 'create', array(), false, 'popover') ?> </li> <?php endif ?> + <?php if ($this->app->config('disable_private_project', 0) == 0): ?> <li> <i class="fa fa-lock fa-fw"></i> - <?= $this->url->link(t('New private project'), 'project', 'create', array('private' => 1)) ?> + <?= $this->url->link(t('New private project'), 'ProjectCreation', 'createPrivate', array(), false, 'popover') ?> </li> + <?php endif ?> <li> <i class="fa fa-search fa-fw"></i> <?= $this->url->link(t('Search'), 'search', 'index') ?> @@ -19,20 +21,10 @@ <i class="fa fa-folder fa-fw"></i> <?= $this->url->link(t('Project management'), 'project', 'index') ?> </li> - <?php if ($this->user->isAdmin()): ?> - <li> - <i class="fa fa-user fa-fw"></i> - <?= $this->url->link(t('User management'), 'user', 'index') ?> - </li> - <li> - <i class="fa fa-cog fa-fw"></i> - <?= $this->url->link(t('Settings'), 'config', 'index') ?> - </li> - <?php endif ?> </ul> </div> <section class="sidebar-container" id="dashboard"> - <?= $this->render('app/sidebar', array('user' => $user)) ?> + <?= $this->render($sidebar_template, array('user' => $user)) ?> <div class="sidebar-content"> <?= $content_for_sublayout ?> </div> diff --git a/app/Template/app/notifications.php b/app/Template/app/notifications.php index 511f377b..4cb3c571 100644 --- a/app/Template/app/notifications.php +++ b/app/Template/app/notifications.php @@ -49,7 +49,7 @@ <?php endif ?> </td> <td> - <?= dt('%B %e, %Y at %k:%M %p', $notification['date_creation']) ?> + <?= $this->dt->datetime($notification['date_creation']) ?> </td> <td> <i class="fa fa-check fa-fw"></i> diff --git a/app/Template/app/overview.php b/app/Template/app/overview.php index 1b160496..0b354791 100644 --- a/app/Template/app/overview.php +++ b/app/Template/app/overview.php @@ -1,13 +1,12 @@ -<div class="search"> +<div class="filter-box"> <form method="get" action="<?= $this->url->dir() ?>" class="search"> <?= $this->form->hidden('controller', array('controller' => 'search')) ?> <?= $this->form->hidden('action', array('action' => 'index')) ?> <?= $this->form->text('search', array(), array(), array('placeholder="'.t('Search').'"'), 'form-input-large') ?> + <?= $this->render('app/filters_helper') ?> </form> - - <?= $this->render('app/filters_helper') ?> </div> -<?= $this->render('app/projects', array('paginator' => $project_paginator)) ?> -<?= $this->render('app/tasks', array('paginator' => $task_paginator)) ?> -<?= $this->render('app/subtasks', array('paginator' => $subtask_paginator)) ?>
\ No newline at end of file +<?= $this->render('app/projects', array('paginator' => $project_paginator, 'user' => $user)) ?> +<?= $this->render('app/tasks', array('paginator' => $task_paginator, 'user' => $user)) ?> +<?= $this->render('app/subtasks', array('paginator' => $subtask_paginator, 'user' => $user)) ?>
\ No newline at end of file diff --git a/app/Template/app/projects.php b/app/Template/app/projects.php index cf22707b..61899c96 100644 --- a/app/Template/app/projects.php +++ b/app/Template/app/projects.php @@ -1,5 +1,5 @@ <div class="page-header"> - <h2><?= t('My projects') ?> (<?= $paginator->getTotal() ?>)</h2> + <h2><?= $this->url->link(t('My projects'), 'app', 'projects', array('user_id' => $user['id'])) ?> (<?= $paginator->getTotal() ?>)</h2> </div> <?php if ($paginator->isEmpty()): ?> <p class="alert"><?= t('Your are not member of any project.') ?></p> @@ -22,7 +22,7 @@ <?php endif ?> </td> <td> - <?php if ($this->user->isProjectManagementAllowed($project['id'])): ?> + <?php if ($this->user->hasProjectAccess('gantt', 'project', $project['id'])): ?> <?= $this->url->link('<i class="fa fa-sliders fa-fw"></i>', 'gantt', 'project', array('project_id' => $project['id']), false, 'dashboard-table-link', t('Gantt chart')) ?> <?php endif ?> diff --git a/app/Template/app/sidebar.php b/app/Template/app/sidebar.php index 552a9c27..3f0d988b 100644 --- a/app/Template/app/sidebar.php +++ b/app/Template/app/sidebar.php @@ -1,29 +1,27 @@ <div class="sidebar"> <h2><?= $this->e($user['name'] ?: $user['username']) ?></h2> <ul> - <li <?= $this->app->getRouterAction() === 'index' ? 'class="active"' : '' ?>> + <li <?= $this->app->checkMenuSelection('app', 'index') ?>> <?= $this->url->link(t('Overview'), 'app', 'index', array('user_id' => $user['id'])) ?> </li> - <li <?= $this->app->getRouterAction() === 'projects' ? 'class="active"' : '' ?>> + <li <?= $this->app->checkMenuSelection('app', 'projects') ?>> <?= $this->url->link(t('My projects'), 'app', 'projects', array('user_id' => $user['id'])) ?> </li> - <li <?= $this->app->getRouterAction() === 'tasks' ? 'class="active"' : '' ?>> + <li <?= $this->app->checkMenuSelection('app', 'tasks') ?>> <?= $this->url->link(t('My tasks'), 'app', 'tasks', array('user_id' => $user['id'])) ?> </li> - <li <?= $this->app->getRouterAction() === 'subtasks' ? 'class="active"' : '' ?>> + <li <?= $this->app->checkMenuSelection('app', 'subtasks') ?>> <?= $this->url->link(t('My subtasks'), 'app', 'subtasks', array('user_id' => $user['id'])) ?> </li> - <li <?= $this->app->getRouterAction() === 'calendar' ? 'class="active"' : '' ?>> + <li <?= $this->app->checkMenuSelection('app', 'calendar') ?>> <?= $this->url->link(t('My calendar'), 'app', 'calendar', array('user_id' => $user['id'])) ?> </li> - <li <?= $this->app->getRouterAction() === 'activity' ? 'class="active"' : '' ?>> + <li <?= $this->app->checkMenuSelection('app', 'activity') ?>> <?= $this->url->link(t('My activity stream'), 'app', 'activity', array('user_id' => $user['id'])) ?> </li> - <li <?= $this->app->getRouterAction() === 'notifications' ? 'class="active"' : '' ?>> + <li <?= $this->app->checkMenuSelection('app', 'notifications') ?>> <?= $this->url->link(t('My notifications'), 'app', 'notifications', array('user_id' => $user['id'])) ?> </li> <?= $this->hook->render('template:dashboard:sidebar') ?> </ul> - <div class="sidebar-collapse"><a href="#" title="<?= t('Hide sidebar') ?>"><i class="fa fa-chevron-left"></i></a></div> - <div class="sidebar-expand" style="display: none"><a href="#" title="<?= t('Expand sidebar') ?>"><i class="fa fa-chevron-right"></i></a></div> </div>
\ No newline at end of file diff --git a/app/Template/app/subtasks.php b/app/Template/app/subtasks.php index ad7402bd..6848112c 100644 --- a/app/Template/app/subtasks.php +++ b/app/Template/app/subtasks.php @@ -1,12 +1,12 @@ <div class="page-header"> - <h2><?= t('My subtasks') ?> (<?= $paginator->getTotal() ?>)</h2> + <h2><?= $this->url->link(t('My subtasks'), 'app', 'subtasks', array('user_id' => $user['id'])) ?> (<?= $paginator->getTotal() ?>)</h2> </div> <?php if ($paginator->isEmpty()): ?> <p class="alert"><?= t('There is nothing assigned to you.') ?></p> <?php else: ?> <table class="table-fixed table-small"> <tr> - <th class="column-10"><?= $paginator->order('Id', 'tasks.id') ?></th> + <th class="column-5"><?= $paginator->order('Id', 'tasks.id') ?></th> <th class="column-20"><?= $paginator->order(t('Project'), 'project_name') ?></th> <th><?= $paginator->order(t('Task'), 'task_name') ?></th> <th><?= $paginator->order(t('Subtask'), 'title') ?></th> @@ -15,7 +15,7 @@ <?php foreach ($paginator->getCollection() as $subtask): ?> <tr> <td class="task-table color-<?= $subtask['color_id'] ?>"> - <?= $this->url->link('#'.$subtask['task_id'], 'task', 'show', array('task_id' => $subtask['task_id'], 'project_id' => $subtask['project_id'])) ?> + <?= $this->render('task/dropdown', array('task' => array('id' => $subtask['task_id'], 'project_id' => $subtask['project_id']))) ?> </td> <td> <?= $this->url->link($this->e($subtask['project_name']), 'board', 'show', array('project_id' => $subtask['project_id'])) ?> @@ -24,7 +24,7 @@ <?= $this->url->link($this->e($subtask['task_name']), 'task', 'show', array('task_id' => $subtask['task_id'], 'project_id' => $subtask['project_id'])) ?> </td> <td> - <?= $this->subtask->toggleStatus($subtask, 'dashboard') ?> + <?= $this->subtask->toggleStatus($subtask, $subtask['project_id']) ?> </td> <td> <?php if (! empty($subtask['time_spent'])): ?> diff --git a/app/Template/app/tasks.php b/app/Template/app/tasks.php index 3712750b..786d7159 100644 --- a/app/Template/app/tasks.php +++ b/app/Template/app/tasks.php @@ -1,12 +1,12 @@ <div class="page-header"> - <h2><?= t('My tasks') ?> (<?= $paginator->getTotal() ?>)</h2> + <h2><?= $this->url->link(t('My tasks'), 'app', 'tasks', array('user_id' => $user['id'])) ?> (<?= $paginator->getTotal() ?>)</h2> </div> <?php if ($paginator->isEmpty()): ?> <p class="alert"><?= t('There is nothing assigned to you.') ?></p> <?php else: ?> <table class="table-fixed table-small"> <tr> - <th class="column-8"><?= $paginator->order('Id', 'tasks.id') ?></th> + <th class="column-5"><?= $paginator->order('Id', 'tasks.id') ?></th> <th class="column-20"><?= $paginator->order(t('Project'), 'project_name') ?></th> <th><?= $paginator->order(t('Task'), 'title') ?></th> <th class="column-20"><?= t('Time tracking') ?></th> @@ -15,7 +15,7 @@ <?php foreach ($paginator->getCollection() as $task): ?> <tr> <td class="task-table color-<?= $task['color_id'] ?>"> - <?= $this->url->link('#'.$task['id'], 'task', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?> + <?= $this->render('task/dropdown', array('task' => $task)) ?> </td> <td> <?= $this->url->link($this->e($task['project_name']), 'board', 'show', array('project_id' => $task['project_id'])) ?> @@ -33,7 +33,7 @@ <?php endif ?> </td> <td> - <?= dt('%B %e, %Y', $task['date_due']) ?> + <?= $this->dt->date($task['date_due']) ?> </td> </tr> <?php endforeach ?> diff --git a/app/Template/auth/index.php b/app/Template/auth/index.php index 2f75b113..41441e69 100644 --- a/app/Template/auth/index.php +++ b/app/Template/auth/index.php @@ -19,36 +19,24 @@ <?php if (isset($captcha) && $captcha): ?> <?= $this->form->label(t('Enter the text below'), 'captcha') ?> - <img src="<?= $this->url->href('auth', 'captcha') ?>"/> - <?= $this->form->text('captcha', $values, $errors, array('required')) ?> + <img src="<?= $this->url->href('Captcha', 'image') ?>"/> + <?= $this->form->text('captcha', array(), $errors, array('required')) ?> <?php endif ?> <?php if (REMEMBER_ME_AUTH): ?> - <?= $this->form->checkbox('remember_me', t('Remember Me'), 1, true) ?><br/> + <?= $this->form->checkbox('remember_me', t('Remember Me'), 1, true) ?><br> <?php endif ?> <div class="form-actions"> <input type="submit" value="<?= t('Sign in') ?>" class="btn btn-blue"/> </div> + <?php if ($this->app->config('password_reset') == 1): ?> + <div class="reset-password"> + <?= $this->url->link(t('Forgot password?'), 'PasswordReset', 'create') ?> + </div> + <?php endif ?> </form> <?php endif ?> <?= $this->hook->render('template:auth:login-form:after') ?> - - <?php if (GOOGLE_AUTH || GITHUB_AUTH || GITLAB_AUTH): ?> - <ul class="no-bullet"> - <?php if (GOOGLE_AUTH): ?> - <li><?= $this->url->link(t('Login with my Google Account'), 'oauth', 'google') ?></li> - <?php endif ?> - - <?php if (GITHUB_AUTH): ?> - <li><?= $this->url->link(t('Login with my Github Account'), 'oauth', 'github') ?></li> - <?php endif ?> - - <?php if (GITLAB_AUTH): ?> - <li><?= $this->url->link(t('Login with my Gitlab Account'), 'oauth', 'gitlab') ?></li> - <?php endif ?> - </ul> - <?php endif ?> - </div>
\ No newline at end of file diff --git a/app/Template/board/popover_assignee.php b/app/Template/board/popover_assignee.php index 4af19cf7..8db95323 100644 --- a/app/Template/board/popover_assignee.php +++ b/app/Template/board/popover_assignee.php @@ -1,21 +1,20 @@ <section id="main"> - <section> - <h3><?= t('Change assignee for the task "%s"', $values['title']) ?></h3> - <form method="post" action="<?= $this->url->href('board', 'updateAssignee', array('task_id' => $values['id'], 'project_id' => $values['project_id'])) ?>"> + <div class="page-header"> + <h2><?= t('Change assignee for the task "%s"', $values['title']) ?></h2> + </div> + <form method="post" action="<?= $this->url->href('BoardPopover', 'updateAssignee', array('task_id' => $values['id'], 'project_id' => $project['id'])) ?>"> - <?= $this->form->csrf() ?> + <?= $this->form->csrf() ?> - <?= $this->form->hidden('id', $values) ?> - <?= $this->form->hidden('project_id', $values) ?> + <?= $this->form->hidden('id', $values) ?> + <?= $this->form->hidden('project_id', $values) ?> - <?= $this->form->label(t('Assignee'), 'owner_id') ?> - <?= $this->form->select('owner_id', $users_list, $values, array(), array('autofocus')) ?><br/> + <?= $this->task->selectAssignee($users_list, $values, array(), array('autofocus')) ?> - <div class="form-actions"> - <input type="submit" value="<?= t('Save') ?>" class="btn btn-blue"/> - <?= t('or') ?> - <?= $this->url->link(t('cancel'), 'board', 'show', array('project_id' => $project['id']), false, 'close-popover') ?> - </div> - </form> - </section> + <div class="form-actions"> + <input type="submit" value="<?= t('Save') ?>" class="btn btn-blue"/> + <?= t('or') ?> + <?= $this->url->link(t('cancel'), 'board', 'show', array('project_id' => $project['id']), false, 'close-popover') ?> + </div> + </form> </section>
\ No newline at end of file diff --git a/app/Template/board/popover_category.php b/app/Template/board/popover_category.php index f391f492..e65593cd 100644 --- a/app/Template/board/popover_category.php +++ b/app/Template/board/popover_category.php @@ -1,21 +1,20 @@ <section id="main"> - <section> - <h3><?= t('Change category for the task "%s"', $values['title']) ?></h3> - <form method="post" action="<?= $this->url->href('board', 'updateCategory', array('task_id' => $values['id'], 'project_id' => $values['project_id'])) ?>"> + <div class="page-header"> + <h2><?= t('Change category for the task "%s"', $values['title']) ?></h2> + </div> + <form method="post" action="<?= $this->url->href('BoardPopover', 'updateCategory', array('task_id' => $values['id'], 'project_id' => $project['id'])) ?>"> - <?= $this->form->csrf() ?> + <?= $this->form->csrf() ?> - <?= $this->form->hidden('id', $values) ?> - <?= $this->form->hidden('project_id', $values) ?> + <?= $this->form->hidden('id', $values) ?> + <?= $this->form->hidden('project_id', $values) ?> - <?= $this->form->label(t('Category'), 'category_id') ?> - <?= $this->form->select('category_id', $categories_list, $values, array(), array('autofocus')) ?><br/> + <?= $this->task->selectCategory($categories_list, $values, array(), array('autofocus'), true) ?> - <div class="form-actions"> - <input type="submit" value="<?= t('Save') ?>" class="btn btn-blue"/> - <?= t('or') ?> - <?= $this->url->link(t('cancel'), 'board', 'show', array('project_id' => $project['id']), false, 'close-popover') ?> - </div> - </form> - </section> + <div class="form-actions"> + <input type="submit" value="<?= t('Save') ?>" class="btn btn-blue"/> + <?= t('or') ?> + <?= $this->url->link(t('cancel'), 'board', 'show', array('project_id' => $project['id']), false, 'close-popover') ?> + </div> + </form> </section>
\ No newline at end of file diff --git a/app/Template/board/popover_close_all_tasks_column.php b/app/Template/board/popover_close_all_tasks_column.php new file mode 100644 index 00000000..da6b9ad7 --- /dev/null +++ b/app/Template/board/popover_close_all_tasks_column.php @@ -0,0 +1,18 @@ +<section id="main"> + <div class="page-header"> + <h2><?= t('Do you really want to close all tasks of this column?') ?></h2> + </div> + <form method="post" action="<?= $this->url->href('BoardPopover', 'closeColumnTasks', array('project_id' => $project['id'])) ?>"> + <?= $this->form->csrf() ?> + <?= $this->form->hidden('column_id', $values) ?> + <?= $this->form->hidden('swimlane_id', $values) ?> + + <p class="alert"><?= t('%d task(s) in the column "%s" and the swimlane "%s" will be closed.', $nb_tasks, $column, $swimlane) ?></p> + + <div class="form-actions"> + <input type="submit" value="<?= t('Save') ?>" class="btn btn-red"> + <?= t('or') ?> + <?= $this->url->link(t('cancel'), 'board', 'show', array('project_id' => $project['id']), false, 'close-popover') ?> + </div> + </form> +</section>
\ No newline at end of file diff --git a/app/Template/board/table_column.php b/app/Template/board/table_column.php index 2a6b496a..58dcaf32 100644 --- a/app/Template/board/table_column.php +++ b/app/Template/board/table_column.php @@ -5,14 +5,14 @@ <!-- column in collapsed mode --> <div class="board-column-collapsed"> - <span title="<?= t('Task count') ?>" class="board-column-header-task-count" title="<?= t('Show this column') ?>"> + <span class="board-column-header-task-count" title="<?= t('Show this column') ?>"> <span id="task-number-column-<?= $column['id'] ?>"><?= $column['nb_tasks'] ?></span> </span> </div> <!-- column in expanded mode --> <div class="board-column-expanded"> - <?php if (! $not_editable): ?> + <?php if (! $not_editable && $this->user->hasProjectAccess('taskcreation', 'create', $column['project_id'])): ?> <div class="board-add-icon"> <?= $this->url->link('+', 'taskcreation', 'create', array('project_id' => $column['project_id'], 'column_id' => $column['id'], 'swimlane_id' => $swimlane['id']), false, 'popover', t('Add a new task')) ?> </div> @@ -24,13 +24,31 @@ </span> <?php endif ?> - <span class="board-column-title" data-column-id="<?= $column['id'] ?>" title="<?= t('Hide this column') ?>"> - <?= $this->e($column['title']) ?> + <span class="board-column-title"> + <?php if ($not_editable): ?> + <?= $this->e($column['title']) ?> + <?php else: ?> + <span class="dropdown"> + <a href="#" class="dropdown-menu"><?= $this->e($column['title']) ?> <i class="fa fa-caret-down"></i></a> + <ul> + <li> + <i class="fa fa-minus-square fa-fw"></i> + <a href="#" class="board-toggle-column-view" data-column-id="<?= $column['id'] ?>"><?= t('Hide this column') ?></a> + </li> + <?php if ($this->user->hasProjectAccess('BoardPopover', 'closeColumnTasks', $column['project_id']) && $column['nb_tasks'] > 0): ?> + <li> + <i class="fa fa-close fa-fw"></i> + <?= $this->url->link(t('Close all tasks of this column'), 'BoardPopover', 'confirmCloseColumnTasks', array('project_id' => $column['project_id'], 'column_id' => $column['id'], 'swimlane_id' => $swimlane['id']), false, 'popover') ?> + </li> + <?php endif ?> + </ul> + </span> + <?php endif ?> </span> <?php if (! $not_editable && ! empty($column['description'])): ?> <span class="tooltip pull-right" title='<?= $this->e($this->text->markdown($column['description'])) ?>'> - <i class="fa fa-info-circle"></i> + <i class="fa fa-info-circle"></i> </span> <?php endif ?> diff --git a/app/Template/board/table_swimlane.php b/app/Template/board/table_swimlane.php index dd38fc97..44607859 100644 --- a/app/Template/board/table_swimlane.php +++ b/app/Template/board/table_swimlane.php @@ -14,7 +14,7 @@ <span title="<?= t('Description') ?>" class="tooltip" - data-href="<?= $this->url->href('board', 'swimlane', array('swimlane_id' => $swimlane['id'], 'project_id' => $project['id'])) ?>"> + data-href="<?= $this->url->href('BoardTooltip', 'swimlane', array('swimlane_id' => $swimlane['id'], 'project_id' => $project['id'])) ?>"> <i class="fa fa-info-circle"></i> </span> <?php endif ?> diff --git a/app/Template/board/table_tasks.php b/app/Template/board/table_tasks.php index f10d48e4..e99e14fb 100644 --- a/app/Template/board/table_tasks.php +++ b/app/Template/board/table_tasks.php @@ -21,8 +21,8 @@ <!-- column in collapsed mode (rotated text) --> <div class="board-column-collapsed"> <div class="board-rotation-wrapper"> - <div class="board-column-title board-rotation" data-column-id="<?= $column['id'] ?>" title="<?= t('Show this column') ?>"> - <i class="fa fa-chevron-circle-up tooltip" title="<?= $this->e($column['title']) ?>"></i> <?= $this->e($column['title']) ?> + <div class="board-column-title board-rotation board-toggle-column-view" data-column-id="<?= $column['id'] ?>" title="<?= t('Show this column') ?>"> + <i class="fa fa-plus-square tooltip" title="<?= $this->e($column['title']) ?>"></i> <?= $this->e($column['title']) ?> </div> </div> </div> diff --git a/app/Template/board/task_footer.php b/app/Template/board/task_footer.php index d486b638..73e68602 100644 --- a/app/Template/board/task_footer.php +++ b/app/Template/board/task_footer.php @@ -6,7 +6,7 @@ <?php else: ?> <?= $this->url->link( $this->e($task['category_name']), - 'board', + 'boardPopover', 'changeCategory', array('task_id' => $task['id'], 'project_id' => $task['project_id']), false, @@ -22,36 +22,40 @@ <?php if (! empty($task['date_due'])): ?> <span class="task-board-date <?= time() > $task['date_due'] ? 'task-board-date-overdue' : '' ?>"> <i class="fa fa-calendar"></i> - <?= (date('Y') === date('Y', $task['date_due']) ? dt('%b %e', $task['date_due']) : dt('%b %e %Y', $task['date_due'])) ?> + <?= $this->dt->date($task['date_due']) ?> </span> <?php endif ?> <?php if ($task['recurrence_status'] == \Kanboard\Model\Task::RECURRING_STATUS_PENDING): ?> - <span title="<?= t('Recurrence') ?>" class="tooltip" data-href="<?= $this->url->href('board', 'recurrence', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?>"><i class="fa fa-refresh fa-rotate-90"></i></span> + <span title="<?= t('Recurrence') ?>" class="tooltip" data-href="<?= $this->url->href('BoardTooltip', 'recurrence', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?>"><i class="fa fa-refresh fa-rotate-90"></i></span> <?php endif ?> <?php if ($task['recurrence_status'] == \Kanboard\Model\Task::RECURRING_STATUS_PROCESSED): ?> - <span title="<?= t('Recurrence') ?>" class="tooltip" data-href="<?= $this->url->href('board', 'recurrence', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?>"><i class="fa fa-refresh fa-rotate-90 fa-inverse"></i></span> + <span title="<?= t('Recurrence') ?>" class="tooltip" data-href="<?= $this->url->href('BoardTooltip', 'recurrence', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?>"><i class="fa fa-refresh fa-rotate-90 fa-inverse"></i></span> <?php endif ?> <?php if (! empty($task['nb_links'])): ?> - <span title="<?= t('Links') ?>" class="tooltip" data-href="<?= $this->url->href('board', 'tasklinks', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?>"><i class="fa fa-code-fork"></i> <?= $task['nb_links'] ?></span> + <span title="<?= t('Links') ?>" class="tooltip" data-href="<?= $this->url->href('BoardTooltip', 'tasklinks', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?>"><i class="fa fa-code-fork fa-fw"></i><?= $task['nb_links'] ?></span> + <?php endif ?> + + <?php if (! empty($task['nb_external_links'])): ?> + <span title="<?= t('External links') ?>" class="tooltip" data-href="<?= $this->url->href('BoardTooltip', 'externallinks', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?>"><i class="fa fa-external-link fa-fw"></i><?= $task['nb_external_links'] ?></span> <?php endif ?> <?php if (! empty($task['nb_subtasks'])): ?> - <span title="<?= t('Sub-Tasks') ?>" class="tooltip" data-href="<?= $this->url->href('board', 'subtasks', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?>"><i class="fa fa-bars"></i> <?= round($task['nb_completed_subtasks']/$task['nb_subtasks']*100, 0).'%' ?></span> + <span title="<?= t('Sub-Tasks') ?>" class="tooltip" data-href="<?= $this->url->href('BoardTooltip', 'subtasks', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?>"><i class="fa fa-bars"></i> <?= round($task['nb_completed_subtasks']/$task['nb_subtasks']*100, 0).'%' ?></span> <?php endif ?> <?php if (! empty($task['nb_files'])): ?> - <span title="<?= t('Attachments') ?>" class="tooltip" data-href="<?= $this->url->href('board', 'attachments', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?>"><i class="fa fa-paperclip"></i> <?= $task['nb_files'] ?></span> + <span title="<?= t('Attachments') ?>" class="tooltip" data-href="<?= $this->url->href('BoardTooltip', 'attachments', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?>"><i class="fa fa-paperclip"></i> <?= $task['nb_files'] ?></span> <?php endif ?> <?php if (! empty($task['nb_comments'])): ?> - <span title="<?= $task['nb_comments'] == 1 ? t('%d comment', $task['nb_comments']) : t('%d comments', $task['nb_comments']) ?>" class="tooltip" data-href="<?= $this->url->href('board', 'comments', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?>"><i class="fa fa-comment-o"></i> <?= $task['nb_comments'] ?></span> + <span title="<?= $task['nb_comments'] == 1 ? t('%d comment', $task['nb_comments']) : t('%d comments', $task['nb_comments']) ?>" class="tooltip" data-href="<?= $this->url->href('BoardTooltip', 'comments', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?>"><i class="fa fa-comment-o"></i> <?= $task['nb_comments'] ?></span> <?php endif ?> <?php if (! empty($task['description'])): ?> - <span title="<?= t('Description') ?>" class="tooltip" data-href="<?= $this->url->href('board', 'description', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?>"> + <span title="<?= t('Description') ?>" class="tooltip" data-href="<?= $this->url->href('BoardTooltip', 'description', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?>"> <i class="fa fa-file-text-o"></i> </span> <?php endif ?> @@ -69,4 +73,6 @@ <i class="fa fa-flag flag-milestone"></i> </span> <?php endif ?> + + <?= $this->task->formatPriority($project, $task) ?> </div> diff --git a/app/Template/board/task_menu.php b/app/Template/board/task_menu.php index 3eb35705..bd582185 100644 --- a/app/Template/board/task_menu.php +++ b/app/Template/board/task_menu.php @@ -1,17 +1,18 @@ <span class="dropdown"> <a href="#" class="dropdown-menu"><?= '#'.$task['id'] ?></a> <ul> - <li><i class="fa fa-user fa-fw"></i> <?= $this->url->link(t('Change assignee'), 'board', 'changeAssignee', array('task_id' => $task['id'], 'project_id' => $task['project_id']), false, 'popover') ?></li> - <li><i class="fa fa-tag fa-fw"></i> <?= $this->url->link(t('Change category'), 'board', 'changeCategory', array('task_id' => $task['id'], 'project_id' => $task['project_id']), false, 'popover') ?></li> + <li><i class="fa fa-user fa-fw"></i> <?= $this->url->link(t('Change assignee'), 'BoardPopover', 'changeAssignee', array('task_id' => $task['id'], 'project_id' => $task['project_id']), false, 'popover') ?></li> + <li><i class="fa fa-tag fa-fw"></i> <?= $this->url->link(t('Change category'), 'BoardPopover', 'changeCategory', array('task_id' => $task['id'], 'project_id' => $task['project_id']), false, 'popover') ?></li> <li><i class="fa fa-align-left fa-fw"></i> <?= $this->url->link(t('Change description'), 'taskmodification', 'description', array('task_id' => $task['id'], 'project_id' => $task['project_id']), false, 'popover') ?></li> <li><i class="fa fa-pencil-square-o fa-fw"></i> <?= $this->url->link(t('Edit this task'), 'taskmodification', 'edit', array('task_id' => $task['id'], 'project_id' => $task['project_id']), false, 'popover') ?></li> <li><i class="fa fa-comment-o fa-fw"></i> <?= $this->url->link(t('Add a comment'), 'comment', 'create', array('task_id' => $task['id'], 'project_id' => $task['project_id']), false, 'popover') ?></li> <li><i class="fa fa-code-fork fa-fw"></i> <?= $this->url->link(t('Add a link'), 'tasklink', 'create', array('task_id' => $task['id'], 'project_id' => $task['project_id']), false, 'popover') ?></li> - <li><i class="fa fa-camera fa-fw"></i> <?= $this->url->link(t('Add a screenshot'), 'board', 'screenshot', array('task_id' => $task['id'], 'project_id' => $task['project_id']), false, 'popover') ?></li> + <li><i class="fa fa-external-link fa-fw"></i> <?= $this->url->link(t('Add external link'), 'TaskExternalLink', 'find', array('task_id' => $task['id'], 'project_id' => $task['project_id']), false, 'popover') ?></li> + <li><i class="fa fa-camera fa-fw"></i> <?= $this->url->link(t('Add a screenshot'), 'BoardPopover', 'screenshot', array('task_id' => $task['id'], 'project_id' => $task['project_id']), false, 'popover') ?></li> <?php if ($task['is_active'] == 1): ?> - <li><i class="fa fa-close fa-fw"></i> <?= $this->url->link(t('Close this task'), 'taskstatus', 'close', array('task_id' => $task['id'], 'project_id' => $task['project_id'], 'redirect' => 'board'), false, 'popover') ?></li> + <li><i class="fa fa-close fa-fw"></i> <?= $this->url->link(t('Close this task'), 'taskstatus', 'close', array('task_id' => $task['id'], 'project_id' => $task['project_id']), false, 'popover') ?></li> <?php else: ?> - <li><i class="fa fa-check-square-o fa-fw"></i> <?= $this->url->link(t('Open this task'), 'taskstatus', 'open', array('task_id' => $task['id'], 'project_id' => $task['project_id'], 'redirect' => 'board'), false, 'popover') ?></li> + <li><i class="fa fa-check-square-o fa-fw"></i> <?= $this->url->link(t('Open this task'), 'taskstatus', 'open', array('task_id' => $task['id'], 'project_id' => $task['project_id']), false, 'popover') ?></li> <?php endif ?> </ul> </span>
\ No newline at end of file diff --git a/app/Template/board/task_private.php b/app/Template/board/task_private.php index da993fdd..4880af00 100644 --- a/app/Template/board/task_private.php +++ b/app/Template/board/task_private.php @@ -1,8 +1,11 @@ <div class=" task-board - <?= $task['is_active'] == 1 ? 'draggable-item task-board-status-open '.($task['date_modification'] > (time() - $board_highlight_period) ? 'task-board-recent' : '') : 'task-board-status-closed' ?> + <?= $task['is_active'] == 1 ? ($this->user->hasProjectAccess('board', 'save', $task['project_id']) ? 'draggable-item ' : '').'task-board-status-open '.($task['date_modification'] > (time() - $board_highlight_period) ? 'task-board-recent' : '') : 'task-board-status-closed' ?> color-<?= $task['color_id'] ?>" data-task-id="<?= $task['id'] ?>" + data-column-id="<?= $task['column_id'] ?>" + data-swimlane-id="<?= $task['swimlane_id'] ?>" + data-position="<?= $task['position'] ?>" data-owner-id="<?= $task['owner_id'] ?>" data-category-id="<?= $task['category_id'] ?>" data-due-date="<?= $task['date_due'] ?>" @@ -12,7 +15,12 @@ <?php if ($this->board->isCollapsed($task['project_id'])): ?> <div class="task-board-collapsed"> - <?= $this->render('board/task_menu', array('task' => $task)) ?> + <div class="task-board-saving-icon" style="display: none;"><i class="fa fa-spinner fa-pulse"></i></div> + <?php if ($this->user->hasProjectAccess('taskmodification', 'edit', $task['project_id'])): ?> + <?= $this->render('board/task_menu', array('task' => $task)) ?> + <?php else: ?> + <strong><?= '#'.$task['id'] ?></strong> + <?php endif ?> <?php if (! empty($task['assignee_username'])): ?> <span title="<?= $this->e($task['assignee_name'] ?: $task['assignee_username']) ?>"> @@ -23,7 +31,12 @@ </div> <?php else: ?> <div class="task-board-expanded"> - <?= $this->render('board/task_menu', array('task' => $task)) ?> + <div class="task-board-saving-icon" style="display: none;"><i class="fa fa-spinner fa-pulse fa-2x"></i></div> + <?php if ($this->user->hasProjectAccess('taskmodification', 'edit', $task['project_id'])): ?> + <?= $this->render('board/task_menu', array('task' => $task)) ?> + <?php else: ?> + <strong><?= '#'.$task['id'] ?></strong> + <?php endif ?> <?php if ($task['reference']): ?> <span class="task-board-reference" title="<?= t('Reference') ?>"> @@ -33,15 +46,19 @@ <?php if (! empty($task['owner_id'])): ?> <span class="task-board-user <?= $this->user->isCurrentUser($task['owner_id']) ? 'task-board-current-user' : '' ?>"> - <?= $this->url->link( - $task['assignee_name'] ?: $task['assignee_username'], - 'board', - 'changeAssignee', - array('task_id' => $task['id'], 'project_id' => $task['project_id']), - false, - 'popover', - t('Change assignee') - ) ?> + <?php if ($this->user->hasProjectAccess('taskmodification', 'edit', $task['project_id'])): ?> + <?= $this->url->link( + $task['assignee_name'] ?: $task['assignee_username'], + 'BoardPopover', + 'changeAssignee', + array('task_id' => $task['id'], 'project_id' => $task['project_id']), + false, + 'popover', + t('Change assignee') + ) ?> + <?php else: ?> + <?= $this->e($task['assignee_name'] ?: $task['assignee_username']) ?> + <?php endif ?> </span> <?php endif ?> @@ -61,6 +78,7 @@ <?= $this->render('board/task_footer', array( 'task' => $task, 'not_editable' => $not_editable, + 'project' => $project, )) ?> </div> <?php endif ?> diff --git a/app/Template/board/task_public.php b/app/Template/board/task_public.php index bacdcef4..d02722bb 100644 --- a/app/Template/board/task_public.php +++ b/app/Template/board/task_public.php @@ -25,5 +25,6 @@ <?= $this->render('board/task_footer', array( 'task' => $task, 'not_editable' => $not_editable, + 'project' => $project, )) ?> </div>
\ No newline at end of file diff --git a/app/Template/board/tooltip_comments.php b/app/Template/board/tooltip_comments.php index 2e2c0c1e..ca91e13f 100644 --- a/app/Template/board/tooltip_comments.php +++ b/app/Template/board/tooltip_comments.php @@ -4,7 +4,7 @@ <?php if (! empty($comment['username'])): ?> <span class="comment-username"><?= $this->e($comment['name'] ?: $comment['username']) ?></span> @ <?php endif ?> - <span class="comment-date"><?= dt('%b %e, %Y, %k:%M %p', $comment['date_creation']) ?></span> + <span class="comment-date"><?= $this->dt->datetime($comment['date_creation']) ?></span> </p> <div class="comment-inner"> diff --git a/app/Template/board/tooltip_external_links.php b/app/Template/board/tooltip_external_links.php new file mode 100644 index 00000000..7681c06c --- /dev/null +++ b/app/Template/board/tooltip_external_links.php @@ -0,0 +1,20 @@ +<table class="table-striped table-small"> + <tr> + <th class="column-20"><?= t('Type') ?></th> + <th class="column-80"><?= t('Title') ?></th> + <th class="column-10"><?= t('Dependency') ?></th> + </tr> + <?php foreach ($links as $link): ?> + <tr> + <td> + <?= $link['type'] ?> + </td> + <td> + <a href="<?= $link['url'] ?>" target="_blank"><?= $this->e($link['title']) ?></a> + </td> + <td> + <?= $this->e($link['dependency_label']) ?> + </td> + </tr> + <?php endforeach ?> +</table>
\ No newline at end of file diff --git a/app/Template/board/tooltip_files.php b/app/Template/board/tooltip_files.php index 407309b3..4fa14b57 100644 --- a/app/Template/board/tooltip_files.php +++ b/app/Template/board/tooltip_files.php @@ -8,9 +8,9 @@ </tr> <tr> <td> - <i class="fa fa-download fa-fw"></i><?= $this->url->link(t('download'), 'file', 'download', array('task_id' => $task['id'], 'project_id' => $task['project_id'], 'file_id' => $file['id'])) ?> + <i class="fa fa-download fa-fw"></i><?= $this->url->link(t('download'), 'TaskFile', 'download', array('task_id' => $task['id'], 'project_id' => $task['project_id'], 'file_id' => $file['id'])) ?> <?php if ($file['is_image'] == 1): ?> - <i class="fa fa-eye"></i> <?= $this->url->link(t('open file'), 'file', 'open', array('task_id' => $task['id'], 'project_id' => $task['project_id'], 'file_id' => $file['id']), false, 'popover') ?> + <i class="fa fa-eye"></i> <?= $this->url->link(t('open file'), 'TaskFile', 'open', array('task_id' => $task['id'], 'project_id' => $task['project_id'], 'file_id' => $file['id']), false, 'popover') ?> <?php endif ?> </td> </tr> diff --git a/app/Template/board/tooltip_subtasks.php b/app/Template/board/tooltip_subtasks.php index 950da925..dc076d26 100644 --- a/app/Template/board/tooltip_subtasks.php +++ b/app/Template/board/tooltip_subtasks.php @@ -1,7 +1,14 @@ -<section id="tooltip-subtasks"> +<table class="table-stripped"> <?php foreach ($subtasks as $subtask): ?> - <?= $this->subtask->toggleStatus($subtask, 'board') ?> - <?= $this->e(empty($subtask['username']) ? '' : ' ['.$this->user->getFullname($subtask).']') ?> - <br/> + <tr> + <td class="column-80"> + <?= $this->subtask->toggleStatus($subtask, $task['project_id']) ?> + </td> + <td> + <?php if (! empty($subtask['username'])): ?> + <?= $this->e($subtask['name'] ?: $subtask['username']) ?> + <?php endif ?> + </td> + </tr> <?php endforeach ?> -</section> +</table> diff --git a/app/Template/board/tooltip_tasklinks.php b/app/Template/board/tooltip_tasklinks.php index 62304330..b51f90ed 100644 --- a/app/Template/board/tooltip_tasklinks.php +++ b/app/Template/board/tooltip_tasklinks.php @@ -1,19 +1,24 @@ <div class="tooltip-tasklinks"> - <ul> - <?php foreach ($links as $link): ?> - <li> - <strong><?= t($link['label']) ?></strong> - [<i><?= $link['project_name'] ?></i>] - <?= $this->url->link( - $this->e('#'.$link['task_id'].' - '.$link['title']), - 'task', 'show', array('task_id' => $link['task_id'], 'project_id' => $link['project_id']), - false, - $link['is_active'] ? '' : 'task-link-closed' - ) ?> - <?php if (! empty($link['task_assignee_username'])): ?> - [<?= $this->e($link['task_assignee_name'] ?: $link['task_assignee_username']) ?>] - <?php endif ?> - </li> + <dl> + <?php foreach ($links as $label => $grouped_links): ?> + <dt><strong><?= t($label) ?></strong></dt> + <?php foreach ($grouped_links as $link): ?> + <dd> + <span class="progress"><?= $this->task->getProgress($link).'%' ?></span> + <?= $this->url->link( + $this->e('#'.$link['task_id'].' '.$link['title']), + 'task', 'show', array('task_id' => $link['task_id'], 'project_id' => $link['project_id']), + false, + $link['is_active'] ? '' : 'task-link-closed' + ) ?> + <?php if (! empty($link['task_assignee_username'])): ?> + [<?= $this->e($link['task_assignee_name'] ?: $link['task_assignee_username']) ?>] + <?php endif ?> + <?php if ($task['project_id'] != $link['project_id']): ?> + (<i><?= $link['project_name'] ?></i>) + <?php endif ?> + </dd> + <?php endforeach ?> <?php endforeach ?> - </ul> + </dl> </div>
\ No newline at end of file diff --git a/app/Template/board/view_private.php b/app/Template/board/view_private.php index 63d261f6..b5e38c66 100644 --- a/app/Template/board/view_private.php +++ b/app/Template/board/view_private.php @@ -1,6 +1,6 @@ <section id="main"> - <?= $this->render('project/filters', array( + <?= $this->render('project_header/header', array( 'project' => $project, 'filters' => $filters, 'categories_list' => $categories_list, diff --git a/app/Template/calendar/show.php b/app/Template/calendar/show.php index 0406414c..7085b51e 100644 --- a/app/Template/calendar/show.php +++ b/app/Template/calendar/show.php @@ -1,11 +1,11 @@ <section id="main"> - <?= $this->render('project/filters', array( + <?= $this->render('project_header/header', array( 'project' => $project, 'filters' => $filters, )) ?> <div id="calendar" - data-save-url="<?= $this->url->href('calendar', 'save') ?>" + data-save-url="<?= $this->url->href('calendar', 'save', array('project_id' => $project['id'])) ?>" data-check-url="<?= $this->url->href('calendar', 'project', array('project_id' => $project['id'])) ?>" data-check-interval="<?= $check_interval ?>" > diff --git a/app/Template/category/edit.php b/app/Template/category/edit.php index 1aae2f2a..d788f673 100644 --- a/app/Template/category/edit.php +++ b/app/Template/category/edit.php @@ -2,7 +2,7 @@ <h2><?= t('Category modification for the project "%s"', $project['name']) ?></h2> </div> -<form method="post" action="<?= $this->url->href('category', 'update', array('project_id' => $project['id'], 'category_id' => $values['id'])) ?>" autocomplete="off"> +<form class="popover-form" method="post" action="<?= $this->url->href('category', 'update', array('project_id' => $project['id'], 'category_id' => $values['id'])) ?>" autocomplete="off"> <?= $this->form->csrf() ?> @@ -33,8 +33,8 @@ <div class="form-help"><?= $this->url->doc(t('Write your text in Markdown'), 'syntax-guide') ?></div> <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') ?> - <?= $this->url->link(t('cancel'), 'category', 'index', array('project_id' => $project['id'])) ?> + <?= $this->url->link(t('cancel'), 'category', 'index', array('project_id' => $project['id']), false, 'close-popover') ?> </div> </form>
\ No newline at end of file diff --git a/app/Template/category/index.php b/app/Template/category/index.php index dba537d0..e99b6d52 100644 --- a/app/Template/category/index.php +++ b/app/Template/category/index.php @@ -5,20 +5,23 @@ <table> <tr> <th><?= t('Category Name') ?></th> - <th><?= t('Actions') ?></th> + <th class="column-8"><?= t('Actions') ?></th> </tr> <?php foreach ($categories as $category_id => $category_name): ?> <tr> <td><?= $this->e($category_name) ?></td> <td> + <div class="dropdown"> + <a href="#" class="dropdown-menu dropdown-menu-link-icon"><i class="fa fa-cog fa-fw"></i><i class="fa fa-caret-down"></i></a> <ul> <li> - <?= $this->url->link(t('Edit'), 'category', 'edit', array('project_id' => $project['id'], 'category_id' => $category_id)) ?> + <?= $this->url->link(t('Edit'), 'category', 'edit', array('project_id' => $project['id'], 'category_id' => $category_id), false, 'popover') ?> </li> <li> - <?= $this->url->link(t('Remove'), 'category', 'confirm', array('project_id' => $project['id'], 'category_id' => $category_id)) ?> + <?= $this->url->link(t('Remove'), 'category', 'confirm', array('project_id' => $project['id'], 'category_id' => $category_id), false, 'popover') ?> </li> </ul> + </div> </td> </tr> <?php endforeach ?> diff --git a/app/Template/category/remove.php b/app/Template/category/remove.php index ce589785..cad58d37 100644 --- a/app/Template/category/remove.php +++ b/app/Template/category/remove.php @@ -11,7 +11,7 @@ <div class="form-actions"> <?= $this->url->link(t('Yes'), 'category', 'remove', array('project_id' => $project['id'], 'category_id' => $category['id']), true, 'btn btn-red') ?> <?= t('or') ?> - <?= $this->url->link(t('cancel'), 'category', 'index', array('project_id' => $project['id'])) ?> + <?= $this->url->link(t('cancel'), 'category', 'index', array('project_id' => $project['id']), false, 'close-popover') ?> </div> </div> </section>
\ No newline at end of file diff --git a/app/Template/column/create.php b/app/Template/column/create.php new file mode 100644 index 00000000..58b130f5 --- /dev/null +++ b/app/Template/column/create.php @@ -0,0 +1,41 @@ +<div class="page-header"> + <h2><?= t('Add a new column') ?></h2> +</div> +<form class="popover-form" method="post" action="<?= $this->url->href('Column', 'save', array('project_id' => $project['id'])) ?>" autocomplete="off"> + + <?= $this->form->csrf() ?> + + <?= $this->form->hidden('project_id', $values) ?> + + <?= $this->form->label(t('Title'), 'title') ?> + <?= $this->form->text('title', $values, $errors, array('autofocus', 'required', 'maxlength="50"')) ?> + + <?= $this->form->label(t('Task limit'), 'task_limit') ?> + <?= $this->form->number('task_limit', $values, $errors) ?> + + <?= $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"> + <input type="submit" value="<?= t('Add this column') ?>" class="btn btn-blue"> + <?= t('or') ?> + <?= $this->url->link(t('cancel'), 'column', 'index', array('project_id' => $project['id']), false, 'close-popover') ?> + </div> +</form>
\ No newline at end of file diff --git a/app/Template/column/edit.php b/app/Template/column/edit.php index a17affd8..618cb134 100644 --- a/app/Template/column/edit.php +++ b/app/Template/column/edit.php @@ -2,7 +2,7 @@ <h2><?= t('Edit column "%s"', $column['title']) ?></h2> </div> -<form method="post" action="<?= $this->url->href('column', 'update', array('project_id' => $project['id'], 'column_id' => $column['id'])) ?>" autocomplete="off"> +<form class="popover-form" method="post" action="<?= $this->url->href('column', 'update', array('project_id' => $project['id'], 'column_id' => $column['id'])) ?>" autocomplete="off"> <?= $this->form->csrf() ?> @@ -37,8 +37,8 @@ <div class="form-help"><?= $this->url->doc(t('Write your text in Markdown'), 'syntax-guide') ?></div> <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') ?> - <?= $this->url->link(t('cancel'), 'column', 'index', array('project_id' => $project['id'])) ?> + <?= $this->url->link(t('cancel'), 'column', 'index', array('project_id' => $project['id']), false, 'close-popover') ?> </div> </form>
\ No newline at end of file diff --git a/app/Template/column/index.php b/app/Template/column/index.php index 689cbbf5..1aa44688 100644 --- a/app/Template/column/index.php +++ b/app/Template/column/index.php @@ -1,89 +1,56 @@ <div class="page-header"> <h2><?= t('Edit the board for "%s"', $project['name']) ?></h2> + <ul> + <li> + <i class="fa fa-plus fa-fw"></i> + <?= $this->url->link(t('Add a new column'), 'Column', 'create', array('project_id' => $project['id']), false, 'popover') ?> + </li> + </ul> </div> -<?php if (! empty($columns)): ?> - - <?php $first_position = $columns[0]['position']; ?> - <?php $last_position = $columns[count($columns) - 1]['position']; ?> - - <h3><?= t('Change columns') ?></h3> - <table> +<?php if (empty($columns)): ?> + <p class="alert alert-error"><?= t('Your board doesn\'t have any column!') ?></p> +<?php else: ?> + <table + class="columns-table table-stripped" + data-save-position-url="<?= $this->url->href('Column', 'move', array('project_id' => $project['id'])) ?>"> + <thead> <tr> - <th><?= t('Column title') ?></th> - <th><?= t('Task limit') ?></th> - <th><?= t('Actions') ?></th> + <th class="column-70"><?= t('Column title') ?></th> + <th class="column-25"><?= t('Task limit') ?></th> + <th class="column-5"><?= t('Actions') ?></th> </tr> + </thead> + <tbody> <?php foreach ($columns as $column): ?> - <tr> - <td class="column-60"><?= $this->e($column['title']) ?> - <?php if (! empty($column['description'])): ?> - <span class="tooltip" title='<?= $this->e($this->text->markdown($column['description'])) ?>'> - <i class="fa fa-info-circle"></i> - </span> - <?php endif ?> + <tr data-column-id="<?= $column['id'] ?>"> + <td> + <i class="fa fa-arrows-alt draggable-row-handle" title="<?= t('Change column position') ?>"></i> + <?= $this->e($column['title']) ?> + <?php if (! empty($column['description'])): ?> + <span class="tooltip" title='<?= $this->e($this->text->markdown($column['description'])) ?>'> + <i class="fa fa-info-circle"></i> + </span> + <?php endif ?> </td> - <td class="column-10"><?= $this->e($column['task_limit']) ?></td> - <td class="column-30"> + <td> + <?= $this->e($column['task_limit']) ?> + </td> + <td> + <div class="dropdown"> + <a href="#" class="dropdown-menu dropdown-menu-link-icon"><i class="fa fa-cog fa-fw"></i><i class="fa fa-caret-down"></i></a> <ul> <li> - <?= $this->url->link(t('Edit'), 'column', 'edit', array('project_id' => $project['id'], 'column_id' => $column['id'])) ?> + <?= $this->url->link(t('Edit'), 'column', 'edit', array('project_id' => $project['id'], 'column_id' => $column['id']), false, 'popover') ?> </li> - <?php if ($column['position'] != $first_position): ?> <li> - <?= $this->url->link(t('Move Up'), 'column', 'move', array('project_id' => $project['id'], 'column_id' => $column['id'], 'direction' => 'up'), true) ?> - </li> - <?php endif ?> - <?php if ($column['position'] != $last_position): ?> - <li> - <?= $this->url->link(t('Move Down'), 'column', 'move', array('project_id' => $project['id'], 'column_id' => $column['id'], 'direction' => 'down'), true) ?> - </li> - <?php endif ?> - <li> - <?= $this->url->link(t('Remove'), 'column', 'confirm', array('project_id' => $project['id'], 'column_id' => $column['id'])) ?> + <?= $this->url->link(t('Remove'), 'column', 'confirm', array('project_id' => $project['id'], 'column_id' => $column['id']), false, 'popover') ?> </li> </ul> + </div> </td> </tr> <?php endforeach ?> + </tbody> </table> - <?php endif ?> - -<h3><?= t('Add a new column') ?></h3> -<form method="post" action="<?= $this->url->href('column', 'create', array('project_id' => $project['id'])) ?>" autocomplete="off"> - - <?= $this->form->csrf() ?> - - <?= $this->form->hidden('project_id', $values) ?> - - <?= $this->form->label(t('Title'), 'title') ?> - <?= $this->form->text('title', $values, $errors, array('required', 'maxlength="50"')) ?> - - <?= $this->form->label(t('Task limit'), 'task_limit') ?> - <?= $this->form->number('task_limit', $values, $errors) ?> - - <?= $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"> - <input type="submit" value="<?= t('Add this column') ?>" class="btn btn-blue"/> - </div> -</form>
\ No newline at end of file diff --git a/app/Template/column/remove.php b/app/Template/column/remove.php index 28d0928f..ccab889d 100644 --- a/app/Template/column/remove.php +++ b/app/Template/column/remove.php @@ -10,6 +10,6 @@ <div class="form-actions"> <?= $this->url->link(t('Yes'), 'column', 'remove', array('project_id' => $project['id'], 'column_id' => $column['id'], 'remove' => 'yes'), true, 'btn btn-red') ?> - <?= t('or') ?> <?= $this->url->link(t('cancel'), 'column', 'index', array('project_id' => $project['id'])) ?> + <?= t('or') ?> <?= $this->url->link(t('cancel'), 'column', 'index', array('project_id' => $project['id']), false, 'close-popover') ?> </div> </div>
\ No newline at end of file diff --git a/app/Template/comment/create.php b/app/Template/comment/create.php index 8bcbe0f7..15dd3a8e 100644 --- a/app/Template/comment/create.php +++ b/app/Template/comment/create.php @@ -1,8 +1,7 @@ <div class="page-header"> <h2><?= t('Add a comment') ?></h2> </div> - -<form method="post" action="<?= $this->url->href('comment', 'save', array('task_id' => $task['id'], 'project_id' => $task['project_id'], 'ajax' => isset($ajax))) ?>" autocomplete="off" class="form-comment"> +<form class="popover-form" method="post" action="<?= $this->url->href('comment', 'save', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?>" autocomplete="off" class="form-comment"> <?= $this->form->csrf() ?> <?= $this->form->hidden('task_id', $values) ?> <?= $this->form->hidden('user_id', $values) ?> @@ -17,7 +16,18 @@ </li> </ul> <div class="write-area"> - <?= $this->form->textarea('comment', $values, $errors, array(! isset($skip_cancel) ? 'autofocus' : '', 'required', 'placeholder="'.t('Leave a comment').'"'), 'comment-textarea') ?> + <?= $this->form->textarea( + 'comment', + $values, + $errors, + array( + ! isset($skip_cancel) ? 'autofocus' : '', + 'required', + 'placeholder="'.t('Leave a comment').'"', + 'data-mention-search-url="'.$this->url->href('UserHelper', 'mention', array('project_id' => $task['project_id'])).'"', + ), + 'comment-textarea' + ) ?> </div> <div class="preview-area"> <div class="markdown"></div> @@ -30,11 +40,7 @@ <input type="submit" value="<?= t('Save') ?>" class="btn btn-blue"/> <?php if (! isset($skip_cancel)): ?> <?= t('or') ?> - <?php if (isset($ajax)): ?> - <?= $this->url->link(t('cancel'), 'board', 'show', array('project_id' => $task['project_id'])) ?> - <?php else: ?> - <?= $this->url->link(t('cancel'), 'task', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?> - <?php endif ?> + <?= $this->url->link(t('cancel'), 'task', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id']), false, 'close-popover') ?> <?php endif ?> </div> </form> diff --git a/app/Template/comment/edit.php b/app/Template/comment/edit.php index e01f3da4..6db952cc 100644 --- a/app/Template/comment/edit.php +++ b/app/Template/comment/edit.php @@ -2,7 +2,7 @@ <h2><?= t('Edit a comment') ?></h2> </div> -<form method="post" action="<?= $this->url->href('comment', 'update', array('task_id' => $task['id'], 'project_id' => $task['project_id'], 'comment_id' => $comment['id'])) ?>" autocomplete="off"> +<form class="popover-form" method="post" action="<?= $this->url->href('comment', 'update', array('task_id' => $task['id'], 'project_id' => $task['project_id'], 'comment_id' => $comment['id'])) ?>" autocomplete="off"> <?= $this->form->csrf() ?> <?= $this->form->hidden('id', $values) ?> @@ -29,8 +29,8 @@ <div class="form-help"><?= $this->url->doc(t('Write your text in Markdown'), 'syntax-guide') ?></div> <div class="form-actions"> - <input type="submit" value="<?= t('Update') ?>" class="btn btn-blue"/> + <input type="submit" value="<?= t('Update') ?>" class="btn btn-blue"> <?= t('or') ?> - <?= $this->url->link(t('cancel'), 'task', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?> + <?= $this->url->link(t('cancel'), 'task', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id']), false, 'close-popover') ?> </div> </form> diff --git a/app/Template/comment/forbidden.php b/app/Template/comment/forbidden.php deleted file mode 100644 index 1e306d45..00000000 --- a/app/Template/comment/forbidden.php +++ /dev/null @@ -1,7 +0,0 @@ -<div class="page-header"> - <h2><?= t('Forbidden') ?></h2> -</div> - -<p class="alert alert-error"> - <?= t('Only administrators or the creator of the comment can access to this page.') ?> -</p>
\ No newline at end of file diff --git a/app/Template/comment/remove.php b/app/Template/comment/remove.php index afc3346f..1b5004f4 100644 --- a/app/Template/comment/remove.php +++ b/app/Template/comment/remove.php @@ -12,6 +12,6 @@ <div class="form-actions"> <?= $this->url->link(t('Yes'), 'comment', 'remove', array('task_id' => $task['id'], 'project_id' => $task['project_id'], 'comment_id' => $comment['id']), true, 'btn btn-red') ?> <?= t('or') ?> - <?= $this->url->link(t('cancel'), 'task', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?> + <?= $this->url->link(t('cancel'), 'task', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id']), false, 'close-popover') ?> </div> </div>
\ No newline at end of file diff --git a/app/Template/comment/show.php b/app/Template/comment/show.php index 84077668..2c9b426f 100644 --- a/app/Template/comment/show.php +++ b/app/Template/comment/show.php @@ -9,19 +9,19 @@ <span class="comment-username"><?= $this->e($comment['name'] ?: $comment['username']) ?></span> @ <?php endif ?> - <span class="comment-date"><?= dt('%B %e, %Y at %k:%M %p', $comment['date_creation']) ?></span> + <span class="comment-date"><?= $this->dt->datetime($comment['date_creation']) ?></span> </p> <div class="comment-inner"> <?php if (! isset($preview)): ?> <ul class="comment-actions"> <li><a href="#comment-<?= $comment['id'] ?>"><?= t('link') ?></a></li> - <?php if ((! isset($not_editable) || ! $not_editable) && ($this->user->isAdmin() || $this->user->isCurrentUser($comment['user_id']))): ?> + <?php if ($editable && ($this->user->isAdmin() || $this->user->isCurrentUser($comment['user_id']))): ?> <li> - <?= $this->url->link(t('remove'), 'comment', 'confirm', array('task_id' => $task['id'], 'project_id' => $task['project_id'], 'comment_id' => $comment['id'])) ?> + <?= $this->url->link(t('remove'), 'comment', 'confirm', array('task_id' => $task['id'], 'project_id' => $task['project_id'], 'comment_id' => $comment['id']), false, 'popover') ?> </li> <li> - <?= $this->url->link(t('edit'), 'comment', 'edit', array('task_id' => $task['id'], 'project_id' => $task['project_id'], 'comment_id' => $comment['id'])) ?> + <?= $this->url->link(t('edit'), 'comment', 'edit', array('task_id' => $task['id'], 'project_id' => $task['project_id'], 'comment_id' => $comment['id']), false, 'popover') ?> </li> <?php endif ?> </ul> diff --git a/app/Template/config/about.php b/app/Template/config/about.php index e0652a2f..f8534029 100644 --- a/app/Template/config/about.php +++ b/app/Template/config/about.php @@ -54,6 +54,7 @@ <div class="listing"> <h3><?= t('Board/Calendar/List view') ?></h3> <ul> + <li><?= t('Switch to the project overview') ?> = <strong>v o</strong></li> <li><?= t('Switch to the board view') ?> = <strong>v b</strong></li> <li><?= t('Switch to the calendar view') ?> = <strong>v c</strong></li> <li><?= t('Switch to the list view') ?> = <strong>v l</strong></li> diff --git a/app/Template/config/application.php b/app/Template/config/application.php index 7d4c811d..48fed7f0 100644 --- a/app/Template/config/application.php +++ b/app/Template/config/application.php @@ -1,30 +1,36 @@ <div class="page-header"> <h2><?= t('Application settings') ?></h2> </div> -<section> <form method="post" action="<?= $this->url->href('config', 'application') ?>" autocomplete="off"> <?= $this->form->csrf() ?> <?= $this->form->label(t('Application URL'), 'application_url') ?> - <?= $this->form->text('application_url', $values, $errors, array('placeholder="http://example.kanboard.net/"')) ?><br/> - <p class="form-help"><?= t('Example: http://example.kanboard.net/ (used by email notifications)') ?></p> + <?= $this->form->text('application_url', $values, $errors, array('placeholder="http://example.kanboard.net/"')) ?> + <p class="form-help"><?= t('Example: http://example.kanboard.net/ (used to generate absolute URLs)') ?></p> <?= $this->form->label(t('Language'), 'application_language') ?> - <?= $this->form->select('application_language', $languages, $values, $errors) ?><br/> + <?= $this->form->select('application_language', $languages, $values, $errors) ?> <?= $this->form->label(t('Timezone'), 'application_timezone') ?> - <?= $this->form->select('application_timezone', $timezones, $values, $errors) ?><br/> + <?= $this->form->select('application_timezone', $timezones, $values, $errors) ?> <?= $this->form->label(t('Date format'), 'application_date_format') ?> - <?= $this->form->select('application_date_format', $date_formats, $values, $errors) ?><br/> + <?= $this->form->select('application_date_format', $date_formats, $values, $errors) ?> <p class="form-help"><?= t('ISO format is always accepted, example: "%s" and "%s"', date('Y-m-d'), date('Y_m_d')) ?></p> + <?= $this->form->label(t('Date and time format'), 'application_datetime_format') ?> + <?= $this->form->select('application_datetime_format', $datetime_formats, $values, $errors) ?> + + <?= $this->form->label(t('Time format'), 'application_time_format') ?> + <?= $this->form->select('application_time_format', $time_formats, $values, $errors) ?> + + <?= $this->form->checkbox('password_reset', t('Enable "Forget Password"'), 1, $values['password_reset'] == 1) ?> + <?= $this->form->label(t('Custom Stylesheet'), 'application_stylesheet') ?> - <?= $this->form->textarea('application_stylesheet', $values, $errors) ?><br/> + <?= $this->form->textarea('application_stylesheet', $values, $errors) ?> <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> </form> -</section>
\ No newline at end of file diff --git a/app/Template/config/board.php b/app/Template/config/board.php index 19a4bcd7..f787a931 100644 --- a/app/Template/config/board.php +++ b/app/Template/config/board.php @@ -1,25 +1,23 @@ <div class="page-header"> <h2><?= t('Board settings') ?></h2> </div> -<section> <form method="post" action="<?= $this->url->href('config', 'board') ?>" autocomplete="off"> <?= $this->form->csrf() ?> <?= $this->form->label(t('Task highlight period'), 'board_highlight_period') ?> - <?= $this->form->number('board_highlight_period', $values, $errors) ?><br/> + <?= $this->form->number('board_highlight_period', $values, $errors) ?> <p class="form-help"><?= t('Period (in second) to consider a task was modified recently (0 to disable, 2 days by default)') ?></p> <?= $this->form->label(t('Refresh interval for public board'), 'board_public_refresh_interval') ?> - <?= $this->form->number('board_public_refresh_interval', $values, $errors) ?><br/> + <?= $this->form->number('board_public_refresh_interval', $values, $errors) ?> <p class="form-help"><?= t('Frequency in second (60 seconds by default)') ?></p> <?= $this->form->label(t('Refresh interval for private board'), 'board_private_refresh_interval') ?> - <?= $this->form->number('board_private_refresh_interval', $values, $errors) ?><br/> + <?= $this->form->number('board_private_refresh_interval', $values, $errors) ?> <p class="form-help"><?= t('Frequency in second (0 to disable this feature, 10 seconds by default)') ?></p> <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> </form> -</section>
\ No newline at end of file diff --git a/app/Template/config/integrations.php b/app/Template/config/integrations.php index bba85672..ced051f7 100644 --- a/app/Template/config/integrations.php +++ b/app/Template/config/integrations.php @@ -3,29 +3,9 @@ </div> <form method="post" action="<?= $this->url->href('config', 'integrations') ?>" autocomplete="off"> - <?= $this->form->csrf() ?> - <?= $this->hook->render('template:config:integrations', array('values' => $values)) ?> - <h3><i class="fa fa-google"></i> <?= t('Google Authentication') ?></h3> - <div class="listing"> - <input type="text" class="auto-select" readonly="readonly" value="<?= $this->url->href('oauth', 'google', array(), false, '', true) ?>"/><br/> - <p class="form-help"><?= $this->url->doc(t('Help on Google authentication'), 'google-authentication') ?></p> - </div> - - <h3><i class="fa fa-github"></i> <?= t('Github Authentication') ?></h3> - <div class="listing"> - <input type="text" class="auto-select" readonly="readonly" value="<?= $this->url->href('oauth', 'github', array(), false, '', true) ?>"/><br/> - <p class="form-help"><?= $this->url->doc(t('Help on Github authentication'), 'github-authentication') ?></p> - </div> - - <h3><img src="<?= $this->url->dir() ?>assets/img/gitlab-icon.png"/> <?= t('Gitlab Authentication') ?></h3> - <div class="listing"> - <input type="text" class="auto-select" readonly="readonly" value="<?= $this->url->href('oauth', 'gitlab', array(), false, '', true) ?>"/><br/> - <p class="form-help"><?= $this->url->doc(t('Help on Gitlab authentication'), 'gitlab-authentication') ?></p> - </div> - <h3><img src="<?= $this->url->dir() ?>assets/img/gravatar-icon.png"/> <?= t('Gravatar') ?></h3> <div class="listing"> <?= $this->form->checkbox('integration_gravatar', t('Enable Gravatar images'), 1, $values['integration_gravatar'] == 1) ?> diff --git a/app/Template/config/layout.php b/app/Template/config/layout.php index 028f138c..f34caaab 100644 --- a/app/Template/config/layout.php +++ b/app/Template/config/layout.php @@ -1,10 +1,10 @@ <section id="main"> <section class="sidebar-container" id="config-section"> - <?= $this->render('config/sidebar') ?> + <?= $this->render($sidebar_template) ?> <div class="sidebar-content"> - <?= $config_content_for_layout ?> + <?= $content_for_sublayout ?> </div> </section> </section>
\ No newline at end of file diff --git a/app/Template/config/project.php b/app/Template/config/project.php index c58a7bac..1d32a14f 100644 --- a/app/Template/config/project.php +++ b/app/Template/config/project.php @@ -1,7 +1,6 @@ <div class="page-header"> <h2><?= t('Project settings') ?></h2> </div> -<section> <form method="post" action="<?= $this->url->href('config', 'project') ?>" autocomplete="off"> <?= $this->form->csrf() ?> @@ -10,19 +9,19 @@ <?= $this->form->select('default_color', $colors, $values, $errors) ?> <?= $this->form->label(t('Default columns for new projects (Comma-separated)'), 'board_columns') ?> - <?= $this->form->text('board_columns', $values, $errors) ?><br/> + <?= $this->form->text('board_columns', $values, $errors) ?> <p class="form-help"><?= t('Default values are "%s"', $default_columns) ?></p> <?= $this->form->label(t('Default categories for new projects (Comma-separated)'), 'project_categories') ?> - <?= $this->form->text('project_categories', $values, $errors) ?><br/> + <?= $this->form->text('project_categories', $values, $errors) ?> <p class="form-help"><?= t('Example: "Bug, Feature Request, Improvement"') ?></p> + <?= $this->form->checkbox('disable_private_project', t('Disable private projects'), 1, isset($values['disable_private_project']) && $values['disable_private_project'] == 1) ?> <?= $this->form->checkbox('subtask_restriction', t('Allow only one subtask in progress at the same time for a user'), 1, $values['subtask_restriction'] == 1) ?> <?= $this->form->checkbox('subtask_time_tracking', t('Trigger automatically subtask time tracking'), 1, $values['subtask_time_tracking'] == 1) ?> <?= $this->form->checkbox('cfd_include_closed_tasks', t('Include closed tasks in the cumulative flow diagram'), 1, $values['cfd_include_closed_tasks'] == 1) ?> <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> </form> -</section>
\ No newline at end of file diff --git a/app/Template/config/sidebar.php b/app/Template/config/sidebar.php index 4195cde1..dd51bc74 100644 --- a/app/Template/config/sidebar.php +++ b/app/Template/config/sidebar.php @@ -1,44 +1,39 @@ <div class="sidebar"> <h2><?= t('Actions') ?></h2> <ul> - <li <?= $this->app->getRouterAction() === 'index' ? 'class="active"' : '' ?>> + <li <?= $this->app->checkMenuSelection('config', 'index') ?>> <?= $this->url->link(t('About'), 'config', 'index') ?> </li> - <li <?= $this->app->getRouterAction() === 'plugins' ? 'class="active"' : '' ?>> + <li <?= $this->app->checkMenuSelection('config', 'plugins') ?>> <?= $this->url->link(t('Plugins'), 'config', 'plugins') ?> </li> - <li <?= $this->app->getRouterAction() === 'application' ? 'class="active"' : '' ?>> + <li <?= $this->app->checkMenuSelection('config', 'application') ?>> <?= $this->url->link(t('Application settings'), 'config', 'application') ?> </li> - <li <?= $this->app->getRouterAction() === 'project' ? 'class="active"' : '' ?>> + <li <?= $this->app->checkMenuSelection('config', 'project') ?>> <?= $this->url->link(t('Project settings'), 'config', 'project') ?> </li> - <li <?= $this->app->getRouterAction() === 'board' ? 'class="active"' : '' ?>> + <li <?= $this->app->checkMenuSelection('config', 'board') ?>> <?= $this->url->link(t('Board settings'), 'config', 'board') ?> </li> - <li <?= $this->app->getRouterAction() === 'calendar' ? 'class="active"' : '' ?>> + <li <?= $this->app->checkMenuSelection('config', 'calendar') ?>> <?= $this->url->link(t('Calendar settings'), 'config', 'calendar') ?> </li> - <li <?= $this->app->getRouterController() === 'link' && $this->app->getRouterAction() === 'index' ? 'class="active"' : '' ?>> + <li <?= $this->app->checkMenuSelection('link') ?>> <?= $this->url->link(t('Link settings'), 'link', 'index') ?> </li> - <li <?= $this->app->getRouterController() === 'currency' && $this->app->getRouterAction() === 'index' ? 'class="active"' : '' ?>> + <li <?= $this->app->checkMenuSelection('currency', 'index') ?>> <?= $this->url->link(t('Currency rates'), 'currency', 'index') ?> </li> - <li <?= $this->app->getRouterAction() === 'integrations' ? 'class="active"' : '' ?>> + <li <?= $this->app->checkMenuSelection('config', 'integrations') ?>> <?= $this->url->link(t('Integrations'), 'config', 'integrations') ?> </li> - <li <?= $this->app->getRouterAction() === 'webhook' ? 'class="active"' : '' ?>> + <li <?= $this->app->checkMenuSelection('config', 'webhook') ?>> <?= $this->url->link(t('Webhooks'), 'config', 'webhook') ?> </li> - <li <?= $this->app->getRouterAction() === 'api' ? 'class="active"' : '' ?>> + <li <?= $this->app->checkMenuSelection('config', 'api') ?>> <?= $this->url->link(t('API'), 'config', 'api') ?> </li> - <li> - <?= $this->url->link(t('Documentation'), 'doc', 'show') ?> - </li> <?= $this->hook->render('template:config:sidebar') ?> </ul> - <div class="sidebar-collapse"><a href="#" title="<?= t('Hide sidebar') ?>"><i class="fa fa-chevron-left"></i></a></div> - <div class="sidebar-expand" style="display: none"><a href="#" title="<?= t('Expand sidebar') ?>"><i class="fa fa-chevron-right"></i></a></div> </div>
\ No newline at end of file diff --git a/app/Template/currency/index.php b/app/Template/currency/index.php index 1c78c47a..07b58a8b 100644 --- a/app/Template/currency/index.php +++ b/app/Template/currency/index.php @@ -29,10 +29,10 @@ <?= $this->form->csrf() ?> <?= $this->form->label(t('Reference currency'), 'application_currency') ?> - <?= $this->form->select('application_currency', $currencies, $config_values, $errors) ?><br/> + <?= $this->form->select('application_currency', $currencies, $config_values, $errors) ?> <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> </form> @@ -43,12 +43,12 @@ <?= $this->form->csrf() ?> <?= $this->form->label(t('Currency'), 'currency') ?> - <?= $this->form->select('currency', $currencies, $values, $errors) ?><br/> + <?= $this->form->select('currency', $currencies, $values, $errors) ?> <?= $this->form->label(t('Rate'), 'rate') ?> - <?= $this->form->text('rate', $values, $errors, array(), 'form-numeric') ?><br/> + <?= $this->form->text('rate', $values, $errors, array(), 'form-numeric') ?> <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> </form> diff --git a/app/Template/custom_filter/add.php b/app/Template/custom_filter/add.php index 61df148c..361083ee 100644 --- a/app/Template/custom_filter/add.php +++ b/app/Template/custom_filter/add.php @@ -12,10 +12,10 @@ <?= $this->form->label(t('Filter'), 'filter') ?> <?= $this->form->text('filter', $values, $errors, array('required', 'maxlength="100"')) ?> - <?php if ($this->user->isProjectManagementAllowed($project['id'])): ?> + <?php if ($this->user->hasProjectAccess('ProjectEdit', 'edit', $project['id'])): ?> <?= $this->form->checkbox('is_shared', t('Share with all project members'), 1) ?> <?php endif ?> - + <?= $this->form->checkbox('append', t('Append filter (instead of replacement)'), 1) ?> <div class="form-actions"> diff --git a/app/Template/custom_filter/edit.php b/app/Template/custom_filter/edit.php index 9d296b84..01fb4ec5 100644 --- a/app/Template/custom_filter/edit.php +++ b/app/Template/custom_filter/edit.php @@ -2,7 +2,7 @@ <h2><?= t('Edit custom filter') ?></h2> </div> -<form method="post" action="<?= $this->url->href('customfilter', 'update', array('project_id' => $filter['project_id'], 'filter_id' => $filter['id'])) ?>" autocomplete="off"> +<form class="form-popover" method="post" action="<?= $this->url->href('customfilter', 'update', array('project_id' => $filter['project_id'], 'filter_id' => $filter['id'])) ?>" autocomplete="off"> <?= $this->form->csrf() ?> @@ -16,17 +16,17 @@ <?= $this->form->label(t('Filter'), 'filter') ?> <?= $this->form->text('filter', $values, $errors, array('required', 'maxlength="100"')) ?> - <?php if ($this->user->isProjectManagementAllowed($project['id'])): ?> + <?php if ($this->user->hasProjectAccess('ProjectEdit', 'edit', $project['id'])): ?> <?= $this->form->checkbox('is_shared', t('Share with all project members'), 1, $values['is_shared'] == 1) ?> <?php else: ?> <?= $this->form->hidden('is_shared', $values) ?> <?php endif ?> - + <?= $this->form->checkbox('append', t('Append filter (instead of replacement)'), 1, $values['append'] == 1) ?> - + <div class="form-actions"> <input type="submit" value="<?= t('Save') ?>" class="btn btn-blue"> <?= t('or') ?> - <?= $this->url->link(t('cancel'), 'customfilter', 'index', array('project_id' => $project['id'])) ?> + <?= $this->url->link(t('cancel'), 'customfilter', 'index', array('project_id' => $project['id']), false, 'close-popover') ?> </div> </form>
\ No newline at end of file diff --git a/app/Template/custom_filter/index.php b/app/Template/custom_filter/index.php index c857e206..28b6a878 100644 --- a/app/Template/custom_filter/index.php +++ b/app/Template/custom_filter/index.php @@ -5,12 +5,12 @@ <div> <table> <tr> - <th><?= t('Name') ?></th> - <th><?= t('Filter') ?></th> - <th><?= t('Shared') ?></th> - <th><?= t('Append/Replace') ?></th> - <th><?= t('Owner') ?></th> - <th><?= t('Actions') ?></th> + <th class="column-15"><?= t('Name') ?></th> + <th class="column-30"><?= t('Filter') ?></th> + <th class="column-10"><?= t('Shared') ?></th> + <th class="column-15"><?= t('Append/Replace') ?></th> + <th class="column-25"><?= t('Owner') ?></th> + <th class="column-5"><?= t('Actions') ?></th> </tr> <?php foreach ($custom_filters as $filter): ?> <tr> @@ -32,11 +32,14 @@ </td> <td><?= $this->e($filter['owner_name'] ?: $filter['owner_username']) ?></td> <td> - <?php if ($filter['user_id'] == $this->user->getId() || $this->user->isProjectManagementAllowed($project['id'])): ?> + <?php if ($filter['user_id'] == $this->user->getId() || $this->user->hasProjectAccess('customfilter', 'edit', $project['id'])): ?> + <div class="dropdown"> + <a href="#" class="dropdown-menu dropdown-menu-link-icon"><i class="fa fa-cog fa-fw"></i><i class="fa fa-caret-down"></i></a> <ul> - <li><?= $this->url->link(t('Remove'), 'customfilter', 'remove', array('project_id' => $filter['project_id'], 'filter_id' => $filter['id']), true) ?></li> - <li><?= $this->url->link(t('Edit'), 'customfilter', 'edit', array('project_id' => $filter['project_id'], 'filter_id' => $filter['id'])) ?></li> + <li><?= $this->url->link(t('Remove'), 'customfilter', 'confirm', array('project_id' => $filter['project_id'], 'filter_id' => $filter['id']), false, 'popover') ?></li> + <li><?= $this->url->link(t('Edit'), 'customfilter', 'edit', array('project_id' => $filter['project_id'], 'filter_id' => $filter['id']), false, 'popover') ?></li> </ul> + </div> <?php endif ?> </td> </tr> diff --git a/app/Template/custom_filter/remove.php b/app/Template/custom_filter/remove.php new file mode 100644 index 00000000..d4c67a2b --- /dev/null +++ b/app/Template/custom_filter/remove.php @@ -0,0 +1,17 @@ +<section id="main"> + <div class="page-header"> + <h2><?= t('Remove a custom filter') ?></h2> + </div> + + <div class="confirm"> + <p class="alert alert-info"> + <?= t('Do you really want to remove this custom filter: "%s"?', $filter['name']) ?> + </p> + + <div class="form-actions"> + <?= $this->url->link(t('Yes'), 'customfilter', 'remove', array('project_id' => $project['id'], 'filter_id' => $filter['id']), true, 'btn btn-red') ?> + <?= t('or') ?> + <?= $this->url->link(t('cancel'), 'customfilter', 'index', array('project_id' => $project['id']), false, 'close-popover') ?> + </div> + </div> +</section> diff --git a/app/Template/event/events.php b/app/Template/event/events.php index aec0b29e..bbb01be4 100644 --- a/app/Template/event/events.php +++ b/app/Template/event/events.php @@ -14,7 +14,7 @@ <?php elseif ($this->text->contains($event['event_name'], 'comment')): ?> <i class="fa fa-comments-o"></i> <?php endif ?> - <?= dt('%B %e, %Y at %k:%M %p', $event['date_creation']) ?> + <?= $this->dt->datetime($event['date_creation']) ?> </p> <div class="activity-content"><?= $event['event_content'] ?></div> </div> diff --git a/app/Template/event/task_file_create.php b/app/Template/event/task_file_create.php new file mode 100644 index 00000000..1a36bc8f --- /dev/null +++ b/app/Template/event/task_file_create.php @@ -0,0 +1,11 @@ +<?= $this->user->avatar($email, $author) ?> + +<p class="activity-title"> + <?= e('%s attached a new file to the task %s', + $this->e($author), + $this->url->link(t('#%d', $task['id']), 'task', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) + ) ?> +</p> +<p class="activity-description"> + <em><?= $this->e($file['name']) ?></em> +</p>
\ No newline at end of file diff --git a/app/Template/export/sidebar.php b/app/Template/export/sidebar.php index 44448520..6a1de7e9 100644 --- a/app/Template/export/sidebar.php +++ b/app/Template/export/sidebar.php @@ -15,6 +15,4 @@ </li> <?= $this->hook->render('template:export:sidebar') ?> </ul> - <div class="sidebar-collapse"><a href="#" title="<?= t('Hide sidebar') ?>"><i class="fa fa-chevron-left"></i></a></div> - <div class="sidebar-expand" style="display: none"><a href="#" title="<?= t('Expand sidebar') ?>"><i class="fa fa-chevron-right"></i></a></div> </div>
\ No newline at end of file diff --git a/app/Template/export/subtasks.php b/app/Template/export/subtasks.php index 4aad2641..f2a00f84 100644 --- a/app/Template/export/subtasks.php +++ b/app/Template/export/subtasks.php @@ -1,7 +1,5 @@ <div class="page-header"> - <h2> - <?= t('Subtasks exportation for "%s"', $project['name']) ?> - </h2> + <h2><?= t('Subtasks exportation for "%s"', $project['name']) ?></h2> </div> <p class="alert alert-info"><?= t('This report contains all subtasks information for the given date range.') ?></p> @@ -13,7 +11,7 @@ <?= $this->form->hidden('project_id', $values) ?> <?= $this->form->label(t('Start Date'), 'from') ?> - <?= $this->form->text('from', $values, $errors, array('required', 'placeholder="'.$this->text->in($date_format, $date_formats).'"'), 'form-date') ?><br/> + <?= $this->form->text('from', $values, $errors, array('required', 'placeholder="'.$this->text->in($date_format, $date_formats).'"'), 'form-date') ?> <?= $this->form->label(t('End Date'), 'to') ?> <?= $this->form->text('to', $values, $errors, array('required', 'placeholder="'.$this->text->in($date_format, $date_formats).'"'), 'form-date') ?> @@ -21,6 +19,6 @@ <div class="form-help"><?= t('Others formats accepted: %s and %s', date('Y-m-d'), date('Y_m_d')) ?></div> <div class="form-actions"> - <input type="submit" value="<?= t('Execute') ?>" class="btn btn-blue"/> + <input type="submit" value="<?= t('Execute') ?>" class="btn btn-blue"> </div> </form>
\ No newline at end of file diff --git a/app/Template/export/summary.php b/app/Template/export/summary.php index ffbd6ac2..0c2a96fb 100644 --- a/app/Template/export/summary.php +++ b/app/Template/export/summary.php @@ -1,7 +1,5 @@ <div class="page-header"> - <h2> - <?= t('Daily project summary export for "%s"', $project['name']) ?> - </h2> + <h2><?= t('Daily project summary export for "%s"', $project['name']) ?></h2> </div> <p class="alert alert-info"><?= t('This export contains the number of tasks per column grouped per day.') ?></p> @@ -13,7 +11,7 @@ <?= $this->form->hidden('project_id', $values) ?> <?= $this->form->label(t('Start Date'), 'from') ?> - <?= $this->form->text('from', $values, $errors, array('required', 'placeholder="'.$this->text->in($date_format, $date_formats).'"'), 'form-date') ?><br/> + <?= $this->form->text('from', $values, $errors, array('required', 'placeholder="'.$this->text->in($date_format, $date_formats).'"'), 'form-date') ?> <?= $this->form->label(t('End Date'), 'to') ?> <?= $this->form->text('to', $values, $errors, array('required', 'placeholder="'.$this->text->in($date_format, $date_formats).'"'), 'form-date') ?> @@ -21,6 +19,6 @@ <div class="form-help"><?= t('Others formats accepted: %s and %s', date('Y-m-d'), date('Y_m_d')) ?></div> <div class="form-actions"> - <input type="submit" value="<?= t('Execute') ?>" class="btn btn-blue"/> + <input type="submit" value="<?= t('Execute') ?>" class="btn btn-blue"> </div> </form>
\ No newline at end of file diff --git a/app/Template/export/tasks.php b/app/Template/export/tasks.php index c74c8f98..c27149d2 100644 --- a/app/Template/export/tasks.php +++ b/app/Template/export/tasks.php @@ -1,7 +1,5 @@ <div class="page-header"> - <h2> - <?= t('Tasks exportation for "%s"', $project['name']) ?> - </h2> + <h2><?= t('Tasks exportation for "%s"', $project['name']) ?></h2> </div> <p class="alert alert-info"><?= t('This report contains all tasks information for the given date range.') ?></p> @@ -13,7 +11,7 @@ <?= $this->form->hidden('project_id', $values) ?> <?= $this->form->label(t('Start Date'), 'from') ?> - <?= $this->form->text('from', $values, $errors, array('required', 'placeholder="'.$this->text->in($date_format, $date_formats).'"'), 'form-date') ?><br/> + <?= $this->form->text('from', $values, $errors, array('required', 'placeholder="'.$this->text->in($date_format, $date_formats).'"'), 'form-date') ?> <?= $this->form->label(t('End Date'), 'to') ?> <?= $this->form->text('to', $values, $errors, array('required', 'placeholder="'.$this->text->in($date_format, $date_formats).'"'), 'form-date') ?> @@ -21,6 +19,6 @@ <div class="form-help"><?= t('Others formats accepted: %s and %s', date('Y-m-d'), date('Y_m_d')) ?></div> <div class="form-actions"> - <input type="submit" value="<?= t('Execute') ?>" class="btn btn-blue"/> + <input type="submit" value="<?= t('Execute') ?>" class="btn btn-blue"> </div> </form>
\ No newline at end of file diff --git a/app/Template/export/transitions.php b/app/Template/export/transitions.php index bf6ef249..d935bde1 100644 --- a/app/Template/export/transitions.php +++ b/app/Template/export/transitions.php @@ -1,7 +1,5 @@ <div class="page-header"> - <h2> - <?= t('Task transitions export') ?> - </h2> + <h2><?= t('Task transitions export') ?></h2> </div> <p class="alert alert-info"><?= t('This report contains all column moves for each task with the date, the user and the time spent for each transition.') ?></p> @@ -13,7 +11,7 @@ <?= $this->form->hidden('project_id', $values) ?> <?= $this->form->label(t('Start Date'), 'from') ?> - <?= $this->form->text('from', $values, $errors, array('required', 'placeholder="'.$this->text->in($date_format, $date_formats).'"'), 'form-date') ?><br/> + <?= $this->form->text('from', $values, $errors, array('required', 'placeholder="'.$this->text->in($date_format, $date_formats).'"'), 'form-date') ?> <?= $this->form->label(t('End Date'), 'to') ?> <?= $this->form->text('to', $values, $errors, array('required', 'placeholder="'.$this->text->in($date_format, $date_formats).'"'), 'form-date') ?> @@ -21,6 +19,6 @@ <div class="form-help"><?= t('Others formats accepted: %s and %s', date('Y-m-d'), date('Y_m_d')) ?></div> <div class="form-actions"> - <input type="submit" value="<?= t('Execute') ?>" class="btn btn-blue"/> + <input type="submit" value="<?= t('Execute') ?>" class="btn btn-blue"> </div> </form>
\ No newline at end of file diff --git a/app/Template/file/new.php b/app/Template/file/new.php deleted file mode 100644 index a1a59eae..00000000 --- a/app/Template/file/new.php +++ /dev/null @@ -1,14 +0,0 @@ -<div class="page-header"> - <h2><?= t('Attach a document') ?></h2> -</div> - -<form action="<?= $this->url->href('file', 'save', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?>" method="post" enctype="multipart/form-data"> - <?= $this->form->csrf() ?> - <input type="file" name="files[]" multiple /> - <div class="form-help"><?= t('Maximum size: ') ?><?= is_integer($max_size) ? $this->text->bytes($max_size) : $max_size ?></div> - <div class="form-actions"> - <input type="submit" value="<?= t('Save') ?>" class="btn btn-blue"/> - <?= t('or') ?> - <?= $this->url->link(t('cancel'), 'task', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?> - </div> -</form>
\ No newline at end of file diff --git a/app/Template/file/open.php b/app/Template/file/open.php deleted file mode 100644 index 3df012b6..00000000 --- a/app/Template/file/open.php +++ /dev/null @@ -1,6 +0,0 @@ -<div class="page-header"> - <h2><?= $this->e($file['name']) ?></h2> - <div class="task-file-viewer"> - <img src="<?= $this->url->href('file', 'image', array('file_id' => $file['id'], 'project_id' => $task['project_id'], 'task_id' => $file['task_id'])) ?>" alt="<?= $this->e($file['name']) ?>"/> - </div> -</div>
\ No newline at end of file diff --git a/app/Template/file/show.php b/app/Template/file/show.php deleted file mode 100644 index a390c9fb..00000000 --- a/app/Template/file/show.php +++ /dev/null @@ -1,56 +0,0 @@ -<?php if (! empty($files) || ! empty($images)): ?> -<div id="attachments" class="task-show-section"> - - <div class="page-header"> - <h2><?= t('Attachments') ?></h2> - </div> - <?php if (! empty($images)): ?> - <h3><?= t('Images') ?></h3> - <ul class="task-show-images"> - <?php foreach ($images as $file): ?> - <li> - <?php if (function_exists('imagecreatetruecolor')): ?> - <div class="img_container"> - <img src="<?= $this->url->href('file', 'thumbnail', array('file_id' => $file['id'], 'project_id' => $task['project_id'], 'task_id' => $file['task_id'])) ?>" alt="<?= $this->e($file['name']) ?>"/> - </div> - <?php endif ?> - <p> - <?= $this->e($file['name']) ?> - <span class="tooltip" title='<?= t('uploaded by: %s', $file['user_name'] ?: $file['username']).'<br>'.t('uploaded on: %s', dt('%B %e, %Y at %k:%M %p', $file['date'])).'<br>'.t('size: %s', $this->text->bytes($file['size'])) ?>'> - <i class="fa fa-info-circle"></i> - </span> - </p> - <span class="task-show-file-actions task-show-image-actions"> - <i class="fa fa-eye"></i> <?= $this->url->link(t('open file'), 'file', 'open', array('task_id' => $task['id'], 'project_id' => $task['project_id'], 'file_id' => $file['id']), false, 'popover') ?> - <i class="fa fa-trash"></i> <?= $this->url->link(t('remove'), 'file', 'confirm', array('task_id' => $task['id'], 'project_id' => $task['project_id'], 'file_id' => $file['id'])) ?> - <i class="fa fa-download"></i> <?= $this->url->link(t('download'), 'file', 'download', array('task_id' => $task['id'], 'project_id' => $task['project_id'], 'file_id' => $file['id'])) ?> - </span> - </li> - <?php endforeach ?> - </ul> - <?php endif ?> - - <?php if (! empty($files)): ?> - <h3><?= t('Files') ?></h3> - <table class="task-show-file-table"> - <?php foreach ($files as $file): ?> - <tr> - <td><i class="fa <?= $this->file->icon($file['name']) ?> fa-fw"></i></td> - <td> - <?= $this->e($file['name']) ?> - <span class="tooltip" title='<?= t('uploaded by: %s', $file['user_name'] ?: $file['username']).'<br>'.t('uploaded on: %s', dt('%B %e, %Y at %k:%M %p', $file['date'])).'<br>'.t('size: %s', $this->text->bytes($file['size'])) ?>'> - <i class="fa fa-info-circle"></i> - </span> - </td> - <td> - <span class="task-show-file-actions"> - <i class="fa fa-trash"></i> <?= $this->url->link(t('remove'), 'file', 'confirm', array('task_id' => $task['id'], 'project_id' => $task['project_id'], 'file_id' => $file['id'])) ?> - <i class="fa fa-download"></i> <?= $this->url->link(t('download'), 'file', 'download', array('task_id' => $task['id'], 'project_id' => $task['project_id'], 'file_id' => $file['id'])) ?> - </span> - </td> - </tr> - <?php endforeach ?> - </table> - <?php endif ?> -</div> -<?php endif ?>
\ No newline at end of file diff --git a/app/Template/file_viewer/show.php b/app/Template/file_viewer/show.php new file mode 100644 index 00000000..c71ef91c --- /dev/null +++ b/app/Template/file_viewer/show.php @@ -0,0 +1,14 @@ +<div class="page-header"> + <h2><?= $this->e($file['name']) ?></h2> +</div> +<div class="file-viewer"> + <?php if ($file['is_image']): ?> + <img src="<?= $this->url->href('FileViewer', 'image', $params) ?>" alt="<?= $this->e($file['name']) ?>"> + <?php elseif ($type === 'markdown'): ?> + <article class="markdown"> + <?= $this->text->markdown($content) ?> + </article> + <?php elseif ($type === 'text'): ?> + <pre><?= $content ?></pre> + <?php endif ?> +</div>
\ No newline at end of file diff --git a/app/Template/gantt/project.php b/app/Template/gantt/project.php index 1face3b8..fe193c2b 100644 --- a/app/Template/gantt/project.php +++ b/app/Template/gantt/project.php @@ -1,5 +1,5 @@ <section id="main"> - <?= $this->render('project/filters', array( + <?= $this->render('project_header/header', array( 'project' => $project, 'filters' => $filters, 'users_list' => $users_list, diff --git a/app/Template/gantt/projects.php b/app/Template/gantt/projects.php index 50e244a5..84b260bb 100644 --- a/app/Template/gantt/projects.php +++ b/app/Template/gantt/projects.php @@ -1,16 +1,10 @@ <section id="main"> <div class="page-header"> <ul> - <?php if ($this->user->isProjectAdmin() || $this->user->isAdmin()): ?> - <li><i class="fa fa-plus fa-fw"></i><?= $this->url->link(t('New project'), 'project', 'create') ?></li> - <?php endif ?> - <li> - <i class="fa fa-lock fa-fw"></i><?= $this->url->link(t('New private project'), 'project', 'create', array('private' => 1)) ?> - </li> <li> <i class="fa fa-folder fa-fw"></i><?= $this->url->link(t('Projects list'), 'project', 'index') ?> </li> - <?php if ($this->user->isProjectAdmin() || $this->user->isAdmin()): ?> + <?php if ($this->user->hasAccess('projectuser', 'managers')): ?> <li><i class="fa fa-user fa-fw"></i><?= $this->url->link(t('Users overview'), 'projectuser', 'managers') ?></li> <?php endif ?> </ul> diff --git a/app/Template/gantt/task_creation.php b/app/Template/gantt/task_creation.php index 7997e231..a08f41b4 100644 --- a/app/Template/gantt/task_creation.php +++ b/app/Template/gantt/task_creation.php @@ -33,26 +33,13 @@ </div> <div class="form-column"> - <?= $this->form->label(t('Assignee'), 'owner_id') ?> - <?= $this->form->select('owner_id', $users_list, $values, $errors, array('tabindex="3"')) ?><br/> - - <?= $this->form->label(t('Category'), 'category_id') ?> - <?= $this->form->select('category_id', $categories_list, $values, $errors, array('tabindex="4"')) ?><br/> - - <?php if (! (count($swimlanes_list) === 1 && key($swimlanes_list) === 0)): ?> - <?= $this->form->label(t('Swimlane'), 'swimlane_id') ?> - <?= $this->form->select('swimlane_id', $swimlanes_list, $values, $errors, array('tabindex="5"')) ?><br/> - <?php endif ?> - - <?= $this->form->label(t('Complexity'), 'score') ?> - <?= $this->form->number('score', $values, $errors, array('tabindex="6"')) ?><br/> - - <?= $this->form->label(t('Start Date'), 'date_started') ?> - <?= $this->form->text('date_started', $values, $errors, array('placeholder="'.$this->text->in($date_format, $date_formats).'"', 'tabindex="7"'), 'form-date') ?> - - <?= $this->form->label(t('Due Date'), 'date_due') ?> - <?= $this->form->text('date_due', $values, $errors, array('placeholder="'.$this->text->in($date_format, $date_formats).'"', 'tabindex="8"'), 'form-date') ?><br/> - <div class="form-help"><?= t('Others formats accepted: %s and %s', date('Y-m-d'), date('Y_m_d')) ?></div> + <?= $this->task->selectAssignee($users_list, $values, $errors) ?> + <?= $this->task->selectCategory($categories_list, $values, $errors) ?> + <?= $this->task->selectSwimlane($swimlanes_list, $values, $errors) ?> + <?= $this->task->selectPriority($project, $values) ?> + <?= $this->task->selectScore($values, $errors) ?> + <?= $this->task->selectStartDate($values, $errors) ?> + <?= $this->task->selectDueDate($values, $errors) ?> </div> <div class="form-actions"> diff --git a/app/Template/group/associate.php b/app/Template/group/associate.php new file mode 100644 index 00000000..468281e2 --- /dev/null +++ b/app/Template/group/associate.php @@ -0,0 +1,25 @@ +<section id="main"> + <div class="page-header"> + <ul> + <li><i class="fa fa-users fa-fw"></i><?= $this->url->link(t('View all groups'), 'group', 'index') ?></li> + <li><i class="fa fa-user fa-fw"></i><?= $this->url->link(t('View group members'), 'group', 'users', array('group_id' => $group['id'])) ?></li> + </ul> + </div> + <?php if (empty($users)): ?> + <p class="alert"><?= t('There is no user available.') ?></p> + <?php else: ?> + <form method="post" action="<?= $this->url->href('group', 'addUser', array('group_id' => $group['id'])) ?>" autocomplete="off"> + <?= $this->form->csrf() ?> + <?= $this->form->hidden('group_id', $values) ?> + + <?= $this->form->label(t('User'), 'user_id') ?> + <?= $this->form->select('user_id', $users, $values, $errors, array('required'), 'chosen-select') ?> + + <div class="form-actions"> + <input type="submit" value="<?= t('Save') ?>" class="btn btn-blue"> + <?= t('or') ?> + <?= $this->url->link(t('cancel'), 'group', 'index') ?> + </div> + </form> + <?php endif ?> +</section> diff --git a/app/Template/group/create.php b/app/Template/group/create.php new file mode 100644 index 00000000..4a935c08 --- /dev/null +++ b/app/Template/group/create.php @@ -0,0 +1,19 @@ +<section id="main"> + <div class="page-header"> + <ul> + <li><i class="fa fa-users fa-fw"></i><?= $this->url->link(t('View all groups'), 'group', 'index') ?></li> + </ul> + </div> + <form method="post" action="<?= $this->url->href('group', 'save') ?>" autocomplete="off"> + <?= $this->form->csrf() ?> + + <?= $this->form->label(t('Name'), 'name') ?> + <?= $this->form->text('name', $values, $errors, array('autofocus', 'required', 'maxlength="100"')) ?> + + <div class="form-actions"> + <input type="submit" value="<?= t('Save') ?>" class="btn btn-blue"> + <?= t('or') ?> + <?= $this->url->link(t('cancel'), 'group', 'index') ?> + </div> + </form> +</section> diff --git a/app/Template/group/dissociate.php b/app/Template/group/dissociate.php new file mode 100644 index 00000000..e1c60764 --- /dev/null +++ b/app/Template/group/dissociate.php @@ -0,0 +1,17 @@ +<section id="main"> + <div class="page-header"> + <ul> + <li><i class="fa fa-users fa-fw"></i><?= $this->url->link(t('View all groups'), 'group', 'index') ?></li> + <li><i class="fa fa-user fa-fw"></i><?= $this->url->link(t('View group members'), 'group', 'users', array('group_id' => $group['id'])) ?></li> + </ul> + </div> + <div class="confirm"> + <p class="alert alert-info"><?= t('Do you really want to remove the user "%s" from the group "%s"?', $user['name'] ?: $user['username'], $group['name']) ?></p> + + <div class="form-actions"> + <?= $this->url->link(t('Yes'), 'group', 'removeUser', array('group_id' => $group['id'], 'user_id' => $user['id']), true, 'btn btn-red') ?> + <?= t('or') ?> + <?= $this->url->link(t('cancel'), 'group', 'users', array('group_id' => $group['id'])) ?> + </div> + </div> +</section> diff --git a/app/Template/group/edit.php b/app/Template/group/edit.php new file mode 100644 index 00000000..d9646ee8 --- /dev/null +++ b/app/Template/group/edit.php @@ -0,0 +1,22 @@ +<section id="main"> + <div class="page-header"> + <ul> + <li><i class="fa fa-users fa-fw"></i><?= $this->url->link(t('View all groups'), 'group', 'index') ?></li> + </ul> + </div> + <form method="post" action="<?= $this->url->href('group', 'update') ?>" autocomplete="off"> + <?= $this->form->csrf() ?> + + <?= $this->form->hidden('id', $values) ?> + <?= $this->form->hidden('external_id', $values) ?> + + <?= $this->form->label(t('Name'), 'name') ?> + <?= $this->form->text('name', $values, $errors, array('autofocus', 'required', 'maxlength="100"')) ?> + + <div class="form-actions"> + <input type="submit" value="<?= t('Save') ?>" class="btn btn-blue"> + <?= t('or') ?> + <?= $this->url->link(t('cancel'), 'group', 'index') ?> + </div> + </form> +</section> diff --git a/app/Template/group/index.php b/app/Template/group/index.php new file mode 100644 index 00000000..d111b5d9 --- /dev/null +++ b/app/Template/group/index.php @@ -0,0 +1,46 @@ +<section id="main"> + <div class="page-header"> + <ul> + <li><i class="fa fa-user fa-fw"></i><?= $this->url->link(t('All users'), 'user', 'index') ?></li> + <li><i class="fa fa-user-plus fa-fw"></i><?= $this->url->link(t('New group'), 'group', 'create') ?></li> + </ul> + </div> + <?php if ($paginator->isEmpty()): ?> + <p class="alert"><?= t('There is no group.') ?></p> + <?php else: ?> + <table class="table-small table-fixed"> + <tr> + <th class="column-5"><?= $paginator->order(t('Id'), 'id') ?></th> + <th class="column-20"><?= $paginator->order(t('External Id'), 'external_id') ?></th> + <th><?= $paginator->order(t('Name'), 'name') ?></th> + <th class="column-5"><?= t('Actions') ?></th> + </tr> + <?php foreach ($paginator->getCollection() as $group): ?> + <tr> + <td> + #<?= $group['id'] ?> + </td> + <td> + <?= $this->e($group['external_id']) ?> + </td> + <td> + <?= $this->e($group['name']) ?> + </td> + <td> + <div class="dropdown"> + <a href="#" class="dropdown-menu dropdown-menu-link-icon"><i class="fa fa-cog fa-fw"></i><i class="fa fa-caret-down"></i></a> + <ul> + <li><?= $this->url->link(t('Add group member'), 'group', 'associate', array('group_id' => $group['id'])) ?></li> + <li><?= $this->url->link(t('Members'), 'group', 'users', array('group_id' => $group['id'])) ?></li> + <li><?= $this->url->link(t('Edit'), 'group', 'edit', array('group_id' => $group['id'])) ?></li> + <li><?= $this->url->link(t('Remove'), 'group', 'confirm', array('group_id' => $group['id'])) ?></li> + </ul> + </div> + </td> + </tr> + <?php endforeach ?> + </table> + + <?= $paginator ?> + <?php endif ?> +</section> diff --git a/app/Template/group/remove.php b/app/Template/group/remove.php new file mode 100644 index 00000000..1cb007b1 --- /dev/null +++ b/app/Template/group/remove.php @@ -0,0 +1,17 @@ +<section id="main"> + <div class="page-header"> + <ul> + <li><i class="fa fa-users fa-fw"></i><?= $this->url->link(t('View all groups'), 'group', 'index') ?></li> + <li><i class="fa fa-user fa-fw"></i><?= $this->url->link(t('View group members'), 'group', 'users', array('group_id' => $group['id'])) ?></li> + </ul> + </div> + <div class="confirm"> + <p class="alert alert-info"><?= t('Do you really want to remove this group: "%s"?', $group['name']) ?></p> + + <div class="form-actions"> + <?= $this->url->link(t('Yes'), 'group', 'remove', array('group_id' => $group['id']), true, 'btn btn-red') ?> + <?= t('or') ?> + <?= $this->url->link(t('cancel'), 'group', 'index') ?> + </div> + </div> +</section> diff --git a/app/Template/group/users.php b/app/Template/group/users.php new file mode 100644 index 00000000..f79cb9ad --- /dev/null +++ b/app/Template/group/users.php @@ -0,0 +1,42 @@ +<section id="main"> + <div class="page-header"> + <ul> + <li><i class="fa fa-users fa-fw"></i><?= $this->url->link(t('View all groups'), 'group', 'index') ?></li> + <li><i class="fa fa-plus fa-fw"></i><?= $this->url->link(t('Add group member'), 'group', 'associate', array('group_id' => $group['id'])) ?></li> + </ul> + </div> + <?php if ($paginator->isEmpty()): ?> + <p class="alert"><?= t('There is no user in this group.') ?></p> + <?php else: ?> + <table> + <tr> + <th><?= $paginator->order(t('Id'), 'id') ?></th> + <th><?= $paginator->order(t('Username'), 'username') ?></th> + <th><?= $paginator->order(t('Name'), 'name') ?></th> + <th><?= $paginator->order(t('Email'), 'email') ?></th> + <th><?= t('Actions') ?></th> + </tr> + <?php foreach ($paginator->getCollection() as $user): ?> + <tr> + <td> + <?= $this->url->link('#'.$user['id'], 'user', 'show', array('user_id' => $user['id'])) ?> + </td> + <td> + <?= $this->url->link($this->e($user['username']), 'user', 'show', array('user_id' => $user['id'])) ?> + </td> + <td> + <?= $this->e($user['name']) ?> + </td> + <td> + <a href="mailto:<?= $this->e($user['email']) ?>"><?= $this->e($user['email']) ?></a> + </td> + <td> + <?= $this->url->link(t('Remove this user'), 'group', 'dissociate', array('group_id' => $group['id'], 'user_id' => $user['id'])) ?> + </td> + </tr> + <?php endforeach ?> + </table> + + <?= $paginator ?> + <?php endif ?> +</section> diff --git a/app/Template/header.php b/app/Template/header.php index e8fd90c7..e646012a 100644 --- a/app/Template/header.php +++ b/app/Template/header.php @@ -1,6 +1,12 @@ <header> <nav> - <h1><?= $this->url->link('K<span>B</span>', 'app', 'index', array(), false, 'logo', t('Dashboard')).' '.$this->e($title) ?> + <h1> + <span class="logo"> + <?= $this->url->link('K<span>B</span>', 'app', 'index', array(), false, '', t('Dashboard')) ?> + </span> + <span class="title"> + <?= $this->e($title) ?> + </span> <?php if (! empty($description)): ?> <span class="tooltip" title='<?= $this->e($this->text->markdown($description)) ?>'> <i class="fa fa-info-circle"></i> @@ -13,6 +19,7 @@ <select id="board-selector" class="chosen-select select-auto-redirect" tabindex="-1" + data-search-threshold="0" data-notfound="<?= t('No results match:') ?>" data-placeholder="<?= t('Display another project') ?>" data-redirect-regex="PROJECT_ID" @@ -24,14 +31,75 @@ </select> </li> <?php endif ?> - <li> + <li class="user-links"> <?php if ($this->user->hasNotifications()): ?> - <?= $this->url->link('<i class="fa fa-bell web-notification-icon"></i>', 'app', 'notifications', array('user_id' => $this->user->getId()), false, '', t('Unread notifications')) ?> + <span class="notification"> + <?= $this->url->link('<i class="fa fa-bell web-notification-icon"></i>', 'app', 'notifications', array('user_id' => $this->user->getId()), false, '', t('Unread notifications')) ?> + </span> + <?php endif ?> + + <?php $has_project_creation_access = $this->user->hasAccess('ProjectCreation', 'create'); ?> + <?php $is_private_project_enabled = $this->app->config('disable_private_project', 0) == 0; ?> + + <?php if ($has_project_creation_access || (!$has_project_creation_access && $is_private_project_enabled)): ?> + <div class="dropdown"> + <a href="#" class="dropdown-menu dropdown-menu-link-icon"><i class="fa fa-plus fa-fw"></i><i class="fa fa-caret-down"></i></a> + <ul> + <?php if ($has_project_creation_access): ?> + <li><i class="fa fa-plus fa-fw"></i><?= $this->url->link(t('New project'), 'ProjectCreation', 'create', array(), false, 'popover') ?></li> + <?php endif ?> + <?php if ($is_private_project_enabled): ?> + <li> + <i class="fa fa-lock fa-fw"></i><?= $this->url->link(t('New private project'), 'ProjectCreation', 'createPrivate', array(), false, 'popover') ?> + </li> + <?php endif ?> + </ul> + </div> <?php endif ?> - <?= $this->url->link(t('Logout'), 'auth', 'logout') ?> - <span class="username hide-tablet">(<?= $this->user->getProfileLink() ?>)</span> + <div class="dropdown"> + <a href="#" class="dropdown-menu dropdown-menu-link-icon"><i class="fa fa-user fa-fw"></i><i class="fa fa-caret-down"></i></a> + <ul> + <li class="no-hover"><strong><?= $this->e($this->user->getFullname()) ?></strong></li> + <li> + <i class="fa fa-tachometer fa-fw"></i> + <?= $this->url->link(t('My dashboard'), 'app', 'index', array('user_id' => $this->user->getId())) ?> + </li> + <li> + <i class="fa fa-home fa-fw"></i> + <?= $this->url->link(t('My profile'), 'user', 'show', array('user_id' => $this->user->getId())) ?> + </li> + <li> + <i class="fa fa-folder fa-fw"></i> + <?= $this->url->link(t('Projects management'), 'project', 'index') ?> + </li> + <?php if ($this->user->hasAccess('user', 'index')): ?> + <li> + <i class="fa fa-user fa-fw"></i> + <?= $this->url->link(t('Users management'), 'user', 'index') ?> + </li> + <li> + <i class="fa fa-group fa-fw"></i> + <?= $this->url->link(t('Groups management'), 'group', 'index') ?> + </li> + <li> + <i class="fa fa-cog fa-fw"></i> + <?= $this->url->link(t('Settings'), 'config', 'index') ?> + </li> + <?php endif ?> + <li> + <i class="fa fa-life-ring fa-fw"></i> + <?= $this->url->link(t('Documentation'), 'doc', 'show') ?> + </li> + <?php if (! DISABLE_LOGOUT): ?> + <li> + <i class="fa fa-sign-out fa-fw"></i> + <?= $this->url->link(t('Logout'), 'auth', 'logout') ?> + </li> + <?php endif ?> + </ul> + </div> </li> </ul> </nav> -</header>
\ No newline at end of file +</header> diff --git a/app/Template/layout.php b/app/Template/layout.php index 20582952..0c81aac2 100644 --- a/app/Template/layout.php +++ b/app/Template/layout.php @@ -36,7 +36,7 @@ </head> <body data-status-url="<?= $this->url->href('app', 'status') ?>" data-login-url="<?= $this->url->href('auth', 'login') ?>" - data-markdown-preview-url="<?= $this->url->href('app', 'preview') ?>" + data-markdown-preview-url="<?= $this->url->href('TaskHelper', 'preview') ?>" data-timezone="<?= $this->app->getTimezone() ?>" data-js-lang="<?= $this->app->jsLang() ?>"> diff --git a/app/Template/listing/show.php b/app/Template/listing/show.php index aa17b228..9a5992e3 100644 --- a/app/Template/listing/show.php +++ b/app/Template/listing/show.php @@ -1,10 +1,13 @@ <section id="main"> - <?= $this->render('project/filters', array( + <?= $this->render('project_header/header', array( 'project' => $project, 'filters' => $filters, + 'custom_filters_list' => $custom_filters_list, + 'users_list' => $users_list, + 'categories_list' => $categories_list, )) ?> - <?php if (! empty($values['search']) && $paginator->isEmpty()): ?> + <?php if ($paginator->isEmpty()): ?> <p class="alert"><?= t('No tasks found.') ?></p> <?php elseif (! $paginator->isEmpty()): ?> <table class="table-fixed table-small"> @@ -21,7 +24,7 @@ <?php foreach ($paginator->getCollection() as $task): ?> <tr> <td class="task-table color-<?= $task['color_id'] ?>"> - <?= $this->url->link('#'.$this->e($task['id']), 'task', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id']), false, '', t('View this task')) ?> + <?= $this->render('task/dropdown', array('task' => $task)) ?> </td> <td> <?= $this->e($task['swimlane_name'] ?: $task['default_swimlane']) ?> @@ -43,7 +46,7 @@ <?php endif ?> </td> <td> - <?= dt('%B %e, %Y', $task['date_due']) ?> + <?= $this->dt->date($task['date_due']) ?> </td> <td> <?php if ($task['is_active'] == \Kanboard\Model\Task::STATUS_OPEN): ?> diff --git a/app/Template/notification/comment_user_mention.php b/app/Template/notification/comment_user_mention.php new file mode 100644 index 00000000..59f5127e --- /dev/null +++ b/app/Template/notification/comment_user_mention.php @@ -0,0 +1,7 @@ +<h2><?= t('You were mentioned in a comment on the task #%d', $task['id']) ?></h2> + +<p><?= $this->e($task['title']) ?></p> + +<?= $this->text->markdown($comment['comment']) ?> + +<?= $this->render('notification/footer', array('task' => $task, 'application_url' => $application_url)) ?>
\ No newline at end of file diff --git a/app/Template/notification/task_create.php b/app/Template/notification/task_create.php index 1d834d44..fb7898fc 100644 --- a/app/Template/notification/task_create.php +++ b/app/Template/notification/task_create.php @@ -2,11 +2,11 @@ <ul> <li> - <?= dt('Created on %B %e, %Y at %k:%M %p', $task['date_creation']) ?> + <?= t('Created:').' '.$this->dt->datetime($task['date_creation']) ?> </li> <?php if ($task['date_due']): ?> <li> - <strong><?= dt('Must be done before %B %e, %Y', $task['date_due']) ?></strong> + <strong><?= t('Due date:').' '.$this->dt->date($task['date_due']) ?></strong> </li> <?php endif ?> <?php if (! empty($task['creator_username'])): ?> diff --git a/app/Template/notification/file_create.php b/app/Template/notification/task_file_create.php index 63f7d1b8..63f7d1b8 100644 --- a/app/Template/notification/file_create.php +++ b/app/Template/notification/task_file_create.php diff --git a/app/Template/notification/task_overdue.php b/app/Template/notification/task_overdue.php index a231937b..d7e6ff5a 100644 --- a/app/Template/notification/task_overdue.php +++ b/app/Template/notification/task_overdue.php @@ -9,7 +9,7 @@ <?php else: ?> <?= $this->e($task['title']) ?> <?php endif ?> - (<?= dt('%B %e, %Y', $task['date_due']) ?>) + (<?= $this->dt->date($task['date_due']) ?>) <?php if ($task['assignee_username']): ?> (<strong><?= t('Assigned to %s', $task['assignee_name'] ?: $task['assignee_username']) ?></strong>) <?php endif ?> diff --git a/app/Template/notification/task_user_mention.php b/app/Template/notification/task_user_mention.php new file mode 100644 index 00000000..40ddddca --- /dev/null +++ b/app/Template/notification/task_user_mention.php @@ -0,0 +1,7 @@ +<h2><?= t('You were mentioned in the task #%d', $task['id']) ?></h2> +<p><?= $this->e($task['title']) ?></p> + +<h2><?= t('Description') ?></h2> +<?= $this->text->markdown($task['description']) ?> + +<?= $this->render('notification/footer', array('task' => $task, 'application_url' => $application_url)) ?>
\ No newline at end of file diff --git a/app/Template/password_reset/change.php b/app/Template/password_reset/change.php new file mode 100644 index 00000000..6d06f442 --- /dev/null +++ b/app/Template/password_reset/change.php @@ -0,0 +1,16 @@ +<div class="form-login"> + <h2><?= t('Password Reset') ?></h2> + <form method="post" action="<?= $this->url->href('PasswordReset', 'update', array('token' => $token)) ?>"> + <?= $this->form->csrf() ?> + + <?= $this->form->label(t('New password'), 'password') ?> + <?= $this->form->password('password', $values, $errors) ?> + + <?= $this->form->label(t('Confirmation'), 'confirmation') ?> + <?= $this->form->password('confirmation', $values, $errors) ?> + + <div class="form-actions"> + <input type="submit" value="<?= t('Change Password') ?>" class="btn btn-blue"> + </div> + </form> +</div>
\ No newline at end of file diff --git a/app/Template/password_reset/create.php b/app/Template/password_reset/create.php new file mode 100644 index 00000000..ef958011 --- /dev/null +++ b/app/Template/password_reset/create.php @@ -0,0 +1,17 @@ +<div class="form-login"> + <h2><?= t('Password Reset') ?></h2> + <form method="post" action="<?= $this->url->href('PasswordReset', 'save') ?>"> + <?= $this->form->csrf() ?> + + <?= $this->form->label(t('Username'), 'username') ?> + <?= $this->form->text('username', $values, $errors, array('autofocus', 'required')) ?> + + <?= $this->form->label(t('Enter the text below'), 'captcha') ?> + <img src="<?= $this->url->href('Captcha', 'image') ?>"/> + <?= $this->form->text('captcha', array(), $errors, array('required')) ?> + + <div class="form-actions"> + <input type="submit" value="<?= t('Change Password') ?>" class="btn btn-blue"/> + </div> + </form> +</div>
\ No newline at end of file diff --git a/app/Template/password_reset/email.php b/app/Template/password_reset/email.php new file mode 100644 index 00000000..62788b49 --- /dev/null +++ b/app/Template/password_reset/email.php @@ -0,0 +1,6 @@ +<p><?= t('To reset your password click on this link:') ?></p> + +<p><?= $this->url->to('PasswordReset', 'change', array('token' => $token), '', true) ?></p> + +<hr> +Kanboard
\ No newline at end of file diff --git a/app/Template/project/dropdown.php b/app/Template/project/dropdown.php index 1eb87b0e..980f9a44 100644 --- a/app/Template/project/dropdown.php +++ b/app/Template/project/dropdown.php @@ -2,10 +2,13 @@ <i class="fa fa-dashboard fa-fw"></i> <?= $this->url->link(t('Activity'), 'activity', 'project', array('project_id' => $project['id'])) ?> </li> + +<?php if ($this->user->hasProjectAccess('customfilter', 'index', $project['id'])): ?> <li> <i class="fa fa-filter fa-fw"></i> <?= $this->url->link(t('Custom filters'), 'customfilter', 'index', array('project_id' => $project['id'])) ?> </li> +<?php endif ?> <?php if ($project['is_public']): ?> <li> @@ -15,15 +18,21 @@ <?= $this->hook->render('template:project:dropdown', array('project' => $project)) ?> -<?php if ($this->user->isProjectManagementAllowed($project['id'])): ?> +<?php if ($this->user->hasProjectAccess('analytic', 'tasks', $project['id'])): ?> <li> <i class="fa fa-line-chart fa-fw"></i> <?= $this->url->link(t('Analytics'), 'analytic', 'tasks', array('project_id' => $project['id'])) ?> </li> +<?php endif ?> + +<?php if ($this->user->hasProjectAccess('export', 'tasks', $project['id'])): ?> <li> <i class="fa fa-download fa-fw"></i> <?= $this->url->link(t('Exports'), 'export', 'tasks', array('project_id' => $project['id'])) ?> </li> +<?php endif ?> + +<?php if ($this->user->hasProjectAccess('ProjectEdit', 'edit', $project['id'])): ?> <li> <i class="fa fa-cog fa-fw"></i> <?= $this->url->link(t('Settings'), 'project', 'show', array('project_id' => $project['id'])) ?> diff --git a/app/Template/project/duplicate.php b/app/Template/project/duplicate.php index 8967c306..ca7d3302 100644 --- a/app/Template/project/duplicate.php +++ b/app/Template/project/duplicate.php @@ -10,13 +10,17 @@ <?= $this->form->csrf() ?> + <?php if ($project['is_private'] == 0): ?> + <?= $this->form->checkbox('projectPermission', t('Permissions'), 1, true) ?> + <?php endif ?> + <?= $this->form->checkbox('category', t('Categories'), 1, true) ?> <?= $this->form->checkbox('action', t('Actions'), 1, true) ?> <?= $this->form->checkbox('swimlane', t('Swimlanes'), 1, false) ?> <?= $this->form->checkbox('task', t('Tasks'), 1, false) ?> <div class="form-actions"> - <input type="submit" value="<?= t('Duplicate') ?>" class="btn btn-red"/> + <input type="submit" value="<?= t('Duplicate') ?>" class="btn btn-red"> <?= t('or') ?> <?= $this->url->link(t('cancel'), 'project', 'show', array('project_id' => $project['id'])) ?> </div> </form> diff --git a/app/Template/project/edit.php b/app/Template/project/edit.php deleted file mode 100644 index 8dcbb88f..00000000 --- a/app/Template/project/edit.php +++ /dev/null @@ -1,50 +0,0 @@ -<div class="page-header"> - <h2><?= t('Edit project') ?></h2> -</div> -<form method="post" action="<?= $this->url->href('project', 'update', array('project_id' => $project['id'])) ?>" autocomplete="off"> - - <?= $this->form->csrf() ?> - <?= $this->form->hidden('id', $values) ?> - - <?= $this->form->label(t('Name'), 'name') ?> - <?= $this->form->text('name', $values, $errors, array('required', 'maxlength="50"')) ?> - - <?= $this->form->label(t('Identifier'), 'identifier') ?> - <?= $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 ?> - - <?= $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"> - <input type="submit" value="<?= t('Save') ?>" class="btn btn-blue"/> - </div> -</form> diff --git a/app/Template/project/filters.php b/app/Template/project/filters.php deleted file mode 100644 index c17cfb3c..00000000 --- a/app/Template/project/filters.php +++ /dev/null @@ -1,101 +0,0 @@ -<div class="page-header"> - <div class="dropdown"> - <i class="fa fa-caret-down"></i> <a href="#" class="dropdown-menu"><?= t('Actions') ?></a> - <ul> - <?php if (isset($is_board)): ?> - <li> - <span class="filter-display-mode" <?= $this->board->isCollapsed($project['id']) ? '' : 'style="display: none;"' ?>> - <i class="fa fa-expand fa-fw"></i> - <?= $this->url->link(t('Expand tasks'), 'board', 'expand', array('project_id' => $project['id']), false, 'board-display-mode', t('Keyboard shortcut: "%s"', 's')) ?> - </span> - <span class="filter-display-mode" <?= $this->board->isCollapsed($project['id']) ? 'style="display: none;"' : '' ?>> - <i class="fa fa-compress fa-fw"></i> - <?= $this->url->link(t('Collapse tasks'), 'board', 'collapse', array('project_id' => $project['id']), false, 'board-display-mode', t('Keyboard shortcut: "%s"', 's')) ?> - </span> - </li> - <li> - <span class="filter-compact"> - <i class="fa fa-th fa-fw"></i> <a href="#" class="filter-toggle-scrolling" title="<?= t('Keyboard shortcut: "%s"', 'c') ?>"><?= t('Compact view') ?></a> - </span> - <span class="filter-wide" style="display: none"> - <i class="fa fa-arrows-h fa-fw"></i> <a href="#" class="filter-toggle-scrolling" title="<?= t('Keyboard shortcut: "%s"', 'c') ?>"><?= t('Horizontal scrolling') ?></a> - </span> - </li> - <li> - <span class="filter-max-height" style="display: none"> - <i class="fa fa-arrows-v fa-fw"></i> <a href="#" class="filter-toggle-height"><?= t('Set maximum column height') ?></a> - </span> - <span class="filter-min-height"> - <i class="fa fa-arrows-v fa-fw"></i> <a href="#" class="filter-toggle-height"><?= t('Remove maximum column height') ?></a> - </span> - </li> - <?php endif ?> - <?= $this->render('project/dropdown', array('project' => $project)) ?> - </ul> - </div> - <ul class="views"> - <li <?= $filters['controller'] === 'board' ? 'class="active"' : '' ?>> - <i class="fa fa-th fa-fw"></i> - <?= $this->url->link(t('Board'), 'board', 'show', array('project_id' => $project['id'], 'search' => $filters['search']), false, 'view-board', t('Keyboard shortcut: "%s"', 'v b')) ?> - </li> - <li <?= $filters['controller'] === 'calendar' ? 'class="active"' : '' ?>> - <i class="fa fa-calendar fa-fw"></i> - <?= $this->url->link(t('Calendar'), 'calendar', 'show', array('project_id' => $project['id'], 'search' => $filters['search']), false, 'view-calendar', t('Keyboard shortcut: "%s"', 'v c')) ?> - </li> - <li <?= $filters['controller'] === 'listing' ? 'class="active"' : '' ?>> - <i class="fa fa-list fa-fw"></i> - <?= $this->url->link(t('List'), 'listing', 'show', array('project_id' => $project['id'], 'search' => $filters['search']), false, 'view-listing', t('Keyboard shortcut: "%s"', 'v l')) ?> - </li> - <?php if ($this->user->isProjectManagementAllowed($project['id'])): ?> - <li <?= $filters['controller'] === 'gantt' ? 'class="active"' : '' ?>> - <i class="fa fa-sliders fa-fw"></i> - <?= $this->url->link(t('Gantt'), 'gantt', 'project', array('project_id' => $project['id'], 'search' => $filters['search']), false, 'view-gantt', t('Keyboard shortcut: "%s"', 'v g')) ?> - </li> - <?php endif ?> - </ul> - <form method="get" action="<?= $this->url->dir() ?>" class="search"> - <?= $this->form->hidden('controller', $filters) ?> - <?= $this->form->hidden('action', $filters) ?> - <?= $this->form->hidden('project_id', $filters) ?> - <?= $this->form->text('search', $filters, array(), array('placeholder="'.t('Filter').'"'), 'form-input-large') ?> - </form> - - <div class="filter-dropdowns"> - <?= $this->render('app/filters_helper', array('reset' => 'status:open')) ?> - - <?php if (isset($custom_filters_list) && ! empty($custom_filters_list)): ?> - <div class="dropdown filters"> - <i class="fa fa-caret-down"></i> <a href="#" class="dropdown-menu"><?= t('My filters') ?></a> - <ul> - <?php foreach ($custom_filters_list as $filter): ?> - <li><a href="#" class="filter-helper" data-<?php if ($filter['append']): ?><?= 'append-' ?><?php endif ?>filter='<?= $this->e($filter['filter']) ?>'><?= $this->e($filter['name']) ?></a></li> - <?php endforeach ?> - </ul> - </div> - <?php endif ?> - - <?php if (isset($users_list)): ?> - <div class="dropdown filters"> - <i class="fa fa-caret-down"></i> <a href="#" class="dropdown-menu"><?= t('Users') ?></a> - <ul> - <li><a href="#" class="filter-helper" data-append-filter="assignee:nobody"><?= t('Not assigned') ?></a></li> - <?php foreach ($users_list as $user): ?> - <li><a href="#" class="filter-helper" data-append-filter='assignee:"<?= $this->e($user) ?>"'><?= $this->e($user) ?></a></li> - <?php endforeach ?> - </ul> - </div> - <?php endif ?> - - <?php if (isset($categories_list) && ! empty($categories_list)): ?> - <div class="dropdown filters"> - <i class="fa fa-caret-down"></i> <a href="#" class="dropdown-menu"><?= t('Categories') ?></a> - <ul> - <li><a href="#" class="filter-helper" data-append-filter="category:none"><?= t('No category') ?></a></li> - <?php foreach ($categories_list as $category): ?> - <li><a href="#" class="filter-helper" data-append-filter='category:"<?= $this->e($category) ?>"'><?= $this->e($category) ?></a></li> - <?php endforeach ?> - </ul> - </div> - <?php endif ?> - </div> -</div>
\ No newline at end of file diff --git a/app/Template/project/index.php b/app/Template/project/index.php index 4b62a27f..8d384e58 100644 --- a/app/Template/project/index.php +++ b/app/Template/project/index.php @@ -1,12 +1,10 @@ <section id="main"> <div class="page-header"> <ul> - <?php if ($this->user->isProjectAdmin() || $this->user->isAdmin()): ?> - <li><i class="fa fa-plus fa-fw"></i><?= $this->url->link(t('New project'), 'project', 'create') ?></li> - <?php endif ?> - <li><i class="fa fa-lock fa-fw"></i><?= $this->url->link(t('New private project'), 'project', 'create', array('private' => 1)) ?></li> - <?php if ($this->user->isProjectAdmin() || $this->user->isAdmin()): ?> + <?php if ($this->user->hasAccess('projectuser', 'managers')): ?> <li><i class="fa fa-user fa-fw"></i><?= $this->url->link(t('Users overview'), 'projectuser', 'managers') ?></li> + <?php endif ?> + <?php if ($this->user->hasAccess('gantt', 'projects')): ?> <li><i class="fa fa-sliders fa-fw"></i><?= $this->url->link(t('Projects Gantt chart'), 'gantt', 'projects') ?></li> <?php endif ?> </ul> @@ -21,9 +19,9 @@ <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-12"><?= t('Managers') ?></th> - <th class="column-12"><?= t('Members') ?></th> + <th class="column-15"><?= $paginator->order(t('Owner'), 'owner_id') ?></th> + <?php if ($this->user->hasAccess('projectuser', 'managers')): ?> + <th class="column-10"><?= t('Users') ?></th> <?php endif ?> <th><?= t('Columns') ?></th> </tr> @@ -59,30 +57,21 @@ <?= $this->url->link($this->e($project['name']), 'project', 'show', array('project_id' => $project['id'])) ?> </td> <td> - <?= $project['start_date'] ?> - </td> - <td> - <?= $project['end_date'] ?> + <?= $this->dt->date($project['start_date']) ?> </td> - <?php if ($this->user->isAdmin() || $this->user->isProjectAdmin()): ?> <td> - <ul class="no-bullet"> - <?php foreach ($project['managers'] as $user_id => $user_name): ?> - <li><?= $this->url->link($this->e($user_name), 'projectuser', 'opens', array('user_id' => $user_id)) ?></li> - <?php endforeach ?> - </ul> + <?= $this->dt->date($project['end_date']) ?> </td> <td> - <?php if ($project['is_everybody_allowed'] == 1): ?> - <?= t('Everybody') ?> - <?php else: ?> - <ul class="no-bullet"> - <?php foreach ($project['members'] as $user_id => $user_name): ?> - <li><?= $this->url->link($this->e($user_name), 'projectuser', 'opens', array('user_id' => $user_id)) ?></li> - <?php endforeach ?> - </ul> + <?php if ($project['owner_id'] > 0): ?> + <?= $this->e($project['owner_name'] ?: $project['owner_username']) ?> <?php endif ?> </td> + <?php if ($this->user->hasAccess('projectuser', 'managers')): ?> + <td> + <i class="fa fa-users fa-fw"></i> + <a href="#" class="tooltip" title="<?= t('Members') ?>" data-href="<?= $this->url->href('Projectuser', 'users', array('project_id' => $project['id'])) ?>"><?= t('Members') ?></a> + </td> <?php endif ?> <td class="dashboard-project-stats"> <?php foreach ($project['columns'] as $column): ?> diff --git a/app/Template/project/integrations.php b/app/Template/project/integrations.php index c4d9385b..54720c69 100644 --- a/app/Template/project/integrations.php +++ b/app/Template/project/integrations.php @@ -5,23 +5,11 @@ <form method="post" action="<?= $this->url->href('project', 'integrations', array('project_id' => $project['id'])) ?>" autocomplete="off"> <?= $this->form->csrf() ?> - <?= $this->hook->render('template:project:integrations', array('values' => $values)) ?> + <?php $integrations = $this->hook->render('template:project:integrations', array('project' => $project, 'values' => $values, 'webhook_token' => $webhook_token)) ?> - <h3><i class="fa fa-github fa-fw"></i> <?= t('Github webhooks') ?></h3> - <div class="listing"> - <input type="text" class="auto-select" readonly="readonly" value="<?= $this->url->href('webhook', 'github', array('token' => $webhook_token, 'project_id' => $project['id']), false, '', true) ?>"/><br/> - <p class="form-help"><?= $this->url->doc(t('Help on Github webhooks'), 'github-webhooks') ?></p> - </div> - - <h3><img src="<?= $this->url->dir() ?>assets/img/gitlab-icon.png"/> <?= t('Gitlab webhooks') ?></h3> - <div class="listing"> - <input type="text" class="auto-select" readonly="readonly" value="<?= $this->url->href('webhook', 'gitlab', array('token' => $webhook_token, 'project_id' => $project['id']), false, '', true) ?>"/><br/> - <p class="form-help"><?= $this->url->doc(t('Help on Gitlab webhooks'), 'gitlab-webhooks') ?></p> - </div> - - <h3><i class="fa fa-bitbucket fa-fw"></i> <?= t('Bitbucket webhooks') ?></h3> - <div class="listing"> - <input type="text" class="auto-select" readonly="readonly" value="<?= $this->url->href('webhook', 'bitbucket', array('token' => $webhook_token, 'project_id' => $project['id']), false, '', true) ?>"/><br/> - <p class="form-help"><?= $this->url->doc(t('Help on Bitbucket webhooks'), 'bitbucket-webhooks') ?></p> - </div> + <?php if (empty($integrations)): ?> + <p class="alert"><?= t('There is no integration registered at the moment.') ?></p> + <?php else: ?> + <?= $integrations ?> + <?php endif ?> </form>
\ No newline at end of file diff --git a/app/Template/project/layout.php b/app/Template/project/layout.php index 8ba92ef9..eb391ae5 100644 --- a/app/Template/project/layout.php +++ b/app/Template/project/layout.php @@ -30,7 +30,7 @@ <?= $this->render($sidebar_template, array('project' => $project)) ?> <div class="sidebar-content"> - <?= $project_content_for_layout ?> + <?= $content_for_sublayout ?> </div> </section> </section>
\ No newline at end of file diff --git a/app/Template/project/new.php b/app/Template/project/new.php deleted file mode 100644 index 8e4ccfec..00000000 --- a/app/Template/project/new.php +++ /dev/null @@ -1,24 +0,0 @@ -<section id="main"> - <div class="page-header"> - <ul> - <li><i class="fa fa-folder fa-fw"></i><?= $this->url->link(t('All projects'), 'project', 'index') ?></li> - </ul> - </div> - <form method="post" action="<?= $this->url->href('project', 'save') ?>" autocomplete="off"> - - <?= $this->form->csrf() ?> - <?= $this->form->hidden('is_private', $values) ?> - <?= $this->form->label(t('Name'), 'name') ?> - <?= $this->form->text('name', $values, $errors, array('autofocus', 'required', 'maxlength="50"')) ?> - - <div class="form-actions"> - <input type="submit" value="<?= t('Save') ?>" class="btn btn-blue"/> - <?= t('or') ?> <?= $this->url->link(t('cancel'), 'project', 'index') ?> - </div> - </form> - <?php if (isset($is_private) && $is_private): ?> - <div class="alert alert-info"> - <p><?= t('There is no user management for private projects.') ?></p> - </div> - <?php endif ?> -</section>
\ No newline at end of file diff --git a/app/Template/project/notifications.php b/app/Template/project/notifications.php index ac743087..b39d6c05 100644 --- a/app/Template/project/notifications.php +++ b/app/Template/project/notifications.php @@ -2,7 +2,7 @@ <h2><?= t('Notifications') ?></h2> </div> <?php if (empty($types)): ?> - <p class="alert"><?= t('There is no notification method registered.') ?></p> + <p class="alert"><?= t('No plugin has registered a project notification method. You can still configure individual notifications in your user profile.') ?></p> <?php else: ?> <form method="post" action="<?= $this->url->href('project', 'notifications', array('project_id' => $project['id'])) ?>" autocomplete="off"> diff --git a/app/Template/project/show.php b/app/Template/project/show.php index 5a65a26e..166b8902 100644 --- a/app/Template/project/show.php +++ b/app/Template/project/show.php @@ -4,6 +4,10 @@ <ul class="listing"> <li><strong><?= $project['is_active'] ? t('Active') : t('Inactive') ?></strong></li> + <?php if ($project['owner_id'] > 0): ?> + <li><?= t('Project owner: ') ?><strong><?= $this->e($project['owner_name'] ?: $project['owner_username']) ?></strong></li> + <?php endif ?> + <?php if ($project['is_private']): ?> <li><i class="fa fa-lock"></i> <?= t('This project is private') ?></li> <?php endif ?> @@ -17,15 +21,15 @@ <?php endif ?> <?php if ($project['last_modified']): ?> - <li><?= dt('Last modified on %B %e, %Y at %k:%M %p', $project['last_modified']) ?></li> + <li><?= t('Modified:').' '.$this->dt->datetime($project['last_modified']) ?></li> <?php endif ?> <?php if ($project['start_date']): ?> - <li><?= t('Start date: %s', $project['start_date']) ?></li> + <li><?= t('Start date: ').$this->dt->date($project['start_date']) ?></li> <?php endif ?> <?php if ($project['end_date']): ?> - <li><?= t('End date: %s', $project['end_date']) ?></li> + <li><?= t('End date: ').$this->dt->date($project['end_date']) ?></li> <?php endif ?> <?php if ($stats['nb_tasks'] > 0): ?> diff --git a/app/Template/project/sidebar.php b/app/Template/project/sidebar.php index fb5dd3bd..304b4aee 100644 --- a/app/Template/project/sidebar.php +++ b/app/Template/project/sidebar.php @@ -1,65 +1,66 @@ <div class="sidebar"> <h2><?= t('Actions') ?></h2> <ul> - <li <?= $this->app->getRouterAction() === 'show' ? 'class="active"' : '' ?>> + <li <?= $this->app->checkMenuSelection('project', 'show') ?>> <?= $this->url->link(t('Summary'), 'project', 'show', array('project_id' => $project['id'])) ?> </li> - <li <?= $this->app->getRouterController() === 'customfilter' && $this->app->getRouterAction() === 'index' ? 'class="active"' : '' ?>> + <?php if ($this->user->hasProjectAccess('customfilter', 'index', $project['id'])): ?> + <li <?= $this->app->checkMenuSelection('customfilter') ?>> <?= $this->url->link(t('Custom filters'), 'customfilter', 'index', array('project_id' => $project['id'])) ?> </li> + <?php endif ?> - <?php if ($this->user->isProjectManagementAllowed($project['id'])): ?> - <li <?= $this->app->getRouterController() === 'project' && $this->app->getRouterAction() === 'share' ? 'class="active"' : '' ?>> + <?php if ($this->user->hasProjectAccess('ProjectEdit', 'edit', $project['id'])): ?> + <li <?= $this->app->checkMenuSelection('ProjectEdit', 'edit') ?>> + <?= $this->url->link(t('Edit project'), 'ProjectEdit', 'edit', array('project_id' => $project['id'])) ?> + </li> + <li <?= $this->app->checkMenuSelection('project', 'share') ?>> <?= $this->url->link(t('Public access'), 'project', 'share', array('project_id' => $project['id'])) ?> </li> - <li <?= $this->app->getRouterController() === 'project' && $this->app->getRouterAction() === 'notifications' ? 'class="active"' : '' ?>> + <li <?= $this->app->checkMenuSelection('project', 'notifications') ?>> <?= $this->url->link(t('Notifications'), 'project', 'notifications', array('project_id' => $project['id'])) ?> </li> - <li <?= $this->app->getRouterController() === 'project' && $this->app->getRouterAction() === 'integrations' ? 'class="active"' : '' ?>> + <li <?= $this->app->checkMenuSelection('project', 'integrations') ?>> <?= $this->url->link(t('Integrations'), 'project', 'integrations', array('project_id' => $project['id'])) ?> </li> - <li <?= $this->app->getRouterController() === 'project' && $this->app->getRouterAction() === 'edit' ? 'class="active"' : '' ?>> - <?= $this->url->link(t('Edit project'), 'project', 'edit', array('project_id' => $project['id'])) ?> - </li> - <li <?= $this->app->getRouterController() === 'column' ? 'class="active"' : '' ?>> + <li <?= $this->app->checkMenuSelection('column') ?>> <?= $this->url->link(t('Columns'), 'column', 'index', array('project_id' => $project['id'])) ?> </li> - <li <?= $this->app->getRouterController() === 'swimlane' ? 'class="active"' : '' ?>> + <li <?= $this->app->checkMenuSelection('swimlane') ?>> <?= $this->url->link(t('Swimlanes'), 'swimlane', 'index', array('project_id' => $project['id'])) ?> </li> - <li <?= $this->app->getRouterController() === 'category' ? 'class="active"' : '' ?>> + <li <?= $this->app->checkMenuSelection('category') ?>> <?= $this->url->link(t('Categories'), 'category', 'index', array('project_id' => $project['id'])) ?> </li> - <?php if ($this->user->isAdmin() || $project['is_private'] == 0): ?> - <li <?= $this->app->getRouterController() === 'project' && $this->app->getRouterAction() === 'users' ? 'class="active"' : '' ?>> - <?= $this->url->link(t('Users'), 'project', 'users', array('project_id' => $project['id'])) ?> + <?php if ($project['is_private'] == 0): ?> + <li <?= $this->app->checkMenuSelection('ProjectPermission') ?>> + <?= $this->url->link(t('Permissions'), 'ProjectPermission', 'index', array('project_id' => $project['id'])) ?> </li> <?php endif ?> - <li <?= $this->app->getRouterController() === 'action' ? 'class="active"' : '' ?>> + <li <?= $this->app->checkMenuSelection('action') ?>> <?= $this->url->link(t('Automatic actions'), 'action', 'index', array('project_id' => $project['id'])) ?> </li> - <li <?= $this->app->getRouterController() === 'project' && $this->app->getRouterAction() === 'duplicate' ? 'class="active"' : '' ?>> + <li <?= $this->app->checkMenuSelection('project', 'duplicate') ?>> <?= $this->url->link(t('Duplicate'), 'project', 'duplicate', array('project_id' => $project['id'])) ?> </li> - <li <?= $this->app->getRouterController() === 'project' && ($this->app->getRouterAction() === 'disable' || $this->app->getRouterAction() === 'enable') ? 'class="active"' : '' ?>> <?php if ($project['is_active']): ?> + <li <?= $this->app->checkMenuSelection('project', 'disable') ?>> <?= $this->url->link(t('Disable'), 'project', 'disable', array('project_id' => $project['id']), true) ?> <?php else: ?> + <li <?= $this->app->checkMenuSelection('project', 'enable') ?>> <?= $this->url->link(t('Enable'), 'project', 'enable', array('project_id' => $project['id']), true) ?> <?php endif ?> </li> - <li <?= $this->app->getRouterController() === 'taskImport' && $this->app->getRouterAction() === 'step1' ? 'class="active"' : '' ?>> + <li <?= $this->app->checkMenuSelection('taskImport') ?>> <?= $this->url->link(t('Import'), 'taskImport', 'step1', array('project_id' => $project['id'])) ?> </li> - <?php if ($this->user->isProjectAdministrationAllowed($project['id'])): ?> - <li <?= $this->app->getRouterController() === 'project' && $this->app->getRouterAction() === 'remove' ? 'class="active"' : '' ?>> + <?php if ($this->user->hasProjectAccess('project', 'remove', $project['id'])): ?> + <li <?= $this->app->checkMenuSelection('project', 'remove') ?>> <?= $this->url->link(t('Remove'), 'project', 'remove', array('project_id' => $project['id'])) ?> </li> <?php endif ?> <?php endif ?> - <?= $this->hook->render('template:project:sidebar') ?> + <?= $this->hook->render('template:project:sidebar', array('project' => $project)) ?> </ul> - <div class="sidebar-collapse"><a href="#" title="<?= t('Hide sidebar') ?>"><i class="fa fa-chevron-left"></i></a></div> - <div class="sidebar-expand" style="display: none"><a href="#" title="<?= t('Expand sidebar') ?>"><i class="fa fa-chevron-right"></i></a></div> </div> diff --git a/app/Template/project/users.php b/app/Template/project/users.php deleted file mode 100644 index 8863a1e4..00000000 --- a/app/Template/project/users.php +++ /dev/null @@ -1,82 +0,0 @@ -<div class="page-header"> - <h2><?= t('List of authorized users') ?></h2> -</div> - -<?php if ($project['is_everybody_allowed']): ?> - <div class="alert"><?= t('Everybody have access to this project.') ?></div> -<?php else: ?> - - <?php if (empty($users['allowed'])): ?> - <div class="alert alert-error"><?= t('Nobody have access to this project.') ?></div> - <?php else: ?> - <table> - <tr> - <th><?= t('User') ?></th> - <th><?= t('Role for this project') ?></th> - <?php if ($project['is_private'] == 0): ?> - <th><?= t('Actions') ?></th> - <?php endif ?> - </tr> - <?php foreach ($users['allowed'] as $user_id => $username): ?> - <tr> - <td><?= $this->e($username) ?></td> - <td><?= isset($users['managers'][$user_id]) ? t('Project manager') : t('Project member') ?></td> - <?php if ($project['is_private'] == 0): ?> - <td> - <ul> - <li><?= $this->url->link(t('Revoke'), 'project', 'revoke', array('project_id' => $project['id'], 'user_id' => $user_id), true) ?></li> - <li> - <?php if (isset($users['managers'][$user_id])): ?> - <?= $this->url->link(t('Set project member'), 'project', 'role', array('project_id' => $project['id'], 'user_id' => $user_id, 'is_owner' => 0), true) ?> - <?php else: ?> - <?= $this->url->link(t('Set project manager'), 'project', 'role', array('project_id' => $project['id'], 'user_id' => $user_id, 'is_owner' => 1), true) ?> - <?php endif ?> - </li> - </ul> - </td> - <?php endif ?> - </tr> - <?php endforeach ?> - </table> - <?php endif ?> - - <?php if ($project['is_private'] == 0 && ! empty($users['not_allowed'])): ?> - <hr/> - <form method="post" action="<?= $this->url->href('project', 'allow', array('project_id' => $project['id'])) ?>" autocomplete="off"> - - <?= $this->form->csrf() ?> - - <?= $this->form->hidden('project_id', array('project_id' => $project['id'])) ?> - - <?= $this->form->label(t('User'), 'user_id') ?> - <?= $this->form->select('user_id', $users['not_allowed'], array(), array(), array('data-notfound="'.t('No results match:').'"'), 'chosen-select') ?><br/> - - <div class="form-actions"> - <input type="submit" value="<?= t('Allow this user') ?>" class="btn btn-blue"/> - </div> - </form> - <?php endif ?> - -<?php endif ?> - -<?php if ($project['is_private'] == 0): ?> -<hr/> -<form method="post" action="<?= $this->url->href('project', 'allowEverybody', array('project_id' => $project['id'])) ?>"> - <?= $this->form->csrf() ?> - - <?= $this->form->hidden('id', array('id' => $project['id'])) ?> - <?= $this->form->checkbox('is_everybody_allowed', t('Allow everybody to access to this project'), 1, $project['is_everybody_allowed']) ?> - - <div class="form-actions"> - <input type="submit" value="<?= t('Save') ?>" class="btn btn-blue"/> - </div> -</form> -<?php endif ?> - -<div class="alert alert-info"> - <ul> - <li><?= t('A project manager can change the settings of the project and have more privileges than a standard user.') ?></li> - <li><?= t('Don\'t forget that administrators have access to everything.') ?></li> - <li><?= $this->url->doc(t('Help with project permissions'), 'project-permissions') ?></li> - </ul> -</div> diff --git a/app/Template/project_creation/create.php b/app/Template/project_creation/create.php new file mode 100644 index 00000000..46ec5d1e --- /dev/null +++ b/app/Template/project_creation/create.php @@ -0,0 +1,42 @@ +<section id="main"> + <div class="page-header"> + <h2><?= $title ?></h2> + </div> + <form class="popover-form" id="project-creation-form" method="post" action="<?= $this->url->href('ProjectCreation', 'save') ?>" autocomplete="off"> + + <?= $this->form->csrf() ?> + <?= $this->form->hidden('is_private', $values) ?> + + <?= $this->form->label(t('Name'), 'name') ?> + <?= $this->form->text('name', $values, $errors, array('autofocus', 'required', 'maxlength="50"')) ?> + + <?php if (count($projects_list) > 1): ?> + <?= $this->form->label(t('Create from another project'), 'src_project_id') ?> + <?= $this->form->select('src_project_id', $projects_list, $values) ?> + <?php endif ?> + + <div class="project-creation-options" <?= isset($values['src_project_id']) && $values['src_project_id'] > 0 ? '' : 'style="display: none"' ?>> + <p class="alert"><?= t('Which parts of the project do you want to duplicate?') ?></p> + + <?php if (! $is_private): ?> + <?= $this->form->checkbox('projectPermission', t('Permissions'), 1, true) ?> + <?php endif ?> + + <?= $this->form->checkbox('category', t('Categories'), 1, true) ?> + <?= $this->form->checkbox('action', t('Actions'), 1, true) ?> + <?= $this->form->checkbox('swimlane', t('Swimlanes'), 1, true) ?> + <?= $this->form->checkbox('task', t('Tasks'), 1, false) ?> + </div> + + <div class="form-actions"> + <input type="submit" value="<?= t('Save') ?>" class="btn btn-blue"> + <?= t('or') ?> + <?= $this->url->link(t('cancel'), 'project', 'index', array(), false, 'close-popover') ?> + </div> + </form> + <?php if ($is_private): ?> + <div class="alert alert-info"> + <p><?= t('There is no user management for private projects.') ?></p> + </div> + <?php endif ?> +</section>
\ No newline at end of file diff --git a/app/Template/project_edit/dates.php b/app/Template/project_edit/dates.php new file mode 100644 index 00000000..cb585c6a --- /dev/null +++ b/app/Template/project_edit/dates.php @@ -0,0 +1,26 @@ +<div class="page-header"> + <h2><?= t('Edit project') ?></h2> + <ul> + <li ><?= $this->url->link(t('General'), 'ProjectEdit', 'edit', array('project_id' => $project['id'])) ?></li> + <li class="active"><?= $this->url->link(t('Dates'), 'ProjectEdit', 'dates', array('project_id' => $project['id'])) ?></li> + <li><?= $this->url->link(t('Description'), 'ProjectEdit', 'description', array('project_id' => $project['id'])) ?></li> + <li><?= $this->url->link(t('Task priority'), 'ProjectEdit', 'priority', array('project_id' => $project['id'])) ?></li> + </ul> +</div> +<form method="post" action="<?= $this->url->href('ProjectEdit', 'update', array('project_id' => $project['id'], 'redirect' => 'dates')) ?>" autocomplete="off"> + <?= $this->form->csrf() ?> + <?= $this->form->hidden('id', $values) ?> + <?= $this->form->hidden('name', $values) ?> + + <?= $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') ?> + + <div class="form-actions"> + <input type="submit" value="<?= t('Save') ?>" class="btn btn-blue"/> + </div> +</form> + +<p class="alert alert-info"><?= t('Those dates are useful for the project Gantt chart.') ?></p> diff --git a/app/Template/project_edit/description.php b/app/Template/project_edit/description.php new file mode 100644 index 00000000..dce8ab10 --- /dev/null +++ b/app/Template/project_edit/description.php @@ -0,0 +1,37 @@ +<div class="page-header"> + <h2><?= t('Edit project') ?></h2> + <ul> + <li><?= $this->url->link(t('General'), 'ProjectEdit', 'edit', array('project_id' => $project['id'])) ?></li> + <li><?= $this->url->link(t('Dates'), 'ProjectEdit', 'dates', array('project_id' => $project['id'])) ?></li> + <li class="active"><?= $this->url->link(t('Description'), 'ProjectEdit', 'description', array('project_id' => $project['id'])) ?></li> + <li><?= $this->url->link(t('Task priority'), 'ProjectEdit', 'priority', array('project_id' => $project['id'])) ?></li> + </ul> +</div> +<form method="post" action="<?= $this->url->href('ProjectEdit', 'update', array('project_id' => $project['id'], 'redirect' => 'description')) ?>" autocomplete="off"> + <?= $this->form->csrf() ?> + <?= $this->form->hidden('id', $values) ?> + <?= $this->form->hidden('name', $values) ?> + + <?= $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"> + <input type="submit" value="<?= t('Save') ?>" class="btn btn-blue"/> + </div> +</form> diff --git a/app/Template/project_edit/general.php b/app/Template/project_edit/general.php new file mode 100644 index 00000000..28cbb66a --- /dev/null +++ b/app/Template/project_edit/general.php @@ -0,0 +1,36 @@ +<div class="page-header"> + <h2><?= t('Edit project') ?></h2> + <ul> + <li class="active"><?= $this->url->link(t('General'), 'ProjectEdit', 'edit', array('project_id' => $project['id'])) ?></li> + <li><?= $this->url->link(t('Dates'), 'ProjectEdit', 'dates', array('project_id' => $project['id'])) ?></li> + <li><?= $this->url->link(t('Description'), 'ProjectEdit', 'description', array('project_id' => $project['id'])) ?></li> + <li><?= $this->url->link(t('Task priority'), 'ProjectEdit', 'priority', array('project_id' => $project['id'])) ?></li> + </ul> +</div> +<form method="post" action="<?= $this->url->href('ProjectEdit', 'update', array('project_id' => $project['id'], 'redirect' => 'edit')) ?>" autocomplete="off"> + <?= $this->form->csrf() ?> + <?= $this->form->hidden('id', $values) ?> + + <?= $this->form->label(t('Name'), 'name') ?> + <?= $this->form->text('name', $values, $errors, array('required', 'maxlength="50"')) ?> + + <?= $this->form->label(t('Identifier'), 'identifier') ?> + <?= $this->form->text('identifier', $values, $errors, array('maxlength="50"')) ?> + <p class="form-help"><?= t('The project identifier is optional and must be alphanumeric, example: MYPROJECT.') ?></p> + + <hr> + <div class="form-inline"> + <?= $this->form->label(t('Project owner'), 'owner_id') ?> + <?= $this->form->select('owner_id', $owners, $values, $errors) ?> + </div> + + <?php if ($this->user->hasProjectAccess('ProjectCreation', 'create', $project['id'])): ?> + <hr> + <?= $this->form->checkbox('is_private', t('Private project'), 1, $project['is_private'] == 1) ?> + <p class="form-help"><?= t('Private projects do not have users and groups management.') ?></p> + <?php endif ?> + + <div class="form-actions"> + <input type="submit" value="<?= t('Save') ?>" class="btn btn-blue"/> + </div> +</form> diff --git a/app/Template/project_edit/task_priority.php b/app/Template/project_edit/task_priority.php new file mode 100644 index 00000000..e54215b2 --- /dev/null +++ b/app/Template/project_edit/task_priority.php @@ -0,0 +1,29 @@ +<div class="page-header"> + <h2><?= t('Edit project') ?></h2> + <ul> + <li ><?= $this->url->link(t('General'), 'ProjectEdit', 'edit', array('project_id' => $project['id'])) ?></li> + <li><?= $this->url->link(t('Dates'), 'ProjectEdit', 'dates', array('project_id' => $project['id'])) ?></li> + <li><?= $this->url->link(t('Description'), 'ProjectEdit', 'description', array('project_id' => $project['id'])) ?></li> + <li class="active"><?= $this->url->link(t('Task priority'), 'ProjectEdit', 'priority', array('project_id' => $project['id'])) ?></li> + </ul> +</div> +<form method="post" action="<?= $this->url->href('ProjectEdit', 'update', array('project_id' => $project['id'], 'redirect' => 'priority')) ?>" autocomplete="off"> + <?= $this->form->csrf() ?> + <?= $this->form->hidden('id', $values) ?> + <?= $this->form->hidden('name', $values) ?> + + <?= $this->form->label(t('Default priority'), 'priority_default') ?> + <?= $this->form->number('priority_default', $values, $errors) ?> + + <?= $this->form->label(t('Lowest priority'), 'priority_start') ?> + <?= $this->form->number('priority_start', $values, $errors) ?> + + <?= $this->form->label(t('Highest priority'), 'priority_end') ?> + <?= $this->form->number('priority_end', $values, $errors) ?> + + <div class="form-actions"> + <input type="submit" value="<?= t('Save') ?>" class="btn btn-blue"/> + </div> +</form> + +<p class="alert alert-info"><?= t('If you put zero to the low and high priority, this feature will be disabled.') ?></p> diff --git a/app/Template/project_file/create.php b/app/Template/project_file/create.php new file mode 100644 index 00000000..67315285 --- /dev/null +++ b/app/Template/project_file/create.php @@ -0,0 +1,33 @@ +<div class="page-header"> + <h2><?= t('Attach a document') ?></h2> +</div> +<div id="file-done" style="display:none"> + <p class="alert alert-success"> + <?= t('All files have been uploaded successfully.') ?> + <?= $this->url->link(t('View uploaded files'), 'ProjectOverview', 'show', array('project_id' => $project['id'])) ?> + </p> +</div> + +<div id="file-error-max-size" style="display:none"> + <p class="alert alert-error"> + <?= t('The maximum allowed file size is %sB.', $this->text->bytes($max_size)) ?> + <a href="#" id="file-browser"><?= t('Choose files again') ?></a> + </p> +</div> + +<div + id="file-dropzone" + data-max-size="<?= $max_size ?>" + data-url="<?= $this->url->href('ProjectFile', 'save', array('project_id' => $project['id'])) ?>"> + <div id="file-dropzone-inner"> + <?= t('Drag and drop your files here') ?> <?= t('or') ?> <a href="#" id="file-browser"><?= t('choose files') ?></a> + </div> +</div> + +<input type="file" name="files[]" multiple style="display:none" id="file-form-element"> + +<div class="form-actions"> + <input type="submit" value="<?= t('Save') ?>" class="btn btn-blue" id="file-upload-button" disabled> + <?= t('or') ?> + <?= $this->url->link(t('cancel'), 'ProjectOverview', 'show', array('project_id' => $project['id']), false, 'close-popover') ?> +</div> diff --git a/app/Template/project_file/remove.php b/app/Template/project_file/remove.php new file mode 100644 index 00000000..4f0ba465 --- /dev/null +++ b/app/Template/project_file/remove.php @@ -0,0 +1,15 @@ +<div class="page-header"> + <h2><?= t('Remove a file') ?></h2> +</div> + +<div class="confirm"> + <p class="alert alert-info"> + <?= t('Do you really want to remove this file: "%s"?', $this->e($file['name'])) ?> + </p> + + <div class="form-actions"> + <?= $this->url->link(t('Yes'), 'ProjectFile', 'remove', array('project_id' => $project['id'], 'file_id' => $file['id']), true, 'btn btn-red') ?> + <?= t('or') ?> + <?= $this->url->link(t('cancel'), 'ProjectOverview', 'show', array('project_id' => $project['id']), false, 'close-popover') ?> + </div> +</div>
\ No newline at end of file diff --git a/app/Template/project_header/dropdown.php b/app/Template/project_header/dropdown.php new file mode 100644 index 00000000..bbc033bf --- /dev/null +++ b/app/Template/project_header/dropdown.php @@ -0,0 +1,34 @@ +<div class="dropdown"> + <i class="fa fa-caret-down"></i> <a href="#" class="dropdown-menu"><?= t('Actions') ?></a> + <ul> + <?php if ($is_board): ?> + <li> + <span class="filter-display-mode" <?= $this->board->isCollapsed($project['id']) ? '' : 'style="display: none;"' ?>> + <i class="fa fa-expand fa-fw"></i> + <?= $this->url->link(t('Expand tasks'), 'board', 'expand', array('project_id' => $project['id']), false, 'board-display-mode', t('Keyboard shortcut: "%s"', 's')) ?> + </span> + <span class="filter-display-mode" <?= $this->board->isCollapsed($project['id']) ? 'style="display: none;"' : '' ?>> + <i class="fa fa-compress fa-fw"></i> + <?= $this->url->link(t('Collapse tasks'), 'board', 'collapse', array('project_id' => $project['id']), false, 'board-display-mode', t('Keyboard shortcut: "%s"', 's')) ?> + </span> + </li> + <li> + <span class="filter-compact"> + <i class="fa fa-th fa-fw"></i> <a href="#" class="filter-toggle-scrolling" title="<?= t('Keyboard shortcut: "%s"', 'c') ?>"><?= t('Compact view') ?></a> + </span> + <span class="filter-wide" style="display: none"> + <i class="fa fa-arrows-h fa-fw"></i> <a href="#" class="filter-toggle-scrolling" title="<?= t('Keyboard shortcut: "%s"', 'c') ?>"><?= t('Horizontal scrolling') ?></a> + </span> + </li> + <li> + <span class="filter-max-height" style="display: none"> + <i class="fa fa-arrows-v fa-fw"></i> <a href="#" class="filter-toggle-height"><?= t('Set maximum column height') ?></a> + </span> + <span class="filter-min-height"> + <i class="fa fa-arrows-v fa-fw"></i> <a href="#" class="filter-toggle-height"><?= t('Remove maximum column height') ?></a> + </span> + </li> + <?php endif ?> + <?= $this->render('project/dropdown', array('project' => $project)) ?> + </ul> +</div>
\ No newline at end of file diff --git a/app/Template/project_header/header.php b/app/Template/project_header/header.php new file mode 100644 index 00000000..f6e5af9e --- /dev/null +++ b/app/Template/project_header/header.php @@ -0,0 +1,15 @@ +<div class="project-header"> + <?= $this->hook->render('template:project:header:before', array('project' => $project)) ?> + + <?= $this->render('project_header/dropdown', array('project' => $project, 'is_board' => isset($is_board))) ?> + <?= $this->render('project_header/views', array('project' => $project, 'filters' => $filters)) ?> + <?= $this->render('project_header/search', array( + 'project' => $project, + 'filters' => $filters, + 'custom_filters_list' => isset($custom_filters_list) ? $custom_filters_list : array(), + 'users_list' => isset($users_list) ? $users_list : array(), + 'categories_list' => isset($categories_list) ? $categories_list : array(), + )) ?> + + <?= $this->hook->render('template:project:header:after', array('project' => $project)) ?> +</div>
\ No newline at end of file diff --git a/app/Template/project_header/search.php b/app/Template/project_header/search.php new file mode 100644 index 00000000..2b2a2c39 --- /dev/null +++ b/app/Template/project_header/search.php @@ -0,0 +1,45 @@ +<div class="filter-box"> + <form method="get" action="<?= $this->url->dir() ?>" class="search"> + <?= $this->form->hidden('controller', $filters) ?> + <?= $this->form->hidden('action', $filters) ?> + <?= $this->form->hidden('project_id', $filters) ?> + <?= $this->form->text('search', $filters, array(), array('placeholder="'.t('Filter').'"')) ?> + + <?= $this->render('app/filters_helper', array('reset' => 'status:open', 'project' => $project)) ?> + + <?php if (isset($custom_filters_list) && ! empty($custom_filters_list)): ?> + <div class="dropdown"> + <a href="#" class="dropdown-menu dropdown-menu-link-icon" title="<?= t('Custom filters') ?>"><i class="fa fa-bookmark fa-fw"></i><i class="fa fa-caret-down"></i></a> + <ul> + <?php foreach ($custom_filters_list as $filter): ?> + <li><a href="#" class="filter-helper" data-<?php if ($filter['append']): ?><?= 'append-' ?><?php endif ?>filter='<?= $this->e($filter['filter']) ?>'><?= $this->e($filter['name']) ?></a></li> + <?php endforeach ?> + </ul> + </div> + <?php endif ?> + + <?php if (isset($users_list)): ?> + <div class="dropdown"> + <a href="#" class="dropdown-menu dropdown-menu-link-icon" title="<?= t('User filters') ?>"><i class="fa fa-users fa-fw"></i> <i class="fa fa-caret-down"></i></a> + <ul> + <li><a href="#" class="filter-helper" data-append-filter="assignee:nobody"><?= t('Not assigned') ?></a></li> + <?php foreach ($users_list as $user): ?> + <li><a href="#" class="filter-helper" data-append-filter='assignee:"<?= $this->e($user) ?>"'><?= $this->e($user) ?></a></li> + <?php endforeach ?> + </ul> + </div> + <?php endif ?> + + <?php if (isset($categories_list) && ! empty($categories_list)): ?> + <div class="dropdown"> + <a href="#" class="dropdown-menu dropdown-menu-link-icon" title="<?= t('Category filters') ?>"><i class="fa fa-tags fa-fw"></i><i class="fa fa-caret-down"></i></a> + <ul> + <li><a href="#" class="filter-helper" data-append-filter="category:none"><?= t('No category') ?></a></li> + <?php foreach ($categories_list as $category): ?> + <li><a href="#" class="filter-helper" data-append-filter='category:"<?= $this->e($category) ?>"'><?= $this->e($category) ?></a></li> + <?php endforeach ?> + </ul> + </div> + <?php endif ?> + </form> +</div> diff --git a/app/Template/project_header/views.php b/app/Template/project_header/views.php new file mode 100644 index 00000000..f8fdbb02 --- /dev/null +++ b/app/Template/project_header/views.php @@ -0,0 +1,24 @@ +<ul class="views"> + <li <?= $this->app->getRouterController() === 'ProjectOverview' ? 'class="active"' : '' ?>> + <i class="fa fa-eye fa-fw"></i> + <?= $this->url->link(t('Overview'), 'ProjectOverview', 'show', array('project_id' => $project['id']), false, 'view-overview', t('Keyboard shortcut: "%s"', 'v o')) ?> + </li> + <li <?= $this->app->getRouterController() === 'Board' ? 'class="active"' : '' ?>> + <i class="fa fa-th fa-fw"></i> + <?= $this->url->link(t('Board'), 'board', 'show', array('project_id' => $project['id'], 'search' => $filters['search']), false, 'view-board', t('Keyboard shortcut: "%s"', 'v b')) ?> + </li> + <li <?= $this->app->getRouterController() === 'Calendar' ? 'class="active"' : '' ?>> + <i class="fa fa-calendar fa-fw"></i> + <?= $this->url->link(t('Calendar'), 'calendar', 'show', array('project_id' => $project['id'], 'search' => $filters['search']), false, 'view-calendar', t('Keyboard shortcut: "%s"', 'v c')) ?> + </li> + <li <?= $this->app->getRouterController() === 'Listing' ? 'class="active"' : '' ?>> + <i class="fa fa-list fa-fw"></i> + <?= $this->url->link(t('List'), 'listing', 'show', array('project_id' => $project['id'], 'search' => $filters['search']), false, 'view-listing', t('Keyboard shortcut: "%s"', 'v l')) ?> + </li> + <?php if ($this->user->hasProjectAccess('gantt', 'project', $project['id'])): ?> + <li <?= $this->app->getRouterController() === 'Gantt' ? 'class="active"' : '' ?>> + <i class="fa fa-sliders fa-fw"></i> + <?= $this->url->link(t('Gantt'), 'gantt', 'project', array('project_id' => $project['id'], 'search' => $filters['search']), false, 'view-gantt', t('Keyboard shortcut: "%s"', 'v g')) ?> + </li> + <?php endif ?> +</ul>
\ No newline at end of file diff --git a/app/Template/project_overview/columns.php b/app/Template/project_overview/columns.php new file mode 100644 index 00000000..870d753f --- /dev/null +++ b/app/Template/project_overview/columns.php @@ -0,0 +1,8 @@ +<div class="project-overview-columns"> + <?php foreach ($project['columns'] as $column): ?> + <div class="project-overview-column"> + <strong title="<?= t('Task count') ?>"><?= $column['nb_tasks'] ?></strong><br> + <span><?= $this->e($column['title']) ?></span> + </div> + <?php endforeach ?> +</div> diff --git a/app/Template/project_overview/description.php b/app/Template/project_overview/description.php new file mode 100644 index 00000000..4137bf9f --- /dev/null +++ b/app/Template/project_overview/description.php @@ -0,0 +1,8 @@ +<?php if (! empty($project['description'])): ?> + <div class="page-header"> + <h2><?= $this->e($project['name']) ?></h2> + </div> + <article class="markdown"> + <?= $this->text->markdown($project['description']) ?> + </article> +<?php endif ?> diff --git a/app/Template/project_overview/files.php b/app/Template/project_overview/files.php new file mode 100644 index 00000000..7eb8c762 --- /dev/null +++ b/app/Template/project_overview/files.php @@ -0,0 +1,98 @@ +<div class="page-header"> + <h2><?= t('Attachments') ?></h2> + <?php if ($this->user->hasProjectAccess('ProjectFile', 'create', $project['id'])): ?> + <ul> + <li> + <i class="fa fa-plus fa-fw"></i> + <?= $this->url->link(t('Upload a file'), 'ProjectFile', 'create', array('project_id' => $project['id']), false, 'popover') ?> + </li> + </ul> + <?php endif ?> +</div> + +<?php if (empty($files) && empty($images)): ?> + <p class="alert"><?= t('There is no attachment at the moment.') ?></p> +<?php endif ?> + +<?php if (! empty($images)): ?> +<div class="file-thumbnails"> + <?php foreach ($images as $file): ?> + <div class="file-thumbnail"> + <a href="<?= $this->url->href('FileViewer', 'show', array('project_id' => $project['id'], 'file_id' => $file['id'])) ?>" class="popover"><img src="<?= $this->url->href('FileViewer', 'thumbnail', array('file_id' => $file['id'], 'project_id' => $project['id'])) ?>" title="<?= $this->e($file['name']) ?>" alt="<?= $this->e($file['name']) ?>"></a> + <div class="file-thumbnail-content"> + <div class="file-thumbnail-title"> + <div class="dropdown"> + <a href="#" class="dropdown-menu dropdown-menu-link-text"><?= $this->e($file['name']) ?> <i class="fa fa-caret-down"></i></a> + <ul> + <li> + <i class="fa fa-download fa-fw"></i> + <?= $this->url->link(t('Download'), 'FileViewer', 'download', array('project_id' => $project['id'], 'file_id' => $file['id'])) ?> + </li> + <?php if ($this->user->hasProjectAccess('ProjectFile', 'remove', $project['id'])): ?> + <li> + <i class="fa fa-trash fa-fw"></i> + <?= $this->url->link(t('Remove'), 'ProjectFile', 'confirm', array('project_id' => $project['id'], 'file_id' => $file['id']), false, 'popover') ?> + </li> + <?php endif ?> + </ul> + </div> + </div> + <div class="file-thumbnail-description"> + <span class="tooltip" title='<?= t('Uploaded: %s', $this->dt->datetime($file['date'])).'<br>'.t('Size: %s', $this->text->bytes($file['size'])) ?>'> + <i class="fa fa-info-circle"></i> + </span> + <?= t('Uploaded by %s', $file['user_name'] ?: $file['username']) ?> + </div> + </div> + </div> + <?php endforeach ?> +</div> +<?php endif ?> + +<?php if (! empty($files)): ?> +<table class="table-stripped"> + <tr> + <th><?= t('Filename') ?></th> + <th><?= t('Creator') ?></th> + <th><?= t('Date') ?></th> + <th><?= t('Size') ?></th> + </tr> + <?php foreach ($files as $file): ?> + <tr> + <td> + <i class="fa <?= $this->file->icon($file['name']) ?> fa-fw"></i> + <div class="dropdown"> + <a href="#" class="dropdown-menu dropdown-menu-link-text"><?= $this->e($file['name']) ?> <i class="fa fa-caret-down"></i></a> + <ul> + <?php if ($this->file->getPreviewType($file['name']) !== null): ?> + <li> + <i class="fa fa-eye fa-fw"></i> + <?= $this->url->link(t('View file'), 'FileViewer', 'show', array('project_id' => $project['id'], 'file_id' => $file['id']), false, 'popover') ?> + </li> + <?php endif ?> + <li> + <i class="fa fa-download fa-fw"></i> + <?= $this->url->link(t('Download'), 'FileViewer', 'download', array('project_id' => $project['id'], 'file_id' => $file['id'])) ?> + </li> + <?php if ($this->user->hasProjectAccess('ProjectFile', 'remove', $project['id'])): ?> + <li> + <i class="fa fa-trash fa-fw"></i> + <?= $this->url->link(t('Remove'), 'ProjectFile', 'confirm', array('project_id' => $project['id'], 'file_id' => $file['id']), false, 'popover') ?> + </li> + <?php endif ?> + </ul> + </div> + </td> + <td> + <?= $this->e($file['user_name'] ?: $file['username']) ?> + </td> + <td> + <?= $this->dt->date($file['date']) ?> + </td> + <td> + <?= $this->text->bytes($file['size']) ?> + </td> + </tr> + <?php endforeach ?> +</table> +<?php endif ?> diff --git a/app/Template/project_overview/information.php b/app/Template/project_overview/information.php new file mode 100644 index 00000000..12a1317d --- /dev/null +++ b/app/Template/project_overview/information.php @@ -0,0 +1,35 @@ +<div class="page-header"> + <h2><?= t('Information') ?></h2> +</div> +<div class="listing"> +<ul> + <?php if ($project['owner_id'] > 0): ?> + <li><?= t('Project owner: ') ?><strong><?= $this->e($project['owner_name'] ?: $project['owner_username']) ?></strong></li> + <?php endif ?> + + <?php if (! empty($users)): ?> + <?php foreach ($roles as $role => $role_name): ?> + <?php if (isset($users[$role])): ?> + <li> + <?= $role_name ?>: + <strong><?= implode(', ', $users[$role]) ?></strong> + </li> + <?php endif ?> + <?php endforeach ?> + <?php endif ?> + + <?php if ($project['start_date']): ?> + <li><?= t('Start date: ').$this->dt->date($project['start_date']) ?></li> + <?php endif ?> + + <?php if ($project['end_date']): ?> + <li><?= t('End date: ').$this->dt->date($project['end_date']) ?></li> + <?php endif ?> + + <?php if ($project['is_public']): ?> + <li><i class="fa fa-share-alt"></i> <?= $this->url->link(t('Public link'), 'board', 'readonly', array('token' => $project['token']), false, '', '', true) ?></li> + <li><i class="fa fa-rss-square"></i> <?= $this->url->link(t('RSS feed'), 'feed', 'project', array('token' => $project['token']), false, '', '', true) ?></li> + <li><i class="fa fa-calendar"></i> <?= $this->url->link(t('iCal feed'), 'ical', 'project', array('token' => $project['token'])) ?></li> + <?php endif ?> +</ul> +</div> diff --git a/app/Template/project_overview/show.php b/app/Template/project_overview/show.php new file mode 100644 index 00000000..0038d952 --- /dev/null +++ b/app/Template/project_overview/show.php @@ -0,0 +1,16 @@ +<section id="main"> + <?= $this->render('project_header/header', array( + 'project' => $project, + 'filters' => $filters, + )) ?> + + <?= $this->render('project_overview/columns', array('project' => $project)) ?> + <?= $this->render('project_overview/description', array('project' => $project)) ?> + <?= $this->render('project_overview/files', array('project' => $project, 'images' => $images, 'files' => $files)) ?> + <?= $this->render('project_overview/information', array('project' => $project, 'users' => $users, 'roles' => $roles)) ?> + + <div class="page-header"> + <h2><?= t('Last activity') ?></h2> + </div> + <?= $this->render('event/events', array('events' => $events)) ?> +</section> diff --git a/app/Template/project_permission/index.php b/app/Template/project_permission/index.php new file mode 100644 index 00000000..5f0edc2b --- /dev/null +++ b/app/Template/project_permission/index.php @@ -0,0 +1,141 @@ +<div class="page-header"> + <h2><?= t('Allowed Users') ?></h2> +</div> + +<?php if ($project['is_everybody_allowed']): ?> + <div class="alert"><?= t('Everybody have access to this project.') ?></div> +<?php else: ?> + + <?php if (empty($users)): ?> + <div class="alert"><?= t('No user have been allowed specifically.') ?></div> + <?php else: ?> + <table> + <tr> + <th class="column-50"><?= t('User') ?></th> + <th><?= t('Role') ?></th> + <?php if ($project['is_private'] == 0): ?> + <th class="column-15"><?= t('Actions') ?></th> + <?php endif ?> + </tr> + <?php foreach ($users as $user): ?> + <tr> + <td><?= $this->e($user['name'] ?: $user['username']) ?></td> + <td> + <?= $this->form->select( + 'role-'.$user['id'], + $roles, + array('role-'.$user['id'] => $user['role']), + array(), + array('data-url="'.$this->url->href('ProjectPermission', 'changeUserRole', array('project_id' => $project['id'])).'"', 'data-id="'.$user['id'].'"'), + 'project-change-role' + ) ?> + </td> + <td> + <?= $this->url->link(t('Remove'), 'ProjectPermission', 'removeUser', array('project_id' => $project['id'], 'user_id' => $user['id']), true) ?> + </td> + </tr> + <?php endforeach ?> + </table> + <?php endif ?> + + <?php if ($project['is_private'] == 0): ?> + <div class="listing"> + <form method="post" action="<?= $this->url->href('ProjectPermission', 'addUser', array('project_id' => $project['id'])) ?>" autocomplete="off" class="form-inline"> + <?= $this->form->csrf() ?> + <?= $this->form->hidden('project_id', array('project_id' => $project['id'])) ?> + <?= $this->form->hidden('user_id', $values) ?> + + <?= $this->form->label(t('Name'), 'name') ?> + <?= $this->form->text('name', $values, $errors, array( + 'required', + 'placeholder="'.t('Enter user name...').'"', + 'title="'.t('Enter user name...').'"', + 'data-dst-field="user_id"', + 'data-search-url="'.$this->url->href('UserHelper', 'autocomplete').'"', + ), + 'autocomplete') ?> + + <?= $this->form->select('role', $roles, $values, $errors) ?> + + <input type="submit" value="<?= t('Add') ?>" class="btn btn-blue"/> + </form> + </div> + <?php endif ?> + + <div class="page-header"> + <h2><?= t('Allowed Groups') ?></h2> + </div> + + <?php if (empty($groups)): ?> + <div class="alert"><?= t('No group have been allowed specifically.') ?></div> + <?php else: ?> + <table> + <tr> + <th class="column-50"><?= t('Group') ?></th> + <th><?= t('Role') ?></th> + <?php if ($project['is_private'] == 0): ?> + <th class="column-15"><?= t('Actions') ?></th> + <?php endif ?> + </tr> + <?php foreach ($groups as $group): ?> + <tr> + <td><?= $this->e($group['name']) ?></td> + <td> + <?= $this->form->select( + 'role-'.$group['id'], + $roles, + array('role-'.$group['id'] => $group['role']), + array(), + array('data-url="'.$this->url->href('ProjectPermission', 'changeGroupRole', array('project_id' => $project['id'])).'"', 'data-id="'.$group['id'].'"'), + 'project-change-role' + ) ?> + </td> + <td> + <?= $this->url->link(t('Remove'), 'ProjectPermission', 'removeGroup', array('project_id' => $project['id'], 'group_id' => $group['id']), true) ?> + </td> + </tr> + <?php endforeach ?> + </table> + <?php endif ?> + + <?php if ($project['is_private'] == 0): ?> + <div class="listing"> + <form method="post" action="<?= $this->url->href('ProjectPermission', 'addGroup', array('project_id' => $project['id'])) ?>" autocomplete="off" class="form-inline"> + <?= $this->form->csrf() ?> + <?= $this->form->hidden('project_id', array('project_id' => $project['id'])) ?> + <?= $this->form->hidden('group_id', $values) ?> + <?= $this->form->hidden('external_id', $values) ?> + + <?= $this->form->label(t('Group Name'), 'name') ?> + <?= $this->form->text('name', $values, $errors, array( + 'required', + 'placeholder="'.t('Enter group name...').'"', + 'title="'.t('Enter group name...').'"', + 'data-dst-field="group_id"', + 'data-dst-extra-field="external_id"', + 'data-search-url="'.$this->url->href('GroupHelper', 'autocomplete').'"', + ), + 'autocomplete') ?> + + <?= $this->form->select('role', $roles, $values, $errors) ?> + + <input type="submit" value="<?= t('Add') ?>" class="btn btn-blue"/> + </form> + </div> + <?php endif ?> + +<?php endif ?> + +<?php if ($project['is_private'] == 0): ?> +<hr/> +<form method="post" action="<?= $this->url->href('ProjectPermission', 'allowEverybody', array('project_id' => $project['id'])) ?>"> + <?= $this->form->csrf() ?> + + <?= $this->form->hidden('id', array('id' => $project['id'])) ?> + <?= $this->form->checkbox('is_everybody_allowed', t('Allow everybody to access to this project'), 1, $project['is_everybody_allowed']) ?> + + <div class="form-actions"> + <input type="submit" value="<?= t('Save') ?>" class="btn btn-blue"/> + </div> +</form> +<?php endif ?> diff --git a/app/Template/project_user/layout.php b/app/Template/project_user/layout.php index 4cf732d6..3ced5590 100644 --- a/app/Template/project_user/layout.php +++ b/app/Template/project_user/layout.php @@ -1,18 +1,11 @@ <section id="main"> <div class="page-header"> <ul> - <?php if ($this->user->isProjectAdmin() || $this->user->isAdmin()): ?> - <li><i class="fa fa-plus fa-fw"></i><?= $this->url->link(t('New project'), 'project', 'create') ?></li> - <?php endif ?> - <li> - <i class="fa fa-lock fa-fw"></i> - <?= $this->url->link(t('New private project'), 'project', 'create', array('private' => 1)) ?> - </li> <li> <i class="fa fa-folder fa-fw"></i> <?= $this->url->link(t('Projects list'), 'project', 'index') ?> </li> - <?php if ($this->user->isProjectAdmin() || $this->user->isAdmin()): ?> + <?php if ($this->user->hasAccess('gantt', 'projects')): ?> <li> <i class="fa fa-sliders fa-fw"></i> <?= $this->url->link(t('Projects Gantt chart'), 'gantt', 'projects') ?> @@ -22,7 +15,7 @@ </div> <section class="sidebar-container"> - <?= $this->render('project_user/sidebar', array('users' => $users, 'filter' => $filter)) ?> + <?= $this->render($sidebar_template, array('users' => $users, 'filter' => $filter)) ?> <div class="sidebar-content"> <div class="page-header"> diff --git a/app/Template/project_user/sidebar.php b/app/Template/project_user/sidebar.php index b81ba14a..ff113ebb 100644 --- a/app/Template/project_user/sidebar.php +++ b/app/Template/project_user/sidebar.php @@ -10,18 +10,18 @@ 'chosen-select select-auto-redirect' ) ?> - <br/><br/> + <br><br> <ul> - <li <?= $this->app->getRouterAction() === 'managers' ? 'class="active"' : '' ?>> + <li <?= $this->app->checkMenuSelection('projectuser', 'managers') ?>> <?= $this->url->link(t('Project managers'), 'projectuser', 'managers', $filter) ?> </li> - <li <?= $this->app->getRouterAction() === 'members' ? 'class="active"' : '' ?>> + <li <?= $this->app->checkMenuSelection('projectuser', 'members') ?>> <?= $this->url->link(t('Project members'), 'projectuser', 'members', $filter) ?> </li> - <li <?= $this->app->getRouterAction() === 'opens' ? 'class="active"' : '' ?>> + <li <?= $this->app->checkMenuSelection('projectuser', 'opens') ?>> <?= $this->url->link(t('Open tasks'), 'projectuser', 'opens', $filter) ?> </li> - <li <?= $this->app->getRouterAction() === 'closed' ? 'class="active"' : '' ?>> + <li <?= $this->app->checkMenuSelection('projectuser', 'closed') ?>> <?= $this->url->link(t('Closed tasks'), 'projectuser', 'closed', $filter) ?> </li> diff --git a/app/Template/project_user/tasks.php b/app/Template/project_user/tasks.php index f4fc2723..8d1cbd96 100644 --- a/app/Template/project_user/tasks.php +++ b/app/Template/project_user/tasks.php @@ -33,10 +33,10 @@ <?php endif ?> </td> <td> - <?= dt('%B %e, %Y', $task['date_started']) ?> + <?= $this->dt->date($task['date_started']) ?> </td> <td> - <?= dt('%B %e, %Y', $task['date_due']) ?> + <?= $this->dt->date($task['date_due']) ?> </td> </tr> <?php endforeach ?> diff --git a/app/Template/project_user/tooltip_users.php b/app/Template/project_user/tooltip_users.php new file mode 100644 index 00000000..7a07caad --- /dev/null +++ b/app/Template/project_user/tooltip_users.php @@ -0,0 +1,14 @@ +<?php if (empty($users)): ?> + <p><?= t('There is no project member.') ?></p> +<?php else: ?> + <?php foreach ($roles as $role => $role_name): ?> + <?php if (isset($users[$role])): ?> + <strong><?= $role_name ?></strong> + <ul> + <?php foreach ($users[$role] as $user_id => $user): ?> + <li><?= $this->url->link($this->e($user), 'Projectuser', 'opens', array('user_id' => $user_id)) ?></li> + <?php endforeach ?> + </ul> + <?php endif ?> + <?php endforeach ?> +<?php endif ?>
\ No newline at end of file diff --git a/app/Template/search/index.php b/app/Template/search/index.php index 329c072a..9231a6f3 100644 --- a/app/Template/search/index.php +++ b/app/Template/search/index.php @@ -8,14 +8,13 @@ </ul> </div> - <div class="search"> + <div class="filter-box"> <form method="get" action="<?= $this->url->dir() ?>" class="search"> <?= $this->form->hidden('controller', $values) ?> <?= $this->form->hidden('action', $values) ?> <?= $this->form->text('search', $values, array(), array(empty($values['search']) ? 'autofocus' : '', 'placeholder="'.t('Search').'"'), 'form-input-large') ?> + <?= $this->render('app/filters_helper') ?> </form> - - <?= $this->render('app/filters_helper') ?> </div> <?php if (empty($values['search'])): ?> diff --git a/app/Template/search/results.php b/app/Template/search/results.php index 88eed87c..3bb0e603 100644 --- a/app/Template/search/results.php +++ b/app/Template/search/results.php @@ -38,7 +38,7 @@ <?php endif ?> </td> <td> - <?= dt('%B %e, %Y', $task['date_due']) ?> + <?= $this->dt->date($task['date_due']) ?> </td> <td> <?php if ($task['is_active'] == \Kanboard\Model\Task::STATUS_OPEN): ?> diff --git a/app/Template/subtask/create.php b/app/Template/subtask/create.php index 82e378f5..8fffd3a9 100644 --- a/app/Template/subtask/create.php +++ b/app/Template/subtask/create.php @@ -2,26 +2,19 @@ <h2><?= t('Add a sub-task') ?></h2> </div> -<form method="post" action="<?= $this->url->href('subtask', 'save', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?>" autocomplete="off"> +<form class="popover-form" method="post" action="<?= $this->url->href('subtask', 'save', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?>" autocomplete="off"> <?= $this->form->csrf() ?> - <?= $this->form->hidden('task_id', $values) ?> - - <?= $this->form->label(t('Title'), 'title') ?> - <?= $this->form->text('title', $values, $errors, array('required', 'autofocus', 'maxlength="255"')) ?><br/> - - <?= $this->form->label(t('Assignee'), 'user_id') ?> - <?= $this->form->select('user_id', $users_list, $values, $errors) ?><br/> - - <?= $this->form->label(t('Original estimate'), 'time_estimated') ?> - <?= $this->form->numeric('time_estimated', $values, $errors) ?> <?= t('hours') ?><br/> + <?= $this->subtask->selectTitle($values, $errors, array('autofocus')) ?> + <?= $this->subtask->selectAssignee($users_list, $values, $errors) ?> + <?= $this->subtask->selectTimeEstimated($values, $errors) ?> <?= $this->form->checkbox('another_subtask', t('Create another sub-task'), 1, isset($values['another_subtask']) && $values['another_subtask'] == 1) ?> <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') ?> - <?= $this->url->link(t('cancel'), 'task', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?> + <?= $this->url->link(t('cancel'), 'task', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id']), false, 'close-popover') ?> </div> </form> diff --git a/app/Template/subtask/edit.php b/app/Template/subtask/edit.php index 2e583069..acce625e 100644 --- a/app/Template/subtask/edit.php +++ b/app/Template/subtask/edit.php @@ -2,28 +2,19 @@ <h2><?= t('Edit a sub-task') ?></h2> </div> -<form method="post" action="<?= $this->url->href('subtask', 'update', array('task_id' => $task['id'], 'project_id' => $task['project_id'], 'subtask_id' => $subtask['id'])) ?>" autocomplete="off"> +<form class="popover-form" method="post" action="<?= $this->url->href('subtask', 'update', array('task_id' => $task['id'], 'project_id' => $task['project_id'], 'subtask_id' => $subtask['id'])) ?>" autocomplete="off"> <?= $this->form->csrf() ?> - <?= $this->form->hidden('id', $values) ?> <?= $this->form->hidden('task_id', $values) ?> - - <?= $this->form->label(t('Title'), 'title') ?> - <?= $this->form->text('title', $values, $errors, array('required', 'autofocus', 'maxlength="255"')) ?><br/> - - <?= $this->form->label(t('Assignee'), 'user_id') ?> - <?= $this->form->select('user_id', $users_list, $values, $errors) ?><br/> - - <?= $this->form->label(t('Original estimate'), 'time_estimated') ?> - <?= $this->form->numeric('time_estimated', $values, $errors) ?> <?= t('hours') ?><br/> - - <?= $this->form->label(t('Time spent'), 'time_spent') ?> - <?= $this->form->numeric('time_spent', $values, $errors) ?> <?= t('hours') ?><br/> + <?= $this->subtask->selectTitle($values, $errors, array('autofocus')) ?> + <?= $this->subtask->selectAssignee($users_list, $values, $errors) ?> + <?= $this->subtask->selectTimeEstimated($values, $errors) ?> + <?= $this->subtask->selectTimeSpent($values, $errors) ?> <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') ?> - <?= $this->url->link(t('cancel'), 'task', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?> + <?= $this->url->link(t('cancel'), 'task', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id']), false, 'close-popover') ?> </div> </form> diff --git a/app/Template/subtask/icons.php b/app/Template/subtask/icons.php deleted file mode 100644 index 1f31d51f..00000000 --- a/app/Template/subtask/icons.php +++ /dev/null @@ -1,7 +0,0 @@ -<?php if ($subtask['status'] == 0): ?> - <i class="fa fa-square-o fa-fw"></i> -<?php elseif ($subtask['status'] == 1): ?> - <i class="fa fa-gears fa-fw"></i> -<?php else: ?> - <i class="fa fa-check-square-o fa-fw"></i> -<?php endif ?>
\ No newline at end of file diff --git a/app/Template/subtask/menu.php b/app/Template/subtask/menu.php new file mode 100644 index 00000000..6c98b951 --- /dev/null +++ b/app/Template/subtask/menu.php @@ -0,0 +1,11 @@ +<div class="dropdown"> + <a href="#" class="dropdown-menu dropdown-menu-link-icon"><i class="fa fa-cog fa-fw"></i><i class="fa fa-caret-down"></i></a> + <ul> + <li> + <?= $this->url->link(t('Edit'), 'subtask', 'edit', array('task_id' => $task['id'], 'project_id' => $task['project_id'], 'subtask_id' => $subtask['id']), false, 'popover') ?> + </li> + <li> + <?= $this->url->link(t('Remove'), 'subtask', 'confirm', array('task_id' => $task['id'], 'project_id' => $task['project_id'], 'subtask_id' => $subtask['id']), false, 'popover') ?> + </li> + </ul> +</div> diff --git a/app/Template/subtask/remove.php b/app/Template/subtask/remove.php index 65ade31d..9aef6842 100644 --- a/app/Template/subtask/remove.php +++ b/app/Template/subtask/remove.php @@ -12,6 +12,6 @@ <div class="form-actions"> <?= $this->url->link(t('Yes'), 'subtask', 'remove', array('task_id' => $task['id'], 'project_id' => $task['project_id'], 'subtask_id' => $subtask['id']), true, 'btn btn-red') ?> <?= t('or') ?> - <?= $this->url->link(t('cancel'), 'task', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?> + <?= $this->url->link(t('cancel'), 'task', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id']), false, 'close-popover') ?> </div> </div>
\ No newline at end of file diff --git a/app/Template/subtask/show.php b/app/Template/subtask/show.php index 1f0f9bba..b0326c48 100644 --- a/app/Template/subtask/show.php +++ b/app/Template/subtask/show.php @@ -1,93 +1,12 @@ -<?php if (! empty($subtasks)): ?> - -<?php $first_position = $subtasks[0]['position']; ?> -<?php $last_position = $subtasks[count($subtasks) - 1]['position']; ?> - -<div id="subtasks" class="task-show-section"> - - <div class="page-header"> - <h2><?= t('Sub-Tasks') ?></h2> - </div> +<div class="page-header"> + <h2><?= t('Sub-Tasks') ?></h2> +</div> - <table class="subtasks-table"> - <tr> - <th class="column-40"><?= t('Title') ?></th> - <th><?= t('Assignee') ?></th> - <th><?= t('Time tracking') ?></th> - <?php if (! isset($not_editable)): ?> - <th><?= t('Actions') ?></th> - <?php endif ?> - </tr> - <?php foreach ($subtasks as $subtask): ?> - <tr> - <td> - <?php if (! isset($not_editable)): ?> - <?= $this->subtask->toggleStatus($subtask, 'task') ?> - <?php else: ?> - <?= $this->render('subtask/icons', array('subtask' => $subtask)) . $this->e($subtask['title']) ?> - <?php endif ?> - </td> - <td> - <?php if (! empty($subtask['username'])): ?> - <?php if (! isset($not_editable)): ?> - <?= $this->url->link($this->e($subtask['name'] ?: $subtask['username']), 'user', 'show', array('user_id' => $subtask['user_id'])) ?> - <?php else: ?> - <?= $this->e($subtask['name'] ?: $subtask['username']) ?> - <?php endif ?> - <?php endif ?> - </td> - <td> - <ul class="no-bullet"> - <li> - <?php if (! empty($subtask['time_spent'])): ?> - <strong><?= $this->e($subtask['time_spent']).'h' ?></strong> <?= t('spent') ?> - <?php endif ?> +<div id="subtasks"> - <?php if (! empty($subtask['time_estimated'])): ?> - <strong><?= $this->e($subtask['time_estimated']).'h' ?></strong> <?= t('estimated') ?> - <?php endif ?> - </li> - <?php if (! isset($not_editable) && $subtask['user_id'] == $this->user->getId()): ?> - <li> - <?php if ($subtask['is_timer_started']): ?> - <i class="fa fa-pause"></i> - <?= $this->url->link(t('Stop timer'), 'timer', 'subtask', array('timer' => 'stop', 'project_id' => $task['project_id'], 'task_id' => $subtask['task_id'], 'subtask_id' => $subtask['id'])) ?> - (<?= $this->dt->age($subtask['timer_start_date']) ?>) - <?php else: ?> - <i class="fa fa-play-circle-o"></i> - <?= $this->url->link(t('Start timer'), 'timer', 'subtask', array('timer' => 'start', 'project_id' => $task['project_id'], 'task_id' => $subtask['task_id'], 'subtask_id' => $subtask['id'])) ?> - <?php endif ?> - </li> - <?php endif ?> - </ul> - </td> - <?php if (! isset($not_editable)): ?> - <td> - <ul> - <?php if ($subtask['position'] != $first_position): ?> - <li> - <?= $this->url->link(t('Move Up'), 'subtask', 'movePosition', array('project_id' => $project['id'], 'task_id' => $subtask['task_id'], 'subtask_id' => $subtask['id'], 'direction' => 'up'), true) ?> - </li> - <?php endif ?> - <?php if ($subtask['position'] != $last_position): ?> - <li> - <?= $this->url->link(t('Move Down'), 'subtask', 'movePosition', array('project_id' => $project['id'], 'task_id' => $subtask['task_id'], 'subtask_id' => $subtask['id'], 'direction' => 'down'), true) ?> - </li> - <?php endif ?> - <li> - <?= $this->url->link(t('Edit'), 'subtask', 'edit', array('task_id' => $task['id'], 'project_id' => $task['project_id'], 'subtask_id' => $subtask['id'])) ?> - </li> - <li> - <?= $this->url->link(t('Remove'), 'subtask', 'confirm', array('task_id' => $task['id'], 'project_id' => $task['project_id'], 'subtask_id' => $subtask['id'])) ?> - </li> - </ul> - </td> - <?php endif ?> - </tr> - <?php endforeach ?> - </table> + <?= $this->render('subtask/table', array('subtasks' => $subtasks, 'task' => $task, 'editable' => $editable)) ?> - <?php if (! isset($not_editable)): ?> + <?php if ($editable && $this->user->hasProjectAccess('subtask', 'save', $task['project_id'])): ?> <form method="post" action="<?= $this->url->href('subtask', 'save', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?>" autocomplete="off"> <?= $this->form->csrf() ?> <?= $this->form->hidden('task_id', array('task_id' => $task['id'])) ?> @@ -99,4 +18,3 @@ <?php endif ?> </div> -<?php endif ?> diff --git a/app/Template/subtask/table.php b/app/Template/subtask/table.php new file mode 100644 index 00000000..13d2c7cc --- /dev/null +++ b/app/Template/subtask/table.php @@ -0,0 +1,71 @@ +<?php if (! empty($subtasks)): ?> + <table + class="subtasks-table table-stripped" + data-save-position-url="<?= $this->url->href('Subtask', 'movePosition', array('project_id' => $task['project_id'], 'task_id' => $task['id'])) ?>" + > + <thead> + <tr> + <th class="column-40"><?= t('Title') ?></th> + <th><?= t('Assignee') ?></th> + <th><?= t('Time tracking') ?></th> + <?php if ($editable): ?> + <th class="column-5"></th> + <?php endif ?> + </tr> + </thead> + <tbody> + <?php foreach ($subtasks as $subtask): ?> + <tr data-subtask-id="<?= $subtask['id'] ?>"> + <td> + <?php if ($editable): ?> + <i class="fa fa-arrows-alt draggable-row-handle" title="<?= t('Change subtask position') ?>"></i> + <?= $this->subtask->toggleStatus($subtask, $task['project_id'], true) ?> + <?php else: ?> + <?= $this->subtask->getTitle($subtask) ?> + <?php endif ?> + </td> + <td> + <?php if (! empty($subtask['username'])): ?> + <?= $this->e($subtask['name'] ?: $subtask['username']) ?> + <?php endif ?> + </td> + <td> + <ul class="no-bullet"> + <li> + <?php if (! empty($subtask['time_spent'])): ?> + <strong><?= $this->e($subtask['time_spent']).'h' ?></strong> <?= t('spent') ?> + <?php endif ?> + + <?php if (! empty($subtask['time_estimated'])): ?> + <strong><?= $this->e($subtask['time_estimated']).'h' ?></strong> <?= t('estimated') ?> + <?php endif ?> + </li> + <?php if ($editable && $subtask['user_id'] == $this->user->getId()): ?> + <li> + <?php if ($subtask['is_timer_started']): ?> + <i class="fa fa-pause"></i> + <?= $this->url->link(t('Stop timer'), 'SubtaskStatus', 'timer', array('timer' => 'stop', 'project_id' => $task['project_id'], 'task_id' => $subtask['task_id'], 'subtask_id' => $subtask['id']), false, 'subtask-toggle-timer') ?> + (<?= $this->dt->age($subtask['timer_start_date']) ?>) + <?php else: ?> + <i class="fa fa-play-circle-o"></i> + <?= $this->url->link(t('Start timer'), 'SubtaskStatus', 'timer', array('timer' => 'start', 'project_id' => $task['project_id'], 'task_id' => $subtask['task_id'], 'subtask_id' => $subtask['id']), false, 'subtask-toggle-timer') ?> + <?php endif ?> + </li> + <?php endif ?> + </ul> + </td> + <?php if ($editable): ?> + <td> + <?= $this->render('subtask/menu', array( + 'task' => $task, + 'subtask' => $subtask, + )) ?> + </td> + <?php endif ?> + </tr> + <?php endforeach ?> + </tbody> + </table> +<?php else: ?> + <p class="alert"><?= t('There is no subtask at the moment.') ?></p> +<?php endif ?> diff --git a/app/Template/subtask/restriction_change_status.php b/app/Template/subtask_restriction/popover.php index 88e91d82..e80d6b6d 100644 --- a/app/Template/subtask/restriction_change_status.php +++ b/app/Template/subtask_restriction/popover.php @@ -1,18 +1,16 @@ <div class="page-header"> <h2><?= t('You already have one subtask in progress') ?></h2> </div> - - <form action="<?= $this->url->href('subtask', 'changeRestrictionStatus', array('task_id' => $task['id'], 'project_id' => $task['project_id'], 'subtask_id' => $subtask['id'])) ?>" method="post"> +<form class="popover-form" action="<?= $this->url->href('SubtaskRestriction', 'update', array('task_id' => $task['id'], 'project_id' => $task['project_id'], 'subtask_id' => $subtask['id'])) ?>" method="post"> <?= $this->form->csrf() ?> - <?= $this->form->hidden('redirect', array('redirect' => $redirect)) ?> <p><?= t('Select the new status of the subtask: "%s"', $subtask_inprogress['title']) ?></p> <?= $this->form->radios('status', $status_list) ?> <?= $this->form->hidden('id', $subtask_inprogress) ?> <div class="form-actions"> - <input type="submit" value="<?= t('Save') ?>" class="btn btn-red"/> + <input type="submit" value="<?= t('Save') ?>" class="btn btn-red"> <?= t('or') ?> <a href="#" class="close-popover"><?= t('cancel') ?></a> </div> diff --git a/app/Template/swimlane/create.php b/app/Template/swimlane/create.php new file mode 100644 index 00000000..bb389555 --- /dev/null +++ b/app/Template/swimlane/create.php @@ -0,0 +1,37 @@ +<div class="page-header"> + <h2><?= t('Add a new swimlane') ?></h2> +</div> +<form class="popover-form" method="post" action="<?= $this->url->href('swimlane', 'save', array('project_id' => $project['id'])) ?>" autocomplete="off"> + + <?= $this->form->csrf() ?> + <?= $this->form->hidden('project_id', $values) ?> + + <?= $this->form->label(t('Name'), 'name') ?> + <?= $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"> + <input type="submit" value="<?= t('Save') ?>" class="btn btn-blue"> + <?= t('or') ?> + <?= $this->url->link(t('cancel'), 'Swimlane', 'index', array('project_id' => $project['id']), false, 'close-popover') ?> + </div> +</form> diff --git a/app/Template/swimlane/edit.php b/app/Template/swimlane/edit.php index dfc5cf0b..31d819d4 100644 --- a/app/Template/swimlane/edit.php +++ b/app/Template/swimlane/edit.php @@ -2,7 +2,7 @@ <h2><?= t('Swimlane modification for the project "%s"', $project['name']) ?></h2> </div> -<form method="post" action="<?= $this->url->href('swimlane', 'update', array('project_id' => $project['id'], 'swimlane_id' => $values['id'])) ?>" autocomplete="off"> +<form class="popover-form" method="post" action="<?= $this->url->href('swimlane', 'update', array('project_id' => $project['id'], 'swimlane_id' => $values['id'])) ?>" autocomplete="off"> <?= $this->form->csrf() ?> @@ -34,8 +34,8 @@ <div class="form-help"><?= $this->url->doc(t('Write your text in Markdown'), 'syntax-guide') ?></div> <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') ?> - <?= $this->url->link(t('cancel'), 'swimlane', 'index', array('project_id' => $project['id'])) ?> + <?= $this->url->link(t('cancel'), 'swimlane', 'index', array('project_id' => $project['id']), false, 'close-popover') ?> </div> </form>
\ No newline at end of file diff --git a/app/Template/swimlane/edit_default.php b/app/Template/swimlane/edit_default.php new file mode 100644 index 00000000..df25ec12 --- /dev/null +++ b/app/Template/swimlane/edit_default.php @@ -0,0 +1,18 @@ +<div class="page-header"> + <h2><?= t('Change default swimlane') ?></h2> +</div> +<form class="popover-form" method="post" action="<?= $this->url->href('swimlane', 'updateDefault', array('project_id' => $project['id'])) ?>" autocomplete="off"> + <?= $this->form->csrf() ?> + <?= $this->form->hidden('id', $values) ?> + + <?= $this->form->label(t('Name'), 'default_swimlane') ?> + <?= $this->form->text('default_swimlane', $values, $errors, array('required', 'maxlength="50"')) ?> + + <?= $this->form->checkbox('show_default_swimlane', t('Show default swimlane'), 1, $values['show_default_swimlane'] == 1) ?> + + <div class="form-actions"> + <input type="submit" value="<?= t('Save') ?>" class="btn btn-blue"> + <?= t('or') ?> + <?= $this->url->link(t('cancel'), 'Swimlane', 'index', array('project_id' => $project['id']), false, 'close-popover') ?> + </div> +</form> diff --git a/app/Template/swimlane/index.php b/app/Template/swimlane/index.php index 9502cffd..fad35306 100644 --- a/app/Template/swimlane/index.php +++ b/app/Template/swimlane/index.php @@ -1,71 +1,28 @@ <div class="page-header"> - <h2><?= t('Change default swimlane') ?></h2> + <h2><?= t('Swimlanes') ?></h2> + <ul> + <li> + <i class="fa fa-plus fa-fw"></i> + <?= $this->url->link(t('Add a new swimlane'), 'Swimlane', 'create', array('project_id' => $project['id']), false, 'popover') ?> + </li> + </ul> </div> -<form method="post" action="<?= $this->url->href('swimlane', 'change', array('project_id' => $project['id'])) ?>" autocomplete="off"> - <?= $this->form->csrf() ?> - <?= $this->form->hidden('id', $default_swimlane) ?> - - <?= $this->form->label(t('Rename'), 'default_swimlane') ?> - <?= $this->form->text('default_swimlane', $default_swimlane, array(), array('required', 'maxlength="50"')) ?><br/> - - <?php if (! empty($active_swimlanes) || $default_swimlane['show_default_swimlane'] == 0): ?> - <?= $this->form->checkbox('show_default_swimlane', t('Show default swimlane'), 1, $default_swimlane['show_default_swimlane'] == 1) ?> - <?php else: ?> - <?= $this->form->hidden('show_default_swimlane', $default_swimlane) ?> - <?php endif ?> - - <div class="form-actions"> - <input type="submit" value="<?= t('Save') ?>" class="btn btn-blue"/> - </div> -</form> - -<?php if (! empty($active_swimlanes)): ?> -<div class="page-header"> - <h2><?= t('Active swimlanes') ?></h2> -</div> -<?= $this->render('swimlane/table', array('swimlanes' => $active_swimlanes, 'project' => $project)) ?> +<?php if (! empty($active_swimlanes) || $default_swimlane['show_default_swimlane'] == 1): ?> +<h3><?= t('Active swimlanes') ?></h3> + <?= $this->render('swimlane/table', array( + 'swimlanes' => $active_swimlanes, + 'project' => $project, + 'default_swimlane' => $default_swimlane['show_default_swimlane'] == 1 ? $default_swimlane : array() + )) ?> <?php endif ?> -<?php if (! empty($inactive_swimlanes)): ?> -<div class="page-header"> - <h2><?= t('Inactive swimlanes') ?></h2> -</div> -<?= $this->render('swimlane/table', array('swimlanes' => $inactive_swimlanes, 'project' => $project, 'hide_position' => true)) ?> +<?php if (! empty($inactive_swimlanes) || $default_swimlane['show_default_swimlane'] == 0): ?> + <h3><?= t('Inactive swimlanes') ?></h3> + <?= $this->render('swimlane/table', array( + 'swimlanes' => $inactive_swimlanes, + 'project' => $project, + 'default_swimlane' => $default_swimlane['show_default_swimlane'] == 0 ? $default_swimlane : array(), + 'disable_handler' => true + )) ?> <?php endif ?> - -<div class="page-header"> - <h2><?= t('Add a new swimlane') ?></h2> -</div> -<form method="post" action="<?= $this->url->href('swimlane', 'save', array('project_id' => $project['id'])) ?>" autocomplete="off"> - - <?= $this->form->csrf() ?> - <?= $this->form->hidden('project_id', $values) ?> - - <?= $this->form->label(t('Name'), 'name') ?> - <?= $this->form->text('name', $values, $errors, array('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"> - <input type="submit" value="<?= t('Save') ?>" class="btn btn-blue"/> - </div> -</form> diff --git a/app/Template/swimlane/remove.php b/app/Template/swimlane/remove.php index 1d7c2b7a..9be39ff8 100644 --- a/app/Template/swimlane/remove.php +++ b/app/Template/swimlane/remove.php @@ -11,7 +11,7 @@ <div class="form-actions"> <?= $this->url->link(t('Yes'), 'swimlane', 'remove', array('project_id' => $project['id'], 'swimlane_id' => $swimlane['id']), true, 'btn btn-red') ?> <?= t('or') ?> - <?= $this->url->link(t('cancel'), 'swimlane', 'index', array('project_id' => $project['id'])) ?> + <?= $this->url->link(t('cancel'), 'swimlane', 'index', array('project_id' => $project['id']), false, 'close-popover') ?> </div> </div> </section>
\ No newline at end of file diff --git a/app/Template/swimlane/table.php b/app/Template/swimlane/table.php index b708e633..1e6a86bc 100644 --- a/app/Template/swimlane/table.php +++ b/app/Template/swimlane/table.php @@ -1,44 +1,76 @@ -<table> - <tr> - <?php if (! isset($hide_position)): ?> - <th><?= t('Position') ?></th> - <?php endif ?> - <th class="column-60"><?= t('Name') ?></th> - <th class="column-35"><?= t('Actions') ?></th> - </tr> - <?php foreach ($swimlanes as $swimlane): ?> - <tr> - <?php if (! isset($hide_position)): ?> - <td>#<?= $swimlane['position'] ?></td> - <?php endif ?> - <td><?= $this->e($swimlane['name']) ?></td> - <td> - <ul> - <?php if ($swimlane['position'] != 0 && $swimlane['position'] != 1): ?> +<table + class="swimlanes-table table-stripped" + data-save-position-url="<?= $this->url->href('Swimlane', 'move', array('project_id' => $project['id'])) ?>"> + <thead> + <tr> + <th><?= t('Name') ?></th> + <th class="column-8"><?= t('Actions') ?></th> + </tr> + + <?php if (! empty($default_swimlane)): ?> + <tr> + <td> + <?= $this->e($default_swimlane['default_swimlane']) ?> + <?php if ($default_swimlane['default_swimlane'] !== t('Default swimlane')): ?> + (<?= t('Default swimlane') ?>) + <?php endif ?> + </td> + <td> + <div class="dropdown"> + <a href="#" class="dropdown-menu dropdown-menu-link-icon"><i class="fa fa-cog fa-fw"></i><i class="fa fa-caret-down"></i></a> + <ul> <li> - <?= $this->url->link(t('Move Up'), 'swimlane', 'moveup', array('project_id' => $project['id'], 'swimlane_id' => $swimlane['id']), true) ?> + <?= $this->url->link(t('Edit'), 'Swimlane', 'editDefault', array('project_id' => $project['id']), false, 'popover') ?> </li> - <?php endif ?> - <?php if ($swimlane['position'] != 0 && $swimlane['position'] != count($swimlanes)): ?> <li> - <?= $this->url->link(t('Move Down'), 'swimlane', 'movedown', array('project_id' => $project['id'], 'swimlane_id' => $swimlane['id']), true) ?> + <?php if ($default_swimlane['show_default_swimlane'] == 1): ?> + <?= $this->url->link(t('Disable'), 'Swimlane', 'disableDefault', array('project_id' => $project['id']), true) ?> + <?php else: ?> + <?= $this->url->link(t('Enable'), 'Swimlane', 'enableDefault', array('project_id' => $project['id']), true) ?> + <?php endif ?> </li> + </ul> + </td> + </tr> + <?php endif ?> + </thead> + <tbody> + <?php foreach ($swimlanes as $swimlane): ?> + <tr data-swimlane-id="<?= $swimlane['id'] ?>"> + <td> + <?php if (! isset($disable_handler)): ?> + <i class="fa fa-arrows-alt draggable-row-handle" title="<?= t('Change column position') ?>"></i> + <?php endif ?> + + <?= $this->e($swimlane['name']) ?> + + <?php if (! empty($swimlane['description'])): ?> + <span class="tooltip" title='<?= $this->e($this->text->markdown($swimlane['description'])) ?>'> + <i class="fa fa-info-circle"></i> + </span> <?php endif ?> - <li> - <?= $this->url->link(t('Edit'), 'swimlane', 'edit', array('project_id' => $project['id'], 'swimlane_id' => $swimlane['id'])) ?> - </li> - <li> - <?php if ($swimlane['is_active']): ?> - <?= $this->url->link(t('Disable'), 'swimlane', 'disable', array('project_id' => $project['id'], 'swimlane_id' => $swimlane['id']), true) ?> - <?php else: ?> - <?= $this->url->link(t('Enable'), 'swimlane', 'enable', array('project_id' => $project['id'], 'swimlane_id' => $swimlane['id']), true) ?> - <?php endif ?> - </li> - <li> - <?= $this->url->link(t('Remove'), 'swimlane', 'confirm', array('project_id' => $project['id'], 'swimlane_id' => $swimlane['id'])) ?> - </li> - </ul> - </td> - </tr> - <?php endforeach ?> -</table>
\ No newline at end of file + </td> + <td> + <div class="dropdown"> + <a href="#" class="dropdown-menu dropdown-menu-link-icon"><i class="fa fa-cog fa-fw"></i><i class="fa fa-caret-down"></i></a> + <ul> + <li> + <?= $this->url->link(t('Edit'), 'swimlane', 'edit', array('project_id' => $project['id'], 'swimlane_id' => $swimlane['id']), false, 'popover') ?> + </li> + <li> + <?php if ($swimlane['is_active']): ?> + <?= $this->url->link(t('Disable'), 'swimlane', 'disable', array('project_id' => $project['id'], 'swimlane_id' => $swimlane['id']), true) ?> + <?php else: ?> + <?= $this->url->link(t('Enable'), 'swimlane', 'enable', array('project_id' => $project['id'], 'swimlane_id' => $swimlane['id']), true) ?> + <?php endif ?> + </li> + <li> + <?= $this->url->link(t('Remove'), 'swimlane', 'confirm', array('project_id' => $project['id'], 'swimlane_id' => $swimlane['id']), false, 'popover') ?> + </li> + </ul> + </div> + </td> + </tr> + <?php endforeach ?> + </tbody> +</table> diff --git a/app/Template/task/changes.php b/app/Template/task/changes.php index f288a8f4..db844857 100644 --- a/app/Template/task/changes.php +++ b/app/Template/task/changes.php @@ -31,7 +31,7 @@ if (empty($task['date_due'])) { echo '<li>'.t('The due date have been removed').'</li>'; } else { - echo '<li>'.dt('New due date: %B %e, %Y', $task['date_due']).'</li>'; + echo '<li>'.t('New due date: ').$this->dt->date($task['date_due']).'</li>'; } break; case 'description': @@ -56,7 +56,7 @@ break; case 'date_started': if ($value != 0) { - echo '<li>'.dt('Start date changed: %B %e, %Y', $task['date_started']).'</li>'; + echo '<li>'.t('Start date changed: ').$this->dt->datetime($task['date_started']).'</li>'; } break; default: diff --git a/app/Template/task/comments.php b/app/Template/task/comments.php index 070de320..c22e39ec 100644 --- a/app/Template/task/comments.php +++ b/app/Template/task/comments.php @@ -15,12 +15,12 @@ 'comment' => $comment, 'task' => $task, 'project' => $project, - 'not_editable' => isset($not_editable) && $not_editable, + 'editable' => $editable, 'is_public' => isset($is_public) && $is_public, )) ?> <?php endforeach ?> - <?php if (! isset($not_editable)): ?> + <?php if ($editable): ?> <?= $this->render('comment/create', array( 'skip_cancel' => true, 'values' => array( @@ -28,7 +28,7 @@ 'task_id' => $task['id'], ), 'errors' => array(), - 'task' => $task + 'task' => $task, )) ?> <?php endif ?> </div> diff --git a/app/Template/task/details.php b/app/Template/task/details.php index 9cd10dda..5c2e3cff 100644 --- a/app/Template/task/details.php +++ b/app/Template/task/details.php @@ -1,101 +1,130 @@ -<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> - <?php endif ?> - <ul> - <?php if ($task['reference']): ?> - <li> - <strong><?= t('Reference: %s', $task['reference']) ?></strong> - </li> - <?php endif ?> - <?php if (! empty($task['swimlane_name'])): ?> - <li> - <?= t('Swimlane: %s', $task['swimlane_name']) ?> - </li> - <?php endif ?> - <li> - <?= dt('Created on %B %e, %Y at %k:%M %p', $task['date_creation']) ?> - </li> - <?php if ($task['date_modification']): ?> - <li> - <?= dt('Last modified on %B %e, %Y at %k:%M %p', $task['date_modification']) ?> - </li> - <?php endif ?> - <?php if ($task['date_completed']): ?> - <li> - <?= dt('Completed on %B %e, %Y at %k:%M %p', $task['date_completed']) ?> - </li> - <?php endif ?> - <?php if ($task['date_started']): ?> - <li> - <?= dt('Started on %B %e, %Y', $task['date_started']) ?> - </li> - <?php endif ?> - <?php if ($task['date_due']): ?> - <li> - <strong><?= dt('Must be done before %B %e, %Y', $task['date_due']) ?></strong> - </li> - <?php endif ?> - <?php if ($task['time_estimated']): ?> - <li> - <?= t('Estimated time: %s hours', $task['time_estimated']) ?> - </li> - <?php endif ?> - <?php if ($task['time_spent']): ?> - <li> - <?= t('Time spent: %s hours', $task['time_spent']) ?> - </li> - <?php endif ?> - <?php if ($task['creator_username']): ?> - <li> - <?= t('Created by %s', $task['creator_name'] ?: $task['creator_username']) ?> - </li> - <?php endif ?> - <li> - <strong> - <?php if ($task['assignee_username']): ?> - <?= t('Assigned to %s', $task['assignee_name'] ?: $task['assignee_username']) ?> - <?php else: ?> - <?= t('There is nobody assigned') ?> - <?php endif ?> - </strong> - </li> - <li> - <?= t('Column on the board:') ?> - <strong><?= $this->e($task['column_title']) ?></strong> - (<?= $this->e($task['project_name']) ?>) - <?= dt('since %B %e, %Y at %k:%M %p', $task['date_moved']) ?> - </li> - <li><?= t('Task position:').' '.$this->e($task['position']) ?></li> - <?php if ($task['category_name']): ?> - <li> - <?= t('Category:') ?> <strong><?= $this->e($task['category_name']) ?></strong> - </li> - <?php endif ?> - <li> - <?php if ($task['is_active'] == 1): ?> - <?= t('Status is open') ?> - <?php else: ?> - <?= t('Status is closed') ?> - <?php endif ?> - </li> - <?php if ($project['is_public']): ?> - <li> - <?= $this->url->link(t('Public link'), 'task', 'readonly', array('task_id' => $task['id'], 'token' => $project['token']), false, '', '', true) ?> - </li> - <?php endif ?> - - <?php if (! isset($not_editable) && $task['recurrence_status'] != \Kanboard\Model\Task::RECURRING_STATUS_NONE): ?> - <li> - <strong><?= t('Recurring information') ?></strong> - <?= $this->render('task/recurring_info', array( - 'task' => $task, - 'recurrence_trigger_list' => $recurrence_trigger_list, - 'recurrence_timeframe_list' => $recurrence_timeframe_list, - 'recurrence_basedate_list' => $recurrence_basedate_list, - )) ?> - </li> - <?php endif ?> - </ul> -</div> +<section id="task-summary"> + <h2><?= $this->e($task['title']) ?></h2> + <div class="task-summary-container color-<?= $task['color_id'] ?>"> + <div class="task-summary-column"> + <ul class="no-bullet"> + <li> + <strong><?= t('Status:') ?></strong> + <span> + <?php if ($task['is_active'] == 1): ?> + <?= t('open') ?> + <?php else: ?> + <?= t('closed') ?> + <?php endif ?> + </span> + </li> + <li> + <strong><?= t('Priority:') ?></strong> <span><?= $task['priority'] ?></span> + </li> + <?php if (! empty($task['reference'])): ?> + <li> + <strong><?= t('Reference:') ?></strong> <span><?= $this->e($task['reference']) ?></span> + </li> + <?php endif ?> + <?php if (! empty($task['score'])): ?> + <li> + <strong><?= t('Complexity:') ?></strong> <span><?= $this->e($task['score']) ?></span> + </li> + <?php endif ?> + <?php if ($project['is_public']): ?> + <li class="smaller"> + <i class="fa fa-external-link fa-fw"></i> + <?= $this->url->link(t('Public link'), 'task', 'readonly', array('task_id' => $task['id'], 'token' => $project['token']), false, '', '', true) ?> + </li> + <?php endif ?> + </ul> + </div> + <div class="task-summary-column"> + <ul class="no-bullet"> + <?php if (! empty($task['category_name'])): ?> + <li> + <strong><?= t('Category:') ?></strong> + <span><?= $this->e($task['category_name']) ?></span> + </li> + <?php endif ?> + <?php if (! empty($task['swimlane_name'])): ?> + <li> + <strong><?= t('Swimlane:') ?></strong> + <span><?= $this->e($task['swimlane_name']) ?></span> + </li> + <?php endif ?> + <li> + <strong><?= t('Column:') ?></strong> + <span><?= $this->e($task['column_title']) ?></span> + </li> + <li> + <strong><?= t('Position:') ?></strong> + <span><?= $task['position'] ?></span> + </li> + </ul> + </div> + <div class="task-summary-column"> + <ul class="no-bullet"> + <li> + <strong><?= t('Assignee:') ?></strong> + <span> + <?php if ($task['assignee_username']): ?> + <?= $this->e($task['assignee_name'] ?: $task['assignee_username']) ?> + <?php else: ?> + <?= t('not assigned') ?> + <?php endif ?> + </span> + </li> + <?php if ($task['creator_username']): ?> + <li> + <strong><?= t('Creator:') ?></strong> + <span><?= $this->e($task['creator_name'] ?: $task['creator_username']) ?></span> + </li> + <?php endif ?> + <?php if ($task['date_due']): ?> + <li> + <strong><?= t('Due date:') ?></strong> + <span><?= $this->dt->date($task['date_due']) ?></span> + </li> + <?php endif ?> + <?php if ($task['time_estimated']): ?> + <li> + <strong><?= t('Time estimated:') ?></strong> + <span><?= t('%s hours', $task['time_estimated']) ?></span> + </li> + <?php endif ?> + <?php if ($task['time_spent']): ?> + <li> + <strong><?= t('Time spent:') ?></strong> + <span><?= t('%s hours', $task['time_spent']) ?></span> + </li> + <?php endif ?> + </ul> + </div> + <div class="task-summary-column"> + <ul class="no-bullet"> + <li> + <strong><?= t('Created:') ?></strong> + <span><?= $this->dt->datetime($task['date_creation']) ?></span> + </li> + <li> + <strong><?= t('Modified:') ?></strong> + <span><?= $this->dt->datetime($task['date_modification']) ?></span> + </li> + <?php if ($task['date_completed']): ?> + <li> + <strong><?= t('Completed:') ?></strong> + <span><?= $this->dt->datetime($task['date_completed']) ?></span> + </li> + <?php endif ?> + <?php if ($task['date_started']): ?> + <li> + <strong><?= t('Started:') ?></strong> + <span><?= $this->dt->datetime($task['date_started']) ?></span> + </li> + <?php endif ?> + <?php if ($task['date_moved']): ?> + <li> + <strong><?= t('Moved:') ?></strong> + <span><?= $this->dt->datetime($task['date_moved']) ?></span> + </li> + <?php endif ?> + </ul> + </div> + </div> +</section> diff --git a/app/Template/task/dropdown.php b/app/Template/task/dropdown.php new file mode 100644 index 00000000..3300ccf0 --- /dev/null +++ b/app/Template/task/dropdown.php @@ -0,0 +1,60 @@ +<div class="dropdown"> + <a href="#" class="dropdown-menu">#<?= $task['id'] ?></a> + <ul> + <?php if (isset($task['date_started']) && empty($task['date_started'])): ?> + <li> + <i class="fa fa-play fa-fw"></i> + <?= $this->url->link(t('Set automatically the start date'), 'taskmodification', 'start', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?> + </li> + <?php endif ?> + <li> + <i class="fa fa-pencil-square-o fa-fw"></i> + <?= $this->url->link(t('Edit the task'), 'taskmodification', 'edit', array('task_id' => $task['id'], 'project_id' => $task['project_id']), false, 'popover') ?> + </li> + <li> + <i class="fa fa-align-left fa-fw"></i> + <?= $this->url->link(t('Edit the description'), 'taskmodification', 'description', array('task_id' => $task['id'], 'project_id' => $task['project_id']), false, 'popover') ?> + </li> + <li> + <i class="fa fa-plus fa-fw"></i> + <?= $this->url->link(t('Add a sub-task'), 'subtask', 'create', array('task_id' => $task['id'], 'project_id' => $task['project_id']), false, 'popover') ?> + </li> + <li> + <i class="fa fa-code-fork fa-fw"></i> + <?= $this->url->link(t('Add internal link'), 'tasklink', 'create', array('task_id' => $task['id'], 'project_id' => $task['project_id']), false, 'popover') ?> + </li> + <li> + <i class="fa fa-external-link fa-fw"></i> + <?= $this->url->link(t('Add external link'), 'TaskExternalLink', 'find', array('task_id' => $task['id'], 'project_id' => $task['project_id']), false, 'popover') ?> + </li> + <li> + <i class="fa fa-comment-o fa-fw"></i> + <?= $this->url->link(t('Add a comment'), 'comment', 'create', array('task_id' => $task['id'], 'project_id' => $task['project_id']), false, 'popover') ?> + </li> + <li> + <i class="fa fa-files-o fa-fw"></i> + <?= $this->url->link(t('Duplicate'), 'taskduplication', 'duplicate', array('task_id' => $task['id'], 'project_id' => $task['project_id']), false, 'popover') ?> + </li> + <li> + <i class="fa fa-clipboard fa-fw"></i> + <?= $this->url->link(t('Duplicate to another project'), 'taskduplication', 'copy', array('task_id' => $task['id'], 'project_id' => $task['project_id']), false, 'popover') ?> + </li> + <li> + <i class="fa fa-clone fa-fw"></i> + <?= $this->url->link(t('Move to another project'), 'taskduplication', 'move', array('task_id' => $task['id'], 'project_id' => $task['project_id']), false, 'popover') ?> + </li> + <?php if (isset($task['is_active'])): ?> + <li> + <?php if ($task['is_active'] == 1): ?> + <i class="fa fa-times fa-fw"></i> + <?= $this->url->link(t('Close this task'), 'taskstatus', 'close', array('task_id' => $task['id'], 'project_id' => $task['project_id']), false, 'popover') ?> + <?php else: ?> + <i class="fa fa-check-square-o fa-fw"></i> + <?= $this->url->link(t('Open this task'), 'taskstatus', 'open', array('task_id' => $task['id'], 'project_id' => $task['project_id']), false, 'popover') ?> + <?php endif ?> + </li> + <?php endif ?> + + <?= $this->hook->render('template:task:dropdown') ?> + </ul> +</div> diff --git a/app/Template/task/layout.php b/app/Template/task/layout.php index 6b6e827a..9cbbfec9 100644 --- a/app/Template/task/layout.php +++ b/app/Template/task/layout.php @@ -2,6 +2,9 @@ <div class="page-header"> <ul> <li> + <?= $this->render('task/menu', array('task' => $task)) ?> + </li> + <li> <i class="fa fa-th fa-fw"></i> <?= $this->url->link(t('Back to the board'), 'board', 'show', array('project_id' => $task['project_id']), false, '', '', false, $task['swimlane_id'] != 0 ? 'swimlane-'.$task['swimlane_id'] : '') ?> </li> @@ -9,7 +12,7 @@ <i class="fa fa-calendar fa-fw"></i> <?= $this->url->link(t('Back to the calendar'), 'calendar', 'show', array('project_id' => $task['project_id'])) ?> </li> - <?php if ($this->user->isProjectManagementAllowed($task['project_id'])): ?> + <?php if ($this->user->hasProjectAccess('ProjectEdit', 'edit', $task['project_id'])): ?> <li> <i class="fa fa-cog fa-fw"></i> <?= $this->url->link(t('Project settings'), 'project', 'show', array('project_id' => $task['project_id'])) ?> @@ -17,12 +20,12 @@ <?php endif ?> </ul> </div> - <section class="sidebar-container" id="task-section"> + <section class="sidebar-container"> - <?= $this->render('task/sidebar', array('task' => $task)) ?> + <?= $this->render($sidebar_template, array('task' => $task)) ?> <div class="sidebar-content"> - <?= $task_content_for_layout ?> + <?= $content_for_sublayout ?> </div> </section> </section>
\ No newline at end of file diff --git a/app/Template/task/menu.php b/app/Template/task/menu.php new file mode 100644 index 00000000..cddd930a --- /dev/null +++ b/app/Template/task/menu.php @@ -0,0 +1,78 @@ +<?php if ($this->user->hasProjectAccess('taskmodification', 'edit', $task['project_id'])): ?> +<div class="dropdown"> + <i class="fa fa-caret-down"></i> <a href="#" class="dropdown-menu"><?= t('Actions') ?></a> + <ul> + <?php if (empty($task['date_started'])): ?> + <li> + <i class="fa fa-play fa-fw"></i> + <?= $this->url->link(t('Set automatically the start date'), 'taskmodification', 'start', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?> + </li> + <?php endif ?> + <li> + <i class="fa fa-pencil-square-o fa-fw"></i> + <?= $this->url->link(t('Edit the task'), 'taskmodification', 'edit', array('task_id' => $task['id'], 'project_id' => $task['project_id']), false, 'popover') ?> + </li> + <li> + <i class="fa fa-align-left fa-fw"></i> + <?= $this->url->link(t('Edit the description'), 'taskmodification', 'description', array('task_id' => $task['id'], 'project_id' => $task['project_id']), false, 'popover') ?> + </li> + <li> + <i class="fa fa-refresh fa-rotate-90 fa-fw"></i> + <?= $this->url->link(t('Edit recurrence'), 'TaskRecurrence', 'edit', array('task_id' => $task['id'], 'project_id' => $task['project_id']), false, 'popover') ?> + </li> + <li> + <i class="fa fa-plus fa-fw"></i> + <?= $this->url->link(t('Add a sub-task'), 'subtask', 'create', array('task_id' => $task['id'], 'project_id' => $task['project_id']), false, 'popover') ?> + </li> + <li> + <i class="fa fa-code-fork fa-fw"></i> + <?= $this->url->link(t('Add internal link'), 'tasklink', 'create', array('task_id' => $task['id'], 'project_id' => $task['project_id']), false, 'popover') ?> + </li> + <li> + <i class="fa fa-external-link fa-fw"></i> + <?= $this->url->link(t('Add external link'), 'TaskExternalLink', 'find', array('task_id' => $task['id'], 'project_id' => $task['project_id']), false, 'popover') ?> + </li> + <li> + <i class="fa fa-comment-o fa-fw"></i> + <?= $this->url->link(t('Add a comment'), 'comment', 'create', array('task_id' => $task['id'], 'project_id' => $task['project_id']), false, 'popover') ?> + </li> + <li> + <i class="fa fa-file fa-fw"></i> + <?= $this->url->link(t('Attach a document'), 'TaskFile', 'create', array('task_id' => $task['id'], 'project_id' => $task['project_id']), false, 'popover') ?> + </li> + <li> + <i class="fa fa-camera fa-fw"></i> + <?= $this->url->link(t('Add a screenshot'), 'TaskFile', 'screenshot', array('task_id' => $task['id'], 'project_id' => $task['project_id']), false, 'popover') ?> + </li> + <li> + <i class="fa fa-files-o fa-fw"></i> + <?= $this->url->link(t('Duplicate'), 'taskduplication', 'duplicate', array('task_id' => $task['id'], 'project_id' => $task['project_id']), false, 'popover') ?> + </li> + <li> + <i class="fa fa-clipboard fa-fw"></i> + <?= $this->url->link(t('Duplicate to another project'), 'taskduplication', 'copy', array('task_id' => $task['id'], 'project_id' => $task['project_id']), false, 'popover') ?> + </li> + <li> + <i class="fa fa-clone fa-fw"></i> + <?= $this->url->link(t('Move to another project'), 'taskduplication', 'move', array('task_id' => $task['id'], 'project_id' => $task['project_id']), false, 'popover') ?> + </li> + <li> + <?php if ($task['is_active'] == 1): ?> + <i class="fa fa-times fa-fw"></i> + <?= $this->url->link(t('Close this task'), 'taskstatus', 'close', array('task_id' => $task['id'], 'project_id' => $task['project_id']), false, 'popover') ?> + <?php else: ?> + <i class="fa fa-check-square-o fa-fw"></i> + <?= $this->url->link(t('Open this task'), 'taskstatus', 'open', array('task_id' => $task['id'], 'project_id' => $task['project_id']), false, 'popover') ?> + <?php endif ?> + </li> + <?php if ($this->task->canRemove($task)): ?> + <li> + <i class="fa fa-trash-o fa-fw"></i> + <?= $this->url->link(t('Remove'), 'task', 'remove', array('task_id' => $task['id'], 'project_id' => $task['project_id']), false, 'popover') ?> + </li> + <?php endif ?> + + <?= $this->hook->render('template:task:menu') ?> + </ul> +</div> +<?php endif ?> diff --git a/app/Template/task/public.php b/app/Template/task/public.php index e3105488..7edf097c 100644 --- a/app/Template/task/public.php +++ b/app/Template/task/public.php @@ -1,33 +1,34 @@ <section id="main" class="public-task"> - <?= $this->render('task/details', array('task' => $task, 'project' => $project, 'not_editable' => true)) ?> + <?= $this->render('task/details', array('task' => $task, 'project' => $project, 'editable' => false)) ?> <p class="pull-right"><?= $this->url->link(t('Back to the board'), 'board', 'readonly', array('token' => $project['token'])) ?></p> <?= $this->render('task/description', array( 'task' => $task, 'project' => $project, - 'is_public' => true + 'is_public' => true, )) ?> <?= $this->render('tasklink/show', array( 'task' => $task, 'links' => $links, 'project' => $project, - 'not_editable' => true + 'editable' => false, + 'is_public' => true, )) ?> <?= $this->render('subtask/show', array( 'task' => $task, 'subtasks' => $subtasks, - 'not_editable' => true + 'editable' => false )) ?> <?= $this->render('task/comments', array( 'task' => $task, 'comments' => $comments, 'project' => $project, - 'not_editable' => true, + 'editable' => false, 'is_public' => true, )) ?> diff --git a/app/Template/task/remove.php b/app/Template/task/remove.php index 2f6edc22..e0d655fe 100644 --- a/app/Template/task/remove.php +++ b/app/Template/task/remove.php @@ -10,6 +10,6 @@ <div class="form-actions"> <?= $this->url->link(t('Yes'), 'task', 'remove', array('task_id' => $task['id'], 'project_id' => $task['project_id'], 'confirmation' => 'yes'), true, 'btn btn-red') ?> <?= t('or') ?> - <?= $this->url->link(t('cancel'), 'task', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?> + <?= $this->url->link(t('cancel'), 'task', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id']), false, 'close-popover') ?> </div> </div>
\ No newline at end of file diff --git a/app/Template/task/show.php b/app/Template/task/show.php index 68d63c58..0c77f576 100644 --- a/app/Template/task/show.php +++ b/app/Template/task/show.php @@ -1,15 +1,38 @@ <?= $this->render('task/details', array( 'task' => $task, 'project' => $project, - 'recurrence_trigger_list' => $this->task->recurrenceTriggers(), - 'recurrence_timeframe_list' => $this->task->recurrenceTimeframes(), - 'recurrence_basedate_list' => $this->task->recurrenceBasedates(), + 'editable' => $this->user->hasProjectAccess('taskmodification', 'edit', $project['id']), )) ?> -<?= $this->render('task_modification/edit_time', array('task' => $task, 'values' => $values, 'date_format' => $date_format, 'date_formats' => $date_formats)) ?> <?= $this->render('task/description', array('task' => $task)) ?> -<?= $this->render('tasklink/show', array('task' => $task, 'links' => $links, 'link_label_list' => $link_label_list)) ?> -<?= $this->render('subtask/show', array('task' => $task, 'subtasks' => $subtasks, 'project' => $project, 'users_list' => isset($users_list) ? $users_list : array())) ?> + +<?= $this->render('subtask/show', array( + 'task' => $task, + 'subtasks' => $subtasks, + 'project' => $project, + 'users_list' => isset($users_list) ? $users_list : array(), + 'editable' => true, +)) ?> + +<?= $this->render('tasklink/show', array( + 'task' => $task, + 'links' => $links, + 'link_label_list' => $link_label_list, + 'editable' => true, + 'is_public' => false, +)) ?> + <?= $this->render('task/time_tracking_summary', array('task' => $task)) ?> -<?= $this->render('file/show', array('task' => $task, 'files' => $files, 'images' => $images)) ?> -<?= $this->render('task/comments', array('task' => $task, 'comments' => $comments, 'project' => $project)) ?> + +<?= $this->render('task_file/show', array( + 'task' => $task, + 'files' => $files, + 'images' => $images +)) ?> + +<?= $this->render('task/comments', array( + 'task' => $task, + 'comments' => $comments, + 'project' => $project, + 'editable' => $this->user->hasProjectAccess('comment', 'edit', $project['id']), +)) ?> diff --git a/app/Template/task/sidebar.php b/app/Template/task/sidebar.php index 9ee1e7df..951c5095 100644 --- a/app/Template/task/sidebar.php +++ b/app/Template/task/sidebar.php @@ -1,76 +1,33 @@ <div class="sidebar"> - <h2><?= t('Information') ?></h2> + <h2><?= t('Task #%d', $task['id']) ?></h2> <ul> - <li <?= $this->app->getRouterController() === 'task' && $this->app->getRouterAction() === 'show' ? 'class="active"' : '' ?>> + <li <?= $this->app->checkMenuSelection('task', 'show') ?>> <?= $this->url->link(t('Summary'), 'task', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?> </li> - <li <?= $this->app->getRouterController() === 'activity' && $this->app->getRouterAction() === 'task' ? 'class="active"' : '' ?>> + <li <?= $this->app->checkMenuSelection('activity', 'task') ?>> <?= $this->url->link(t('Activity stream'), 'activity', 'task', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?> </li> - <li <?= $this->app->getRouterController() === 'task' && $this->app->getRouterAction() === 'transitions' ? 'class="active"' : '' ?>> + <li <?= $this->app->checkMenuSelection('task', 'transitions') ?>> <?= $this->url->link(t('Transitions'), 'task', 'transitions', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?> </li> - <li <?= $this->app->getRouterController() === 'task' && $this->app->getRouterAction() === 'analytics' ? 'class="active"' : '' ?>> + <li <?= $this->app->checkMenuSelection('task', 'analytics') ?>> <?= $this->url->link(t('Analytics'), 'task', 'analytics', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?> </li> <?php if ($task['time_estimated'] > 0 || $task['time_spent'] > 0): ?> - <li <?= $this->app->getRouterController() === 'task' && $this->app->getRouterAction() === 'timetracking' ? 'class="active"' : '' ?>> + <li <?= $this->app->checkMenuSelection('task', 'timetracking') ?>> <?= $this->url->link(t('Time tracking'), 'task', 'timetracking', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?> </li> <?php endif ?> - - <?= $this->hook->render('template:task:sidebar:information') ?> - </ul> - <h2><?= t('Actions') ?></h2> - <ul> - <li <?= $this->app->getRouterController() === 'taskmodification' && $this->app->getRouterAction() === 'edit' ? 'class="active"' : '' ?>> - <?= $this->url->link(t('Edit the task'), 'taskmodification', 'edit', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?> - </li> - <li <?= $this->app->getRouterController() === 'taskmodification' && $this->app->getRouterAction() === 'description' ? 'class="active"' : '' ?>> - <?= $this->url->link(t('Edit the description'), 'taskmodification', 'description', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?> - </li> - <li <?= $this->app->getRouterController() === 'taskmodification' && $this->app->getRouterAction() === 'recurrence' ? 'class="active"' : '' ?>> - <?= $this->url->link(t('Edit recurrence'), 'taskmodification', 'recurrence', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?> - </li> - <li <?= $this->app->getRouterController() === 'subtask' && $this->app->getRouterAction() === 'create' ? 'class="active"' : '' ?>> - <?= $this->url->link(t('Add a sub-task'), 'subtask', 'create', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?> - </li> - <li <?= $this->app->getRouterController() === 'tasklink' && $this->app->getRouterAction() === 'create' ? 'class="active"' : '' ?>> - <?= $this->url->link(t('Add a link'), 'tasklink', 'create', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?> + <li <?= $this->app->checkMenuSelection('subtask', 'show') ?>> + <?= $this->url->link(t('Sub-tasks'), 'subtask', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?> </li> - <li <?= $this->app->getRouterController() === 'comment' && $this->app->getRouterAction() === 'create' ? 'class="active"' : '' ?>> - <?= $this->url->link(t('Add a comment'), 'comment', 'create', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?> + <li <?= $this->app->checkMenuSelection('tasklink', 'show') ?>> + <?= $this->url->link(t('Internal links'), 'tasklink', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?> </li> - <li <?= $this->app->getRouterController() === 'file' && $this->app->getRouterAction() === 'create' ? 'class="active"' : '' ?>> - <?= $this->url->link(t('Attach a document'), 'file', 'create', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?> + <li <?= $this->app->checkMenuSelection('TaskExternalLink', 'show') ?>> + <?= $this->url->link(t('External links'), 'TaskExternalLink', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?> </li> - <li <?= $this->app->getRouterController() === 'file' && $this->app->getRouterAction() === 'screenshot' ? 'class="active"' : '' ?>> - <?= $this->url->link(t('Add a screenshot'), 'file', 'screenshot', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?> - </li> - <li <?= $this->app->getRouterController() === 'taskduplication' && $this->app->getRouterAction() === 'duplicate' ? 'class="active"' : '' ?>> - <?= $this->url->link(t('Duplicate'), 'taskduplication', 'duplicate', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?> - </li> - <li <?= $this->app->getRouterController() === 'taskduplication' && $this->app->getRouterAction() === 'copy' ? 'class="active"' : '' ?>> - <?= $this->url->link(t('Duplicate to another project'), 'taskduplication', 'copy', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?> - </li> - <li <?= $this->app->getRouterController() === 'taskduplication' && $this->app->getRouterAction() === 'move' ? 'class="active"' : '' ?>> - <?= $this->url->link(t('Move to another project'), 'taskduplication', 'move', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?> - </li> - <li <?= $this->app->getRouterController() === 'taskstatus' ? 'class="active"' : '' ?>> - <?php if ($task['is_active'] == 1): ?> - <?= $this->url->link(t('Close this task'), 'taskstatus', 'close', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?> - <?php else: ?> - <?= $this->url->link(t('Open this task'), 'taskstatus', 'open', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?> - <?php endif ?> - </li> - <?php if ($this->task->canRemove($task)): ?> - <li <?= $this->app->getRouterController() === 'task' && $this->app->getRouterAction() === 'remove' ? 'class="active"' : '' ?>> - <?= $this->url->link(t('Remove'), 'task', 'remove', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?> - </li> - <?php endif ?> - <?= $this->hook->render('template:task:sidebar:actions') ?> + <?= $this->hook->render('template:task:sidebar', array('task' => $task)) ?> </ul> - <div class="sidebar-collapse"><a href="#" title="<?= t('Hide sidebar') ?>"><i class="fa fa-chevron-left"></i></a></div> - <div class="sidebar-expand" style="display: none"><a href="#" title="<?= t('Expand sidebar') ?>"><i class="fa fa-chevron-right"></i></a></div> </div> diff --git a/app/Template/task/time_tracking_details.php b/app/Template/task/time_tracking_details.php index faa07cb8..147c5109 100644 --- a/app/Template/task/time_tracking_details.php +++ b/app/Template/task/time_tracking_details.php @@ -10,14 +10,14 @@ <th><?= $subtask_paginator->order(t('Subtask'), 'subtask_title') ?></th> <th class="column-20"><?= $subtask_paginator->order(t('Start'), 'start') ?></th> <th class="column-20"><?= $subtask_paginator->order(t('End'), 'end') ?></th> - <th class="column-10"><?= $subtask_paginator->order(t('Time spent'), 'time_spent') ?></th> + <th class="column-10"><?= $subtask_paginator->order(t('Time spent'), \Kanboard\Model\SubtaskTimeTracking::TABLE.'.time_spent') ?></th> </tr> <?php foreach ($subtask_paginator->getCollection() as $record): ?> <tr> <td><?= $this->url->link($this->e($record['user_fullname'] ?: $record['username']), 'user', 'show', array('user_id' => $record['user_id'])) ?></td> <td><?= t($record['subtask_title']) ?></td> - <td><?= dt('%B %e, %Y at %k:%M %p', $record['start']) ?></td> - <td><?= dt('%B %e, %Y at %k:%M %p', $record['end']) ?></td> + <td><?= $this->dt->datetime($record['start']) ?></td> + <td><?= $this->dt->datetime($record['end']) ?></td> <td><?= n($record['time_spent']).' '.t('hours') ?></td> </tr> <?php endforeach ?> diff --git a/app/Template/task/transitions.php b/app/Template/task/transitions.php index 2ca2387f..d79c2fd9 100644 --- a/app/Template/task/transitions.php +++ b/app/Template/task/transitions.php @@ -15,7 +15,7 @@ </tr> <?php foreach ($transitions as $transition): ?> <tr> - <td><?= dt('%B %e, %Y at %k:%M %p', $transition['date']) ?></td> + <td><?= $this->dt->datetime($transition['date']) ?></td> <td><?= $this->e($transition['src_column']) ?></td> <td><?= $this->e($transition['dst_column']) ?></td> <td><?= $this->url->link($this->e($transition['name'] ?: $transition['username']), 'user', 'show', array('user_id' => $transition['user_id'])) ?></td> diff --git a/app/Template/task_creation/form.php b/app/Template/task_creation/form.php index 325ca1c8..84f74c36 100644 --- a/app/Template/task_creation/form.php +++ b/app/Template/task_creation/form.php @@ -1,28 +1,29 @@ -<?php if (! $ajax): ?> -<div class="page-header"> - <ul> - <li><i class="fa fa-th fa-fw"></i><?= $this->url->link(t('Back to the board'), 'board', 'show', array('project_id' => $values['project_id'])) ?></li> - </ul> -</div> -<?php else: ?> <div class="page-header"> <h2><?= t('New task') ?></h2> </div> -<?php endif ?> -<form id="task-form" method="post" action="<?= $this->url->href('taskcreation', 'save', array('project_id' => $values['project_id'])) ?>" autocomplete="off"> +<form class="popover-form" method="post" action="<?= $this->url->href('taskcreation', 'save', array('project_id' => $values['project_id'])) ?>" autocomplete="off"> <?= $this->form->csrf() ?> <div class="form-column"> <?= $this->form->label(t('Title'), 'title') ?> - <?= $this->form->text('title', $values, $errors, array('autofocus', 'required', 'maxlength="200"', 'tabindex="1"'), 'form-input-large') ?><br/> + <?= $this->form->text('title', $values, $errors, array('autofocus', 'required', 'maxlength="200"', 'tabindex="1"'), 'form-input-large') ?> <?= $this->form->label(t('Description'), 'description') ?> <div class="form-tabs"> <div class="write-area"> - <?= $this->form->textarea('description', $values, $errors, array('placeholder="'.t('Leave a description').'"', 'tabindex="2"')) ?> + <?= $this->form->textarea( + 'description', + $values, + $errors, + array( + 'placeholder="'.t('Leave a description').'"', + 'tabindex="2"', + 'data-mention-search-url="'.$this->url->href('UserHelper', 'mention', array('project_id' => $values['project_id'])).'"' + ) + ) ?> </div> <div class="preview-area"> <div class="markdown"></div> @@ -46,34 +47,20 @@ <div class="form-column"> <?= $this->form->hidden('project_id', $values) ?> - - <?= $this->form->label(t('Assignee'), 'owner_id') ?> - <?= $this->form->select('owner_id', $users_list, $values, $errors, array('tabindex="3"')) ?><br/> - - <?= $this->form->label(t('Category'), 'category_id') ?> - <?= $this->form->select('category_id', $categories_list, $values, $errors, array('tabindex="4"')) ?><br/> - - <?php if (! (count($swimlanes_list) === 1 && key($swimlanes_list) === 0)): ?> - <?= $this->form->label(t('Swimlane'), 'swimlane_id') ?> - <?= $this->form->select('swimlane_id', $swimlanes_list, $values, $errors, array('tabindex="5"')) ?><br/> - <?php endif ?> - - <?= $this->form->label(t('Column'), 'column_id') ?> - <?= $this->form->select('column_id', $columns_list, $values, $errors, array('tabindex="6"')) ?><br/> - - <?= $this->form->label(t('Complexity'), 'score') ?> - <?= $this->form->number('score', $values, $errors, array('tabindex="8"')) ?><br/> - - <?= $this->form->label(t('Original estimate'), 'time_estimated') ?> - <?= $this->form->numeric('time_estimated', $values, $errors, array('tabindex="9"')) ?> <?= t('hours') ?><br/> - - <?= $this->form->label(t('Due Date'), 'date_due') ?> - <?= $this->form->text('date_due', $values, $errors, array('placeholder="'.$this->text->in($date_format, $date_formats).'"', 'tabindex="10"'), 'form-date') ?><br/> - <div class="form-help"><?= t('Others formats accepted: %s and %s', date('Y-m-d'), date('Y_m_d')) ?></div> + <?= $this->task->selectAssignee($users_list, $values, $errors) ?> + <?= $this->task->selectCategory($categories_list, $values, $errors) ?> + <?= $this->task->selectSwimlane($swimlanes_list, $values, $errors) ?> + <?= $this->task->selectColumn($columns_list, $values, $errors) ?> + <?= $this->task->selectPriority($project, $values) ?> + <?= $this->task->selectScore($values, $errors) ?> + <?= $this->task->selectTimeEstimated($values, $errors) ?> + <?= $this->task->selectDueDate($values, $errors) ?> + + <?= $this->hook->render('template:task:form:right-column', array('values'=>$values, 'errors'=>$errors)) ?> </div> <div class="form-actions"> - <input type="submit" value="<?= t('Save') ?>" class="btn btn-blue" tabindex="11"/> + <input type="submit" value="<?= t('Save') ?>" class="btn btn-blue" tabindex="12"/> <?= t('or') ?> <?= $this->url->link(t('cancel'), 'board', 'show', array('project_id' => $values['project_id']), false, 'close-popover') ?> </div> </form>
\ No newline at end of file diff --git a/app/Template/task_duplication/copy.php b/app/Template/task_duplication/copy.php index 415b8610..fe2c599a 100644 --- a/app/Template/task_duplication/copy.php +++ b/app/Template/task_duplication/copy.php @@ -6,7 +6,7 @@ <p class="alert"><?= t('There is no destination project available.') ?></p> <?php else: ?> - <form method="post" action="<?= $this->url->href('taskduplication', 'copy', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?>" autocomplete="off"> + <form class="popover-form" method="post" action="<?= $this->url->href('taskduplication', 'copy', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?>" autocomplete="off"> <?= $this->form->csrf() ?> <?= $this->form->hidden('id', $values) ?> @@ -39,9 +39,9 @@ <p class="form-help"><?= t('Current assignee: %s', ($task['assignee_name'] ?: $task['assignee_username']) ?: e('not assigned')) ?></p> <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') ?> - <?= $this->url->link(t('cancel'), 'task', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?> + <?= $this->url->link(t('cancel'), 'task', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id']), false, 'close-popover') ?> </div> </form> diff --git a/app/Template/task_duplication/duplicate.php b/app/Template/task_duplication/duplicate.php index 4b50d9ca..376f6b3b 100644 --- a/app/Template/task_duplication/duplicate.php +++ b/app/Template/task_duplication/duplicate.php @@ -10,6 +10,6 @@ <div class="form-actions"> <?= $this->url->link(t('Yes'), 'taskduplication', 'duplicate', array('task_id' => $task['id'], 'project_id' => $task['project_id'], 'confirmation' => 'yes'), true, 'btn btn-red') ?> <?= t('or') ?> - <?= $this->url->link(t('cancel'), 'task', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?> + <?= $this->url->link(t('cancel'), 'task', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id']), false, 'close-popover') ?> </div> </div>
\ No newline at end of file diff --git a/app/Template/task_duplication/move.php b/app/Template/task_duplication/move.php index d8d1ba05..8ab81f5b 100644 --- a/app/Template/task_duplication/move.php +++ b/app/Template/task_duplication/move.php @@ -6,7 +6,7 @@ <p class="alert"><?= t('There is no destination project available.') ?></p> <?php else: ?> - <form method="post" action="<?= $this->url->href('taskduplication', 'move', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?>" autocomplete="off"> + <form class="popover-form" method="post" action="<?= $this->url->href('taskduplication', 'move', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?>" autocomplete="off"> <?= $this->form->csrf() ?> <?= $this->form->hidden('id', $values) ?> @@ -39,9 +39,9 @@ <p class="form-help"><?= t('Current assignee: %s', ($task['assignee_name'] ?: $task['assignee_username']) ?: e('not assigned')) ?></p> <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') ?> - <?= $this->url->link(t('cancel'), 'task', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?> + <?= $this->url->link(t('cancel'), 'task', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id']), false, 'close-popover') ?> </div> </form> diff --git a/app/Template/task_external_link/create.php b/app/Template/task_external_link/create.php new file mode 100644 index 00000000..b62abdb2 --- /dev/null +++ b/app/Template/task_external_link/create.php @@ -0,0 +1,13 @@ +<div class="page-header"> + <h2><?= t('Add a new external link') ?></h2> +</div> + +<form class="popover-form" action="<?= $this->url->href('TaskExternalLink', 'save', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?>" method="post" autocomplete="off"> + <?= $this->render('task_external_link/form', array('task' => $task, 'dependencies' => $dependencies, 'values' => $values, 'errors' => $errors)) ?> + + <div class="form-actions"> + <input type="submit" value="<?= t('Save') ?>" class="btn btn-blue"> + <?= t('or') ?> + <?= $this->url->link(t('cancel'), 'TaskExternalLink', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id']), false, 'close-popover') ?> + </div> +</form>
\ No newline at end of file diff --git a/app/Template/task_external_link/edit.php b/app/Template/task_external_link/edit.php new file mode 100644 index 00000000..8caaaebe --- /dev/null +++ b/app/Template/task_external_link/edit.php @@ -0,0 +1,13 @@ +<div class="page-header"> + <h2><?= t('Edit external link') ?></h2> +</div> + +<form class="popover-form" action="<?= $this->url->href('TaskExternalLink', 'update', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?>" method="post" autocomplete="off"> + <?= $this->render('task_external_link/form', array('task' => $task, 'dependencies' => $dependencies, 'values' => $values, 'errors' => $errors)) ?> + + <div class="form-actions"> + <input type="submit" value="<?= t('Save') ?>" class="btn btn-blue"> + <?= t('or') ?> + <?= $this->url->link(t('cancel'), 'TaskExternalLink', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id']), false, 'close-popover') ?> + </div> +</form>
\ No newline at end of file diff --git a/app/Template/task_external_link/find.php b/app/Template/task_external_link/find.php new file mode 100644 index 00000000..36a031d3 --- /dev/null +++ b/app/Template/task_external_link/find.php @@ -0,0 +1,28 @@ +<div class="page-header"> + <h2><?= t('Add a new external link') ?></h2> +</div> + +<form class="popover-form" action="<?= $this->url->href('TaskExternalLink', 'create', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?>" method="post" autocomplete="off"> + <?= $this->form->csrf() ?> + <?= $this->form->hidden('task_id', array('task_id' => $task['id'])) ?> + + <?= $this->form->label(t('External link'), 'text') ?> + <?= $this->form->text( + 'text', + $values, + $errors, + array( + 'required', + 'autofocus', + 'placeholder="'.t('Copy and paste your link here...').'"', + )) ?> + + <?= $this->form->label(t('Link type'), 'type') ?> + <?= $this->form->select('type', $types, $values) ?> + + <div class="form-actions"> + <input type="submit" value="<?= t('Next') ?>" class="btn btn-blue"/> + <?= t('or') ?> + <?= $this->url->link(t('cancel'), 'task', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id']), false, 'close-popover') ?> + </div> +</form>
\ No newline at end of file diff --git a/app/Template/task_external_link/form.php b/app/Template/task_external_link/form.php new file mode 100644 index 00000000..932ca521 --- /dev/null +++ b/app/Template/task_external_link/form.php @@ -0,0 +1,13 @@ +<?= $this->form->csrf() ?> +<?= $this->form->hidden('task_id', array('task_id' => $task['id'])) ?> +<?= $this->form->hidden('id', $values) ?> +<?= $this->form->hidden('link_type', $values) ?> + +<?= $this->form->label(t('URL'), 'url') ?> +<?= $this->form->text('url', $values, $errors, array('required')) ?> + +<?= $this->form->label(t('Title'), 'title') ?> +<?= $this->form->text('title', $values, $errors, array('required')) ?> + +<?= $this->form->label(t('Dependency'), 'dependency') ?> +<?= $this->form->select('dependency', $dependencies, $values, $errors) ?> diff --git a/app/Template/task_external_link/remove.php b/app/Template/task_external_link/remove.php new file mode 100644 index 00000000..01535255 --- /dev/null +++ b/app/Template/task_external_link/remove.php @@ -0,0 +1,15 @@ +<div class="page-header"> + <h2><?= t('Remove a link') ?></h2> +</div> + +<div class="confirm"> + <p class="alert alert-info"> + <?= t('Do you really want to remove this link: "%s"?', $link['title']) ?> + </p> + + <div class="form-actions"> + <?= $this->url->link(t('Yes'), 'TaskExternalLink', 'remove', array('link_id' => $link['id'], 'task_id' => $task['id'], 'project_id' => $task['project_id']), true, 'btn btn-red') ?> + <?= t('or') ?> + <?= $this->url->link(t('cancel'), 'TaskExternalLink', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id']), false, 'close-popover') ?> + </div> +</div>
\ No newline at end of file diff --git a/app/Template/task_external_link/show.php b/app/Template/task_external_link/show.php new file mode 100644 index 00000000..12d8e4f6 --- /dev/null +++ b/app/Template/task_external_link/show.php @@ -0,0 +1,50 @@ +<div class="page-header"> + <h2><?= t('External links') ?></h2> +</div> + +<?php if (empty($links)): ?> + <p class="alert"><?= t('There is no external link for the moment.') ?></p> +<?php else: ?> + <table class="table-stripped table-small"> + <tr> + <th class="column-10"><?= t('Type') ?></th> + <th><?= t('Title') ?></th> + <th class="column-10"><?= t('Dependency') ?></th> + <th class="column-15"><?= t('Creator') ?></th> + <th class="column-15"><?= t('Date') ?></th> + <?php if ($this->user->hasProjectAccess('TaskExternalLink', 'edit', $task['project_id'])): ?> + <th class="column-5"><?= t('Action') ?></th> + <?php endif ?> + </tr> + <?php foreach ($links as $link): ?> + <tr> + <td> + <?= $link['type'] ?> + </td> + <td> + <a href="<?= $link['url'] ?>" target="_blank"><?= $this->e($link['title']) ?></a> + </td> + <td> + <?= $this->e($link['dependency_label']) ?> + </td> + <td> + <?= $this->e($link['creator_name'] ?: $link['creator_username']) ?> + </td> + <td> + <?= $this->dt->date($link['date_creation']) ?> + </td> + <?php if ($this->user->hasProjectAccess('TaskExternalLink', 'edit', $task['project_id'])): ?> + <td> + <div class="dropdown"> + <a href="#" class="dropdown-menu dropdown-menu-link-icon"><i class="fa fa-cog fa-fw"></i><i class="fa fa-caret-down"></i></a> + <ul> + <li><?= $this->url->link(t('Edit'), 'TaskExternalLink', 'edit', array('link_id' => $link['id'], 'task_id' => $task['id'], 'project_id' => $task['project_id']), false, 'popover') ?></li> + <li><?= $this->url->link(t('Remove'), 'TaskExternalLink', 'confirm', array('link_id' => $link['id'], 'task_id' => $task['id'], 'project_id' => $task['project_id']), false, 'popover') ?></li> + </ul> + </div> + </td> + <?php endif ?> + </tr> + <?php endforeach ?> + </table> +<?php endif ?> diff --git a/app/Template/task_file/create.php b/app/Template/task_file/create.php new file mode 100644 index 00000000..f03ce8dc --- /dev/null +++ b/app/Template/task_file/create.php @@ -0,0 +1,33 @@ +<div class="page-header"> + <h2><?= t('Attach a document') ?></h2> +</div> +<div id="file-done" style="display:none"> + <p class="alert alert-success"> + <?= t('All files have been uploaded successfully.') ?> + <?= $this->url->link(t('View uploaded files'), 'task', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?> + </p> +</div> + +<div id="file-error-max-size" style="display:none"> + <p class="alert alert-error"> + <?= t('The maximum allowed file size is %sB.', $this->text->bytes($max_size)) ?> + <a href="#" id="file-browser"><?= t('Choose files again') ?></a> + </p> +</div> + +<div + id="file-dropzone" + data-max-size="<?= $max_size ?>" + data-url="<?= $this->url->href('TaskFile', 'save', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?>"> + <div id="file-dropzone-inner"> + <?= t('Drag and drop your files here') ?> <?= t('or') ?> <a href="#" id="file-browser"><?= t('choose files') ?></a> + </div> +</div> + +<input type="file" name="files[]" multiple style="display:none" id="file-form-element"> + +<div class="form-actions"> + <input type="submit" value="<?= t('Save') ?>" class="btn btn-blue" id="file-upload-button" disabled> + <?= t('or') ?> + <?= $this->url->link(t('cancel'), 'task', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id']), false, 'close-popover') ?> +</div> diff --git a/app/Template/file/remove.php b/app/Template/task_file/remove.php index 37f648eb..5e6c83f2 100644 --- a/app/Template/file/remove.php +++ b/app/Template/task_file/remove.php @@ -8,8 +8,8 @@ </p> <div class="form-actions"> - <?= $this->url->link(t('Yes'), 'file', 'remove', array('task_id' => $task['id'], 'project_id' => $task['project_id'], 'file_id' => $file['id']), true, 'btn btn-red') ?> + <?= $this->url->link(t('Yes'), 'TaskFile', 'remove', array('task_id' => $task['id'], 'project_id' => $task['project_id'], 'file_id' => $file['id']), true, 'btn btn-red') ?> <?= t('or') ?> - <?= $this->url->link(t('cancel'), 'task', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?> + <?= $this->url->link(t('cancel'), 'task', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id']), false, 'close-popover') ?> </div> </div>
\ No newline at end of file diff --git a/app/Template/file/screenshot.php b/app/Template/task_file/screenshot.php index 73b72eae..72214362 100644 --- a/app/Template/file/screenshot.php +++ b/app/Template/task_file/screenshot.php @@ -6,7 +6,7 @@ <p id="screenshot-inner"><?= t('Take a screenshot and press CTRL+V or ⌘+V to paste here.') ?></p> </div> -<form action="<?= $this->url->href('file', 'screenshot', array('task_id' => $task['id'], 'project_id' => $task['project_id'], 'redirect' => $redirect)) ?>" method="post"> +<form class="popover-form" action="<?= $this->url->href('TaskFile', 'screenshot', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?>" method="post"> <input type="hidden" name="screenshot"/> <?= $this->form->csrf() ?> <div class="form-actions"> diff --git a/app/Template/task_file/show.php b/app/Template/task_file/show.php new file mode 100644 index 00000000..c3f2bb98 --- /dev/null +++ b/app/Template/task_file/show.php @@ -0,0 +1,90 @@ +<?php if (! empty($files) || ! empty($images)): ?> +<div id="attachments" class="task-show-section"> + + <div class="page-header"> + <h2><?= t('Attachments') ?></h2> + </div> + <?php if (! empty($images)): ?> + <div class="file-thumbnails"> + <?php foreach ($images as $file): ?> + <div class="file-thumbnail"> + <a href="<?= $this->url->href('FileViewer', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id'], 'file_id' => $file['id'])) ?>" class="popover"><img src="<?= $this->url->href('FileViewer', 'thumbnail', array('file_id' => $file['id'], 'project_id' => $task['project_id'], 'task_id' => $file['task_id'])) ?>" title="<?= $this->e($file['name']) ?>" alt="<?= $this->e($file['name']) ?>"></a> + <div class="file-thumbnail-content"> + <div class="file-thumbnail-title"> + <div class="dropdown"> + <a href="#" class="dropdown-menu dropdown-menu-link-text"><?= $this->e($file['name']) ?> <i class="fa fa-caret-down"></i></a> + <ul> + <li> + <i class="fa fa-download fa-fw"></i> + <?= $this->url->link(t('Download'), 'FileViewer', 'download', array('task_id' => $task['id'], 'project_id' => $task['project_id'], 'file_id' => $file['id'])) ?> + </li> + <?php if ($this->user->hasProjectAccess('TaskFile', 'remove', $task['project_id'])): ?> + <li> + <i class="fa fa-trash fa-fw"></i> + <?= $this->url->link(t('Remove'), 'TaskFile', 'confirm', array('task_id' => $task['id'], 'project_id' => $task['project_id'], 'file_id' => $file['id']), false, 'popover') ?> + </li> + <?php endif ?> + </ul> + </div> + </div> + <div class="file-thumbnail-description"> + <span class="tooltip" title='<?= t('Uploaded: %s', $this->dt->datetime($file['date'])).'<br>'.t('Size: %s', $this->text->bytes($file['size'])) ?>'> + <i class="fa fa-info-circle"></i> + </span> + <?= t('Uploaded by %s', $file['user_name'] ?: $file['username']) ?> + </div> + </div> + </div> + <?php endforeach ?> + </div> + <?php endif ?> + + <?php if (! empty($files)): ?> + <table class="table-stripped"> + <tr> + <th><?= t('Filename') ?></th> + <th><?= t('Creator') ?></th> + <th><?= t('Date') ?></th> + <th><?= t('Size') ?></th> + </tr> + <?php foreach ($files as $file): ?> + <tr> + <td> + <i class="fa <?= $this->file->icon($file['name']) ?> fa-fw"></i> + <div class="dropdown"> + <a href="#" class="dropdown-menu dropdown-menu-link-text"><?= $this->e($file['name']) ?> <i class="fa fa-caret-down"></i></a> + <ul> + <?php if ($this->file->getPreviewType($file['name']) !== null): ?> + <li> + <i class="fa fa-eye fa-fw"></i> + <?= $this->url->link(t('View file'), 'FileViewer', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id'], 'file_id' => $file['id']), false, 'popover') ?> + </li> + <?php endif ?> + <li> + <i class="fa fa-download fa-fw"></i> + <?= $this->url->link(t('Download'), 'FileViewer', 'download', array('task_id' => $task['id'], 'project_id' => $task['project_id'], 'file_id' => $file['id'])) ?> + </li> + <?php if ($this->user->hasProjectAccess('TaskFile', 'remove', $task['project_id'])): ?> + <li> + <i class="fa fa-trash fa-fw"></i> + <?= $this->url->link(t('Remove'), 'TaskFile', 'confirm', array('task_id' => $task['id'], 'project_id' => $task['project_id'], 'file_id' => $file['id']), false, 'popover') ?> + </li> + <?php endif ?> + </ul> + </div> + </td> + <td> + <?= $this->e($file['user_name'] ?: $file['username']) ?> + </td> + <td> + <?= $this->dt->date($file['date']) ?> + </td> + <td> + <?= $this->text->bytes($file['size']) ?> + </td> + </tr> + <?php endforeach ?> + </table> + <?php endif ?> +</div> +<?php endif ?>
\ No newline at end of file diff --git a/app/Template/task_modification/edit_description.php b/app/Template/task_modification/edit_description.php index 4cae939c..f5a9b0e1 100644 --- a/app/Template/task_modification/edit_description.php +++ b/app/Template/task_modification/edit_description.php @@ -2,7 +2,7 @@ <h2><?= t('Edit the description') ?></h2> </div> -<form method="post" action="<?= $this->url->href('taskmodification', 'description', array('task_id' => $task['id'], 'project_id' => $task['project_id'], 'ajax' => $ajax)) ?>" autocomplete="off"> +<form class="popover-form" method="post" action="<?= $this->url->href('taskmodification', 'updateDescription', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?>" autocomplete="off"> <?= $this->form->csrf() ?> <?= $this->form->hidden('id', $values) ?> @@ -17,7 +17,17 @@ </li> </ul> <div class="write-area"> - <?= $this->form->textarea('description', $values, $errors, array('autofocus', 'placeholder="'.t('Leave a description').'"'), 'task-show-description-textarea') ?> + <?= $this->form->textarea( + 'description', + $values, + $errors, + array( + 'autofocus', + 'placeholder="'.t('Leave a description').'"', + 'data-mention-search-url="'.$this->url->href('UserHelper', 'mention', array('project_id' => $task['project_id'])).'"' + ), + 'task-show-description-textarea' + ) ?> </div> <div class="preview-area"> <div class="markdown"></div> @@ -29,10 +39,6 @@ <div class="form-actions"> <input type="submit" value="<?= t('Save') ?>" class="btn btn-blue"/> <?= t('or') ?> - <?php if ($ajax): ?> - <?= $this->url->link(t('cancel'), 'board', 'show', array('project_id' => $task['project_id'])) ?> - <?php else: ?> - <?= $this->url->link(t('cancel'), 'task', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?> - <?php endif ?> + <?= $this->url->link(t('cancel'), 'task', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id']), false, 'close-popover') ?> </div> </form> diff --git a/app/Template/task_modification/edit_task.php b/app/Template/task_modification/edit_task.php index f4d7449a..9e98ad5e 100644 --- a/app/Template/task_modification/edit_task.php +++ b/app/Template/task_modification/edit_task.php @@ -1,61 +1,35 @@ <div class="page-header"> <h2><?= t('Edit a task') ?></h2> </div> -<form id="task-form" method="post" action="<?= $this->url->href('taskmodification', 'update', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?>" autocomplete="off"> +<form class="popover-form" method="post" action="<?= $this->url->href('taskmodification', 'update', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?>" autocomplete="off"> <?= $this->form->csrf() ?> + <?= $this->form->hidden('id', $values) ?> + <?= $this->form->hidden('project_id', $values) ?> <div class="form-column"> - <?= $this->form->label(t('Title'), 'title') ?> - <?= $this->form->text('title', $values, $errors, array('autofocus', 'required', 'maxlength="200"', 'tabindex="1"')) ?><br/> - - <?= $this->form->label(t('Description'), 'description') ?> - <div class="form-tabs"> - <div class="write-area"> - <?= $this->form->textarea('description', $values, $errors, array('placeholder="'.t('Leave a description').'"', 'tabindex="2"')) ?> - </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> - - <?= $this->render('task/color_picker', array('colors_list' => $colors_list, 'values' => $values)) ?> + <?= $this->form->text('title', $values, $errors, array('autofocus', 'required', 'maxlength="200"', 'tabindex="1"')) ?> + <?= $this->task->selectAssignee($users_list, $values, $errors) ?> + <?= $this->task->selectCategory($categories_list, $values, $errors) ?> + <?= $this->task->selectPriority($project, $values) ?> + <?= $this->task->selectScore($values, $errors) ?> </div> <div class="form-column"> - <?= $this->form->hidden('id', $values) ?> - <?= $this->form->hidden('project_id', $values) ?> - - <?= $this->form->label(t('Assignee'), 'owner_id') ?> - <?= $this->form->select('owner_id', $users_list, $values, $errors, array('tabindex="3"')) ?><br/> - - <?= $this->form->label(t('Category'), 'category_id') ?> - <?= $this->form->select('category_id', $categories_list, $values, $errors, array('tabindex="4"')) ?><br/> - - <?= $this->form->label(t('Complexity'), 'score') ?> - <?= $this->form->number('score', $values, $errors, array('tabindex="6"')) ?><br/> + <?= $this->task->selectTimeEstimated($values, $errors) ?> + <?= $this->task->selectTimeSpent($values, $errors) ?> + <?= $this->task->selectStartDate($values, $errors) ?> + <?= $this->task->selectDueDate($values, $errors) ?> + </div> - <?= $this->form->label(t('Due Date'), 'date_due') ?> - <?= $this->form->text('date_due', $values, $errors, array('placeholder="'.$this->text->in($date_format, $date_formats).'"', 'tabindex="7"'), 'form-date') ?><br/> - <div class="form-help"><?= t('Others formats accepted: %s and %s', date('Y-m-d'), date('Y_m_d')) ?></div> + <div class="form-clear"> + <?= $this->render('task/color_picker', array('colors_list' => $colors_list, 'values' => $values)) ?> </div> <div class="form-actions"> <input type="submit" value="<?= t('Save') ?>" class="btn btn-blue" tabindex="10"> <?= t('or') ?> - <?php if ($ajax): ?> - <?= $this->url->link(t('cancel'), 'board', 'show', array('project_id' => $task['project_id']), false, 'close-popover') ?> - <?php else: ?> - <?= $this->url->link(t('cancel'), 'task', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?> - <?php endif ?> + <?= $this->url->link(t('cancel'), 'task', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id']), false, 'close-popover') ?> </div> </form>
\ No newline at end of file diff --git a/app/Template/task_modification/edit_time.php b/app/Template/task_modification/edit_time.php deleted file mode 100644 index 8e7f9b42..00000000 --- a/app/Template/task_modification/edit_time.php +++ /dev/null @@ -1,20 +0,0 @@ -<form method="post" action="<?= $this->url->href('taskmodification', 'time', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?>" class="form-inline task-time-form" autocomplete="off"> - - <?php if (empty($values['date_started'])): ?> - <?= $this->url->link('<i class="fa fa-play"></i>', 'taskmodification', 'start', array('task_id' => $task['id'], 'project_id' => $task['project_id']), false, 'task-show-start-link', t('Set automatically the start date')) ?> - <?php endif ?> - - <?= $this->form->csrf() ?> - <?= $this->form->hidden('id', $values) ?> - - <?= $this->form->label(t('Start date'), 'date_started') ?> - <?= $this->form->text('date_started', $values, array(), array('placeholder="'.$this->text->in($date_format, $date_formats).'"'), 'form-datetime') ?> - - <?= $this->form->label(t('Time estimated'), 'time_estimated') ?> - <?= $this->form->numeric('time_estimated', $values, array(), array('placeholder="'.t('hours').'"')) ?> - - <?= $this->form->label(t('Time spent'), 'time_spent') ?> - <?= $this->form->numeric('time_spent', $values, array(), array('placeholder="'.t('hours').'"')) ?> - - <input type="submit" value="<?= t('Save') ?>" class="btn btn-blue"/> -</form>
\ No newline at end of file diff --git a/app/Template/task_modification/edit_recurrence.php b/app/Template/task_recurrence/edit.php index dc4faa7a..ce69aade 100644 --- a/app/Template/task_modification/edit_recurrence.php +++ b/app/Template/task_recurrence/edit.php @@ -4,7 +4,7 @@ <?php if ($task['recurrence_status'] != \Kanboard\Model\Task::RECURRING_STATUS_NONE): ?> <div class="listing"> - <?= $this->render('task/recurring_info', array( + <?= $this->render('task_recurrence/info', array( 'task' => $task, 'recurrence_trigger_list' => $recurrence_trigger_list, 'recurrence_timeframe_list' => $recurrence_timeframe_list, @@ -15,7 +15,7 @@ <?php if ($task['recurrence_status'] != \Kanboard\Model\Task::RECURRING_STATUS_PROCESSED): ?> - <form method="post" action="<?= $this->url->href('taskmodification', 'recurrence', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?>" autocomplete="off"> + <form class="popover-form" method="post" action="<?= $this->url->href('TaskRecurrence', 'update', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?>" autocomplete="off"> <?= $this->form->csrf() ?> @@ -38,9 +38,9 @@ <?= $this->form->select('recurrence_basedate', $recurrence_basedate_list, $values, $errors) ?> <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') ?> - <?= $this->url->link(t('cancel'), 'task', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?> + <?= $this->url->link(t('cancel'), 'task', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id']), false, 'close-popover') ?> </div> </form> diff --git a/app/Template/task/recurring_info.php b/app/Template/task_recurrence/info.php index 83ca0960..83ca0960 100644 --- a/app/Template/task/recurring_info.php +++ b/app/Template/task_recurrence/info.php diff --git a/app/Template/task_status/close.php b/app/Template/task_status/close.php index d32863bd..7d200544 100644 --- a/app/Template/task_status/close.php +++ b/app/Template/task_status/close.php @@ -8,7 +8,7 @@ </p> <div class="form-actions"> - <?= $this->url->link(t('Yes'), 'taskstatus', 'close', array('task_id' => $task['id'], 'project_id' => $task['project_id'], 'confirmation' => 'yes', 'redirect' => $redirect), true, 'btn btn-red') ?> + <?= $this->url->link(t('Yes'), 'taskstatus', 'close', array('task_id' => $task['id'], 'project_id' => $task['project_id'], 'confirmation' => 'yes'), true, 'btn btn-red popover-link') ?> <?= t('or') ?> <?= $this->url->link(t('cancel'), 'task', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id']), false, 'close-popover') ?> </div> diff --git a/app/Template/task_status/open.php b/app/Template/task_status/open.php index 615b2464..5d19bfbe 100644 --- a/app/Template/task_status/open.php +++ b/app/Template/task_status/open.php @@ -8,7 +8,7 @@ </p> <div class="form-actions"> - <?= $this->url->link(t('Yes'), 'taskstatus', 'open', array('task_id' => $task['id'], 'project_id' => $task['project_id'], 'confirmation' => 'yes', 'redirect' => $redirect), true, 'btn btn-red') ?> + <?= $this->url->link(t('Yes'), 'taskstatus', 'open', array('task_id' => $task['id'], 'project_id' => $task['project_id'], 'confirmation' => 'yes'), true, 'btn btn-red popover-link') ?> <?= t('or') ?> <?= $this->url->link(t('cancel'), 'task', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id']), false, 'close-popover') ?> </div> diff --git a/app/Template/tasklink/create.php b/app/Template/tasklink/create.php index 749f2968..c0d49191 100644 --- a/app/Template/tasklink/create.php +++ b/app/Template/tasklink/create.php @@ -2,7 +2,7 @@ <h2><?= t('Add a new link') ?></h2> </div> -<form action="<?= $this->url->href('tasklink', 'save', array('task_id' => $task['id'], 'project_id' => $task['project_id'], 'ajax' => isset($ajax))) ?>" method="post" autocomplete="off"> +<form class="popover-form" action="<?= $this->url->href('tasklink', 'save', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?>" method="post" autocomplete="off"> <?= $this->form->csrf() ?> <?= $this->form->hidden('task_id', array('task_id' => $task['id'])) ?> @@ -21,17 +21,13 @@ 'placeholder="'.t('Start to type task title...').'"', 'title="'.t('Start to type task title...').'"', 'data-dst-field="opposite_task_id"', - 'data-search-url="'.$this->url->href('app', 'autocomplete', array('exclude_task_id' => $task['id'])).'"', + 'data-search-url="'.$this->url->href('TaskHelper', 'autocomplete', array('exclude_task_id' => $task['id'])).'"', ), - 'task-autocomplete') ?> + 'autocomplete') ?> <div class="form-actions"> <input type="submit" value="<?= t('Save') ?>" class="btn btn-blue"/> <?= t('or') ?> - <?php if (isset($ajax)): ?> - <?= $this->url->link(t('cancel'), 'board', 'show', array('project_id' => $task['project_id']), false, 'close-popover') ?> - <?php else: ?> - <?= $this->url->link(t('cancel'), 'task', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?> - <?php endif ?> + <?= $this->url->link(t('cancel'), 'task', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id']), false, 'close-popover') ?> </div> </form>
\ No newline at end of file diff --git a/app/Template/tasklink/edit.php b/app/Template/tasklink/edit.php index 73b43277..896f84c0 100644 --- a/app/Template/tasklink/edit.php +++ b/app/Template/tasklink/edit.php @@ -22,9 +22,9 @@ 'placeholder="'.t('Start to type task title...').'"', 'title="'.t('Start to type task title...').'"', 'data-dst-field="opposite_task_id"', - 'data-search-url="'.$this->url->href('app', 'autocomplete', array('exclude_task_id' => $task['id'])).'"', + 'data-search-url="'.$this->url->href('TaskHelper', 'autocomplete', array('exclude_task_id' => $task['id'])).'"', ), - 'task-autocomplete') ?> + 'autocomplete') ?> <div class="form-actions"> <input type="submit" value="<?= t('Save') ?>" class="btn btn-blue"/> diff --git a/app/Template/tasklink/show.php b/app/Template/tasklink/show.php index 97a3a767..fd8b37a6 100644 --- a/app/Template/tasklink/show.php +++ b/app/Template/tasklink/show.php @@ -1,16 +1,18 @@ -<?php if (! empty($links)): ?> <div class="page-header"> - <h2><?= t('Links') ?></h2> + <h2><?= t('Internal links') ?></h2> </div> -<table id="links"> +<?php if (empty($links)): ?> + <p class="alert"><?= t('There is no internal link for the moment.') ?></p> +<?php else: ?> +<table id="links" class="table-small table-stripped"> <tr> <th class="column-20"><?= t('Label') ?></th> <th class="column-30"><?= t('Task') ?></th> <th class="column-20"><?= t('Project') ?></th> <th><?= t('Column') ?></th> <th><?= t('Assignee') ?></th> - <?php if (! isset($not_editable)): ?> - <th><?= t('Action') ?></th> + <?php if ($editable && $this->user->hasProjectAccess('Tasklink', 'edit', $task['project_id'])): ?> + <th class="column-5"><?= t('Action') ?></th> <?php endif ?> </tr> <?php foreach ($links as $label => $grouped_links): ?> @@ -23,12 +25,12 @@ <?php endif ?> <td> - <?php if (! isset($not_editable)): ?> + <?php if ($is_public): ?> <?= $this->url->link( $this->e('#'.$link['task_id'].' '.$link['title']), 'task', - 'show', - array('task_id' => $link['task_id'], 'project_id' => $link['project_id']), + 'readonly', + array('task_id' => $link['task_id'], 'token' => $project['token']), false, $link['is_active'] ? '' : 'task-link-closed' ) ?> @@ -36,14 +38,14 @@ <?= $this->url->link( $this->e('#'.$link['task_id'].' '.$link['title']), 'task', - 'readonly', - array('task_id' => $link['task_id'], 'token' => $project['token']), + 'show', + array('task_id' => $link['task_id'], 'project_id' => $link['project_id']), false, $link['is_active'] ? '' : 'task-link-closed' ) ?> <?php endif ?> - <br/> + <br> <?php if (! empty($link['task_time_spent'])): ?> <strong><?= $this->e($link['task_time_spent']).'h' ?></strong> <?= t('spent') ?> @@ -57,19 +59,22 @@ <td><?= $this->e($link['column_title']) ?></td> <td> <?php if (! empty($link['task_assignee_username'])): ?> - <?php if (! isset($not_editable)): ?> + <?php if ($editable): ?> <?= $this->url->link($this->e($link['task_assignee_name'] ?: $link['task_assignee_username']), 'user', 'show', array('user_id' => $link['task_assignee_id'])) ?> <?php else: ?> <?= $this->e($link['task_assignee_name'] ?: $link['task_assignee_username']) ?> <?php endif ?> <?php endif ?> </td> - <?php if (! isset($not_editable)): ?> + <?php if ($editable && $this->user->hasProjectAccess('Tasklink', 'edit', $task['project_id'])): ?> <td> + <div class="dropdown"> + <a href="#" class="dropdown-menu dropdown-menu-link-icon"><i class="fa fa-cog fa-fw"></i><i class="fa fa-caret-down"></i></a> <ul> <li><?= $this->url->link(t('Edit'), 'tasklink', 'edit', array('link_id' => $link['id'], 'task_id' => $task['id'], 'project_id' => $task['project_id'])) ?></li> <li><?= $this->url->link(t('Remove'), 'tasklink', 'confirm', array('link_id' => $link['id'], 'task_id' => $task['id'], 'project_id' => $task['project_id'])) ?></li> </ul> + </div> </td> <?php endif ?> </tr> @@ -77,7 +82,7 @@ <?php endforeach ?> </table> -<?php if (! isset($not_editable) && isset($link_label_list)): ?> +<?php if ($editable && isset($link_label_list)): ?> <form action="<?= $this->url->href('tasklink', 'save', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?>" method="post" autocomplete="off"> <?= $this->form->csrf() ?> @@ -95,9 +100,9 @@ 'placeholder="'.t('Start to type task title...').'"', 'title="'.t('Start to type task title...').'"', 'data-dst-field="opposite_task_id"', - 'data-search-url="'.$this->url->href('app', 'autocomplete', array('exclude_task_id' => $task['id'])).'"', + 'data-search-url="'.$this->url->href('TaskHelper', 'autocomplete', array('exclude_task_id' => $task['id'])).'"', ), - 'task-autocomplete') ?> + 'autocomplete') ?> <input type="submit" value="<?= t('Add') ?>" class="btn btn-blue"/> </form> diff --git a/app/Template/twofactor/index.php b/app/Template/twofactor/index.php index 36b92653..b9ee4b49 100644 --- a/app/Template/twofactor/index.php +++ b/app/Template/twofactor/index.php @@ -2,36 +2,14 @@ <h2><?= t('Two factor authentication') ?></h2> </div> -<form method="post" action="<?= $this->url->href('twofactor', 'save', array('user_id' => $user['id'])) ?>" autocomplete="off"> - +<form method="post" action="<?= $this->url->href('twofactor', $user['twofactor_activated'] == 1 ? 'deactivate' : 'show', array('user_id' => $user['id'])) ?>" autocomplete="off"> <?= $this->form->csrf() ?> - <?= $this->form->checkbox('twofactor_activated', t('Enable/disable two factor authentication'), 1, isset($user['twofactor_activated']) && $user['twofactor_activated'] == 1) ?> - - <div class="form-actions"> - <input type="submit" value="<?= t('Save') ?>" class="btn btn-blue"/> - </div> -</form> - -<?php if ($user['twofactor_activated'] == 1): ?> -<div class="listing"> - <p><?= t('Secret key: ') ?><strong><?= $this->e($user['twofactor_secret']) ?></strong> (base32)</p> - <p><br/><img src="<?= $qrcode_url ?>"/><br/><br/></p> - <p> - <?= t('This QR code contains the key URI: ') ?><strong><?= $this->e($key_url) ?></strong> - <br/><br/> - <?= t('Save the secret key in your TOTP software (by example Google Authenticator or FreeOTP).') ?> - </p> -</div> - -<h3><?= t('Test your device') ?></h3> -<form method="post" action="<?= $this->url->href('twofactor', 'test', array('user_id' => $user['id'])) ?>" autocomplete="off"> - - <?= $this->form->csrf() ?> - <?= $this->form->label(t('Code'), 'code') ?> - <?= $this->form->text('code', array(), array(), array('placeholder="123456"'), 'form-numeric') ?> - + <p><?= t('Two-Factor Provider: ') ?><strong><?= $this->e($provider) ?></strong></p> <div class="form-actions"> - <input type="submit" value="<?= t('Check my code') ?>" class="btn btn-blue"/> + <?php if ($user['twofactor_activated'] == 1): ?> + <input type="submit" value="<?= t('Disable two-factor authentication') ?>" class="btn btn-red"/> + <?php else: ?> + <input type="submit" value="<?= t('Enable two-factor authentication') ?>" class="btn btn-blue"/> + <?php endif ?> </div> </form> -<?php endif ?> diff --git a/app/Template/twofactor/show.php b/app/Template/twofactor/show.php new file mode 100644 index 00000000..d6d8f405 --- /dev/null +++ b/app/Template/twofactor/show.php @@ -0,0 +1,31 @@ +<div class="page-header"> + <h2><?= t('Two factor authentication') ?></h2> +</div> + +<?php if (! empty($secret) || ! empty($qrcode_url) || ! empty($key_url)): ?> +<div class="listing"> + <?php if (! empty($secret)): ?> + <p><?= t('Secret key: ') ?><strong><?= $this->e($secret) ?></strong></p> + <?php endif ?> + + <?php if (! empty($qrcode_url)): ?> + <p><br><img src="<?= $qrcode_url ?>"/><br><br></p> + <?php endif ?> + + <?php if (! empty($key_url)): ?> + <p><?= t('This QR code contains the key URI: ') ?><a href="<?= $this->e($key_url) ?>"><?= $this->e($key_url) ?></a></p> + <?php endif ?> +</div> +<?php endif ?> + +<h3><?= t('Test your device') ?></h3> +<form method="post" action="<?= $this->url->href('twofactor', 'test', array('user_id' => $user['id'])) ?>" autocomplete="off"> + + <?= $this->form->csrf() ?> + <?= $this->form->label(t('Code'), 'code') ?> + <?= $this->form->text('code', array(), array(), array('placeholder="123456"', 'autofocus'), 'form-numeric') ?> + + <div class="form-actions"> + <input type="submit" value="<?= t('Check my code') ?>" class="btn btn-blue"> + </div> +</form>
\ No newline at end of file diff --git a/app/Template/user/authentication.php b/app/Template/user/authentication.php index 20c3d372..0c08f3fb 100644 --- a/app/Template/user/authentication.php +++ b/app/Template/user/authentication.php @@ -8,14 +8,7 @@ <?= $this->form->hidden('id', $values) ?> <?= $this->form->hidden('username', $values) ?> - <?= $this->form->label(t('Google Id'), 'google_id') ?> - <?= $this->form->text('google_id', $values, $errors) ?> - - <?= $this->form->label(t('Github Id'), 'github_id') ?> - <?= $this->form->text('github_id', $values, $errors) ?> - - <?= $this->form->label(t('Gitlab Id'), 'gitlab_id') ?> - <?= $this->form->text('gitlab_id', $values, $errors) ?> + <?= $this->hook->render('template:user:authentication:form', array('values' => $values, 'errors' => $errors, 'user' => $user)) ?> <?= $this->form->checkbox('is_ldap_user', t('Remote user'), 1, isset($values['is_ldap_user']) && $values['is_ldap_user'] == 1) ?> <?= $this->form->checkbox('disable_login_form', t('Disallow login form'), 1, isset($values['disable_login_form']) && $values['disable_login_form'] == 1) ?> diff --git a/app/Template/user/create_local.php b/app/Template/user/create_local.php index 98c38f0d..38bd7836 100644 --- a/app/Template/user/create_local.php +++ b/app/Template/user/create_local.php @@ -12,34 +12,35 @@ <div class="form-column"> <?= $this->form->label(t('Username'), 'username') ?> - <?= $this->form->text('username', $values, $errors, array('autofocus', 'required', 'maxlength="50"')) ?><br/> + <?= $this->form->text('username', $values, $errors, array('autofocus', 'required', 'maxlength="50"')) ?> <?= $this->form->label(t('Name'), 'name') ?> - <?= $this->form->text('name', $values, $errors) ?><br/> + <?= $this->form->text('name', $values, $errors) ?> <?= $this->form->label(t('Email'), 'email') ?> - <?= $this->form->email('email', $values, $errors) ?><br/> + <?= $this->form->email('email', $values, $errors) ?> <?= $this->form->label(t('Password'), 'password') ?> - <?= $this->form->password('password', $values, $errors, array('required')) ?><br/> + <?= $this->form->password('password', $values, $errors, array('required')) ?> <?= $this->form->label(t('Confirmation'), 'confirmation') ?> - <?= $this->form->password('confirmation', $values, $errors, array('required')) ?><br/> + <?= $this->form->password('confirmation', $values, $errors, array('required')) ?> </div> <div class="form-column"> <?= $this->form->label(t('Add project member'), 'project_id') ?> - <?= $this->form->select('project_id', $projects, $values, $errors) ?><br/> + <?= $this->form->select('project_id', $projects, $values, $errors) ?> <?= $this->form->label(t('Timezone'), 'timezone') ?> - <?= $this->form->select('timezone', $timezones, $values, $errors) ?><br/> + <?= $this->form->select('timezone', $timezones, $values, $errors) ?> <?= $this->form->label(t('Language'), 'language') ?> - <?= $this->form->select('language', $languages, $values, $errors) ?><br/> + <?= $this->form->select('language', $languages, $values, $errors) ?> + + <?= $this->form->label(t('Role'), 'role') ?> + <?= $this->form->select('role', $roles, $values, $errors) ?> <?= $this->form->checkbox('notifications_enabled', t('Enable email notifications'), 1, isset($values['notifications_enabled']) && $values['notifications_enabled'] == 1 ? true : false) ?> - <?= $this->form->checkbox('is_admin', t('Administrator'), 1, isset($values['is_admin']) && $values['is_admin'] == 1 ? true : false) ?> - <?= $this->form->checkbox('is_project_admin', t('Project Administrator'), 1, isset($values['is_project_admin']) && $values['is_project_admin'] == 1 ? true : false) ?> </div> <div class="form-actions"> @@ -49,4 +50,4 @@ </div> </form> </section> -</section>
\ No newline at end of file +</section> diff --git a/app/Template/user/create_remote.php b/app/Template/user/create_remote.php index 49d1548c..7399a010 100644 --- a/app/Template/user/create_remote.php +++ b/app/Template/user/create_remote.php @@ -12,37 +12,31 @@ <div class="form-column"> <?= $this->form->label(t('Username'), 'username') ?> - <?= $this->form->text('username', $values, $errors, array('autofocus', 'required', 'maxlength="50"')) ?><br/> + <?= $this->form->text('username', $values, $errors, array('autofocus', 'required', 'maxlength="50"')) ?> <?= $this->form->label(t('Name'), 'name') ?> - <?= $this->form->text('name', $values, $errors) ?><br/> + <?= $this->form->text('name', $values, $errors) ?> <?= $this->form->label(t('Email'), 'email') ?> - <?= $this->form->email('email', $values, $errors) ?><br/> + <?= $this->form->email('email', $values, $errors) ?> - <?= $this->form->label(t('Google Id'), 'google_id') ?> - <?= $this->form->text('google_id', $values, $errors) ?><br/> - - <?= $this->form->label(t('Github Id'), 'github_id') ?> - <?= $this->form->text('github_id', $values, $errors) ?><br/> - - <?= $this->form->label(t('Gitlab Id'), 'gitlab_id') ?> - <?= $this->form->text('gitlab_id', $values, $errors) ?><br/> + <?= $this->hook->render('template:user:create-remote:form', array('values' => $values, 'errors' => $errors)) ?> </div> <div class="form-column"> <?= $this->form->label(t('Add project member'), 'project_id') ?> - <?= $this->form->select('project_id', $projects, $values, $errors) ?><br/> + <?= $this->form->select('project_id', $projects, $values, $errors) ?> <?= $this->form->label(t('Timezone'), 'timezone') ?> - <?= $this->form->select('timezone', $timezones, $values, $errors) ?><br/> + <?= $this->form->select('timezone', $timezones, $values, $errors) ?> <?= $this->form->label(t('Language'), 'language') ?> - <?= $this->form->select('language', $languages, $values, $errors) ?><br/> + <?= $this->form->select('language', $languages, $values, $errors) ?> + + <?= $this->form->label(t('Role'), 'role') ?> + <?= $this->form->select('role', $roles, $values, $errors) ?> <?= $this->form->checkbox('notifications_enabled', t('Enable email notifications'), 1, isset($values['notifications_enabled']) && $values['notifications_enabled'] == 1 ? true : false) ?> - <?= $this->form->checkbox('is_admin', t('Administrator'), 1, isset($values['is_admin']) && $values['is_admin'] == 1 ? true : false) ?> - <?= $this->form->checkbox('is_project_admin', t('Project Administrator'), 1, isset($values['is_project_admin']) && $values['is_project_admin'] == 1 ? true : false) ?> <?= $this->form->checkbox('disable_login_form', t('Disallow login form'), 1, isset($values['disable_login_form']) && $values['disable_login_form'] == 1) ?> </div> diff --git a/app/Template/user/dropdown.php b/app/Template/user/dropdown.php new file mode 100644 index 00000000..b74ed6e0 --- /dev/null +++ b/app/Template/user/dropdown.php @@ -0,0 +1,27 @@ +<div class="dropdown"> + <a href="#" class="dropdown-menu dropdown-menu-link-icon"><i class="fa fa-cog fa-fw"></i><i class="fa fa-caret-down"></i></a> + <ul> + <li> + <i class="fa fa-user fa-fw"></i> + <?= $this->url->link(t('View profile'), 'user', 'show', array('user_id' => $user['id'])) ?> + </li> + <?php if ($user['is_active'] == 1 && $this->user->hasAccess('UserStatus', 'disable') && ! $this->user->isCurrentUser($user['id'])): ?> + <li> + <i class="fa fa-times fa-fw"></i> + <?= $this->url->link(t('Disable'), 'UserStatus', 'confirmDisable', array('user_id' => $user['id']), false, 'popover') ?> + </li> + <?php endif ?> + <?php if ($user['is_active'] == 0 && $this->user->hasAccess('UserStatus', 'enable') && ! $this->user->isCurrentUser($user['id'])): ?> + <li> + <i class="fa fa-check-square-o fa-fw"></i> + <?= $this->url->link(t('Enable'), 'UserStatus', 'confirmEnable', array('user_id' => $user['id']), false, 'popover') ?> + </li> + <?php endif ?> + <?php if ($this->user->hasAccess('UserStatus', 'remove') && ! $this->user->isCurrentUser($user['id'])): ?> + <li> + <i class="fa fa-trash-o fa-fw"></i> + <?= $this->url->link(t('Remove'), 'UserStatus', 'confirmRemove', array('user_id' => $user['id']), false, 'popover') ?> + </li> + <?php endif ?> + </ul> +</div>
\ No newline at end of file diff --git a/app/Template/user/edit.php b/app/Template/user/edit.php index cd10b2ab..f7f67fb7 100644 --- a/app/Template/user/edit.php +++ b/app/Template/user/edit.php @@ -8,23 +8,23 @@ <?= $this->form->hidden('id', $values) ?> <?= $this->form->label(t('Username'), 'username') ?> - <?= $this->form->text('username', $values, $errors, array('required', $values['is_ldap_user'] == 1 ? 'readonly' : '', 'maxlength="50"')) ?><br/> + <?= $this->form->text('username', $values, $errors, array('required', isset($values['is_ldap_user']) && $values['is_ldap_user'] == 1 ? 'readonly' : '', 'maxlength="50"')) ?> <?= $this->form->label(t('Name'), 'name') ?> - <?= $this->form->text('name', $values, $errors) ?><br/> + <?= $this->form->text('name', $values, $errors) ?> <?= $this->form->label(t('Email'), 'email') ?> - <?= $this->form->email('email', $values, $errors) ?><br/> + <?= $this->form->email('email', $values, $errors) ?> <?= $this->form->label(t('Timezone'), 'timezone') ?> - <?= $this->form->select('timezone', $timezones, $values, $errors) ?><br/> + <?= $this->form->select('timezone', $timezones, $values, $errors) ?> <?= $this->form->label(t('Language'), 'language') ?> - <?= $this->form->select('language', $languages, $values, $errors) ?><br/> + <?= $this->form->select('language', $languages, $values, $errors) ?> <?php if ($this->user->isAdmin()): ?> - <?= $this->form->checkbox('is_admin', t('Administrator'), 1, isset($values['is_admin']) && $values['is_admin'] == 1) ?> - <?= $this->form->checkbox('is_project_admin', t('Project Administrator'), 1, isset($values['is_project_admin']) && $values['is_project_admin'] == 1) ?> + <?= $this->form->label(t('Role'), 'role') ?> + <?= $this->form->select('role', $roles, $values, $errors) ?> <?php endif ?> <div class="form-actions"> diff --git a/app/Template/user/external.php b/app/Template/user/external.php index 7a42f38e..22c25af2 100644 --- a/app/Template/user/external.php +++ b/app/Template/user/external.php @@ -2,54 +2,10 @@ <h2><?= t('External authentications') ?></h2> </div> -<?php if (GOOGLE_AUTH): ?> - <h3><i class="fa fa-google"></i> <?= t('Google Account') ?></h3> +<?php $html = $this->hook->render('template:user:external', array('user' => $user)) ?> - <p class="listing"> - <?php if ($this->user->isCurrentUser($user['id'])): ?> - <?php if (empty($user['google_id'])): ?> - <?= $this->url->link(t('Link my Google Account'), 'oauth', 'google', array(), true) ?> - <?php else: ?> - <?= $this->url->link(t('Unlink my Google Account'), 'oauth', 'unlink', array('backend' => 'google'), true) ?> - <?php endif ?> - <?php else: ?> - <?= empty($user['google_id']) ? t('No account linked.') : t('Account linked.') ?> - <?php endif ?> - </p> -<?php endif ?> - -<?php if (GITHUB_AUTH): ?> - <h3><i class="fa fa-github"></i> <?= t('Github Account') ?></h3> - - <p class="listing"> - <?php if ($this->user->isCurrentUser($user['id'])): ?> - <?php if (empty($user['github_id'])): ?> - <?= $this->url->link(t('Link my Github Account'), 'oauth', 'github', array(), true) ?> - <?php else: ?> - <?= $this->url->link(t('Unlink my Github Account'), 'oauth', 'unlink', array('backend' => 'github'), true) ?> - <?php endif ?> - <?php else: ?> - <?= empty($user['github_id']) ? t('No account linked.') : t('Account linked.') ?> - <?php endif ?> - </p> -<?php endif ?> - -<?php if (GITLAB_AUTH): ?> - <h3><img src="<?= $this->url->dir() ?>assets/img/gitlab-icon.png"/> <?= t('Gitlab Account') ?></h3> - - <p class="listing"> - <?php if ($this->user->isCurrentUser($user['id'])): ?> - <?php if (empty($user['gitlab_id'])): ?> - <?= $this->url->link(t('Link my Gitlab Account'), 'oauth', 'gitlab', array(), true) ?> - <?php else: ?> - <?= $this->url->link(t('Unlink my Gitlab Account'), 'oauth', 'unlink', array('backend' => 'gitlab'), true) ?> - <?php endif ?> - <?php else: ?> - <?= empty($user['gitlab_id']) ? t('No account linked.') : t('Account linked.') ?> - <?php endif ?> - </p> -<?php endif ?> - -<?php if (! GOOGLE_AUTH && ! GITHUB_AUTH && ! GITLAB_AUTH): ?> +<?php if (empty($html)): ?> <p class="alert"><?= t('No external authentication enabled.') ?></p> +<?php else: ?> + <?= $html ?> <?php endif ?> diff --git a/app/Template/user/index.php b/app/Template/user/index.php index 4008b920..494c1465 100644 --- a/app/Template/user/index.php +++ b/app/Template/user/index.php @@ -1,34 +1,32 @@ <section id="main"> <div class="page-header"> - <?php if ($this->user->isAdmin()): ?> + <?php if ($this->user->hasAccess('user', 'create')): ?> <ul> <li><i class="fa fa-plus fa-fw"></i><?= $this->url->link(t('New local user'), 'user', 'create') ?></li> <li><i class="fa fa-plus fa-fw"></i><?= $this->url->link(t('New remote user'), 'user', 'create', array('remote' => 1)) ?></li> <li><i class="fa fa-upload fa-fw"></i><?= $this->url->link(t('Import'), 'userImport', 'step1') ?></li> + <li><i class="fa fa-users fa-fw"></i><?= $this->url->link(t('View all groups'), 'group', 'index') ?></li> </ul> <?php endif ?> </div> <?php if ($paginator->isEmpty()): ?> <p class="alert"><?= t('No user') ?></p> <?php else: ?> - <table> + <table class="table-stripped"> <tr> - <th><?= $paginator->order(t('Id'), 'id') ?></th> - <th><?= $paginator->order(t('Username'), 'username') ?></th> - <th><?= $paginator->order(t('Name'), 'name') ?></th> - <th><?= $paginator->order(t('Email'), 'email') ?></th> - <th><?= $paginator->order(t('Administrator'), 'is_admin') ?></th> - <th><?= $paginator->order(t('Project Administrator'), 'is_project_admin') ?></th> - <th><?= $paginator->order(t('Two factor authentication'), 'twofactor_activated') ?></th> - <th><?= $paginator->order(t('Notifications'), 'notifications_enabled') ?></th> - <th><?= $paginator->order(t('Account type'), 'is_ldap_user') ?></th> + <th class="column-18"><?= $paginator->order(t('Username'), 'username') ?></th> + <th class="column-18"><?= $paginator->order(t('Name'), 'name') ?></th> + <th class="column-15"><?= $paginator->order(t('Email'), 'email') ?></th> + <th class="column-15"><?= $paginator->order(t('Role'), 'role') ?></th> + <th class="column-10"><?= $paginator->order(t('Two Factor'), 'twofactor_activated') ?></th> + <th class="column-10"><?= $paginator->order(t('Account type'), 'is_ldap_user') ?></th> + <th class="column-10"><?= $paginator->order(t('Status'), 'is_active') ?></th> + <th class="column-5"><?= t('Actions') ?></th> </tr> <?php foreach ($paginator->getCollection() as $user): ?> <tr> <td> - <?= $this->url->link('#'.$user['id'], 'user', 'show', array('user_id' => $user['id'])) ?> - </td> - <td> + <?= '#'.$user['id'] ?> <?= $this->url->link($this->e($user['username']), 'user', 'show', array('user_id' => $user['id'])) ?> </td> <td> @@ -38,23 +36,23 @@ <a href="mailto:<?= $this->e($user['email']) ?>"><?= $this->e($user['email']) ?></a> </td> <td> - <?= $user['is_admin'] ? t('Yes') : t('No') ?> + <?= $this->user->getRoleName($user['role']) ?> </td> <td> - <?= $user['is_project_admin'] ? t('Yes') : t('No') ?> + <?= $user['twofactor_activated'] ? t('Yes') : t('No') ?> </td> <td> - <?= $user['twofactor_activated'] ? t('Yes') : t('No') ?> + <?= $user['is_ldap_user'] ? t('Remote') : t('Local') ?> </td> <td> - <?php if ($user['notifications_enabled'] == 1): ?> - <?= t('Enabled') ?> + <?php if ($user['is_active'] == 1): ?> + <?= t('Active') ?> <?php else: ?> - <?= t('Disabled') ?> + <?= t('Inactive') ?> <?php endif ?> </td> <td> - <?= $user['is_ldap_user'] ? t('Remote') : t('Local') ?> + <?= $this->render('user/dropdown', array('user' => $user)) ?> </td> </tr> <?php endforeach ?> diff --git a/app/Template/user/last.php b/app/Template/user/last.php index 8879466e..d6c86391 100644 --- a/app/Template/user/last.php +++ b/app/Template/user/last.php @@ -14,7 +14,7 @@ </tr> <?php foreach ($last_logins as $login): ?> <tr> - <td><?= dt('%B %e, %Y at %k:%M %p', $login['date_creation']) ?></td> + <td><?= $this->dt->datetime($login['date_creation']) ?></td> <td><?= $this->e($login['auth_type']) ?></td> <td><?= $this->e($login['ip']) ?></td> <td><?= $this->e($login['user_agent']) ?></td> diff --git a/app/Template/user/layout.php b/app/Template/user/layout.php index a27f359b..3a0a5ba6 100644 --- a/app/Template/user/layout.php +++ b/app/Template/user/layout.php @@ -1,6 +1,6 @@ <section id="main"> <div class="page-header"> - <?php if ($this->user->isAdmin()): ?> + <?php if ($this->user->hasAccess('user', 'create')): ?> <ul> <li><i class="fa fa-user fa-fw"></i><?= $this->url->link(t('All users'), 'user', 'index') ?></li> <li><i class="fa fa-plus fa-fw"></i><?= $this->url->link(t('New local user'), 'user', 'create') ?></li> @@ -13,7 +13,7 @@ <?= $this->render('user/sidebar', array('user' => $user)) ?> <div class="sidebar-content"> - <?= $user_content_for_layout ?> + <?= $content_for_sublayout ?> </div> </section> </section>
\ No newline at end of file diff --git a/app/Template/user/password.php b/app/Template/user/password.php index 3ef28d33..a24a4ee4 100644 --- a/app/Template/user/password.php +++ b/app/Template/user/password.php @@ -9,17 +9,17 @@ <div class="alert alert-error"> <?= $this->form->label(t('Current password for the user "%s"', $this->user->getFullname()), 'current_password') ?> - <?= $this->form->password('current_password', $values, $errors) ?><br/> + <?= $this->form->password('current_password', $values, $errors) ?> </div> <?= $this->form->label(t('New password for the user "%s"', $this->user->getFullname($user)), 'password') ?> - <?= $this->form->password('password', $values, $errors) ?><br/> + <?= $this->form->password('password', $values, $errors) ?> <?= $this->form->label(t('Confirmation'), 'confirmation') ?> - <?= $this->form->password('confirmation', $values, $errors) ?><br/> + <?= $this->form->password('confirmation', $values, $errors) ?> <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') ?> <?= $this->url->link(t('cancel'), 'user', 'show', array('user_id' => $user['id'])) ?> </div> diff --git a/app/Template/user/password_reset.php b/app/Template/user/password_reset.php new file mode 100644 index 00000000..4e9063ef --- /dev/null +++ b/app/Template/user/password_reset.php @@ -0,0 +1,26 @@ +<div class="page-header"> + <h2><?= t('Last Password Reset') ?></h2> +</div> + +<?php if (empty($tokens)): ?> + <p class="alert"><?= t('The password has never been reinitialized.') ?></p> +<?php else: ?> + <table class="table-small table-fixed"> + <tr> + <th class="column-20"><?= t('Creation') ?></th> + <th class="column-20"><?= t('Expiration') ?></th> + <th class="column-5"><?= t('Active') ?></th> + <th class="column-15"><?= t('IP address') ?></th> + <th><?= t('User agent') ?></th> + </tr> + <?php foreach ($tokens as $token): ?> + <tr> + <td><?= $this->dt->datetime($token['date_creation']) ?></td> + <td><?= $this->dt->datetime($token['date_expiration']) ?></td> + <td><?= $token['is_active'] == 0 ? t('No') : t('Yes') ?></td> + <td><?= $this->e($token['ip']) ?></td> + <td><?= $this->e($token['user_agent']) ?></td> + </tr> + <?php endforeach ?> + </table> +<?php endif ?>
\ No newline at end of file diff --git a/app/Template/user/profile.php b/app/Template/user/profile.php new file mode 100644 index 00000000..176a1491 --- /dev/null +++ b/app/Template/user/profile.php @@ -0,0 +1,8 @@ +<section id="main"> + <br> + <ul class="listing"> + <li><?= t('Username:') ?> <strong><?= $this->e($user['username']) ?></strong></li> + <li><?= t('Name:') ?> <strong><?= $this->e($user['name']) ?: t('None') ?></strong></li> + <li><?= t('Email:') ?> <strong><?= $this->e($user['email']) ?: t('None') ?></strong></li> + </ul> +</section>
\ No newline at end of file diff --git a/app/Template/user/sessions.php b/app/Template/user/sessions.php index eabf3672..8db02430 100644 --- a/app/Template/user/sessions.php +++ b/app/Template/user/sessions.php @@ -15,11 +15,11 @@ </tr> <?php foreach ($sessions as $session): ?> <tr> - <td><?= dt('%B %e, %Y at %k:%M %p', $session['date_creation']) ?></td> - <td><?= dt('%B %e, %Y at %k:%M %p', $session['expiration']) ?></td> + <td><?= $this->dt->datetime($session['date_creation']) ?></td> + <td><?= $this->dt->datetime($session['expiration']) ?></td> <td><?= $this->e($session['ip']) ?></td> <td><?= $this->e($session['user_agent']) ?></td> - <td><?= $this->url->link(t('Remove'), 'user', 'removeSession', array('user_id' => $user['id'], 'id' => $session['id']), true) ?></td> + <td><?= $this->url->link(t('Remove'), 'User', 'removeSession', array('user_id' => $user['id'], 'id' => $session['id']), true) ?></td> </tr> <?php endforeach ?> </table> diff --git a/app/Template/user/show.php b/app/Template/user/show.php index 220ad87e..9da56666 100644 --- a/app/Template/user/show.php +++ b/app/Template/user/show.php @@ -5,13 +5,14 @@ <li><?= t('Username:') ?> <strong><?= $this->e($user['username']) ?></strong></li> <li><?= t('Name:') ?> <strong><?= $this->e($user['name']) ?: t('None') ?></strong></li> <li><?= t('Email:') ?> <strong><?= $this->e($user['email']) ?: t('None') ?></strong></li> + <li><?= t('Status:') ?> <strong><?= $user['is_active'] ? t('Active') : t('Inactive') ?></strong></li> </ul> <div class="page-header"> <h2><?= t('Security') ?></h2> </div> <ul class="listing"> - <li><?= t('Group:') ?> <strong><?= $user['is_admin'] ? t('Administrator') : ($user['is_project_admin'] ? t('Project Administrator') : t('Regular user')) ?></strong></li> + <li><?= t('Role:') ?> <strong><?= $this->user->getRoleName($user['role']) ?></strong></li> <li><?= t('Account type:') ?> <strong><?= $user['is_ldap_user'] ? t('Remote') : t('Local') ?></strong></li> <li><?= $user['twofactor_activated'] == 1 ? t('Two factor authentication enabled') : t('Two factor authentication disabled') ?></li> </ul> diff --git a/app/Template/user/sidebar.php b/app/Template/user/sidebar.php index 167c8054..20fd2ad2 100644 --- a/app/Template/user/sidebar.php +++ b/app/Template/user/sidebar.php @@ -1,80 +1,80 @@ <div class="sidebar"> <h2><?= t('Information') ?></h2> <ul> - <li <?= $this->app->getRouterController() === 'user' && $this->app->getRouterAction() === 'show' ? 'class="active"' : '' ?>> - <?= $this->url->link(t('Summary'), 'user', 'show', array('user_id' => $user['id'])) ?> - </li> + <?php if ($this->user->hasAccess('user', 'show')): ?> + <li <?= $this->app->checkMenuSelection('user', 'show') ?>> + <?= $this->url->link(t('Summary'), 'user', 'show', array('user_id' => $user['id'])) ?> + </li> + <?php endif ?> <?php if ($this->user->isAdmin()): ?> <li> <?= $this->url->link(t('User dashboard'), 'app', 'index', array('user_id' => $user['id'])) ?> </li> <?php endif ?> <?php if ($this->user->isAdmin() || $this->user->isCurrentUser($user['id'])): ?> - <li <?= $this->app->getRouterController() === 'user' && $this->app->getRouterAction() === 'timesheet' ? 'class="active"' : '' ?>> + <li <?= $this->app->checkMenuSelection('user', 'timesheet') ?>> <?= $this->url->link(t('Time tracking'), 'user', 'timesheet', array('user_id' => $user['id'])) ?> </li> - <li <?= $this->app->getRouterController() === 'user' && $this->app->getRouterAction() === 'last' ? 'class="active"' : '' ?>> + <li <?= $this->app->checkMenuSelection('user', 'last') ?>> <?= $this->url->link(t('Last logins'), 'user', 'last', array('user_id' => $user['id'])) ?> </li> - <li <?= $this->app->getRouterController() === 'user' && $this->app->getRouterAction() === 'sessions' ? 'class="active"' : '' ?>> + <li <?= $this->app->checkMenuSelection('user', 'sessions') ?>> <?= $this->url->link(t('Persistent connections'), 'user', 'sessions', array('user_id' => $user['id'])) ?> </li> + <li <?= $this->app->checkMenuSelection('user', 'passwordReset') ?>> + <?= $this->url->link(t('Password reset history'), 'user', 'passwordReset', array('user_id' => $user['id'])) ?> + </li> <?php endif ?> - <?= $this->hook->render('template:user:sidebar:information') ?> + <?= $this->hook->render('template:user:sidebar:information', array('user' => $user)) ?> </ul> <h2><?= t('Actions') ?></h2> <ul> <?php if ($this->user->isAdmin() || $this->user->isCurrentUser($user['id'])): ?> - <li <?= $this->app->getRouterController() === 'user' && $this->app->getRouterAction() === 'edit' ? 'class="active"' : '' ?>> - <?= $this->url->link(t('Edit profile'), 'user', 'edit', array('user_id' => $user['id'])) ?> - </li> + + <?php if ($this->user->hasAccess('user', 'edit')): ?> + <li <?= $this->app->checkMenuSelection('user', 'edit') ?>> + <?= $this->url->link(t('Edit profile'), 'user', 'edit', array('user_id' => $user['id'])) ?> + </li> + <?php endif ?> <?php if ($user['is_ldap_user'] == 0): ?> - <li <?= $this->app->getRouterController() === 'user' && $this->app->getRouterAction() === 'password' ? 'class="active"' : '' ?>> + <li <?= $this->app->checkMenuSelection('user', 'password') ?>> <?= $this->url->link(t('Change password'), 'user', 'password', array('user_id' => $user['id'])) ?> </li> <?php endif ?> <?php if ($this->user->isCurrentUser($user['id'])): ?> - <li <?= $this->app->getRouterController() === 'twofactor' && $this->app->getRouterAction() === 'index' ? 'class="active"' : '' ?>> + <li <?= $this->app->checkMenuSelection('twofactor', 'index') ?>> <?= $this->url->link(t('Two factor authentication'), 'twofactor', 'index', array('user_id' => $user['id'])) ?> </li> - <?php elseif ($this->user->isAdmin() && $user['twofactor_activated'] == 1): ?> - <li <?= $this->app->getRouterController() === 'twofactor' && $this->app->getRouterAction() === 'disable' ? 'class="active"' : '' ?>> + <?php elseif ($this->user->hasAccess('twofactor', 'disable') && $user['twofactor_activated'] == 1): ?> + <li <?= $this->app->checkMenuSelection('twofactor', 'disable') ?>> <?= $this->url->link(t('Two factor authentication'), 'twofactor', 'disable', array('user_id' => $user['id'])) ?> </li> <?php endif ?> - <li <?= $this->app->getRouterController() === 'user' && $this->app->getRouterAction() === 'share' ? 'class="active"' : '' ?>> + <li <?= $this->app->checkMenuSelection('user', 'share') ?>> <?= $this->url->link(t('Public access'), 'user', 'share', array('user_id' => $user['id'])) ?> </li> - <li <?= $this->app->getRouterController() === 'user' && $this->app->getRouterAction() === 'notifications' ? 'class="active"' : '' ?>> + <li <?= $this->app->checkMenuSelection('user', 'notifications') ?>> <?= $this->url->link(t('Notifications'), 'user', 'notifications', array('user_id' => $user['id'])) ?> </li> - <li <?= $this->app->getRouterController() === 'user' && $this->app->getRouterAction() === 'external' ? 'class="active"' : '' ?>> + <li <?= $this->app->checkMenuSelection('user', 'external') ?>> <?= $this->url->link(t('External accounts'), 'user', 'external', array('user_id' => $user['id'])) ?> </li> - <li <?= $this->app->getRouterController() === 'user' && $this->app->getRouterAction() === 'integrations' ? 'class="active"' : '' ?>> + <li <?= $this->app->checkMenuSelection('user', 'integrations') ?>> <?= $this->url->link(t('Integrations'), 'user', 'integrations', array('user_id' => $user['id'])) ?> </li> <?php endif ?> - <?php if ($this->user->isAdmin()): ?> - <li <?= $this->app->getRouterController() === 'user' && $this->app->getRouterAction() === 'authentication' ? 'class="active"' : '' ?>> + <?php if ($this->user->hasAccess('user', 'authentication')): ?> + <li <?= $this->app->checkMenuSelection('user', 'authentication') ?>> <?= $this->url->link(t('Edit Authentication'), 'user', 'authentication', array('user_id' => $user['id'])) ?> </li> <?php endif ?> <?= $this->hook->render('template:user:sidebar:actions', array('user' => $user)) ?> - - <?php if ($this->user->isAdmin() && ! $this->user->isCurrentUser($user['id'])): ?> - <li <?= $this->app->getRouterController() === 'user' && $this->app->getRouterAction() === 'remove' ? 'class="active"' : '' ?>> - <?= $this->url->link(t('Remove'), 'user', 'remove', array('user_id' => $user['id'])) ?> - </li> - <?php endif ?> </ul> - <div class="sidebar-collapse"><a href="#" title="<?= t('Hide sidebar') ?>"><i class="fa fa-chevron-left"></i></a></div> - <div class="sidebar-expand" style="display: none"><a href="#" title="<?= t('Expand sidebar') ?>"><i class="fa fa-chevron-right"></i></a></div> </div>
\ No newline at end of file diff --git a/app/Template/user/timesheet.php b/app/Template/user/timesheet.php index 5c0d3af8..4a6e42c5 100644 --- a/app/Template/user/timesheet.php +++ b/app/Template/user/timesheet.php @@ -18,8 +18,8 @@ <tr> <td><?= $this->url->link($this->e($record['task_title']), 'task', 'show', array('project_id' => $record['project_id'], 'task_id' => $record['task_id'])) ?></td> <td><?= $this->url->link($this->e($record['subtask_title']), 'task', 'show', array('project_id' => $record['project_id'], 'task_id' => $record['task_id'])) ?></td> - <td><?= dt('%B %e, %Y at %k:%M %p', $record['start']) ?></td> - <td><?= dt('%B %e, %Y at %k:%M %p', $record['end']) ?></td> + <td><?= $this->dt->datetime($record['start']) ?></td> + <td><?= $this->dt->datetime($record['end']) ?></td> <td><?= n($record['time_spent']).' '.t('hours') ?></td> </tr> <?php endforeach ?> diff --git a/app/Template/user_import/step1.php b/app/Template/user_import/step1.php index 7256bfa6..69643d6d 100644 --- a/app/Template/user_import/step1.php +++ b/app/Template/user_import/step1.php @@ -1,6 +1,6 @@ <section id="main"> <div class="page-header"> - <?php if ($this->user->isAdmin()): ?> + <?php if ($this->user->hasAccess('user', 'create')): ?> <ul> <li><i class="fa fa-user fa-fw"></i><?= $this->url->link(t('All users'), 'user', 'index') ?></li> <li><i class="fa fa-plus fa-fw"></i><?= $this->url->link(t('New local user'), 'user', 'create') ?></li> diff --git a/app/Template/user_status/disable.php b/app/Template/user_status/disable.php new file mode 100644 index 00000000..90d8c757 --- /dev/null +++ b/app/Template/user_status/disable.php @@ -0,0 +1,13 @@ +<div class="page-header"> + <h2><?= t('Disable user') ?></h2> +</div> + +<div class="confirm"> + <p class="alert alert-info"><?= t('Do you really want to disable this user: "%s"?', $user['name'] ?: $user['username']) ?></p> + + <div class="form-actions"> + <?= $this->url->link(t('Yes'), 'UserStatus', 'disable', array('user_id' => $user['id']), true, 'btn btn-red') ?> + <?= t('or') ?> + <?= $this->url->link(t('cancel'), 'user', 'index', array(), false, 'close-popover') ?> + </div> +</div> diff --git a/app/Template/user_status/enable.php b/app/Template/user_status/enable.php new file mode 100644 index 00000000..cd3d4947 --- /dev/null +++ b/app/Template/user_status/enable.php @@ -0,0 +1,13 @@ +<div class="page-header"> + <h2><?= t('Enable user') ?></h2> +</div> + +<div class="confirm"> + <p class="alert alert-info"><?= t('Do you really want to enable this user: "%s"?', $user['name'] ?: $user['username']) ?></p> + + <div class="form-actions"> + <?= $this->url->link(t('Yes'), 'UserStatus', 'enable', array('user_id' => $user['id']), true, 'btn btn-red') ?> + <?= t('or') ?> + <?= $this->url->link(t('cancel'), 'user', 'index', array(), false, 'close-popover') ?> + </div> +</div> diff --git a/app/Template/user/remove.php b/app/Template/user_status/remove.php index 810a3a3f..cd5c09a6 100644 --- a/app/Template/user/remove.php +++ b/app/Template/user_status/remove.php @@ -6,8 +6,8 @@ <p class="alert alert-info"><?= t('Do you really want to remove this user: "%s"?', $user['name'] ?: $user['username']) ?></p> <div class="form-actions"> - <?= $this->url->link(t('Yes'), 'user', 'remove', array('user_id' => $user['id'], 'confirmation' => 'yes'), true, 'btn btn-red') ?> + <?= $this->url->link(t('Yes'), 'UserStatus', 'remove', array('user_id' => $user['id']), true, 'btn btn-red') ?> <?= t('or') ?> - <?= $this->url->link(t('cancel'), 'user', 'show', array('user_id' => $user['id'])) ?> + <?= $this->url->link(t('cancel'), 'user', 'index', array(), false, 'close-popover') ?> </div> -</div>
\ No newline at end of file +</div> |