diff options
Diffstat (limited to 'app/Template')
235 files changed, 2124 insertions, 1590 deletions
diff --git a/app/Template/action/event.php b/app/Template/action/event.php deleted file mode 100644 index 7f968a97..00000000 --- a/app/Template/action/event.php +++ /dev/null @@ -1,25 +0,0 @@ -<div class="page-header"> - <h2><?= t('Automatic actions for the project "%s"', $project['name']) ?></h2> -</div> - -<h3><?= t('Choose an event') ?></h3> -<form method="post" action="<?= $this->url->href('action', 'params', array('project_id' => $project['id'])) ?>"> - - <?= $this->form->csrf() ?> - - <?= $this->form->hidden('project_id', $values) ?> - <?= $this->form->hidden('action_name', $values) ?> - - <?= $this->form->label(t('Event'), 'event_name') ?> - <?= $this->form->select('event_name', $events, $values) ?><br/> - - <div class="form-help"> - <?= t('When the selected event occurs execute the corresponding action.') ?> - </div> - - <div class="form-actions"> - <input type="submit" value="<?= t('Next step') ?>" class="btn btn-blue"/> - <?= t('or') ?> - <?= $this->url->link(t('cancel'), 'action', 'index', array('project_id' => $project['id'])) ?> - </div> -</form>
\ No newline at end of file diff --git a/app/Template/action/index.php b/app/Template/action/index.php index 8275f080..63d63887 100644 --- a/app/Template/action/index.php +++ b/app/Template/action/index.php @@ -1,75 +1,71 @@ <div class="page-header"> <h2><?= t('Automatic actions for the project "%s"', $project['name']) ?></h2> + <ul> + <li> + <i class="fa fa-plus fa-fw"></i> + <?= $this->url->link(t('Add a new action'), 'ActionCreation', 'create', array('project_id' => $project['id']), false, 'popover') ?> + </li> + <li> + <i class="fa fa-copy fa-fw"></i> + <?= $this->url->link(t('Import from another project'), 'ActionProject', 'project', array('project_id' => $project['id']), false, 'popover') ?> + </li> + </ul> </div> -<?php if (! empty($actions)): ?> +<?php if (empty($actions)): ?> + <p class="alert"><?= t('There is no action at the moment.') ?></p> +<?php else: ?> + <table> + <tr> + <th><?= t('Automatic actions') ?></th> + <th><?= t('Action parameters') ?></th> + <th><?= t('Action') ?></th> + </tr> -<h3><?= t('Defined actions') ?></h3> -<table> - <tr> - <th><?= t('Automatic actions') ?></th> - <th><?= t('Action parameters') ?></th> - <th><?= t('Action') ?></th> - </tr> - - <?php foreach ($actions as $action): ?> - <tr> - <td> - <ul> - <li> - <?= t('Event name') ?> = - <strong><?= $this->text->in($action['event_name'], $available_events) ?></strong> - </li> - <li> - <?= t('Action name') ?> = - <strong><?= $this->text->in($action['action_name'], $available_actions) ?></strong> - </li> - <ul> - </td> - <td> - <ul> - <?php foreach ($action['params'] as $param_name => $param_value): ?> - <li> - <?= $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 else: ?> - <?= $this->e($param_value) ?> - <?php endif ?> - </strong> - </li> - <?php endforeach ?> - </ul> - </td> - <td> - <?= $this->url->link(t('Remove'), 'action', 'confirm', array('project_id' => $project['id'], 'action_id' => $action['id'])) ?> - </td> - </tr> - <?php endforeach ?> -</table> - -<?php endif ?> - -<h3><?= t('Add an action') ?></h3> -<form method="post" action="<?= $this->url->href('action', 'event', array('project_id' => $project['id'])) ?>" class="listing"> - <?= $this->form->csrf() ?> - <?= $this->form->hidden('project_id', $values) ?> - - <?= $this->form->label(t('Action'), 'action_name') ?> - <?= $this->form->select('action_name', $available_actions, $values) ?><br/> - - <div class="form-actions"> - <input type="submit" value="<?= t('Next step') ?>" class="btn btn-blue"/> - </div> -</form>
\ No newline at end of file + <?php foreach ($actions as $action): ?> + <tr> + <td> + <ul> + <li> + <?= t('Event name') ?> = + <strong><?= $this->text->in($action['event_name'], $available_events) ?></strong> + </li> + <li> + <?= t('Action name') ?> = + <strong><?= $this->text->in($action['action_name'], $available_actions) ?></strong> + </li> + <ul> + </td> + <td> + <ul> + <?php foreach ($action['params'] as $param_name => $param_value): ?> + <li> + <?= $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 else: ?> + <?= $this->text->e($param_value) ?> + <?php endif ?> + </strong> + </li> + <?php endforeach ?> + </ul> + </td> + <td> + <?= $this->url->link(t('Remove'), 'action', 'confirm', array('project_id' => $project['id'], 'action_id' => $action['id']), false, 'popover') ?> + </td> + </tr> + <?php endforeach ?> + </table> +<?php endif ?>
\ No newline at end of file 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/action_creation/create.php b/app/Template/action_creation/create.php new file mode 100644 index 00000000..bccb19b3 --- /dev/null +++ b/app/Template/action_creation/create.php @@ -0,0 +1,16 @@ +<div class="page-header"> + <h2><?= t('Add an action') ?></h2> +</div> +<form class="popover-form" method="post" action="<?= $this->url->href('ActionCreation', 'event', array('project_id' => $project['id'])) ?>"> + <?= $this->form->csrf() ?> + <?= $this->form->hidden('project_id', $values) ?> + + <?= $this->form->label(t('Action'), 'action_name') ?> + <?= $this->form->select('action_name', $available_actions, $values) ?> + + <div class="form-actions"> + <button type="submit" class="btn btn-blue"><?= t('Next step') ?></button> + <?= t('or') ?> + <?= $this->url->link(t('cancel'), 'Action', 'index', array(), false, 'close-popover') ?> + </div> +</form>
\ No newline at end of file diff --git a/app/Template/action_creation/event.php b/app/Template/action_creation/event.php new file mode 100644 index 00000000..e7e5aaf9 --- /dev/null +++ b/app/Template/action_creation/event.php @@ -0,0 +1,27 @@ +<div class="page-header"> + <h2><?= t('Choose an event') ?></h2> +</div> + +<form class="popover-form" method="post" action="<?= $this->url->href('ActionCreation', 'params', array('project_id' => $project['id'])) ?>"> + + <?= $this->form->csrf() ?> + + <?= $this->form->hidden('project_id', $values) ?> + <?= $this->form->hidden('action_name', $values) ?> + + <?= $this->form->label(t('Action'), 'action_name') ?> + <?= $this->form->select('action_name', $available_actions, $values, array(), array('disabled')) ?> + + <?= $this->form->label(t('Event'), 'event_name') ?> + <?= $this->form->select('event_name', $events, $values) ?> + + <div class="form-help"> + <?= t('When the selected event occurs execute the corresponding action.') ?> + </div> + + <div class="form-actions"> + <button type="submit" class="btn btn-blue"><?= t('Next step') ?></button> + <?= t('or') ?> + <?= $this->url->link(t('cancel'), 'action', 'index', array('project_id' => $project['id']), false, 'close-popover') ?> + </div> +</form>
\ No newline at end of file diff --git a/app/Template/action/params.php b/app/Template/action_creation/params.php index dcfaa9cc..59ff6ce9 100644 --- a/app/Template/action/params.php +++ b/app/Template/action_creation/params.php @@ -1,9 +1,8 @@ <div class="page-header"> - <h2><?= t('Automatic actions for the project "%s"', $project['name']) ?></h2> + <h2><?= t('Define action parameters') ?></h2> </div> -<h3><?= t('Define action parameters') ?></h3> -<form method="post" action="<?= $this->url->href('action', 'create', array('project_id' => $project['id'])) ?>" autocomplete="off"> +<form class="popover-form" method="post" action="<?= $this->url->href('ActionCreation', 'save', array('project_id' => $project['id'])) ?>" autocomplete="off"> <?= $this->form->csrf() ?> @@ -11,36 +10,43 @@ <?= $this->form->hidden('event_name', $values) ?> <?= $this->form->hidden('action_name', $values) ?> - <?php foreach ($action_params as $param_name => $param_desc): ?> + <?= $this->form->label(t('Action'), 'action_name') ?> + <?= $this->form->select('action_name', $available_actions, $values, array(), array('disabled')) ?> + + <?= $this->form->label(t('Event'), 'event_name') ?> + <?= $this->form->select('event_name', $events, $values, array(), array('disabled')) ?> + <?php foreach ($action_params as $param_name => $param_desc): ?> <?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) ?> <?php endif ?> - <?php endforeach ?> <div class="form-actions"> - <input type="submit" value="<?= t('Save this action') ?>" class="btn btn-blue"/> + <button type="submit" class="btn btn-blue"><?= t('Save') ?></button> <?= 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> </form>
\ No newline at end of file diff --git a/app/Template/action_project/project.php b/app/Template/action_project/project.php new file mode 100644 index 00000000..226f3b19 --- /dev/null +++ b/app/Template/action_project/project.php @@ -0,0 +1,20 @@ +<div class="page-header"> + <h2><?= t('Import actions from another project') ?></h2> +</div> +<?php if (empty($projects_list)): ?> + <p class="alert"><?= t('There is no available project.') ?></p> +<?php else: ?> + <form class="popover-form" method="post" action="<?= $this->url->href('ActionProject', 'save', array('project_id' => $project['id'])) ?>" autocomplete="off"> + + <?= $this->form->csrf() ?> + + <?= $this->form->label(t('Create from another project'), 'src_project_id') ?> + <?= $this->form->select('src_project_id', $projects_list) ?> + + <div class="form-actions"> + <button type="submit" class="btn btn-blue"><?= t('Save') ?></button> + <?= t('or') ?> + <?= $this->url->link(t('cancel'), 'Action', 'index', array(), false, 'close-popover') ?> + </div> + </form> +<?php endif ?>
\ No newline at end of file diff --git a/app/Template/analytic/avg_time_columns.php b/app/Template/analytic/avg_time_columns.php index 7b9d7cf9..5f6c6b35 100644 --- a/app/Template/analytic/avg_time_columns.php +++ b/app/Template/analytic/avg_time_columns.php @@ -16,7 +16,7 @@ </tr> <?php foreach ($metrics as $column): ?> <tr> - <td><?= $this->e($column['title']) ?></td> + <td><?= $this->text->e($column['title']) ?></td> <td><?= $this->dt->duration($column['average']) ?></td> </tr> <?php endforeach ?> diff --git a/app/Template/analytic/burndown.php b/app/Template/analytic/burndown.php index 3dfb6ee8..ed6c8aeb 100644 --- a/app/Template/analytic/burndown.php +++ b/app/Template/analytic/burndown.php @@ -27,7 +27,7 @@ </div> <div class="form-inline-group"> - <input type="submit" value="<?= t('Execute') ?>" class="btn btn-blue"/> + <button type="submit" class="btn btn-blue"><?= t('Execute') ?></button> </div> </form> diff --git a/app/Template/analytic/cfd.php b/app/Template/analytic/cfd.php index 45f53e0f..ee259c70 100644 --- a/app/Template/analytic/cfd.php +++ b/app/Template/analytic/cfd.php @@ -27,6 +27,6 @@ </div> <div class="form-inline-group"> - <input type="submit" value="<?= t('Execute') ?>" class="btn btn-blue"/> + <button type="submit" class="btn btn-blue"><?= t('Execute') ?></button> </div> </form> diff --git a/app/Template/analytic/compare_hours.php b/app/Template/analytic/compare_hours.php index bb145d61..8249e7ba 100644 --- a/app/Template/analytic/compare_hours.php +++ b/app/Template/analytic/compare_hours.php @@ -4,8 +4,8 @@ <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> + <li><?= t('Estimated hours: ').'<strong>'.$this->text->e($metrics['open']['time_estimated'] + $metrics['closed']['time_estimated']) ?></strong></li> + <li><?= t('Actual hours: ').'<strong>'.$this->text->e($metrics['open']['time_spent'] + $metrics['closed']['time_spent']) ?></strong></li> </ul> </div> @@ -34,10 +34,10 @@ <?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->url->link('#'.$this->text->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')) ?> + <?= $this->url->link($this->text->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): ?> @@ -47,10 +47,10 @@ <?php endif ?> </td> <td> - <?= $this->e($task['time_estimated']) ?> + <?= $this->text->e($task['time_estimated']) ?> </td> <td> - <?= $this->e($task['time_spent']) ?> + <?= $this->text->e($task['time_spent']) ?> </td> </tr> <?php endforeach ?> diff --git a/app/Template/analytic/layout.php b/app/Template/analytic/layout.php index ff532fc0..f1dba552 100644 --- a/app/Template/analytic/layout.php +++ b/app/Template/analytic/layout.php @@ -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/lead_cycle_time.php b/app/Template/analytic/lead_cycle_time.php index 8e04bd6d..82ffe534 100644 --- a/app/Template/analytic/lead_cycle_time.php +++ b/app/Template/analytic/lead_cycle_time.php @@ -31,7 +31,7 @@ </div> <div class="form-inline-group"> - <input type="submit" value="<?= t('Execute') ?>" class="btn btn-blue"/> + <button type="submit" class="btn btn-blue"><?= t('Execute') ?></button> </div> </form> diff --git a/app/Template/analytic/sidebar.php b/app/Template/analytic/sidebar.php index 19eef8d5..76289b9f 100644 --- a/app/Template/analytic/sidebar.php +++ b/app/Template/analytic/sidebar.php @@ -22,7 +22,8 @@ <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> diff --git a/app/Template/analytic/tasks.php b/app/Template/analytic/tasks.php index 7392ee56..9e7b1fd7 100644 --- a/app/Template/analytic/tasks.php +++ b/app/Template/analytic/tasks.php @@ -18,7 +18,7 @@ <?php foreach ($metrics as $metric): ?> <tr> <td> - <?= $this->e($metric['column_title']) ?> + <?= $this->text->e($metric['column_title']) ?> </td> <td> <?= $metric['nb_tasks'] ?> diff --git a/app/Template/analytic/users.php b/app/Template/analytic/users.php index 514d7133..9d1d3a1e 100644 --- a/app/Template/analytic/users.php +++ b/app/Template/analytic/users.php @@ -18,7 +18,7 @@ <?php foreach ($metrics as $metric): ?> <tr> <td> - <?= $this->e($metric['user']) ?> + <?= $this->text->e($metric['user']) ?> </td> <td> <?= $metric['nb_tasks'] ?> diff --git a/app/Template/app/filters_helper.php b/app/Template/app/filters_helper.php index e4cbb942..c16c2251 100644 --- a/app/Template/app/filters_helper.php +++ b/app/Template/app/filters_helper.php @@ -1,6 +1,6 @@ <?= $this->hook->render('template:app:filters-helper:before', isset($project) ? array('project' => $project) : array()) ?> -<div class="dropdown filters"> - <i class="fa fa-caret-down"></i> <a href="#" class="dropdown-menu"><?= t('Filters') ?></a> +<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> diff --git a/app/Template/app/layout.php b/app/Template/app/layout.php index ad1d5a9e..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->hasAccess('project', 'create')): ?> + <?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', 'createPrivate') ?> + <?= $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->hasAccess('user', 'index')): ?> - <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 ebb3b412..0b354791 100644 --- a/app/Template/app/overview.php +++ b/app/Template/app/overview.php @@ -1,11 +1,10 @@ -<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, 'user' => $user)) ?> diff --git a/app/Template/app/projects.php b/app/Template/app/projects.php index 61899c96..4ab8b106 100644 --- a/app/Template/app/projects.php +++ b/app/Template/app/projects.php @@ -8,7 +8,7 @@ <tr> <th class="column-5"><?= $paginator->order('Id', 'id') ?></th> <th class="column-3"><?= $paginator->order('<i class="fa fa-lock fa-fw" title="'.t('Private project').'"></i>', 'is_private') ?></th> - <th class="column-25"><?= $paginator->order(t('Project'), 'name') ?></th> + <th class="column-25"><?= $paginator->order(t('Project'), \Kanboard\Model\Project::TABLE.'.name') ?></th> <th><?= t('Columns') ?></th> </tr> <?php foreach ($paginator->getCollection() as $project): ?> @@ -29,9 +29,9 @@ <?= $this->url->link('<i class="fa fa-list"></i>', 'listing', 'show', array('project_id' => $project['id']), false, 'dashboard-table-link', t('List')) ?> <?= $this->url->link('<i class="fa fa-calendar"></i>', 'calendar', 'show', array('project_id' => $project['id']), false, 'dashboard-table-link', t('Calendar')) ?> - <?= $this->url->link($this->e($project['name']), 'board', 'show', array('project_id' => $project['id'])) ?> + <?= $this->url->link($this->text->e($project['name']), 'board', 'show', array('project_id' => $project['id'])) ?> <?php if (! empty($project['description'])): ?> - <span class="tooltip" title='<?= $this->e($this->text->markdown($project['description'])) ?>'> + <span class="tooltip" title='<?= $this->text->e($this->text->markdown($project['description'])) ?>'> <i class="fa fa-info-circle"></i> </span> <?php endif ?> @@ -39,7 +39,7 @@ <td class="dashboard-project-stats"> <?php foreach ($project['columns'] as $column): ?> <strong title="<?= t('Task count') ?>"><?= $column['nb_tasks'] ?></strong> - <span><?= $this->e($column['title']) ?></span> + <span><?= $this->text->e($column['title']) ?></span> <?php endforeach ?> </td> </tr> diff --git a/app/Template/app/sidebar.php b/app/Template/app/sidebar.php index b5e14aaf..66d15b14 100644 --- a/app/Template/app/sidebar.php +++ b/app/Template/app/sidebar.php @@ -1,5 +1,5 @@ <div class="sidebar"> - <h2><?= $this->e($user['name'] ?: $user['username']) ?></h2> + <h2><?= $this->text->e($user['name'] ?: $user['username']) ?></h2> <ul> <li <?= $this->app->checkMenuSelection('app', 'index') ?>> <?= $this->url->link(t('Overview'), 'app', 'index', array('user_id' => $user['id'])) ?> @@ -24,6 +24,4 @@ </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 b4c87bab..cca09481 100644 --- a/app/Template/app/subtasks.php +++ b/app/Template/app/subtasks.php @@ -6,7 +6,7 @@ <?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,24 +15,24 @@ <?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'])) ?> + <?= $this->url->link($this->text->e($subtask['project_name']), 'board', 'show', array('project_id' => $subtask['project_id'])) ?> </td> <td> - <?= $this->url->link($this->e($subtask['task_name']), 'task', 'show', array('task_id' => $subtask['task_id'], 'project_id' => $subtask['project_id'])) ?> + <?= $this->url->link($this->text->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'])): ?> - <strong><?= $this->e($subtask['time_spent']).'h' ?></strong> <?= t('spent') ?> + <strong><?= $this->text->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') ?> + <strong><?= $this->text->e($subtask['time_estimated']).'h' ?></strong> <?= t('estimated') ?> <?php endif ?> </td> </tr> diff --git a/app/Template/app/tasks.php b/app/Template/app/tasks.php index 1213e405..d7826fb7 100644 --- a/app/Template/app/tasks.php +++ b/app/Template/app/tasks.php @@ -6,7 +6,7 @@ <?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,25 +15,25 @@ <?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'])) ?> + <?= $this->url->link($this->text->e($task['project_name']), 'board', 'show', array('project_id' => $task['project_id'])) ?> </td> <td> - <?= $this->url->link($this->e($task['title']), 'task', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?> + <?= $this->url->link($this->text->e($task['title']), 'task', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?> </td> <td> <?php if (! empty($task['time_spent'])): ?> - <strong><?= $this->e($task['time_spent']).'h' ?></strong> <?= t('spent') ?> + <strong><?= $this->text->e($task['time_spent']).'h' ?></strong> <?= t('spent') ?> <?php endif ?> <?php if (! empty($task['time_estimated'])): ?> - <strong><?= $this->e($task['time_estimated']).'h' ?></strong> <?= t('estimated') ?> + <strong><?= $this->text->e($task['time_estimated']).'h' ?></strong> <?= t('estimated') ?> <?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 a1059d6f..cc562170 100644 --- a/app/Template/auth/index.php +++ b/app/Template/auth/index.php @@ -3,7 +3,7 @@ <?= $this->hook->render('template:auth:login-form:before') ?> <?php if (isset($errors['login'])): ?> - <p class="alert alert-error"><?= $this->e($errors['login']) ?></p> + <p class="alert alert-error"><?= $this->text->e($errors['login']) ?></p> <?php endif ?> <?php if (! HIDE_LOGIN_FORM): ?> @@ -28,7 +28,7 @@ <?php endif ?> <div class="form-actions"> - <input type="submit" value="<?= t('Sign in') ?>" class="btn btn-blue"/> + <button type="submit" class="btn btn-blue"><?= t('Sign in') ?></button> </div> <?php if ($this->app->config('password_reset') == 1): ?> <div class="reset-password"> @@ -39,21 +39,4 @@ <?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 e86ba420..87e16816 100644 --- a/app/Template/board/popover_assignee.php +++ b/app/Template/board/popover_assignee.php @@ -2,18 +2,17 @@ <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'])) ?>"> + <form class="popover-form" method="post" action="<?= $this->url->href('BoardPopover', 'updateAssignee', array('task_id' => $values['id'], 'project_id' => $project['id'])) ?>"> <?= $this->form->csrf() ?> <?= $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"/> + <button type="submit" class="btn btn-blue"><?= t('Save') ?></button> <?= t('or') ?> <?= $this->url->link(t('cancel'), 'board', 'show', array('project_id' => $project['id']), false, 'close-popover') ?> </div> diff --git a/app/Template/board/popover_category.php b/app/Template/board/popover_category.php index 224ce8d1..e3794760 100644 --- a/app/Template/board/popover_category.php +++ b/app/Template/board/popover_category.php @@ -2,18 +2,17 @@ <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'])) ?>"> + <form class="popover-form" method="post" action="<?= $this->url->href('BoardPopover', 'updateCategory', array('task_id' => $values['id'], 'project_id' => $project['id'])) ?>"> <?= $this->form->csrf() ?> <?= $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"/> + <button type="submit" class="btn btn-blue"><?= t('Save') ?></button> <?= t('or') ?> <?= $this->url->link(t('cancel'), 'board', 'show', array('project_id' => $project['id']), false, 'close-popover') ?> </div> diff --git a/app/Template/board/popover_close_all_tasks_column.php b/app/Template/board/popover_close_all_tasks_column.php index da6b9ad7..5090f499 100644 --- a/app/Template/board/popover_close_all_tasks_column.php +++ b/app/Template/board/popover_close_all_tasks_column.php @@ -10,7 +10,7 @@ <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"> + <button type="submit" class="btn btn-red"><?= t('Save') ?></button> <?= t('or') ?> <?= $this->url->link(t('cancel'), 'board', 'show', array('project_id' => $project['id']), false, 'close-popover') ?> </div> diff --git a/app/Template/board/table_column.php b/app/Template/board/table_column.php index 8c97f7d5..48538c88 100644 --- a/app/Template/board/table_column.php +++ b/app/Template/board/table_column.php @@ -26,10 +26,10 @@ <span class="board-column-title"> <?php if ($not_editable): ?> - <?= $this->e($column['title']) ?> + <?= $this->text->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> + <a href="#" class="dropdown-menu"><?= $this->text->e($column['title']) ?> <i class="fa fa-caret-down"></i></a> <ul> <li> <i class="fa fa-minus-square fa-fw"></i> @@ -47,8 +47,8 @@ </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> + <span class="tooltip pull-right" title='<?= $this->text->e($this->text->markdown($column['description'])) ?>'> + <i class="fa fa-info-circle"></i> </span> <?php endif ?> @@ -60,7 +60,7 @@ <?php if ($column['task_limit']): ?> <span title="<?= t('Task limit') ?>"> - (<span id="task-number-column-<?= $column['id'] ?>"><?= $column['nb_tasks'] ?></span>/<?= $this->e($column['task_limit']) ?>) + (<span id="task-number-column-<?= $column['id'] ?>"><?= $column['nb_tasks'] ?></span>/<?= $this->text->e($column['task_limit']) ?>) </span> <?php else: ?> <span title="<?= t('Task count') ?>" class="board-column-header-task-count"> diff --git a/app/Template/board/table_swimlane.php b/app/Template/board/table_swimlane.php index 44607859..349b9acb 100644 --- a/app/Template/board/table_swimlane.php +++ b/app/Template/board/table_swimlane.php @@ -8,7 +8,7 @@ </a> <?php endif ?> - <?= $this->e($swimlane['name']) ?> + <?= $this->text->e($swimlane['name']) ?> <?php if (! $not_editable && ! empty($swimlane['description'])): ?> <span diff --git a/app/Template/board/table_tasks.php b/app/Template/board/table_tasks.php index e99e14fb..fd9ce5e7 100644 --- a/app/Template/board/table_tasks.php +++ b/app/Template/board/table_tasks.php @@ -22,7 +22,7 @@ <div class="board-column-collapsed"> <div class="board-rotation-wrapper"> <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']) ?> + <i class="fa fa-plus-square tooltip" title="<?= $this->text->e($column['title']) ?>"></i> <?= $this->text->e($column['title']) ?> </div> </div> </div> diff --git a/app/Template/board/task_footer.php b/app/Template/board/task_footer.php index 26f3b1d4..d8b21a5b 100644 --- a/app/Template/board/task_footer.php +++ b/app/Template/board/task_footer.php @@ -2,10 +2,10 @@ <div class="task-board-category-container"> <span class="task-board-category"> <?php if ($not_editable): ?> - <?= $this->e($task['category_name']) ?> + <?= $this->text->e($task['category_name']) ?> <?php else: ?> <?= $this->url->link( - $this->e($task['category_name']), + $this->text->e($task['category_name']), 'boardPopover', 'changeCategory', array('task_id' => $task['id'], 'project_id' => $task['project_id']), @@ -22,7 +22,7 @@ <?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 ?> @@ -35,7 +35,11 @@ <?php endif ?> <?php if (! empty($task['nb_links'])): ?> - <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"></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'])): ?> @@ -57,11 +61,11 @@ <?php endif ?> <?php if ($task['score']): ?> - <span class="task-score"><?= $this->e($task['score']) ?></span> + <span class="task-score"><?= $this->text->e($task['score']) ?></span> <?php endif ?> <?php if (! empty($task['time_estimated'])): ?> - <span class="task-time-estimated" title="<?= t('Time estimated') ?>"><?= $this->e($task['time_estimated']).'h' ?></span> + <span class="task-time-estimated" title="<?= t('Time estimated') ?>"><?= $this->text->e($task['time_estimated']).'h' ?></span> <?php endif ?> <?php if ($task['is_milestone'] == 1): ?> diff --git a/app/Template/board/task_menu.php b/app/Template/board/task_menu.php index b5ed125d..bd582185 100644 --- a/app/Template/board/task_menu.php +++ b/app/Template/board/task_menu.php @@ -7,11 +7,12 @@ <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-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 4880af00..50efe2f6 100644 --- a/app/Template/board/task_private.php +++ b/app/Template/board/task_private.php @@ -23,11 +23,11 @@ <?php endif ?> <?php if (! empty($task['assignee_username'])): ?> - <span title="<?= $this->e($task['assignee_name'] ?: $task['assignee_username']) ?>"> - <?= $this->e($this->user->getInitials($task['assignee_name'] ?: $task['assignee_username'])) ?> + <span title="<?= $this->text->e($task['assignee_name'] ?: $task['assignee_username']) ?>"> + <?= $this->text->e($this->user->getInitials($task['assignee_name'] ?: $task['assignee_username'])) ?> </span> - <?php endif ?> - <?= $this->url->link($this->e($task['title']), 'task', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id']), false, 'task-board-collapsed-title tooltip', $this->e($task['title'])) ?> + <?= $this->url->link($this->text->e($task['title']), 'task', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id']), false, 'task-board-collapsed-title tooltip', $this->text->e($task['title'])) ?> </div> <?php else: ?> <div class="task-board-expanded"> @@ -57,7 +57,7 @@ t('Change assignee') ) ?> <?php else: ?> - <?= $this->e($task['assignee_name'] ?: $task['assignee_username']) ?> + <?= $this->text->e($task['assignee_name'] ?: $task['assignee_username']) ?> <?php endif ?> </span> <?php endif ?> @@ -72,7 +72,7 @@ <?php endif ?> <div class="task-board-title"> - <?= $this->url->link($this->e($task['title']), 'task', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id']), false, '', t('View this task')) ?> + <?= $this->url->link($this->text->e($task['title']), 'task', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id']), false, '', t('View this task')) ?> </div> <?= $this->render('board/task_footer', array( diff --git a/app/Template/board/task_public.php b/app/Template/board/task_public.php index d02722bb..9058f897 100644 --- a/app/Template/board/task_public.php +++ b/app/Template/board/task_public.php @@ -19,7 +19,7 @@ </span> <div class="task-board-title"> - <?= $this->url->link($this->e($task['title']), 'task', 'readonly', array('task_id' => $task['id'], 'token' => $project['token'])) ?> + <?= $this->url->link($this->text->e($task['title']), 'task', 'readonly', array('task_id' => $task['id'], 'token' => $project['token'])) ?> </div> <?= $this->render('board/task_footer', array( diff --git a/app/Template/board/tooltip_comments.php b/app/Template/board/tooltip_comments.php index 2e2c0c1e..6665bc7d 100644 --- a/app/Template/board/tooltip_comments.php +++ b/app/Template/board/tooltip_comments.php @@ -2,9 +2,9 @@ <?php foreach ($comments as $comment): ?> <p class="comment-title"> <?php if (! empty($comment['username'])): ?> - <span class="comment-username"><?= $this->e($comment['name'] ?: $comment['username']) ?></span> @ + <span class="comment-username"><?= $this->text->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..24cd1d88 --- /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->text->e($link['title']) ?></a> + </td> + <td> + <?= $this->text->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..39823757 100644 --- a/app/Template/board/tooltip_files.php +++ b/app/Template/board/tooltip_files.php @@ -3,14 +3,14 @@ <tr> <th> <i class="fa <?= $this->file->icon($file['name']) ?> fa-fw"></i> - <?= $this->e($file['name']) ?> + <?= $this->text->e($file['name']) ?> </th> </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 5c273e08..126a319f 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', $task['project_id']) ?> - <?= $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->text->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..cabe43d8 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->text->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->text->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 d74e945e..7085b51e 100644 --- a/app/Template/calendar/show.php +++ b/app/Template/calendar/show.php @@ -1,5 +1,5 @@ <section id="main"> - <?= $this->render('project/filters', array( + <?= $this->render('project_header/header', array( 'project' => $project, 'filters' => $filters, )) ?> diff --git a/app/Template/category/edit.php b/app/Template/category/edit.php index 1aae2f2a..78156e6f 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"/> + <button type="submit" class="btn btn-blue"><?= t('Save') ?></button> <?= 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 4602f3b9..b3bdfd81 100644 --- a/app/Template/category/index.php +++ b/app/Template/category/index.php @@ -9,16 +9,16 @@ </tr> <?php foreach ($categories as $category_id => $category_name): ?> <tr> - <td><?= $this->e($category_name) ?></td> + <td><?= $this->text->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> @@ -40,6 +40,6 @@ <?= $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"/> + <button type="submit" class="btn btn-blue"><?= t('Save') ?></button> </div> </form>
\ No newline at end of file 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..747b1529 --- /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"> + <button type="submit" class="btn btn-blue"><?= t('Save') ?></button> + <?= 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..206322cd 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"/> + <button type="submit" class="btn btn-blue"><?= t('Save') ?></button> <?= 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 17651d46..eef176f3 100644 --- a/app/Template/column/index.php +++ b/app/Template/column/index.php @@ -1,92 +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 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><?= $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->text->e($column['title']) ?> + <?php if (! empty($column['description'])): ?> + <span class="tooltip" title='<?= $this->text->e($this->text->markdown($column['description'])) ?>'> + <i class="fa fa-info-circle"></i> + </span> + <?php endif ?> + </td> + <td> + <?= $this->text->e($column['task_limit']) ?> </td> - <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'])) ?> - </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) ?> + <?= $this->url->link(t('Edit'), 'column', 'edit', array('project_id' => $project['id'], 'column_id' => $column['id']), false, 'popover') ?> </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 e9a6404d..574eec9f 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) ?> @@ -38,14 +37,10 @@ <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"/> + <button type="submit" class="btn btn-blue"><?= t('Save') ?></button> <?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..ad6f58fb 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"/> + <button type="submit" class="btn btn-blue"><?= t('Save') ?></button> <?= 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 44457653..873e1470 100644 --- a/app/Template/comment/show.php +++ b/app/Template/comment/show.php @@ -6,10 +6,10 @@ <?php endif ?> <?php if (! empty($comment['username'])): ?> - <span class="comment-username"><?= $this->e($comment['name'] ?: $comment['username']) ?></span> @ + <span class="comment-username"><?= $this->text->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"> @@ -18,10 +18,10 @@ <li><a href="#comment-<?= $comment['id'] ?>"><?= t('link') ?></a></li> <?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..968b109a 100644 --- a/app/Template/config/about.php +++ b/app/Template/config/about.php @@ -29,7 +29,7 @@ <ul> <li> <?= t('Database driver:') ?> - <strong><?= $this->e(DB_DRIVER) ?></strong> + <strong><?= $this->text->e(DB_DRIVER) ?></strong> </li> <?php if (DB_DRIVER === 'sqlite'): ?> <li> @@ -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/api.php b/app/Template/config/api.php index 489f1968..3ebbb956 100644 --- a/app/Template/config/api.php +++ b/app/Template/config/api.php @@ -5,7 +5,7 @@ <ul> <li> <?= t('API token:') ?> - <strong><?= $this->e($values['api_token']) ?></strong> + <strong><?= $this->text->e($values['api_token']) ?></strong> </li> <li> <?= t('API endpoint:') ?> diff --git a/app/Template/config/application.php b/app/Template/config/application.php index ec7d8462..259756bc 100644 --- a/app/Template/config/application.php +++ b/app/Template/config/application.php @@ -1,14 +1,13 @@ <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/"')) ?> - <p class="form-help"><?= t('Example: http://example.kanboard.net/ (used by email notifications)') ?></p> + <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) ?> @@ -20,13 +19,20 @@ <?= $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) ?> + + <?= $this->hook->render('template:config:application', array('values' => $values, 'errors' => $errors)) ?> <div class="form-actions"> - <input type="submit" value="<?= t('Save') ?>" class="btn btn-blue"/> + <button type="submit" class="btn btn-blue"><?= t('Save') ?></button> </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..ba1bab59 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"/> + <button type="submit" class="btn btn-blue"><?= t('Save') ?></button> </div> </form> -</section>
\ No newline at end of file diff --git a/app/Template/config/calendar.php b/app/Template/config/calendar.php index f5250132..b7b230df 100644 --- a/app/Template/config/calendar.php +++ b/app/Template/config/calendar.php @@ -28,7 +28,7 @@ </div> <div class="form-actions"> - <input type="submit" value="<?= t('Save') ?>" class="btn btn-blue"/> + <button type="submit" class="btn btn-blue"><?= t('Save') ?></button> </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..e404c52e 100644 --- a/app/Template/config/integrations.php +++ b/app/Template/config/integrations.php @@ -3,35 +3,15 @@ </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) ?> </div> <div class="form-actions"> - <input type="submit" value="<?= t('Save') ?>" class="btn btn-blue"/> + <button type="submit" class="btn btn-blue"><?= t('Save') ?></button> </div> </form>
\ No newline at end of file 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/plugins.php b/app/Template/config/plugins.php index 4a263ce7..04b3f095 100644 --- a/app/Template/config/plugins.php +++ b/app/Template/config/plugins.php @@ -17,14 +17,14 @@ <tr> <td> <?php if ($plugin->getPluginHomepage()): ?> - <a href="<?= $plugin->getPluginHomepage() ?>" target="_blank" rel="noreferrer"><?= $this->e($plugin->getPluginName()) ?></a> + <a href="<?= $plugin->getPluginHomepage() ?>" target="_blank" rel="noreferrer"><?= $this->text->e($plugin->getPluginName()) ?></a> <?php else: ?> - <?= $this->e($plugin->getPluginName()) ?> + <?= $this->text->e($plugin->getPluginName()) ?> <?php endif ?> </td> - <td><?= $this->e($plugin->getPluginAuthor()) ?></td> - <td><?= $this->e($plugin->getPluginVersion()) ?></td> - <td><?= $this->e($plugin->getPluginDescription()) ?></td> + <td><?= $this->text->e($plugin->getPluginAuthor()) ?></td> + <td><?= $this->text->e($plugin->getPluginVersion()) ?></td> + <td><?= $this->text->e($plugin->getPluginDescription()) ?></td> </tr> <?php endforeach ?> <?php endif ?>
\ No newline at end of file diff --git a/app/Template/config/project.php b/app/Template/config/project.php index c58a7bac..b6b7ec25 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"/> + <button type="submit" class="btn btn-blue"><?= t('Save') ?></button> </div> </form> -</section>
\ No newline at end of file diff --git a/app/Template/config/sidebar.php b/app/Template/config/sidebar.php index a8174505..dd51bc74 100644 --- a/app/Template/config/sidebar.php +++ b/app/Template/config/sidebar.php @@ -34,11 +34,6 @@ <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/config/webhook.php b/app/Template/config/webhook.php index f1a98f8b..b96979a0 100644 --- a/app/Template/config/webhook.php +++ b/app/Template/config/webhook.php @@ -10,7 +10,7 @@ <?= $this->form->text('webhook_url', $values, $errors) ?> <div class="form-actions"> - <input type="submit" value="<?= t('Save') ?>" class="btn btn-blue"/> + <button type="submit" class="btn btn-blue"><?= t('Save') ?></button> </div> </form> </section> @@ -22,7 +22,7 @@ <ul> <li> <?= t('Webhook token:') ?> - <strong><?= $this->e($values['webhook_token']) ?></strong> + <strong><?= $this->text->e($values['webhook_token']) ?></strong> </li> <li> <?= t('URL for task creation:') ?> diff --git a/app/Template/currency/index.php b/app/Template/currency/index.php index 1c78c47a..d35ac459 100644 --- a/app/Template/currency/index.php +++ b/app/Template/currency/index.php @@ -12,7 +12,7 @@ <?php foreach ($rates as $rate): ?> <tr> <td> - <strong><?= $this->e($rate['currency']) ?></strong> + <strong><?= $this->text->e($rate['currency']) ?></strong> </td> <td> <?= n($rate['rate']) ?> @@ -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"/> + <button type="submit" class="btn btn-blue"><?= t('Save') ?></button> </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"/> + <button type="submit" class="btn btn-blue"><?= t('Save') ?></button> </div> </form> diff --git a/app/Template/custom_filter/add.php b/app/Template/custom_filter/add.php index 361083ee..e3e144ae 100644 --- a/app/Template/custom_filter/add.php +++ b/app/Template/custom_filter/add.php @@ -19,6 +19,6 @@ <?= $this->form->checkbox('append', t('Append filter (instead of replacement)'), 1) ?> <div class="form-actions"> - <input type="submit" value="<?= t('Save') ?>" class="btn btn-blue"> + <button type="submit" class="btn btn-blue"><?= t('Save') ?></button> </div> </form>
\ No newline at end of file diff --git a/app/Template/custom_filter/edit.php b/app/Template/custom_filter/edit.php index adae6b4f..5d07e8c2 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() ?> @@ -25,8 +25,8 @@ <?= $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"> + <button type="submit" class="btn btn-blue"><?= t('Save') ?></button> <?= 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 7868384f..12a4eece 100644 --- a/app/Template/custom_filter/index.php +++ b/app/Template/custom_filter/index.php @@ -14,8 +14,8 @@ </tr> <?php foreach ($custom_filters as $filter): ?> <tr> - <td><?= $this->e($filter['name']) ?></td> - <td><?= $this->e($filter['filter']) ?></td> + <td><?= $this->text->e($filter['name']) ?></td> + <td><?= $this->text->e($filter['filter']) ?></td> <td> <?php if ($filter['is_shared'] == 1): ?> <?= t('Yes') ?> @@ -30,14 +30,14 @@ <?= t('Replace') ?> <?php endif ?> </td> - <td><?= $this->e($filter['owner_name'] ?: $filter['owner_username']) ?></td> + <td><?= $this->text->e($filter['owner_name'] ?: $filter['owner_username']) ?></td> <td> <?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 ?> 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/comment_create.php b/app/Template/event/comment_create.php index 462f15ca..063736b3 100644 --- a/app/Template/event/comment_create.php +++ b/app/Template/event/comment_create.php @@ -2,11 +2,11 @@ <p class="activity-title"> <?= e('%s commented the task %s', - $this->e($author), + $this->text->e($author), $this->url->link(t('#%d', $task['id']), 'task', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ) ?> </p> <div class="activity-description"> - <em><?= $this->e($task['title']) ?></em><br/> + <em><?= $this->text->e($task['title']) ?></em><br/> <div class="markdown"><?= $this->text->markdown($comment['comment']) ?></div> </div>
\ No newline at end of file diff --git a/app/Template/event/comment_update.php b/app/Template/event/comment_update.php index 0cb10bf6..93f24d8a 100644 --- a/app/Template/event/comment_update.php +++ b/app/Template/event/comment_update.php @@ -2,10 +2,10 @@ <p class="activity-title"> <?= e('%s updated a comment on the task %s', - $this->e($author), + $this->text->e($author), $this->url->link(t('#%d', $task['id']), 'task', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ) ?> </p> <div class="activity-description"> - <em><?= $this->e($task['title']) ?></em><br/> + <em><?= $this->text->e($task['title']) ?></em><br/> </div>
\ No newline at end of file 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/subtask_create.php b/app/Template/event/subtask_create.php index ca23aa9c..532783d5 100644 --- a/app/Template/event/subtask_create.php +++ b/app/Template/event/subtask_create.php @@ -2,16 +2,16 @@ <p class="activity-title"> <?= e('%s created a subtask for the task %s', - $this->e($author), + $this->text->e($author), $this->url->link(t('#%d', $task['id']), 'task', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ) ?> </p> <div class="activity-description"> - <p><em><?= $this->e($task['title']) ?></em></p> + <p><em><?= $this->text->e($task['title']) ?></em></p> <ul> <li> - <?= $this->e($subtask['title']) ?> (<strong><?= $this->e($subtask['status_name']) ?></strong>) + <?= $this->text->e($subtask['title']) ?> (<strong><?= $this->text->e($subtask['status_name']) ?></strong>) </li> <li> <?php if ($subtask['username']): ?> diff --git a/app/Template/event/subtask_update.php b/app/Template/event/subtask_update.php index 11a778de..e9ff6ac6 100644 --- a/app/Template/event/subtask_update.php +++ b/app/Template/event/subtask_update.php @@ -2,16 +2,16 @@ <p class="activity-title"> <?= e('%s updated a subtask for the task %s', - $this->e($author), + $this->text->e($author), $this->url->link(t('#%d', $task['id']), 'task', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ) ?> </p> <div class="activity-description"> - <p><em><?= $this->e($task['title']) ?></em></p> + <p><em><?= $this->text->e($task['title']) ?></em></p> <ul> <li> - <?= $this->e($subtask['title']) ?> (<strong><?= $this->e($subtask['status_name']) ?></strong>) + <?= $this->text->e($subtask['title']) ?> (<strong><?= $this->text->e($subtask['status_name']) ?></strong>) </li> <li> <?php if ($subtask['username']): ?> diff --git a/app/Template/event/task_assignee_change.php b/app/Template/event/task_assignee_change.php index cdec8743..580176c7 100644 --- a/app/Template/event/task_assignee_change.php +++ b/app/Template/event/task_assignee_change.php @@ -5,14 +5,14 @@ <?php if (! empty($assignee)): ?> <?= e('%s changed the assignee of the task %s to %s', - $this->e($author), + $this->text->e($author), $this->url->link(t('#%d', $task['id']), 'task', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id'])), - $this->e($assignee) + $this->text->e($assignee) ) ?> <?php else: ?> - <?= e('%s remove the assignee of 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']))) ?> + <?= e('%s remove the assignee of the task %s', $this->text->e($author), $this->url->link(t('#%d', $task['id']), 'task', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id']))) ?> <?php endif ?> </p> <p class="activity-description"> - <em><?= $this->e($task['title']) ?></em> + <em><?= $this->text->e($task['title']) ?></em> </p>
\ No newline at end of file diff --git a/app/Template/event/task_close.php b/app/Template/event/task_close.php index 3d8670a6..361458d3 100644 --- a/app/Template/event/task_close.php +++ b/app/Template/event/task_close.php @@ -2,10 +2,10 @@ <p class="activity-title"> <?= e('%s closed the task %s', - $this->e($author), + $this->text->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($task['title']) ?></em> + <em><?= $this->text->e($task['title']) ?></em> </p>
\ No newline at end of file diff --git a/app/Template/event/task_create.php b/app/Template/event/task_create.php index 773f401c..655bf8f3 100644 --- a/app/Template/event/task_create.php +++ b/app/Template/event/task_create.php @@ -2,10 +2,10 @@ <p class="activity-title"> <?= e('%s created the task %s', - $this->e($author), + $this->text->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($task['title']) ?></em> + <em><?= $this->text->e($task['title']) ?></em> </p>
\ No newline at end of file diff --git a/app/Template/event/file_create.php b/app/Template/event/task_file_create.php index 1a36bc8f..61bf3d61 100644 --- a/app/Template/event/file_create.php +++ b/app/Template/event/task_file_create.php @@ -2,10 +2,10 @@ <p class="activity-title"> <?= e('%s attached a new file to the task %s', - $this->e($author), + $this->text->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> + <em><?= $this->text->e($file['name']) ?></em> </p>
\ No newline at end of file diff --git a/app/Template/event/task_move_column.php b/app/Template/event/task_move_column.php index ca482e46..904c956c 100644 --- a/app/Template/event/task_move_column.php +++ b/app/Template/event/task_move_column.php @@ -2,11 +2,11 @@ <p class="activity-title"> <?= e('%s moved the task %s to the column "%s"', - $this->e($author), + $this->text->e($author), $this->url->link(t('#%d', $task['id']), 'task', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id'])), - $this->e($task['column_title']) + $this->text->e($task['column_title']) ) ?> </p> <p class="activity-description"> - <em><?= $this->e($task['title']) ?></em> + <em><?= $this->text->e($task['title']) ?></em> </p>
\ No newline at end of file diff --git a/app/Template/event/task_move_position.php b/app/Template/event/task_move_position.php index dcdd3e1b..6580bb79 100644 --- a/app/Template/event/task_move_position.php +++ b/app/Template/event/task_move_position.php @@ -2,12 +2,12 @@ <p class="activity-title"> <?= e('%s moved the task %s to the position #%d in the column "%s"', - $this->e($author), + $this->text->e($author), $this->url->link(t('#%d', $task['id']), 'task', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id'])), $task['position'], - $this->e($task['column_title']) + $this->text->e($task['column_title']) ) ?> </p> <p class="activity-description"> - <em><?= $this->e($task['title']) ?></em> + <em><?= $this->text->e($task['title']) ?></em> </p>
\ No newline at end of file diff --git a/app/Template/event/task_move_swimlane.php b/app/Template/event/task_move_swimlane.php index ca440dbf..9ffa554c 100644 --- a/app/Template/event/task_move_swimlane.php +++ b/app/Template/event/task_move_swimlane.php @@ -3,17 +3,17 @@ <p class="activity-title"> <?php if ($task['swimlane_id'] == 0): ?> <?= e('%s moved the task %s to the first swimlane', - $this->e($author), + $this->text->e($author), $this->url->link(t('#%d', $task['id']), 'task', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ) ?> <?php else: ?> <?= e('%s moved the task %s to the swimlane "%s"', - $this->e($author), + $this->text->e($author), $this->url->link(t('#%d', $task['id']), 'task', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id'])), - $this->e($task['swimlane_name']) + $this->text->e($task['swimlane_name']) ) ?> <?php endif ?> </p> <p class="activity-description"> - <em><?= $this->e($task['title']) ?></em> + <em><?= $this->text->e($task['title']) ?></em> </p>
\ No newline at end of file diff --git a/app/Template/event/task_open.php b/app/Template/event/task_open.php index 11fec64b..9db2e3c9 100644 --- a/app/Template/event/task_open.php +++ b/app/Template/event/task_open.php @@ -2,10 +2,10 @@ <p class="activity-title"> <?= e('%s opened the task %s', - $this->e($author), + $this->text->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($task['title']) ?></em> + <em><?= $this->text->e($task['title']) ?></em> </p>
\ No newline at end of file diff --git a/app/Template/event/task_update.php b/app/Template/event/task_update.php index e8254bcb..72d70495 100644 --- a/app/Template/event/task_update.php +++ b/app/Template/event/task_update.php @@ -2,12 +2,12 @@ <p class="activity-title"> <?= e('%s updated the task %s', - $this->e($author), + $this->text->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($task['title']) ?></em> + <em><?= $this->text->e($task['title']) ?></em> <?php if (isset($changes)): ?> <div class="activity-changes"> <?= $this->render('task/changes', array('changes' => $changes, 'task' => $task)) ?> 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..a82cb3d1 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"/> + <button type="submit" class="btn btn-blue"><?= t('Execute') ?></button> </div> </form>
\ No newline at end of file diff --git a/app/Template/export/summary.php b/app/Template/export/summary.php index ffbd6ac2..60aa306f 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"/> + <button type="submit" class="btn btn-blue"><?= t('Execute') ?></button> </div> </form>
\ No newline at end of file diff --git a/app/Template/export/tasks.php b/app/Template/export/tasks.php index c74c8f98..bed8ab90 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"/> + <button type="submit" class="btn btn-blue"><?= t('Execute') ?></button> </div> </form>
\ No newline at end of file diff --git a/app/Template/export/transitions.php b/app/Template/export/transitions.php index bf6ef249..093930a3 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"/> + <button type="submit" class="btn btn-blue"><?= t('Execute') ?></button> </div> </form>
\ No newline at end of file diff --git a/app/Template/feed/project.php b/app/Template/feed/project.php index 76cf6cf0..1c6d1166 100644 --- a/app/Template/feed/project.php +++ b/app/Template/feed/project.php @@ -15,7 +15,7 @@ <published><?= date(DATE_ATOM, $e['date_creation']) ?></published> <updated><?= date(DATE_ATOM, $e['date_creation']) ?></updated> <author> - <name><?= $this->e($e['author']) ?></name> + <name><?= $this->text->e($e['author']) ?></name> </author> <content type="html"> <![CDATA[ diff --git a/app/Template/feed/user.php b/app/Template/feed/user.php index 3e9606c6..28847f1f 100644 --- a/app/Template/feed/user.php +++ b/app/Template/feed/user.php @@ -15,7 +15,7 @@ <published><?= date(DATE_ATOM, $e['date_creation']) ?></published> <updated><?= date(DATE_ATOM, $e['date_creation']) ?></updated> <author> - <name><?= $this->e($e['author']) ?></name> + <name><?= $this->text->e($e['author']) ?></name> </author> <content type="html"> <![CDATA[ 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 b87739a8..00000000 --- a/app/Template/file/show.php +++ /dev/null @@ -1,58 +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> - <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> - <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') ?> - <?php if ($this->user->hasProjectAccess('file', 'remove', $task['project_id'])): ?> - <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'])) ?> - <?php endif ?> - <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"> - <?php if ($this->user->hasProjectAccess('file', 'remove', $task['project_id'])): ?> - <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'])) ?> - <?php endif ?> - <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..191aaa6c --- /dev/null +++ b/app/Template/file_viewer/show.php @@ -0,0 +1,14 @@ +<div class="page-header"> + <h2><?= $this->text->e($file['name']) ?></h2> +</div> +<div class="file-viewer"> + <?php if ($file['is_image']): ?> + <img src="<?= $this->url->href('FileViewer', 'image', $params) ?>" alt="<?= $this->text->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 46d2af91..84b260bb 100644 --- a/app/Template/gantt/projects.php +++ b/app/Template/gantt/projects.php @@ -1,12 +1,6 @@ <section id="main"> <div class="page-header"> <ul> - <?php if ($this->user->hasAccess('project', 'create')): ?> - <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> diff --git a/app/Template/gantt/task_creation.php b/app/Template/gantt/task_creation.php index 7997e231..ef1298a9 100644 --- a/app/Template/gantt/task_creation.php +++ b/app/Template/gantt/task_creation.php @@ -33,30 +33,17 @@ </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"> - <input type="submit" value="<?= t('Save') ?>" class="btn btn-blue" tabindex="11"/> + <button type="submit" class="btn btn-blue" tabindex="15"><?= t('Save') ?></button> <?= t('or') ?> <?= $this->url->link(t('cancel'), 'board', 'show', array('project_id' => $values['project_id']), false, 'close-popover') ?> </div> diff --git a/app/Template/group/associate.php b/app/Template/group/associate.php index dc665bb3..9de46f35 100644 --- a/app/Template/group/associate.php +++ b/app/Template/group/associate.php @@ -13,10 +13,10 @@ <?= $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') ?><br/> + <?= $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"/> + <button type="submit" class="btn btn-blue"><?= t('Save') ?></button> <?= t('or') ?> <?= $this->url->link(t('cancel'), 'group', 'index') ?> </div> diff --git a/app/Template/group/create.php b/app/Template/group/create.php index 696e5013..4ce6b1f3 100644 --- a/app/Template/group/create.php +++ b/app/Template/group/create.php @@ -8,10 +8,10 @@ <?= $this->form->csrf() ?> <?= $this->form->label(t('Name'), 'name') ?> - <?= $this->form->text('name', $values, $errors, array('autofocus', 'required', 'maxlength="100"')) ?><br/> + <?= $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"/> + <button type="submit" class="btn btn-blue"><?= t('Save') ?></button> <?= t('or') ?> <?= $this->url->link(t('cancel'), 'group', 'index') ?> </div> diff --git a/app/Template/group/edit.php b/app/Template/group/edit.php index 4d7e5e81..e9d9dd5a 100644 --- a/app/Template/group/edit.php +++ b/app/Template/group/edit.php @@ -11,10 +11,10 @@ <?= $this->form->hidden('external_id', $values) ?> <?= $this->form->label(t('Name'), 'name') ?> - <?= $this->form->text('name', $values, $errors, array('autofocus', 'required', 'maxlength="100"')) ?><br/> + <?= $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"/> + <button type="submit" class="btn btn-blue"><?= t('Save') ?></button> <?= t('or') ?> <?= $this->url->link(t('cancel'), 'group', 'index') ?> </div> diff --git a/app/Template/group/index.php b/app/Template/group/index.php index d111b5d9..8302e5a8 100644 --- a/app/Template/group/index.php +++ b/app/Template/group/index.php @@ -21,10 +21,10 @@ #<?= $group['id'] ?> </td> <td> - <?= $this->e($group['external_id']) ?> + <?= $this->text->e($group['external_id']) ?> </td> <td> - <?= $this->e($group['name']) ?> + <?= $this->text->e($group['name']) ?> </td> <td> <div class="dropdown"> diff --git a/app/Template/group/users.php b/app/Template/group/users.php index f79cb9ad..bbd41525 100644 --- a/app/Template/group/users.php +++ b/app/Template/group/users.php @@ -22,13 +22,13 @@ <?= $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'])) ?> + <?= $this->url->link($this->text->e($user['username']), 'user', 'show', array('user_id' => $user['id'])) ?> </td> <td> - <?= $this->e($user['name']) ?> + <?= $this->text->e($user['name']) ?> </td> <td> - <a href="mailto:<?= $this->e($user['email']) ?>"><?= $this->e($user['email']) ?></a> + <a href="mailto:<?= $this->text->e($user['email']) ?>"><?= $this->text->e($user['email']) ?></a> </td> <td> <?= $this->url->link(t('Remove this user'), 'group', 'dissociate', array('group_id' => $group['id'], 'user_id' => $user['id'])) ?> diff --git a/app/Template/header.php b/app/Template/header.php index 405d07b3..d891118c 100644 --- a/app/Template/header.php +++ b/app/Template/header.php @@ -5,10 +5,10 @@ <?= $this->url->link('K<span>B</span>', 'app', 'index', array(), false, '', t('Dashboard')) ?> </span> <span class="title"> - <?= $this->e($title) ?> + <?= $this->text->e($title) ?> </span> <?php if (! empty($description)): ?> - <span class="tooltip" title='<?= $this->e($this->text->markdown($description)) ?>'> + <span class="tooltip" title='<?= $this->text->e($this->text->markdown($description)) ?>'> <i class="fa fa-info-circle"></i> </span> <?php endif ?> @@ -26,28 +26,80 @@ data-redirect-url="<?= $this->url->href('board', 'show', array('project_id' => 'PROJECT_ID')) ?>"> <option value=""></option> <?php foreach ($board_selector as $board_id => $board_name): ?> - <option value="<?= $board_id ?>"><?= $this->e($board_name) ?></option> + <option value="<?= $board_id ?>"><?= $this->text->e($board_name) ?></option> <?php endforeach ?> </select> </li> <?php endif ?> - <li> + <li class="user-links"> <?php if ($this->user->hasNotifications()): ?> <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 ?> - <span class="dropdown"> + <?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 ?> + + <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><?= $this->url->link(t('My dashboard'), 'app', 'index', array('user_id' => $this->user->getId())) ?></li> - <li><?= $this->url->link(t('My profile'), 'user', 'show', array('user_id' => $this->user->getId())) ?></li> - <li><?= $this->url->link(t('Logout'), 'auth', 'logout') ?></li> + <li class="no-hover"><strong><?= $this->text->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> - </span> + </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 0c81aac2..a694a96a 100644 --- a/app/Template/layout.php +++ b/app/Template/layout.php @@ -30,7 +30,7 @@ <link rel="apple-touch-icon" sizes="114x114" href="<?= $this->url->dir() ?>assets/img/touch-icon-iphone-retina.png"> <link rel="apple-touch-icon" sizes="144x144" href="<?= $this->url->dir() ?>assets/img/touch-icon-ipad-retina.png"> - <title><?= isset($title) ? $this->e($title) : 'Kanboard' ?></title> + <title><?= isset($title) ? $this->text->e($title) : 'Kanboard' ?></title> <?= $this->hook->render('template:layout:head') ?> </head> diff --git a/app/Template/link/create.php b/app/Template/link/create.php index 2b4ac62c..3b36abee 100644 --- a/app/Template/link/create.php +++ b/app/Template/link/create.php @@ -13,6 +13,6 @@ <?= $this->form->text('opposite_label', $values, $errors) ?> <div class="form-actions"> - <input type="submit" value="<?= t('Save') ?>" class="btn btn-blue"/> + <button type="submit" class="btn btn-blue"><?= t('Save') ?></button> </div> </form>
\ No newline at end of file diff --git a/app/Template/link/edit.php b/app/Template/link/edit.php index 516de464..e91422be 100644 --- a/app/Template/link/edit.php +++ b/app/Template/link/edit.php @@ -14,7 +14,7 @@ <?= $this->form->select('opposite_id', $labels, $values, $errors) ?> <div class="form-actions"> - <input type="submit" value="<?= t('Save') ?>" class="btn btn-blue"/> + <button type="submit" class="btn btn-blue"><?= t('Save') ?></button> <?= t('or') ?> <?= $this->url->link(t('cancel'), 'link', 'index') ?> </div> diff --git a/app/Template/listing/show.php b/app/Template/listing/show.php index aa17b228..10dcedcc 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,29 +24,29 @@ <?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']) ?> + <?= $this->text->e($task['swimlane_name'] ?: $task['default_swimlane']) ?> </td> <td> - <?= $this->e($task['column_name']) ?> + <?= $this->text->e($task['column_name']) ?> </td> <td> - <?= $this->e($task['category_name']) ?> + <?= $this->text->e($task['category_name']) ?> </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')) ?> + <?= $this->url->link($this->text->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['assignee_username']): ?> - <?= $this->e($task['assignee_name'] ?: $task['assignee_username']) ?> + <?= $this->text->e($task['assignee_name'] ?: $task['assignee_username']) ?> <?php else: ?> <?= t('Unassigned') ?> <?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_create.php b/app/Template/notification/comment_create.php index 2f2c0fa6..fefc8ba1 100644 --- a/app/Template/notification/comment_create.php +++ b/app/Template/notification/comment_create.php @@ -1,4 +1,4 @@ -<h2><?= $this->e($task['title']) ?> (#<?= $task['id'] ?>)</h2> +<h2><?= $this->text->e($task['title']) ?> (#<?= $task['id'] ?>)</h2> <?php if (! empty($comment['username'])): ?> <h3><?= t('New comment posted by %s', $comment['name'] ?: $comment['username']) ?></h3> diff --git a/app/Template/notification/comment_update.php b/app/Template/notification/comment_update.php index a15e5d6d..2477d8b3 100644 --- a/app/Template/notification/comment_update.php +++ b/app/Template/notification/comment_update.php @@ -1,4 +1,4 @@ -<h2><?= $this->e($task['title']) ?> (#<?= $task['id'] ?>)</h2> +<h2><?= $this->text->e($task['title']) ?> (#<?= $task['id'] ?>)</h2> <h3><?= t('Comment updated') ?></h3> diff --git a/app/Template/notification/comment_user_mention.php b/app/Template/notification/comment_user_mention.php index 59f5127e..372183df 100644 --- a/app/Template/notification/comment_user_mention.php +++ b/app/Template/notification/comment_user_mention.php @@ -1,6 +1,6 @@ <h2><?= t('You were mentioned in a comment on the task #%d', $task['id']) ?></h2> -<p><?= $this->e($task['title']) ?></p> +<p><?= $this->text->e($task['title']) ?></p> <?= $this->text->markdown($comment['comment']) ?> diff --git a/app/Template/notification/subtask_create.php b/app/Template/notification/subtask_create.php index e1c62b73..f6f8ba13 100644 --- a/app/Template/notification/subtask_create.php +++ b/app/Template/notification/subtask_create.php @@ -1,15 +1,15 @@ -<h2><?= $this->e($task['title']) ?> (#<?= $task['id'] ?>)</h2> +<h2><?= $this->text->e($task['title']) ?> (#<?= $task['id'] ?>)</h2> <h3><?= t('New sub-task') ?></h3> <ul> - <li><?= t('Title:') ?> <?= $this->e($subtask['title']) ?></li> - <li><?= t('Status:') ?> <?= $this->e($subtask['status_name']) ?></li> - <li><?= t('Assignee:') ?> <?= $this->e($subtask['name'] ?: $subtask['username'] ?: '?') ?></li> + <li><?= t('Title:') ?> <?= $this->text->e($subtask['title']) ?></li> + <li><?= t('Status:') ?> <?= $this->text->e($subtask['status_name']) ?></li> + <li><?= t('Assignee:') ?> <?= $this->text->e($subtask['name'] ?: $subtask['username'] ?: '?') ?></li> <li> <?= t('Time tracking:') ?> <?php if (! empty($subtask['time_estimated'])): ?> - <strong><?= $this->e($subtask['time_estimated']).'h' ?></strong> <?= t('estimated') ?> + <strong><?= $this->text->e($subtask['time_estimated']).'h' ?></strong> <?= t('estimated') ?> <?php endif ?> </li> </ul> diff --git a/app/Template/notification/subtask_update.php b/app/Template/notification/subtask_update.php index cfde9db6..e6785f2c 100644 --- a/app/Template/notification/subtask_update.php +++ b/app/Template/notification/subtask_update.php @@ -1,19 +1,19 @@ -<h2><?= $this->e($task['title']) ?> (#<?= $task['id'] ?>)</h2> +<h2><?= $this->text->e($task['title']) ?> (#<?= $task['id'] ?>)</h2> <h3><?= t('Sub-task updated') ?></h3> <ul> - <li><?= t('Title:') ?> <?= $this->e($subtask['title']) ?></li> - <li><?= t('Status:') ?> <?= $this->e($subtask['status_name']) ?></li> - <li><?= t('Assignee:') ?> <?= $this->e($subtask['name'] ?: $subtask['username'] ?: '?') ?></li> + <li><?= t('Title:') ?> <?= $this->text->e($subtask['title']) ?></li> + <li><?= t('Status:') ?> <?= $this->text->e($subtask['status_name']) ?></li> + <li><?= t('Assignee:') ?> <?= $this->text->e($subtask['name'] ?: $subtask['username'] ?: '?') ?></li> <li> <?= t('Time tracking:') ?> <?php if (! empty($subtask['time_spent'])): ?> - <strong><?= $this->e($subtask['time_spent']).'h' ?></strong> <?= t('spent') ?> + <strong><?= $this->text->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') ?> + <strong><?= $this->text->e($subtask['time_estimated']).'h' ?></strong> <?= t('estimated') ?> <?php endif ?> </li> </ul> diff --git a/app/Template/notification/task_assignee_change.php b/app/Template/notification/task_assignee_change.php index c9729ac9..53f7c5c1 100644 --- a/app/Template/notification/task_assignee_change.php +++ b/app/Template/notification/task_assignee_change.php @@ -1,4 +1,4 @@ -<h2><?= $this->e($task['title']) ?> (#<?= $task['id'] ?>)</h2> +<h2><?= $this->text->e($task['title']) ?> (#<?= $task['id'] ?>)</h2> <ul> <li> diff --git a/app/Template/notification/task_close.php b/app/Template/notification/task_close.php index 463223a0..4202e092 100644 --- a/app/Template/notification/task_close.php +++ b/app/Template/notification/task_close.php @@ -1,4 +1,4 @@ -<h2><?= $this->e($task['title']) ?> (#<?= $task['id'] ?>)</h2> +<h2><?= $this->text->e($task['title']) ?> (#<?= $task['id'] ?>)</h2> <p><?= t('The task #%d have been closed.', $task['id']) ?></p> diff --git a/app/Template/notification/task_create.php b/app/Template/notification/task_create.php index 1d834d44..3cd68ac0 100644 --- a/app/Template/notification/task_create.php +++ b/app/Template/notification/task_create.php @@ -1,12 +1,12 @@ -<h2><?= $this->e($task['title']) ?> (#<?= $task['id'] ?>)</h2> +<h2><?= $this->text->e($task['title']) ?> (#<?= $task['id'] ?>)</h2> <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'])): ?> @@ -25,12 +25,12 @@ </li> <li> <?= t('Column on the board:') ?> - <strong><?= $this->e($task['column_title']) ?></strong> + <strong><?= $this->text->e($task['column_title']) ?></strong> </li> - <li><?= t('Task position:').' '.$this->e($task['position']) ?></li> + <li><?= t('Task position:').' '.$this->text->e($task['position']) ?></li> <?php if (! empty($task['category_name'])): ?> <li> - <?= t('Category:') ?> <strong><?= $this->e($task['category_name']) ?></strong> + <?= t('Category:') ?> <strong><?= $this->text->e($task['category_name']) ?></strong> </li> <?php endif ?> </ul> diff --git a/app/Template/notification/file_create.php b/app/Template/notification/task_file_create.php index 63f7d1b8..feab8dd2 100644 --- a/app/Template/notification/file_create.php +++ b/app/Template/notification/task_file_create.php @@ -1,4 +1,4 @@ -<h2><?= $this->e($task['title']) ?> (#<?= $task['id'] ?>)</h2> +<h2><?= $this->text->e($task['title']) ?> (#<?= $task['id'] ?>)</h2> <p><?= t('New attachment added "%s"', $file['name']) ?></p> diff --git a/app/Template/notification/task_move_column.php b/app/Template/notification/task_move_column.php index 88ab8ab5..263adebf 100644 --- a/app/Template/notification/task_move_column.php +++ b/app/Template/notification/task_move_column.php @@ -1,11 +1,11 @@ -<h2><?= $this->e($task['title']) ?> (#<?= $task['id'] ?>)</h2> +<h2><?= $this->text->e($task['title']) ?> (#<?= $task['id'] ?>)</h2> <ul> <li> <?= t('Column on the board:') ?> - <strong><?= $this->e($task['column_title']) ?></strong> + <strong><?= $this->text->e($task['column_title']) ?></strong> </li> - <li><?= t('Task position:').' '.$this->e($task['position']) ?></li> + <li><?= t('Task position:').' '.$this->text->e($task['position']) ?></li> </ul> <?= $this->render('notification/footer', array('task' => $task, 'application_url' => $application_url)) ?>
\ No newline at end of file diff --git a/app/Template/notification/task_move_position.php b/app/Template/notification/task_move_position.php index 88ab8ab5..263adebf 100644 --- a/app/Template/notification/task_move_position.php +++ b/app/Template/notification/task_move_position.php @@ -1,11 +1,11 @@ -<h2><?= $this->e($task['title']) ?> (#<?= $task['id'] ?>)</h2> +<h2><?= $this->text->e($task['title']) ?> (#<?= $task['id'] ?>)</h2> <ul> <li> <?= t('Column on the board:') ?> - <strong><?= $this->e($task['column_title']) ?></strong> + <strong><?= $this->text->e($task['column_title']) ?></strong> </li> - <li><?= t('Task position:').' '.$this->e($task['position']) ?></li> + <li><?= t('Task position:').' '.$this->text->e($task['position']) ?></li> </ul> <?= $this->render('notification/footer', array('task' => $task, 'application_url' => $application_url)) ?>
\ No newline at end of file diff --git a/app/Template/notification/task_move_swimlane.php b/app/Template/notification/task_move_swimlane.php index 04de7cc6..cbbd620d 100644 --- a/app/Template/notification/task_move_swimlane.php +++ b/app/Template/notification/task_move_swimlane.php @@ -1,4 +1,4 @@ -<h2><?= $this->e($task['title']) ?> (#<?= $task['id'] ?>)</h2> +<h2><?= $this->text->e($task['title']) ?> (#<?= $task['id'] ?>)</h2> <ul> <li> @@ -6,14 +6,14 @@ <?= t('The task have been moved to the first swimlane') ?> <?php else: ?> <?= t('The task have been moved to another swimlane:') ?> - <strong><?= $this->e($task['swimlane_name']) ?></strong> + <strong><?= $this->text->e($task['swimlane_name']) ?></strong> <?php endif ?> </li> <li> <?= t('Column on the board:') ?> - <strong><?= $this->e($task['column_title']) ?></strong> + <strong><?= $this->text->e($task['column_title']) ?></strong> </li> - <li><?= t('Task position:').' '.$this->e($task['position']) ?></li> + <li><?= t('Task position:').' '.$this->text->e($task['position']) ?></li> </ul> <?= $this->render('notification/footer', array('task' => $task, 'application_url' => $application_url)) ?>
\ No newline at end of file diff --git a/app/Template/notification/task_open.php b/app/Template/notification/task_open.php index cb02a79c..6eb4ec08 100644 --- a/app/Template/notification/task_open.php +++ b/app/Template/notification/task_open.php @@ -1,4 +1,4 @@ -<h2><?= $this->e($task['title']) ?> (#<?= $task['id'] ?>)</h2> +<h2><?= $this->text->e($task['title']) ?> (#<?= $task['id'] ?>)</h2> <p><?= t('The task #%d have been opened.', $task['id']) ?></p> diff --git a/app/Template/notification/task_overdue.php b/app/Template/notification/task_overdue.php index a231937b..ac0665a2 100644 --- a/app/Template/notification/task_overdue.php +++ b/app/Template/notification/task_overdue.php @@ -5,11 +5,11 @@ <li> (<strong>#<?= $task['id'] ?></strong>) <?php if ($application_url): ?> - <a href="<?= $this->url->href('task', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id']), false, '', true) ?>"><?= $this->e($task['title']) ?></a> + <a href="<?= $this->url->href('task', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id']), false, '', true) ?>"><?= $this->text->e($task['title']) ?></a> <?php else: ?> - <?= $this->e($task['title']) ?> + <?= $this->text->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_update.php b/app/Template/notification/task_update.php index 54f5c6d1..8adb2553 100644 --- a/app/Template/notification/task_update.php +++ b/app/Template/notification/task_update.php @@ -1,4 +1,4 @@ -<h2><?= $this->e($task['title']) ?> (#<?= $task['id'] ?>)</h2> +<h2><?= $this->text->e($task['title']) ?> (#<?= $task['id'] ?>)</h2> <?= $this->render('task/changes', array('changes' => $changes, 'task' => $task)) ?> <?= $this->render('notification/footer', array('task' => $task, 'application_url' => $application_url)) ?>
\ No newline at end of file diff --git a/app/Template/notification/task_user_mention.php b/app/Template/notification/task_user_mention.php index 40ddddca..3d8c8e95 100644 --- a/app/Template/notification/task_user_mention.php +++ b/app/Template/notification/task_user_mention.php @@ -1,5 +1,5 @@ <h2><?= t('You were mentioned in the task #%d', $task['id']) ?></h2> -<p><?= $this->e($task['title']) ?></p> +<p><?= $this->text->e($task['title']) ?></p> <h2><?= t('Description') ?></h2> <?= $this->text->markdown($task['description']) ?> diff --git a/app/Template/password_reset/change.php b/app/Template/password_reset/change.php index 310f0f97..0a1d8de4 100644 --- a/app/Template/password_reset/change.php +++ b/app/Template/password_reset/change.php @@ -4,13 +4,13 @@ <?= $this->form->csrf() ?> <?= $this->form->label(t('New password'), '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) ?> <div class="form-actions"> - <input type="submit" value="<?= t('Change Password') ?>" class="btn btn-blue"/> + <button type="submit" class="btn btn-blue"><?= t('Change Password') ?></button> </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 index ef958011..918a0eb4 100644 --- a/app/Template/password_reset/create.php +++ b/app/Template/password_reset/create.php @@ -11,7 +11,7 @@ <?= $this->form->text('captcha', array(), $errors, array('required')) ?> <div class="form-actions"> - <input type="submit" value="<?= t('Change Password') ?>" class="btn btn-blue"/> + <button type="submit" class="btn btn-blue"><?= t('Change Password') ?></button> </div> </form> </div>
\ No newline at end of file diff --git a/app/Template/project/duplicate.php b/app/Template/project/duplicate.php index 8967c306..7cfa8969 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"/> + <button type="submit" class="btn btn-red"><?= t('Duplicate') ?></button> <?= t('or') ?> <?= $this->url->link(t('cancel'), 'project', 'show', array('project_id' => $project['id'])) ?> </div> </form> diff --git a/app/Template/project/filters.php b/app/Template/project/filters.php deleted file mode 100644 index 78794e1c..00000000 --- a/app/Template/project/filters.php +++ /dev/null @@ -1,106 +0,0 @@ -<div class="page-header"> - <?= $this->hook->render('template:project:header:before', array('project' => $project)) ?> - - <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->hasProjectAccess('gantt', 'project', $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', 'project' => $project)) ?> - - <?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> - - <?= $this->hook->render('template:project:header:after', array('project' => $project)) ?> -</div>
\ No newline at end of file diff --git a/app/Template/project/index.php b/app/Template/project/index.php index 3d2a33ea..10d4aaa2 100644 --- a/app/Template/project/index.php +++ b/app/Template/project/index.php @@ -1,10 +1,6 @@ <section id="main"> <div class="page-header"> <ul> - <?php if ($this->user->hasAccess('project', 'create')): ?> - <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', 'createPrivate') ?></li> <?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 ?> @@ -53,22 +49,22 @@ <?php endif ?> <?php if (! empty($project['description'])): ?> - <span class="tooltip" title='<?= $this->e($this->text->markdown($project['description'])) ?>'> + <span class="tooltip" title='<?= $this->text->e($this->text->markdown($project['description'])) ?>'> <i class="fa fa-info-circle"></i> </span> <?php endif ?> - <?= $this->url->link($this->e($project['name']), 'project', 'show', array('project_id' => $project['id'])) ?> + <?= $this->url->link($this->text->e($project['name']), 'project', 'show', array('project_id' => $project['id'])) ?> </td> <td> - <?= $project['start_date'] ?> + <?= $this->dt->date($project['start_date']) ?> </td> <td> - <?= $project['end_date'] ?> + <?= $this->dt->date($project['end_date']) ?> </td> <td> <?php if ($project['owner_id'] > 0): ?> - <?= $this->e($project['owner_name'] ?: $project['owner_username']) ?> + <?= $this->text->e($project['owner_name'] ?: $project['owner_username']) ?> <?php endif ?> </td> <?php if ($this->user->hasAccess('projectuser', 'managers')): ?> @@ -80,7 +76,7 @@ <td class="dashboard-project-stats"> <?php foreach ($project['columns'] as $column): ?> <strong title="<?= t('Task count') ?>"><?= $column['nb_tasks'] ?></strong> - <span><?= $this->e($column['title']) ?></span> + <span><?= $this->text->e($column['title']) ?></span> <?php endforeach ?> </td> </tr> 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 b39d6c05..494a322a 100644 --- a/app/Template/project/notifications.php +++ b/app/Template/project/notifications.php @@ -12,7 +12,7 @@ <?= $this->form->checkboxes('notification_types', $types, $notifications) ?> <div class="form-actions"> - <input type="submit" value="<?= t('Save') ?>" class="btn btn-blue"/> + <button type="submit" class="btn btn-blue"><?= t('Save') ?></button> <?= t('or') ?> <?= $this->url->link(t('cancel'), 'project', 'show', array('project_id' => $project['id'])) ?> </div> diff --git a/app/Template/project/show.php b/app/Template/project/show.php index 5f1aefc1..42eeec4d 100644 --- a/app/Template/project/show.php +++ b/app/Template/project/show.php @@ -5,7 +5,7 @@ <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> + <li><?= t('Project owner: ') ?><strong><?= $this->text->e($project['owner_name'] ?: $project['owner_username']) ?></strong></li> <?php endif ?> <?php if ($project['is_private']): ?> @@ -21,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): ?> @@ -61,9 +61,9 @@ <?php foreach ($stats['columns'] as $column): ?> <tr> <td> - <?= $this->e($column['title']) ?> + <?= $this->text->e($column['title']) ?> <?php if (! empty($column['description'])): ?> - <span class="tooltip" title='<?= $this->e($this->text->markdown($column['description'])) ?>'> + <span class="tooltip" title='<?= $this->text->e($this->text->markdown($column['description'])) ?>'> <i class="fa fa-info-circle"></i> </span> <?php endif ?> diff --git a/app/Template/project/sidebar.php b/app/Template/project/sidebar.php index 2f2ce3ce..304b4aee 100644 --- a/app/Template/project/sidebar.php +++ b/app/Template/project/sidebar.php @@ -63,6 +63,4 @@ <?= $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_creation/create.php b/app/Template/project_creation/create.php new file mode 100644 index 00000000..c34173a9 --- /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"> + <button type="submit" class="btn btn-blue"><?= t('Save') ?></button> + <?= 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 index cb585c6a..83651592 100644 --- a/app/Template/project_edit/dates.php +++ b/app/Template/project_edit/dates.php @@ -19,7 +19,7 @@ <?= $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"/> + <button type="submit" class="btn btn-blue"><?= t('Save') ?></button> </div> </form> diff --git a/app/Template/project_edit/description.php b/app/Template/project_edit/description.php index dce8ab10..6bfe8b8d 100644 --- a/app/Template/project_edit/description.php +++ b/app/Template/project_edit/description.php @@ -32,6 +32,6 @@ <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"/> + <button type="submit" class="btn btn-blue"><?= t('Save') ?></button> </div> </form> diff --git a/app/Template/project_edit/general.php b/app/Template/project_edit/general.php index 5caefa2d..5e6d32b4 100644 --- a/app/Template/project_edit/general.php +++ b/app/Template/project_edit/general.php @@ -24,13 +24,13 @@ <?= $this->form->select('owner_id', $owners, $values, $errors) ?> </div> - <?php if ($this->user->hasProjectAccess('project', 'create', $project['id'])): ?> + <?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"/> + <button type="submit" class="btn btn-blue"><?= t('Save') ?></button> </div> </form> diff --git a/app/Template/project_edit/task_priority.php b/app/Template/project_edit/task_priority.php index e54215b2..faf49f5d 100644 --- a/app/Template/project_edit/task_priority.php +++ b/app/Template/project_edit/task_priority.php @@ -22,7 +22,7 @@ <?= $this->form->number('priority_end', $values, $errors) ?> <div class="form-actions"> - <input type="submit" value="<?= t('Save') ?>" class="btn btn-blue"/> + <button type="submit" class="btn btn-blue"><?= t('Save') ?></button> </div> </form> 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..ba834288 --- /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->text->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..42216352 --- /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->text->e($filter['filter']) ?>'><?= $this->text->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->text->e($user) ?>"'><?= $this->text->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->text->e($category) ?>"'><?= $this->text->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..cc5782bd --- /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->text->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..cd6e2450 --- /dev/null +++ b/app/Template/project_overview/description.php @@ -0,0 +1,8 @@ +<?php if (! empty($project['description'])): ?> + <div class="page-header"> + <h2><?= $this->text->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..605431ed --- /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->text->e($file['name']) ?>" alt="<?= $this->text->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->text->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->text->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->text->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..95508d98 --- /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->text->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 index 5f0edc2b..a7d666a6 100644 --- a/app/Template/project_permission/index.php +++ b/app/Template/project_permission/index.php @@ -19,7 +19,7 @@ </tr> <?php foreach ($users as $user): ?> <tr> - <td><?= $this->e($user['name'] ?: $user['username']) ?></td> + <td><?= $this->text->e($user['name'] ?: $user['username']) ?></td> <td> <?= $this->form->select( 'role-'.$user['id'], @@ -57,7 +57,7 @@ <?= $this->form->select('role', $roles, $values, $errors) ?> - <input type="submit" value="<?= t('Add') ?>" class="btn btn-blue"/> + <button type="submit" class="btn btn-blue"><?= t('Add') ?></button> </form> </div> <?php endif ?> @@ -79,7 +79,7 @@ </tr> <?php foreach ($groups as $group): ?> <tr> - <td><?= $this->e($group['name']) ?></td> + <td><?= $this->text->e($group['name']) ?></td> <td> <?= $this->form->select( 'role-'.$group['id'], @@ -119,7 +119,7 @@ <?= $this->form->select('role', $roles, $values, $errors) ?> - <input type="submit" value="<?= t('Add') ?>" class="btn btn-blue"/> + <button type="submit" class="btn btn-blue"><?= t('Add') ?></button> </form> </div> <?php endif ?> @@ -135,7 +135,7 @@ <?= $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"/> + <button type="submit" class="btn btn-blue"><?= t('Save') ?></button> </div> </form> <?php endif ?> diff --git a/app/Template/project_user/layout.php b/app/Template/project_user/layout.php index 3a569da4..1103e9bc 100644 --- a/app/Template/project_user/layout.php +++ b/app/Template/project_user/layout.php @@ -1,13 +1,6 @@ <section id="main"> <div class="page-header"> <ul> - <?php if ($this->user->hasAccess('project', 'create')): ?> - <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') ?> @@ -22,11 +15,11 @@ </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"> - <h2><?= $this->e($title) ?></h2> + <h2><?= $this->text->e($title) ?></h2> </div> <?= $content_for_sublayout ?> </div> diff --git a/app/Template/project_user/roles.php b/app/Template/project_user/roles.php index 35d16241..17fb709b 100644 --- a/app/Template/project_user/roles.php +++ b/app/Template/project_user/roles.php @@ -10,19 +10,19 @@ <?php foreach ($paginator->getCollection() as $project): ?> <tr> <td> - <?= $this->e($this->user->getFullname($project)) ?> + <?= $this->text->e($this->user->getFullname($project)) ?> </td> <td> <?= $this->url->link('<i class="fa fa-th"></i>', 'board', 'show', array('project_id' => $project['id']), false, 'dashboard-table-link', t('Board')) ?> <?= $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')) ?> <?= $this->url->link('<i class="fa fa-cog fa-fw"></i>', 'project', 'show', array('project_id' => $project['id']), false, 'dashboard-table-link', t('Project settings')) ?> - <?= $this->e($project['project_name']) ?> + <?= $this->text->e($project['project_name']) ?> </td> <td class="dashboard-project-stats"> <?php foreach ($project['columns'] as $column): ?> <strong title="<?= t('Task count') ?>"><?= $column['nb_tasks'] ?></strong> - <span><?= $this->e($column['title']) ?></span> + <span><?= $this->text->e($column['title']) ?></span> <?php endforeach ?> </td> </tr> diff --git a/app/Template/project_user/sidebar.php b/app/Template/project_user/sidebar.php index 27f1094c..ff113ebb 100644 --- a/app/Template/project_user/sidebar.php +++ b/app/Template/project_user/sidebar.php @@ -10,7 +10,7 @@ 'chosen-select select-auto-redirect' ) ?> - <br/><br/> + <br><br> <ul> <li <?= $this->app->checkMenuSelection('projectuser', 'managers') ?>> <?= $this->url->link(t('Project managers'), 'projectuser', 'managers', $filter) ?> diff --git a/app/Template/project_user/tasks.php b/app/Template/project_user/tasks.php index f4fc2723..108d3b33 100644 --- a/app/Template/project_user/tasks.php +++ b/app/Template/project_user/tasks.php @@ -14,29 +14,29 @@ <?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->url->link('#'.$this->text->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['project_name']), 'board', 'show', array('project_id' => $task['project_id'])) ?> + <?= $this->url->link($this->text->e($task['project_name']), 'board', 'show', array('project_id' => $task['project_id'])) ?> </td> <td> - <?= $this->e($task['column_name']) ?> + <?= $this->text->e($task['column_name']) ?> </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')) ?> + <?= $this->url->link($this->text->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['assignee_username']): ?> - <?= $this->e($task['assignee_name'] ?: $task['assignee_username']) ?> + <?= $this->text->e($task['assignee_name'] ?: $task['assignee_username']) ?> <?php else: ?> <?= t('Unassigned') ?> <?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 index 7a07caad..f75d964b 100644 --- a/app/Template/project_user/tooltip_users.php +++ b/app/Template/project_user/tooltip_users.php @@ -6,7 +6,7 @@ <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> + <li><?= $this->url->link($this->text->e($user), 'Projectuser', 'opens', array('user_id' => $user_id)) ?></li> <?php endforeach ?> </ul> <?php endif ?> 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..79df3544 100644 --- a/app/Template/search/results.php +++ b/app/Template/search/results.php @@ -13,32 +13,32 @@ <?php foreach ($paginator->getCollection() as $task): ?> <tr> <td> - <?= $this->url->link($this->e($task['project_name']), 'board', 'show', array('project_id' => $task['project_id'])) ?> + <?= $this->url->link($this->text->e($task['project_name']), 'board', 'show', array('project_id' => $task['project_id'])) ?> </td> <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->url->link('#'.$this->text->e($task['id']), 'task', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id']), false, '', t('View this task')) ?> </td> <td> - <?= $this->e($task['swimlane_name'] ?: $task['default_swimlane']) ?> + <?= $this->text->e($task['swimlane_name'] ?: $task['default_swimlane']) ?> </td> <td> - <?= $this->e($task['column_name']) ?> + <?= $this->text->e($task['column_name']) ?> </td> <td> - <?= $this->e($task['category_name']) ?> + <?= $this->text->e($task['category_name']) ?> </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')) ?> + <?= $this->url->link($this->text->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['assignee_username']): ?> - <?= $this->e($task['assignee_name'] ?: $task['assignee_username']) ?> + <?= $this->text->e($task['assignee_name'] ?: $task['assignee_username']) ?> <?php else: ?> <?= t('Unassigned') ?> <?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..029fddf5 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"/> + <button type="submit" class="btn btn-blue"><?= t('Save') ?></button> <?= 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..3c210f60 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"/> + <button type="submit" class="btn btn-blue"><?= t('Save') ?></button> <?= 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..374256fd 100644 --- a/app/Template/subtask/remove.php +++ b/app/Template/subtask/remove.php @@ -7,11 +7,11 @@ <?= t('Do you really want to remove this sub-task?') ?> </p> - <p><strong><?= $this->e($subtask['title']) ?></strong></p> + <p><strong><?= $this->text->e($subtask['title']) ?></strong></p> <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 6945840f..999016c3 100644 --- a/app/Template/subtask/show.php +++ b/app/Template/subtask/show.php @@ -1,107 +1,19 @@ -<div id="subtasks" class="task-show-section"> - - <?php if (! empty($subtasks)): ?> - <div class="page-header"> - <h2><?= t('Sub-Tasks') ?></h2> - </div> +<div class="page-header"> + <h2><?= t('Sub-Tasks') ?></h2> +</div> - <?php $first_position = $subtasks[0]['position']; ?> - <?php $last_position = $subtasks[count($subtasks) - 1]['position']; ?> - <table class="subtasks-table"> - <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> - <?php foreach ($subtasks as $subtask): ?> - <tr> - <td> - <?php if ($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 ($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 ($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 ($editable): ?> - <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> - <?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> - </div> - </td> - <?php endif ?> - </tr> - <?php endforeach ?> - </table> - <?php endif ?> + <?= $this->render('subtask/table', array('subtasks' => $subtasks, 'task' => $task, 'editable' => $editable)) ?> <?php if ($editable && $this->user->hasProjectAccess('subtask', 'save', $task['project_id'])): ?> - <?php if (empty($subtasks)): ?> - <div class="page-header"> - <h2><?= t('Sub-Tasks') ?></h2> - </div> - <?php endif ?> <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'])) ?> <?= $this->form->text('title', array(), array(), array('required', 'placeholder="'.t('Type here to create a new sub-task').'"')) ?> <?= $this->form->numeric('time_estimated', array(), array(), array('placeholder="'.t('Original estimate').'"')) ?> <?= $this->form->select('user_id', $users_list, array(), array(), array('placeholder="'.t('Assignee').'"')) ?> - <input type="submit" value="<?= t('Add') ?>" class="btn btn-blue"/> + <button type="submit" class="btn btn-blue"><?= t('Add') ?></button> </form> <?php endif ?> diff --git a/app/Template/subtask/table.php b/app/Template/subtask/table.php new file mode 100644 index 00000000..0af02dcf --- /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->text->e($subtask['name'] ?: $subtask['username']) ?> + <?php endif ?> + </td> + <td> + <ul class="no-bullet"> + <li> + <?php if (! empty($subtask['time_spent'])): ?> + <strong><?= $this->text->e($subtask['time_spent']).'h' ?></strong> <?= t('spent') ?> + <?php endif ?> + + <?php if (! empty($subtask['time_estimated'])): ?> + <strong><?= $this->text->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..916a664e 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"/> + <button type="submit" class="btn btn-red"><?= t('Save') ?></button> <?= 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..aa92a930 --- /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"> + <button type="submit" class="btn btn-blue"><?= t('Save') ?></button> + <?= 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..232570e7 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"/> + <button type="submit" class="btn btn-blue"><?= t('Save') ?></button> <?= 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..3bf82568 --- /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"> + <button type="submit" class="btn btn-blue"><?= t('Save') ?></button> + <?= 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 89915d56..17be6924 100644 --- a/app/Template/swimlane/table.php +++ b/app/Template/swimlane/table.php @@ -1,47 +1,76 @@ -<table> - <tr> - <?php if (! isset($hide_position)): ?> - <th class="column-10"><?= t('Position') ?></th> - <?php endif ?> - <th><?= t('Name') ?></th> - <th class="column-8"><?= 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> - <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> - <?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->text->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->text->e($swimlane['name']) ?> + + <?php if (! empty($swimlane['description'])): ?> + <span class="tooltip" title='<?= $this->text->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> - </div> - </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/analytics.php b/app/Template/task/analytics.php index 306dd021..2f2c23a1 100644 --- a/app/Template/task/analytics.php +++ b/app/Template/task/analytics.php @@ -18,7 +18,7 @@ </tr> <?php foreach ($time_spent_columns as $column): ?> <tr> - <td><?= $this->e($column['title']) ?></td> + <td><?= $this->text->e($column['title']) ?></td> <td><?= $this->dt->duration($column['time_spent']) ?></td> </tr> <?php endforeach ?> 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/color_picker.php b/app/Template/task/color_picker.php index a849b9ce..0c62fa70 100644 --- a/app/Template/task/color_picker.php +++ b/app/Template/task/color_picker.php @@ -3,7 +3,7 @@ <div data-color-id="<?= $color_id ?>" class="color-square color-<?= $color_id ?> <?= isset($values['color_id']) && $values['color_id'] === $color_id ? 'color-square-selected' : '' ?>" - title="<?= $this->e($color_name) ?>"> + title="<?= $this->text->e($color_name) ?>"> </div> <?php endforeach ?> </div> diff --git a/app/Template/task/comments.php b/app/Template/task/comments.php index 57fb305f..c22e39ec 100644 --- a/app/Template/task/comments.php +++ b/app/Template/task/comments.php @@ -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 d885ca9c..61f6c848 100644 --- a/app/Template/task/details.php +++ b/app/Template/task/details.php @@ -1,104 +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> - <li> - <strong><?= t('Priority: %d', $task['priority']) ?></strong> - </li> - <?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 ($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->text->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->text->e($task['reference']) ?></span> + </li> + <?php endif ?> + <?php if (! empty($task['score'])): ?> + <li> + <strong><?= t('Complexity:') ?></strong> <span><?= $this->text->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->text->e($task['category_name']) ?></span> + </li> + <?php endif ?> + <?php if (! empty($task['swimlane_name'])): ?> + <li> + <strong><?= t('Swimlane:') ?></strong> + <span><?= $this->text->e($task['swimlane_name']) ?></span> + </li> + <?php endif ?> + <li> + <strong><?= t('Column:') ?></strong> + <span><?= $this->text->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->text->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->text->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 9fe1a716..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> @@ -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/remove.php b/app/Template/task/remove.php index 2f6edc22..eb0809b1 100644 --- a/app/Template/task/remove.php +++ b/app/Template/task/remove.php @@ -4,12 +4,12 @@ <div class="confirm"> <p class="alert alert-info"> - <?= t('Do you really want to remove this task: "%s"?', $this->e($task['title'])) ?> + <?= t('Do you really want to remove this task: "%s"?', $this->text->e($task['title'])) ?> </p> <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 f6d47e53..56ecdf76 100644 --- a/app/Template/task/show.php +++ b/app/Template/task/show.php @@ -1,45 +1,54 @@ +<?= $this->hook->render('template:task:show:top', array('task' => $task, 'project' => $project)) ?> + <?= $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']), )) ?> -<?php if ($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)) ?> -<?php endif ?> +<?= $this->hook->render('template:task:show:before-description', array('task' => $task, 'project' => $project)) ?> <?= $this->render('task/description', array('task' => $task)) ?> -<?= $this->render('tasklink/show', array( - 'task' => $task, - 'links' => $links, - 'link_label_list' => $link_label_list, - 'editable' => $this->user->hasProjectAccess('tasklink', 'edit', $project['id']), - 'is_public' => false, -)) ?> +<?= $this->hook->render('template:task:show:before-subtasks', array('task' => $task, 'project' => $project)) ?> <?= $this->render('subtask/show', array( 'task' => $task, 'subtasks' => $subtasks, 'project' => $project, 'users_list' => isset($users_list) ? $users_list : array(), - 'editable' => $this->user->hasProjectAccess('subtask', 'edit', $project['id']), + 'editable' => true, )) ?> +<?= $this->hook->render('template:task:show:before-tasklinks', array('task' => $task, 'project' => $project)) ?> + +<?= $this->render('tasklink/show', array( + 'task' => $task, + 'links' => $links, + 'link_label_list' => $link_label_list, + 'editable' => true, + 'is_public' => false, +)) ?> + +<?= $this->hook->render('template:task:show:before-timetracking', array('task' => $task, 'project' => $project)) ?> + <?= $this->render('task/time_tracking_summary', array('task' => $task)) ?> -<?= $this->render('file/show', array( +<?= $this->hook->render('template:task:show:before-attachements', array('task' => $task, 'project' => $project)) ?> + +<?= $this->render('task_file/show', array( 'task' => $task, 'files' => $files, 'images' => $images )) ?> +<?= $this->hook->render('template:task:show:before-comments', array('task' => $task, 'project' => $project)) ?> + <?= $this->render('task/comments', array( 'task' => $task, 'comments' => $comments, 'project' => $project, 'editable' => $this->user->hasProjectAccess('comment', 'edit', $project['id']), )) ?> + +<?= $this->hook->render('template:task:show:bottom', array('task' => $task, 'project' => $project)) ?> diff --git a/app/Template/task/sidebar.php b/app/Template/task/sidebar.php index f522c1c4..951c5095 100644 --- a/app/Template/task/sidebar.php +++ b/app/Template/task/sidebar.php @@ -1,5 +1,5 @@ <div class="sidebar"> - <h2><?= t('Information') ?></h2> + <h2><?= t('Task #%d', $task['id']) ?></h2> <ul> <li <?= $this->app->checkMenuSelection('task', 'show') ?>> <?= $this->url->link(t('Summary'), 'task', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?> @@ -18,61 +18,16 @@ <?= $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> - <?php if ($this->user->hasProjectAccess('taskmodification', 'edit', $task['project_id'])): ?> - <h2><?= t('Actions') ?></h2> - <ul> - <li <?= $this->app->checkMenuSelection('taskmodification', 'edit') ?>> - <?= $this->url->link(t('Edit the task'), 'taskmodification', 'edit', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?> - </li> - <li <?= $this->app->checkMenuSelection('taskmodification', 'description') ?>> - <?= $this->url->link(t('Edit the description'), 'taskmodification', 'description', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?> - </li> - <li <?= $this->app->checkMenuSelection('taskmodification', 'recurrence') ?>> - <?= $this->url->link(t('Edit recurrence'), 'taskmodification', 'recurrence', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?> - </li> - <li <?= $this->app->checkMenuSelection('subtask', 'create') ?>> - <?= $this->url->link(t('Add a sub-task'), 'subtask', 'create', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?> - </li> - <li <?= $this->app->checkMenuSelection('tasklink', 'create') ?>> - <?= $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->checkMenuSelection('comment', 'create') ?>> - <?= $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->checkMenuSelection('file', 'create') ?>> - <?= $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->checkMenuSelection('file', 'screenshot') ?>> - <?= $this->url->link(t('Add a screenshot'), 'file', 'screenshot', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?> - </li> - <li <?= $this->app->checkMenuSelection('taskduplication', 'duplicate') ?>> - <?= $this->url->link(t('Duplicate'), 'taskduplication', 'duplicate', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?> - </li> - <li <?= $this->app->checkMenuSelection('taskduplication', 'copy') ?>> - <?= $this->url->link(t('Duplicate to another project'), 'taskduplication', 'copy', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?> - </li> - <li <?= $this->app->checkMenuSelection('taskduplication', 'move') ?>> - <?= $this->url->link(t('Move to another project'), 'taskduplication', 'move', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?> - </li> - <li <?= $this->app->checkMenuSelection('taskstatus') ?>> - <?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->checkMenuSelection('task', 'remove') ?>> - <?= $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> - <?php endif ?> - <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..e2b599a5 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><?= $this->url->link($this->text->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/time_tracking_summary.php b/app/Template/task/time_tracking_summary.php index 0210be7e..9886ccfa 100644 --- a/app/Template/task/time_tracking_summary.php +++ b/app/Template/task/time_tracking_summary.php @@ -5,9 +5,9 @@ </div> <ul class="listing"> - <li><?= t('Estimate:') ?> <strong><?= $this->e($task['time_estimated']) ?></strong> <?= t('hours') ?></li> - <li><?= t('Spent:') ?> <strong><?= $this->e($task['time_spent']) ?></strong> <?= t('hours') ?></li> - <li><?= t('Remaining:') ?> <strong><?= $this->e($task['time_estimated'] - $task['time_spent']) ?></strong> <?= t('hours') ?></li> + <li><?= t('Estimate:') ?> <strong><?= $this->text->e($task['time_estimated']) ?></strong> <?= t('hours') ?></li> + <li><?= t('Spent:') ?> <strong><?= $this->text->e($task['time_spent']) ?></strong> <?= t('hours') ?></li> + <li><?= t('Remaining:') ?> <strong><?= $this->text->e($task['time_estimated'] - $task['time_spent']) ?></strong> <?= t('hours') ?></li> </ul> <?php endif ?>
\ No newline at end of file diff --git a/app/Template/task/transitions.php b/app/Template/task/transitions.php index 2ca2387f..57f1e0ff 100644 --- a/app/Template/task/transitions.php +++ b/app/Template/task/transitions.php @@ -15,10 +15,10 @@ </tr> <?php foreach ($transitions as $transition): ?> <tr> - <td><?= dt('%B %e, %Y at %k:%M %p', $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> + <td><?= $this->dt->datetime($transition['date']) ?></td> + <td><?= $this->text->e($transition['src_column']) ?></td> + <td><?= $this->text->e($transition['dst_column']) ?></td> + <td><?= $this->url->link($this->text->e($transition['name'] ?: $transition['username']), 'user', 'show', array('user_id' => $transition['user_id'])) ?></td> <td><?= $this->dt->duration($transition['time_spent']) ?></td> </tr> <?php endforeach ?> diff --git a/app/Template/task_creation/form.php b/app/Template/task_creation/form.php index eaf9024d..0af2eb1e 100644 --- a/app/Template/task_creation/form.php +++ b/app/Template/task_creation/form.php @@ -1,16 +1,8 @@ -<?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() ?> @@ -55,36 +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"')) ?> - - <?= $this->form->label(t('Category'), 'category_id') ?> - <?= $this->form->select('category_id', $categories_list, $values, $errors, array('tabindex="4"')) ?> - - <?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"')) ?> - <?php endif ?> - - <?= $this->form->label(t('Column'), 'column_id') ?> - <?= $this->form->select('column_id', $columns_list, $values, $errors, array('tabindex="6"')) ?> - + <?= $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->form->label(t('Complexity'), 'score') ?> - <?= $this->form->number('score', $values, $errors, array('tabindex="9"')) ?> - - <?= $this->form->label(t('Original estimate'), 'time_estimated') ?> - <?= $this->form->numeric('time_estimated', $values, $errors, array('tabindex="10"')) ?> <?= t('hours') ?> - - <?= $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="11"'), 'form-date') ?> - <div class="form-help"><?= t('Others formats accepted: %s and %s', date('Y-m-d'), date('Y_m_d')) ?></div> + <?= $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="12"/> + <button type="submit" class="btn btn-blue" tabindex="15"><?= t('Save') ?></button> <?= 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..b7337a1e 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"/> + <button type="submit" class="btn btn-blue"><?= t('Save') ?></button> <?= 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..beebf9eb 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"/> + <button type="submit" class="btn btn-blue"><?= t('Save') ?></button> <?= 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..5d49eef0 --- /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"> + <button type="submit" class="btn btn-blue"><?= t('Save') ?></button> + <?= 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..dcbc2633 --- /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"> + <button type="submit" class="btn btn-blue"><?= t('Save') ?></button> + <?= 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..3977a66c --- /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"> + <button type="submit" class="btn btn-blue"><?= t('Next') ?></button> + <?= 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..7dce107e --- /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->text->e($link['title']) ?></a> + </td> + <td> + <?= $this->text->e($link['dependency_label']) ?> + </td> + <td> + <?= $this->text->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..fe601f6f 100644 --- a/app/Template/file/remove.php +++ b/app/Template/task_file/remove.php @@ -4,12 +4,12 @@ <div class="confirm"> <p class="alert alert-info"> - <?= t('Do you really want to remove this file: "%s"?', $this->e($file['name'])) ?> + <?= t('Do you really want to remove this file: "%s"?', $this->text->e($file['name'])) ?> </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..2880478d 100644 --- a/app/Template/file/screenshot.php +++ b/app/Template/task_file/screenshot.php @@ -6,11 +6,11 @@ <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"> - <input type="submit" value="<?= t('Save') ?>" class="btn btn-blue"/> + <button type="submit" class="btn btn-blue"><?= t('Save') ?></button> <?= 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_file/show.php b/app/Template/task_file/show.php new file mode 100644 index 00000000..21bf79ef --- /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->text->e($file['name']) ?>" alt="<?= $this->text->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->text->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->text->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->text->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_import/step1.php b/app/Template/task_import/step1.php index 7619216a..abb43505 100644 --- a/app/Template/task_import/step1.php +++ b/app/Template/task_import/step1.php @@ -16,7 +16,7 @@ <p class="form-help"><?= t('Maximum size: ') ?><?= is_integer($max_size) ? $this->text->bytes($max_size) : $max_size ?></p> <div class="form-actions"> - <input type="submit" value="<?= t('Import') ?>" class="btn btn-blue"> + <button type="submit" class="btn btn-blue"><?= t('Import') ?></button> </div> </form> <div class="page-header"> diff --git a/app/Template/task_modification/edit_description.php b/app/Template/task_modification/edit_description.php index c38e885d..cb74b250 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) ?> @@ -37,12 +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"/> + <button type="submit" class="btn btn-blue"><?= t('Save') ?></button> <?= 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 2701dd8f..b5891c15 100644 --- a/app/Template/task_modification/edit_task.php +++ b/app/Template/task_modification/edit_task.php @@ -1,72 +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"')) ?> - - <?= $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"', - 'data-mention-search-url="'.$this->url->href('UserHelper', 'mention', array('project_id' => $task['project_id'])).'"' - ) - ) ?> - </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->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"')) ?> - - <?= $this->form->label(t('Category'), 'category_id') ?> - <?= $this->form->select('category_id', $categories_list, $values, $errors, array('tabindex="4"')) ?> - - <?= $this->form->label(t('Complexity'), 'score') ?> - <?= $this->form->number('score', $values, $errors, array('tabindex="6"')) ?> - - <?= $this->task->selectPriority($project, $values) ?> + <?= $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="8"'), 'form-date') ?> - <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"> + <button type="submit" class="btn btn-blue" tabindex="15"><?= t('Save') ?></button> <?= 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..0f5d611a 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"/> + <button type="submit" class="btn btn-blue"><?= t('Save') ?></button> <?= 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..1a6574df 100644 --- a/app/Template/task/recurring_info.php +++ b/app/Template/task_recurrence/info.php @@ -5,16 +5,16 @@ <li><?= t('Recurrent task has been generated:') ?> <ul> <li> - <?= t('Trigger to generate recurrent task: ') ?><strong><?= $this->e($recurrence_trigger_list[$task['recurrence_trigger']]) ?></strong> + <?= t('Trigger to generate recurrent task: ') ?><strong><?= $this->text->e($recurrence_trigger_list[$task['recurrence_trigger']]) ?></strong> </li> <li> - <?= t('Factor to calculate new due date: ') ?><strong><?= $this->e($task['recurrence_factor']) ?></strong> + <?= t('Factor to calculate new due date: ') ?><strong><?= $this->text->e($task['recurrence_factor']) ?></strong> </li> <li> - <?= t('Timeframe to calculate new due date: ') ?><strong><?= $this->e($recurrence_timeframe_list[$task['recurrence_timeframe']]) ?></strong> + <?= t('Timeframe to calculate new due date: ') ?><strong><?= $this->text->e($recurrence_timeframe_list[$task['recurrence_timeframe']]) ?></strong> </li> <li> - <?= t('Base date to calculate new due date: ') ?><strong><?= $this->e($recurrence_basedate_list[$task['recurrence_basedate']]) ?></strong> + <?= t('Base date to calculate new due date: ') ?><strong><?= $this->text->e($recurrence_basedate_list[$task['recurrence_basedate']]) ?></strong> </li> </ul> </li> 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 2832bdc7..02d38a9b 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'])) ?> @@ -26,12 +26,8 @@ 'autocomplete') ?> <div class="form-actions"> - <input type="submit" value="<?= t('Save') ?>" class="btn btn-blue"/> + <button type="submit" class="btn btn-blue"><?= t('Save') ?></button> <?= 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 896f84c0..15afe047 100644 --- a/app/Template/tasklink/edit.php +++ b/app/Template/tasklink/edit.php @@ -27,7 +27,7 @@ 'autocomplete') ?> <div class="form-actions"> - <input type="submit" value="<?= t('Save') ?>" class="btn btn-blue"/> + <button type="submit" class="btn btn-blue"><?= t('Save') ?></button> <?= t('or') ?> <?= $this->url->link(t('cancel'), 'task', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?> </div> diff --git a/app/Template/tasklink/show.php b/app/Template/tasklink/show.php index 5843da17..8527a344 100644 --- a/app/Template/tasklink/show.php +++ b/app/Template/tasklink/show.php @@ -1,15 +1,17 @@ -<?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 ($editable): ?> + <?php if ($editable && $this->user->hasProjectAccess('Tasklink', 'edit', $task['project_id'])): ?> <th class="column-5"><?= t('Action') ?></th> <?php endif ?> </tr> @@ -25,7 +27,7 @@ <td> <?php if ($is_public): ?> <?= $this->url->link( - $this->e('#'.$link['task_id'].' '.$link['title']), + $this->text->e('#'.$link['task_id'].' '.$link['title']), 'task', 'readonly', array('task_id' => $link['task_id'], 'token' => $project['token']), @@ -34,7 +36,7 @@ ) ?> <?php else: ?> <?= $this->url->link( - $this->e('#'.$link['task_id'].' '.$link['title']), + $this->text->e('#'.$link['task_id'].' '.$link['title']), 'task', 'show', array('task_id' => $link['task_id'], 'project_id' => $link['project_id']), @@ -43,28 +45,28 @@ ) ?> <?php endif ?> - <br/> + <br> <?php if (! empty($link['task_time_spent'])): ?> - <strong><?= $this->e($link['task_time_spent']).'h' ?></strong> <?= t('spent') ?> + <strong><?= $this->text->e($link['task_time_spent']).'h' ?></strong> <?= t('spent') ?> <?php endif ?> <?php if (! empty($link['task_time_estimated'])): ?> - <strong><?= $this->e($link['task_time_estimated']).'h' ?></strong> <?= t('estimated') ?> + <strong><?= $this->text->e($link['task_time_estimated']).'h' ?></strong> <?= t('estimated') ?> <?php endif ?> </td> - <td><?= $this->e($link['project_name']) ?></td> - <td><?= $this->e($link['column_title']) ?></td> + <td><?= $this->text->e($link['project_name']) ?></td> + <td><?= $this->text->e($link['column_title']) ?></td> <td> <?php if (! empty($link['task_assignee_username'])): ?> <?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'])) ?> + <?= $this->url->link($this->text->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']) ?> + <?= $this->text->e($link['task_assignee_name'] ?: $link['task_assignee_username']) ?> <?php endif ?> <?php endif ?> </td> - <?php if ($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> @@ -102,7 +104,7 @@ ), 'autocomplete') ?> - <input type="submit" value="<?= t('Add') ?>" class="btn btn-blue"/> + <button type="submit" class="btn btn-blue"><?= t('Add') ?></button> </form> <?php endif ?> diff --git a/app/Template/twofactor/check.php b/app/Template/twofactor/check.php index 68a58a6c..b0cb4825 100644 --- a/app/Template/twofactor/check.php +++ b/app/Template/twofactor/check.php @@ -5,6 +5,6 @@ <?= $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"/> + <button type="submit" class="btn btn-blue"><?= t('Check my code') ?></button> </div> </form>
\ No newline at end of file diff --git a/app/Template/twofactor/index.php b/app/Template/twofactor/index.php index b9ee4b49..6de36514 100644 --- a/app/Template/twofactor/index.php +++ b/app/Template/twofactor/index.php @@ -4,12 +4,12 @@ <form method="post" action="<?= $this->url->href('twofactor', $user['twofactor_activated'] == 1 ? 'deactivate' : 'show', array('user_id' => $user['id'])) ?>" autocomplete="off"> <?= $this->form->csrf() ?> - <p><?= t('Two-Factor Provider: ') ?><strong><?= $this->e($provider) ?></strong></p> + <p><?= t('Two-Factor Provider: ') ?><strong><?= $this->text->e($provider) ?></strong></p> <div class="form-actions"> <?php if ($user['twofactor_activated'] == 1): ?> - <input type="submit" value="<?= t('Disable two-factor authentication') ?>" class="btn btn-red"/> + <button type="submit" class="btn btn-red"><?= t('Disable two-factor authentication') ?></button> <?php else: ?> - <input type="submit" value="<?= t('Enable two-factor authentication') ?>" class="btn btn-blue"/> + <button type="submit" class="btn btn-blue"><?= t('Enable two-factor authentication') ?></button> <?php endif ?> </div> </form> diff --git a/app/Template/twofactor/show.php b/app/Template/twofactor/show.php index dd72965a..59897e20 100644 --- a/app/Template/twofactor/show.php +++ b/app/Template/twofactor/show.php @@ -5,15 +5,15 @@ <?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> + <p><?= t('Secret key: ') ?><strong><?= $this->text->e($secret) ?></strong></p> <?php endif ?> <?php if (! empty($qrcode_url)): ?> - <p><br/><img src="<?= $qrcode_url ?>"/><br/><br/></p> + <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> + <p><?= t('This QR code contains the key URI: ') ?><a href="<?= $this->text->e($key_url) ?>"><?= $this->text->e($key_url) ?></a></p> <?php endif ?> </div> <?php endif ?> @@ -26,6 +26,6 @@ <?= $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"/> + <button type="submit" class="btn btn-blue"><?= t('Check my code') ?></button> </div> </form>
\ No newline at end of file diff --git a/app/Template/user/authentication.php b/app/Template/user/authentication.php index 20c3d372..6cfd4e57 100644 --- a/app/Template/user/authentication.php +++ b/app/Template/user/authentication.php @@ -8,20 +8,13 @@ <?= $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) ?> <div class="form-actions"> - <input type="submit" value="<?= t('Save') ?>" class="btn btn-blue"/> + <button type="submit" class="btn btn-blue"><?= t('Save') ?></button> <?= t('or') ?> <?= $this->url->link(t('cancel'), 'user', 'show', array('user_id' => $user['id'])) ?> </div> diff --git a/app/Template/user/create_local.php b/app/Template/user/create_local.php index 38bd7836..7257456d 100644 --- a/app/Template/user/create_local.php +++ b/app/Template/user/create_local.php @@ -44,7 +44,7 @@ </div> <div class="form-actions"> - <input type="submit" value="<?= t('Save') ?>" class="btn btn-blue"/> + <button type="submit" class="btn btn-blue"><?= t('Save') ?></button> <?= t('or') ?> <?= $this->url->link(t('cancel'), 'user', 'index') ?> </div> diff --git a/app/Template/user/create_remote.php b/app/Template/user/create_remote.php index 1cc560cd..05acbba1 100644 --- a/app/Template/user/create_remote.php +++ b/app/Template/user/create_remote.php @@ -20,14 +20,7 @@ <?= $this->form->label(t('Email'), 'email') ?> <?= $this->form->email('email', $values, $errors) ?> - <?= $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:create-remote:form', array('values' => $values, 'errors' => $errors)) ?> </div> <div class="form-column"> @@ -48,7 +41,7 @@ </div> <div class="form-actions"> - <input type="submit" value="<?= t('Save') ?>" class="btn btn-blue"/> + <button type="submit" class="btn btn-blue"><?= t('Save') ?></button> <?= t('or') ?> <?= $this->url->link(t('cancel'), 'user', 'index') ?> </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 f7f67fb7..7b51eb73 100644 --- a/app/Template/user/edit.php +++ b/app/Template/user/edit.php @@ -28,7 +28,7 @@ <?php endif ?> <div class="form-actions"> - <input type="submit" value="<?= t('Save') ?>" class="btn btn-blue"/> + <button type="submit" class="btn btn-blue"><?= t('Save') ?></button> <?= t('or') ?> <?= $this->url->link(t('cancel'), 'user', 'show', array('user_id' => $user['id'])) ?> </div> diff --git a/app/Template/user/external.php b/app/Template/user/external.php index 8b1d3c46..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 cb7416d6..364fd965 100644 --- a/app/Template/user/index.php +++ b/app/Template/user/index.php @@ -12,30 +12,28 @@ <?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('Role'), 'role') ?></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'])) ?> + <?= '#'.$user['id'] ?> + <?= $this->url->link($this->text->e($user['username']), 'user', 'show', array('user_id' => $user['id'])) ?> </td> <td> - <?= $this->url->link($this->e($user['username']), 'user', 'show', array('user_id' => $user['id'])) ?> + <?= $this->text->e($user['name']) ?> </td> <td> - <?= $this->e($user['name']) ?> - </td> - <td> - <a href="mailto:<?= $this->e($user['email']) ?>"><?= $this->e($user['email']) ?></a> + <a href="mailto:<?= $this->text->e($user['email']) ?>"><?= $this->text->e($user['email']) ?></a> </td> <td> <?= $this->user->getRoleName($user['role']) ?> @@ -44,14 +42,17 @@ <?= $user['twofactor_activated'] ? t('Yes') : t('No') ?> </td> <td> - <?php if ($user['notifications_enabled'] == 1): ?> - <?= t('Enabled') ?> + <?= $user['is_ldap_user'] ? t('Remote') : t('Local') ?> + </td> + <td> + <?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..3de4d5e2 100644 --- a/app/Template/user/last.php +++ b/app/Template/user/last.php @@ -14,10 +14,10 @@ </tr> <?php foreach ($last_logins as $login): ?> <tr> - <td><?= dt('%B %e, %Y at %k:%M %p', $login['date_creation']) ?></td> - <td><?= $this->e($login['auth_type']) ?></td> - <td><?= $this->e($login['ip']) ?></td> - <td><?= $this->e($login['user_agent']) ?></td> + <td><?= $this->dt->datetime($login['date_creation']) ?></td> + <td><?= $this->text->e($login['auth_type']) ?></td> + <td><?= $this->text->e($login['ip']) ?></td> + <td><?= $this->text->e($login['user_agent']) ?></td> </tr> <?php endforeach ?> </table> diff --git a/app/Template/user/layout.php b/app/Template/user/layout.php index 1e456348..3a0a5ba6 100644 --- a/app/Template/user/layout.php +++ b/app/Template/user/layout.php @@ -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/notifications.php b/app/Template/user/notifications.php index 7223013c..2a5c8152 100644 --- a/app/Template/user/notifications.php +++ b/app/Template/user/notifications.php @@ -22,7 +22,7 @@ <?php endif ?> <div class="form-actions"> - <input type="submit" value="<?= t('Save') ?>" class="btn btn-blue"/> + <button type="submit" class="btn btn-blue"><?= t('Save') ?></button> <?= t('or') ?> <?= $this->url->link(t('cancel'), 'user', 'show', array('user_id' => $user['id'])) ?> </div> diff --git a/app/Template/user/password.php b/app/Template/user/password.php index 3ef28d33..ea6e997d 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"/> + <button type="submit" class="btn btn-blue"><?= t('Save') ?></button> <?= 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 index b4c9a0c4..1371ce11 100644 --- a/app/Template/user/password_reset.php +++ b/app/Template/user/password_reset.php @@ -15,11 +15,11 @@ </tr> <?php foreach ($tokens as $token): ?> <tr> - <td><?= dt('%B %e, %Y at %k:%M %p', $token['date_creation']) ?></td> - <td><?= dt('%B %e, %Y at %k:%M %p', $token['date_expiration']) ?></td> + <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> + <td><?= $this->text->e($token['ip']) ?></td> + <td><?= $this->text->e($token['user_agent']) ?></td> </tr> <?php endforeach ?> </table> diff --git a/app/Template/user/profile.php b/app/Template/user/profile.php index 176a1491..80a633e3 100644 --- a/app/Template/user/profile.php +++ b/app/Template/user/profile.php @@ -1,8 +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> + <li><?= t('Username:') ?> <strong><?= $this->text->e($user['username']) ?></strong></li> + <li><?= t('Name:') ?> <strong><?= $this->text->e($user['name']) ?: t('None') ?></strong></li> + <li><?= t('Email:') ?> <strong><?= $this->text->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 7a66c5ad..d7fe895d 100644 --- a/app/Template/user/sessions.php +++ b/app/Template/user/sessions.php @@ -15,10 +15,10 @@ </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->e($session['ip']) ?></td> - <td><?= $this->e($session['user_agent']) ?></td> + <td><?= $this->dt->datetime($session['date_creation']) ?></td> + <td><?= $this->dt->datetime($session['expiration']) ?></td> + <td><?= $this->text->e($session['ip']) ?></td> + <td><?= $this->text->e($session['user_agent']) ?></td> <td><?= $this->url->link(t('Remove'), 'User', 'removeSession', array('user_id' => $user['id'], 'id' => $session['id']), true) ?></td> </tr> <?php endforeach ?> diff --git a/app/Template/user/show.php b/app/Template/user/show.php index 89c6b36b..df0affb8 100644 --- a/app/Template/user/show.php +++ b/app/Template/user/show.php @@ -2,9 +2,10 @@ <h2><?= t('Summary') ?></h2> </div> <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> + <li><?= t('Username:') ?> <strong><?= $this->text->e($user['username']) ?></strong></li> + <li><?= t('Name:') ?> <strong><?= $this->text->e($user['name']) ?: t('None') ?></strong></li> + <li><?= t('Email:') ?> <strong><?= $this->text->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"> diff --git a/app/Template/user/sidebar.php b/app/Template/user/sidebar.php index 9f745568..20fd2ad2 100644 --- a/app/Template/user/sidebar.php +++ b/app/Template/user/sidebar.php @@ -1,9 +1,11 @@ <div class="sidebar"> <h2><?= t('Information') ?></h2> <ul> - <li <?= $this->app->checkMenuSelection('user', 'show') ?>> - <?= $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'])) ?> @@ -24,15 +26,18 @@ </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->checkMenuSelection('user', 'edit') ?>> - <?= $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->checkMenuSelection('user', 'password') ?>> @@ -71,13 +76,5 @@ <?php endif ?> <?= $this->hook->render('template:user:sidebar:actions', array('user' => $user)) ?> - - <?php if ($this->user->hasAccess('user', 'remove') && ! $this->user->isCurrentUser($user['id'])): ?> - <li <?= $this->app->checkMenuSelection('user', 'remove') ?>> - <?= $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..92ebafb5 100644 --- a/app/Template/user/timesheet.php +++ b/app/Template/user/timesheet.php @@ -16,10 +16,10 @@ </tr> <?php foreach ($subtask_paginator->getCollection() as $record): ?> <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->url->link($this->text->e($record['task_title']), 'task', 'show', array('project_id' => $record['project_id'], 'task_id' => $record['task_id'])) ?></td> + <td><?= $this->url->link($this->text->e($record['subtask_title']), 'task', 'show', array('project_id' => $record['project_id'], 'task_id' => $record['task_id'])) ?></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 69643d6d..592587a3 100644 --- a/app/Template/user_import/step1.php +++ b/app/Template/user_import/step1.php @@ -26,7 +26,7 @@ <p class="form-help"><?= t('Maximum size: ') ?><?= is_integer($max_size) ? $this->text->bytes($max_size) : $max_size ?></p> <div class="form-actions"> - <input type="submit" value="<?= t('Import') ?>" class="btn btn-blue"> + <button type="submit" class="btn btn-blue"><?= t('Import') ?></button> </div> </form> <div class="page-header"> 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> |