diff options
Diffstat (limited to 'app/Template')
86 files changed, 549 insertions, 490 deletions
diff --git a/app/Template/action/index.php b/app/Template/action/index.php index a6fc70f9..29b6aca6 100644 --- a/app/Template/action/index.php +++ b/app/Template/action/index.php @@ -45,7 +45,11 @@ </li> <?php foreach ($action['params'] as $param_name => $param_value): ?> <li> - <?= $this->text->in($param_name, $available_params[$action['action_name']]) ?> = + <?php if (isset($available_params[$action['action_name']][$param_name]) && is_array($available_params[$action['action_name']][$param_name])): ?> + <?= $this->text->e(ucfirst($param_name)) ?> = + <?php else: ?> + <?= $this->text->in($param_name, $available_params[$action['action_name']]) ?> = + <?php endif ?> <strong> <?php if ($this->text->contains($param_name, 'column_id')): ?> <?= $this->text->in($param_value, $columns_list) ?> diff --git a/app/Template/action_creation/create.php b/app/Template/action_creation/create.php index 862ee474..a1169dca 100644 --- a/app/Template/action_creation/create.php +++ b/app/Template/action_creation/create.php @@ -3,7 +3,6 @@ </div> <form method="post" action="<?= $this->url->href('ActionCreationController', '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) ?> diff --git a/app/Template/action_creation/event.php b/app/Template/action_creation/event.php index e4166548..2ea72612 100644 --- a/app/Template/action_creation/event.php +++ b/app/Template/action_creation/event.php @@ -5,7 +5,6 @@ <form method="post" action="<?= $this->url->href('ActionCreationController', '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') ?> diff --git a/app/Template/action_creation/params.php b/app/Template/action_creation/params.php index 0cc98f50..9083b949 100644 --- a/app/Template/action_creation/params.php +++ b/app/Template/action_creation/params.php @@ -5,7 +5,6 @@ <form method="post" action="<?= $this->url->href('ActionCreationController', 'save', array('project_id' => $project['id'])) ?>" autocomplete="off"> <?= $this->form->csrf() ?> - <?= $this->form->hidden('project_id', $values) ?> <?= $this->form->hidden('event_name', $values) ?> <?= $this->form->hidden('action_name', $values) ?> @@ -43,6 +42,9 @@ <?php elseif ($this->text->contains($param_name, 'swimlane_id')): ?> <?= $this->form->label($param_desc, $param_name) ?> <?= $this->form->select('params['.$param_name.']', $swimlane_list, $values) ?> + <?php elseif (is_array($param_desc)): ?> + <?= $this->form->label(ucfirst($param_name), $param_name) ?> + <?= $this->form->select('params['.$param_name.']', $param_desc, $values) ?> <?php else: ?> <?= $this->form->label($param_desc, $param_name) ?> <?= $this->form->text('params['.$param_name.']', $values) ?> diff --git a/app/Template/board/table_column.php b/app/Template/board/table_column.php index 9d2815ff..a9652a2b 100644 --- a/app/Template/board/table_column.php +++ b/app/Template/board/table_column.php @@ -16,9 +16,7 @@ <!-- column in expanded mode --> <div class="board-column-expanded"> <?php if (! $not_editable && $this->projectRole->canCreateTaskInColumn($column['project_id'], $column['id'])): ?> - <div class="board-add-icon"> - <?= $this->modal->largeIcon('plus', t('Add a new task'), 'TaskCreationController', 'show', array('project_id' => $column['project_id'], 'column_id' => $column['id'], 'swimlane_id' => $swimlane['id'])) ?> - </div> + <?= $this->task->getNewBoardTaskButton($swimlane, $column) ?> <?php endif ?> <?php if ($swimlane['nb_swimlanes'] > 1 && ! empty($column['column_nb_tasks'])): ?> diff --git a/app/Template/board/task_footer.php b/app/Template/board/task_footer.php index 1ad1c9f1..4ea5bb31 100644 --- a/app/Template/board/task_footer.php +++ b/app/Template/board/task_footer.php @@ -32,7 +32,7 @@ <div class="task-board-icons-row"> <?php if ($task['reference']): ?> <span class="task-board-reference" title="<?= t('Reference') ?>"> - <?= $this->text->e($task['reference']) ?> + <?= $this->task->renderReference($task) ?> </span> <?php endif ?> </div> @@ -58,14 +58,14 @@ <?php if (! empty($task['date_due'])): ?> <span class="task-date - <?php if (date('Y-m-d') == date('Y-m-d', $task['date_due'])): ?> - task-date-today - <?php elseif (time() > $task['date_due']): ?> + <?php if (time() > $task['date_due']): ?> task-date-overdue + <?php elseif (date('Y-m-d') == date('Y-m-d', $task['date_due'])): ?> + task-date-today <?php endif ?> "> <i class="fa fa-calendar"></i> - <?= $this->dt->date($task['date_due']) ?> + <?= $this->dt->datetime($task['date_due']) ?> </span> <?php endif ?> </div> diff --git a/app/Template/board/task_private.php b/app/Template/board/task_private.php index c4afc0bf..ece5efbe 100644 --- a/app/Template/board/task_private.php +++ b/app/Template/board/task_private.php @@ -19,6 +19,7 @@ <div class="task-board-saving-icon" style="display: none;"><i class="fa fa-spinner fa-pulse"></i></div> <?php if ($this->user->hasProjectAccess('TaskModificationController', 'edit', $task['project_id'])): ?> <?= $this->render('task/dropdown', array('task' => $task)) ?> + <?= $this->modal->large('edit', '', 'TaskModificationController', 'edit', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?> <?php else: ?> <strong><?= '#'.$task['id'] ?></strong> <?php endif ?> @@ -28,7 +29,7 @@ <?= $this->text->e($this->user->getInitials($task['assignee_name'] ?: $task['assignee_username'])) ?> </span> - <?php endif ?> - <?= $this->text->e($task['title']) ?> + <?= $this->url->link($this->text->e($task['title']), 'TaskViewController', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id']), false, '', $this->text->e($task['title'])) ?> </div> <?php else: ?> <div class="task-board-expanded"> @@ -36,6 +37,7 @@ <div class="task-board-header"> <?php if ($this->user->hasProjectAccess('TaskModificationController', 'edit', $task['project_id'])): ?> <?= $this->render('task/dropdown', array('task' => $task)) ?> + <?= $this->modal->large('edit', '', 'TaskModificationController', 'edit', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?> <?php else: ?> <strong><?= '#'.$task['id'] ?></strong> <?php endif ?> @@ -51,7 +53,7 @@ <?= $this->hook->render('template:board:private:task:before-title', array('task' => $task)) ?> <div class="task-board-title"> - <?= $this->text->e($task['title']) ?> + <?= $this->url->link($this->text->e($task['title']), 'TaskViewController', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?> </div> <?= $this->hook->render('template:board:private:task:after-title', array('task' => $task)) ?> diff --git a/app/Template/board/tooltip_external_links.php b/app/Template/board/tooltip_external_links.php index a9f1fc7f..2c287adf 100644 --- a/app/Template/board/tooltip_external_links.php +++ b/app/Template/board/tooltip_external_links.php @@ -11,7 +11,7 @@ <?= $link['type'] ?> </td> <td> - <a href="<?= $link['url'] ?>" target="_blank"><?= $this->text->e($link['title']) ?></a> + <a href="<?= $link['url'] ?>" title="<?= $this->text->e($link['url']) ?>" target="_blank"><?= $this->text->e($link['title']) ?></a> </td> <td> <?= $this->text->e($link['dependency_label']) ?> diff --git a/app/Template/calendar/project.php b/app/Template/calendar/project.php deleted file mode 100644 index 769e019b..00000000 --- a/app/Template/calendar/project.php +++ /dev/null @@ -1,6 +0,0 @@ -<?= $this->projectHeader->render($project, 'CalendarController', 'show') ?> - -<?= $this->calendar->render( - $this->url->href('CalendarController', 'projectEvents', array('project_id' => $project['id'])), - $this->url->href('CalendarController', 'save', array('project_id' => $project['id'])) -) ?> diff --git a/app/Template/calendar/user.php b/app/Template/calendar/user.php deleted file mode 100644 index c68bd32d..00000000 --- a/app/Template/calendar/user.php +++ /dev/null @@ -1,4 +0,0 @@ -<?= $this->calendar->render( - $this->url->href('CalendarController', 'userEvents', array('user_id' => $user['id'])), - $this->url->href('CalendarController', 'save') -) ?> diff --git a/app/Template/category/create.php b/app/Template/category/create.php index b12ff7fa..b32a770c 100644 --- a/app/Template/category/create.php +++ b/app/Template/category/create.php @@ -3,7 +3,6 @@ </div> <form method="post" action="<?= $this->url->href('CategoryController', 'save', array('project_id' => $project['id'])) ?>" autocomplete="off"> <?= $this->form->csrf() ?> - <?= $this->form->hidden('project_id', $values) ?> <?= $this->form->label(t('Category Name'), 'name') ?> <?= $this->form->text('name', $values, $errors, array('autofocus', 'required', 'maxlength="50"')) ?> diff --git a/app/Template/category/edit.php b/app/Template/category/edit.php index 108826f3..9ad5a9e9 100644 --- a/app/Template/category/edit.php +++ b/app/Template/category/edit.php @@ -5,9 +5,6 @@ <form method="post" action="<?= $this->url->href('CategoryController', 'update', array('project_id' => $project['id'], 'category_id' => $values['id'])) ?>" autocomplete="off"> <?= $this->form->csrf() ?> - <?= $this->form->hidden('id', $values) ?> - <?= $this->form->hidden('project_id', $values) ?> - <?= $this->form->label(t('Category Name'), 'name') ?> <?= $this->form->text('name', $values, $errors, array('autofocus', 'required', 'maxlength="50"', 'tabindex="1"')) ?> diff --git a/app/Template/column/create.php b/app/Template/column/create.php index aad9606b..2b0c4641 100644 --- a/app/Template/column/create.php +++ b/app/Template/column/create.php @@ -4,8 +4,6 @@ <form method="post" action="<?= $this->url->href('ColumnController', '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"', 'tabindex="1"')) ?> diff --git a/app/Template/column/edit.php b/app/Template/column/edit.php index e590b5cc..25cf60c9 100644 --- a/app/Template/column/edit.php +++ b/app/Template/column/edit.php @@ -5,9 +5,6 @@ <form method="post" action="<?= $this->url->href('ColumnController', 'update', array('project_id' => $project['id'], 'column_id' => $column['id'])) ?>" autocomplete="off"> <?= $this->form->csrf() ?> - <?= $this->form->hidden('id', $values) ?> - <?= $this->form->hidden('project_id', $values) ?> - <?= $this->form->label(t('Title'), 'title') ?> <?= $this->form->text('title', $values, $errors, array('autofocus', 'required', 'maxlength="50"')) ?> diff --git a/app/Template/column_move_restriction/create.php b/app/Template/column_move_restriction/create.php index 852df971..cd9e1bf5 100644 --- a/app/Template/column_move_restriction/create.php +++ b/app/Template/column_move_restriction/create.php @@ -12,6 +12,8 @@ <?= $this->form->label(t('Destination column'), 'dst_column_id') ?> <?= $this->form->select('dst_column_id', $columns, $values, $errors) ?> + <?= $this->form->checkbox('only_assigned', t('Only for tasks assigned to the current user'), 1, isset($values['only_assigned']) && $values['only_assigned'] == 1) ?> + <?= $this->modal->submitButtons() ?> <p class="alert alert-info"><?= t('People belonging to this role will be able to move tasks only between the source and the destination column.') ?></p> diff --git a/app/Template/comment/create.php b/app/Template/comment/create.php index 0e19ac19..55e972dc 100644 --- a/app/Template/comment/create.php +++ b/app/Template/comment/create.php @@ -8,8 +8,6 @@ </div> <form method="post" action="<?= $this->url->href('CommentController', 'save', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?>" autocomplete="off"> <?= $this->form->csrf() ?> - <?= $this->form->hidden('task_id', $values) ?> - <?= $this->form->hidden('user_id', $values) ?> <?= $this->form->textEditor('comment', $values, $errors, array('autofocus' => true, 'required' => true)) ?> diff --git a/app/Template/comment/edit.php b/app/Template/comment/edit.php index 04f6ffd4..db8d2921 100644 --- a/app/Template/comment/edit.php +++ b/app/Template/comment/edit.php @@ -4,9 +4,6 @@ <form method="post" action="<?= $this->url->href('CommentController', '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) ?> - <?= $this->form->hidden('task_id', $values) ?> - <?= $this->form->hidden('user_id', $values) ?> <?= $this->form->textEditor('comment', $values, $errors, array('autofocus' => true, 'required' => true)) ?> diff --git a/app/Template/comment_list/create.php b/app/Template/comment_list/create.php index a1bae5eb..4c86bc06 100644 --- a/app/Template/comment_list/create.php +++ b/app/Template/comment_list/create.php @@ -3,6 +3,6 @@ </div> <form method="post" action="<?= $this->url->href('CommentListController', 'save', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?>" autocomplete="off"> <?= $this->form->csrf() ?> - <?= $this->form->textEditor('comment', array(), array(), array('required' => true)) ?> + <?= $this->form->textEditor('comment', array('project_id' => $task['project_id']), array(), array('required' => true)) ?> <?= $this->modal->submitButtons() ?> </form> diff --git a/app/Template/comment_mail/create.php b/app/Template/comment_mail/create.php index 019f8a20..8732080a 100644 --- a/app/Template/comment_mail/create.php +++ b/app/Template/comment_mail/create.php @@ -1,7 +1,7 @@ <div class="page-header"> <h2><?= t('Create and send a comment by email') ?></h2> </div> -<form method="post" action="<?= $this->url->href('CommentMailController', 'save', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?>" autocomplete="off"> +<form method="post" action="<?= $this->url->href('CommentMailController', 'save', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?>" autocomplete="off" class="js-mail-form"> <?= $this->form->csrf() ?> <?= $this->form->hidden('task_id', $values) ?> <?= $this->form->hidden('user_id', $values) ?> @@ -9,9 +9,39 @@ <?= $this->form->label(t('Email'), 'email') ?> <?= $this->form->email('email', $values, $errors, array('autofocus', 'required', 'tabindex="1"')) ?> + <?php if (! empty($members)): ?> + <div class="dropdown"> + <a href="#" class="dropdown-menu dropdown-menu-link-icon"><i class="fa fa-address-card-o"></i><i class="fa fa-caret-down"></i></a> + <ul> + <?php foreach ($members as $member): ?> + <li data-email="<?= $this->text->e($member['email']) ?>" class="js-autocomplete-email"> + <?= $this->text->e($this->user->getFullname($member)) ?> + </li> + <?php endforeach ?> + </ul> + </div> + <?php endif ?> + <?= $this->form->label(t('Subject'), 'subject') ?> <?= $this->form->text('subject', $values, $errors, array('required', 'tabindex="2"')) ?> + <?php if (! empty($project['predefined_email_subjects'])): ?> + <div class="dropdown"> + <a href="#" class="dropdown-menu dropdown-menu-link-icon"><i class="fa fa-archive"></i><i class="fa fa-caret-down"></i></a> + <ul> + <?php foreach (explode("\r\n", trim($project['predefined_email_subjects'])) as $subject): ?> + <?php $subject = trim($subject); ?> + + <?php if (! empty($subject)): ?> + <li data-subject="<?= $this->text->e($subject) ?>" class="js-autocomplete-subject"> + <?= $this->text->e($subject) ?> + </li> + <?php endif ?> + <?php endforeach ?> + </ul> + </div> + <?php endif ?> + <?= $this->form->textEditor('comment', $values, $errors, array('required' => true, 'tabindex' => 3)) ?> <?= $this->modal->submitButtons(array( diff --git a/app/Template/config/about.php b/app/Template/config/about.php index 23a3e6c0..4cce5e63 100644 --- a/app/Template/config/about.php +++ b/app/Template/config/about.php @@ -79,8 +79,6 @@ </div> <?php endif ?> -<?= $this->render('config/keyboard_shortcuts') ?> - <div class="page-header"> <h2><?= t('License') ?></h2> </div> diff --git a/app/Template/config/calendar.php b/app/Template/config/calendar.php deleted file mode 100644 index 0cc3d064..00000000 --- a/app/Template/config/calendar.php +++ /dev/null @@ -1,36 +0,0 @@ -<div class="page-header"> - <h2><?= t('Calendar settings') ?></h2> -</div> -<form method="post" action="<?= $this->url->href('ConfigController', 'save', array('redirect' => 'calendar')) ?>" autocomplete="off"> - - <?= $this->form->csrf() ?> - - <fieldset> - <legend><?= t('Project calendar view') ?></legend> - <?= $this->form->radios('calendar_project_tasks', array( - 'date_creation' => t('Show tasks based on the creation date'), - 'date_started' => t('Show tasks based on the start date'), - ), - $values - ) ?> - </fieldset> - - <fieldset> - <legend><?= t('User calendar view') ?></legend> - <?= $this->form->radios('calendar_user_tasks', array( - 'date_creation' => t('Show tasks based on the creation date'), - 'date_started' => t('Show tasks based on the start date'), - ), - $values - ) ?> - </fieldset> - - <fieldset> - <legend><?= t('Subtasks time tracking') ?></legend> - <?= $this->form->checkbox('calendar_user_subtasks_time_tracking', t('Show subtasks based on the time tracking'), 1, $values['calendar_user_subtasks_time_tracking'] == 1) ?> - </fieldset> - - <div class="form-actions"> - <button type="submit" class="btn btn-blue"><?= t('Save') ?></button> - </div> -</form> diff --git a/app/Template/config/integrations.php b/app/Template/config/integrations.php index 07a90ce2..0a3f9953 100644 --- a/app/Template/config/integrations.php +++ b/app/Template/config/integrations.php @@ -4,14 +4,11 @@ <form method="post" action="<?= $this->url->href('ConfigController', 'save', array('redirect' => 'integrations')) ?>" autocomplete="off"> <?= $this->form->csrf() ?> - <?= $this->hook->render('template:config:integrations', array('values' => $values)) ?> - - <h3><img src="<?= $this->url->dir() ?>assets/img/gravatar-icon.png"/> <?= t('Gravatar') ?></h3> - <div class="panel"> - <?= $this->form->checkbox('integration_gravatar', t('Enable Gravatar images'), 1, $values['integration_gravatar'] == 1) ?> - <div class="form-actions"> - <button type="submit" class="btn btn-blue"><?= t('Save') ?></button> - </div> - </div> + <?php $contents = $this->hook->render('template:config:integrations', array('values' => $values)) ?> + <?php if (empty($contents)): ?> + <p class="alert"><?= t('There is no external integration installed.') ?></p> + <?php else: ?> + <?= $contents ?> + <?php endif ?> </form> diff --git a/app/Template/config/keyboard_shortcuts.php b/app/Template/config/keyboard_shortcuts.php index 6ac71ee0..4e78dbe0 100644 --- a/app/Template/config/keyboard_shortcuts.php +++ b/app/Template/config/keyboard_shortcuts.php @@ -6,9 +6,7 @@ <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> - <li><?= t('Switch to the Gantt chart view') ?> = <strong>v g</strong></li> </ul> <h3><?= t('Board view') ?></h3> <ul> diff --git a/app/Template/config/sidebar.php b/app/Template/config/sidebar.php index 95be963b..2f265ed2 100644 --- a/app/Template/config/sidebar.php +++ b/app/Template/config/sidebar.php @@ -15,9 +15,6 @@ <li <?= $this->app->checkMenuSelection('ConfigController', 'board') ?>> <?= $this->url->link(t('Board settings'), 'ConfigController', 'board') ?> </li> - <li <?= $this->app->checkMenuSelection('ConfigController', 'calendar') ?>> - <?= $this->url->link(t('Calendar settings'), 'ConfigController', 'calendar') ?> - </li> <li <?= $this->app->checkMenuSelection('TagController', 'index') ?>> <?= $this->url->link(t('Tags management'), 'TagController', 'index') ?> </li> diff --git a/app/Template/custom_filter/create.php b/app/Template/custom_filter/create.php index 24e896ee..724cbc85 100644 --- a/app/Template/custom_filter/create.php +++ b/app/Template/custom_filter/create.php @@ -3,7 +3,6 @@ </div> <form method="post" action="<?= $this->url->href('CustomFilterController', '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="100"')) ?> diff --git a/app/Template/custom_filter/edit.php b/app/Template/custom_filter/edit.php index b64dee53..786e0c91 100644 --- a/app/Template/custom_filter/edit.php +++ b/app/Template/custom_filter/edit.php @@ -5,9 +5,7 @@ <form method="post" action="<?= $this->url->href('CustomFilterController', 'update', array('project_id' => $filter['project_id'], 'filter_id' => $filter['id'])) ?>" autocomplete="off"> <?= $this->form->csrf() ?> - <?= $this->form->hidden('id', $values) ?> <?= $this->form->hidden('user_id', $values) ?> - <?= $this->form->hidden('project_id', $values) ?> <?= $this->form->label(t('Name'), 'name') ?> <?= $this->form->text('name', $values, $errors, array('autofocus', 'required', 'maxlength="100"')) ?> diff --git a/app/Template/dashboard/layout.php b/app/Template/dashboard/layout.php index dbd16886..45b52451 100644 --- a/app/Template/dashboard/layout.php +++ b/app/Template/dashboard/layout.php @@ -7,9 +7,9 @@ </li> <?php endif ?> <?php if ($this->app->config('disable_private_project', 0) == 0): ?> - <li> - <?= $this->modal->medium('lock', t('New private project'), 'ProjectCreationController', 'createPrivate') ?> - </li> + <li> + <?= $this->modal->medium('lock', t('New private project'), 'ProjectCreationController', 'createPrivate') ?> + </li> <?php endif ?> <li> <?= $this->url->icon('folder', t('Project management'), 'ProjectListController', 'show') ?> @@ -17,9 +17,7 @@ <li> <?= $this->modal->medium('dashboard', t('My activity stream'), 'ActivityController', 'user') ?> </li> - <li> - <?= $this->modal->medium('calendar', t('My calendar'), 'CalendarController', 'user') ?> - </li> + <?= $this->hook->render('template:dashboard:page-header:menu', array('user' => $user)) ?> </ul> </div> <section class="sidebar-container" id="dashboard"> diff --git a/app/Template/dashboard/overview.php b/app/Template/dashboard/overview.php new file mode 100644 index 00000000..e732a387 --- /dev/null +++ b/app/Template/dashboard/overview.php @@ -0,0 +1,93 @@ +<div class="filter-box margin-bottom"> + <form method="get" action="<?= $this->url->dir() ?>" class="search"> + <?= $this->form->hidden('controller', array('controller' => 'SearchController')) ?> + <?= $this->form->hidden('action', array('action' => 'index')) ?> + + <div class="input-addon"> + <?= $this->form->text('search', array(), array(), array('placeholder="'.t('Search').'"'), 'input-addon-field') ?> + <div class="input-addon-item"> + <?= $this->render('app/filters_helper') ?> + </div> + </div> + </form> +</div> + +<?php if (! $project_paginator->isEmpty()): ?> + <div class="table-list"> + <?= $this->render('project_list/header', array('paginator' => $project_paginator)) ?> + <?php foreach ($project_paginator->getCollection() as $project): ?> + <div class="table-list-row table-border-left"> + <div> + <?php if ($this->user->hasProjectAccess('ProjectViewController', 'show', $project['id'])): ?> + <?= $this->render('project/dropdown', array('project' => $project)) ?> + <?php else: ?> + <strong><?= '#'.$project['id'] ?></strong> + <?php endif ?> + + <span class="table-list-title <?= $project['is_active'] == 0 ? 'status-closed' : '' ?>"> + <?= $this->url->link($this->text->e($project['name']), 'BoardViewController', 'show', array('project_id' => $project['id'])) ?> + </span> + + <?php if ($project['is_private']): ?> + <i class="fa fa-lock fa-fw" title="<?= t('Private project') ?>"></i> + <?php endif ?> + </div> + <div class="table-list-details"> + <?php foreach ($project['columns'] as $column): ?> + <strong title="<?= t('Task count') ?>"><?= $column['nb_open_tasks'] ?></strong> + <small><?= $this->text->e($column['title']) ?></small> + <?php endforeach ?> + </div> + </div> + <?php endforeach ?> + </div> + + <?= $project_paginator ?> +<?php endif ?> + +<?php if (empty($overview_paginator)): ?> + <p class="alert"><?= t('There is nothing assigned to you.') ?></p> +<?php else: ?> + <?php foreach ($overview_paginator as $result): ?> + <?php if (! $result['paginator']->isEmpty()): ?> + <div class="page-header"> + <h2><?= $this->url->link($this->text->e($result['project_name']), 'BoardViewController', 'show', array('project_id' => $result['project_id'])) ?></h2> + </div> + + <div class="table-list"> + <?= $this->render('task_list/header', array( + 'paginator' => $result['paginator'], + )) ?> + + <?php foreach ($result['paginator']->getCollection() as $task): ?> + <div class="table-list-row color-<?= $task['color_id'] ?>"> + <?= $this->render('task_list/task_title', array( + 'task' => $task, + )) ?> + + <?= $this->render('task_list/task_details', array( + 'task' => $task, + )) ?> + + <?= $this->render('task_list/task_avatars', array( + 'task' => $task, + )) ?> + + <?= $this->render('task_list/task_icons', array( + 'task' => $task, + )) ?> + + <?= $this->render('task_list/task_subtasks', array( + 'task' => $task, + 'user_id' => $user['id'], + )) ?> + </div> + <?php endforeach ?> + </div> + + <?= $result['paginator'] ?> + <?php endif ?> + <?php endforeach ?> +<?php endif ?> + +<?= $this->hook->render('template:dashboard:show', array('user' => $user)) ?> diff --git a/app/Template/dashboard/projects.php b/app/Template/dashboard/projects.php index 7e35b059..e84a9415 100644 --- a/app/Template/dashboard/projects.php +++ b/app/Template/dashboard/projects.php @@ -4,52 +4,24 @@ <?php if ($paginator->isEmpty()): ?> <p class="alert"><?= t('Your are not member of any project.') ?></p> <?php else: ?> - <table class="table-striped table-small table-scrolling"> - <tr> - <th class="column-5"><?= $paginator->order('Id', \Kanboard\Model\ProjectModel::TABLE.'.id') ?></th> - <th class="column-3"><?= $paginator->order('<i class="fa fa-lock fa-fw" title="'.t('Private project').'"></i>', \Kanboard\Model\ProjectModel::TABLE.'.is_private') ?></th> - <th class="column-25"><?= $paginator->order(t('Project'), \Kanboard\Model\ProjectModel::TABLE.'.name') ?></th> - <th class="column-10"><?= t('Tasks') ?></th> - <th><?= t('Columns') ?></th> - </tr> + <div class="table-list"> + <?= $this->render('project_list/header', array('paginator' => $paginator)) ?> <?php foreach ($paginator->getCollection() as $project): ?> - <tr> - <td> - <?= $this->render('project/dropdown', array('project' => $project)) ?> - </td> - <td> - <?php if ($project['is_private']): ?> - <i class="fa fa-lock fa-fw" title="<?= t('Private project') ?>"></i> - <?php endif ?> - </td> - <td> - <?php if ($this->user->hasProjectAccess('TaskGanttController', 'show', $project['id'])): ?> - <?= $this->url->link('<i class="fa fa-sliders fa-fw"></i>', 'TaskGanttController', 'show', array('project_id' => $project['id']), false, 'dashboard-table-link', t('Gantt chart')) ?> - <?php endif ?> + <div class="table-list-row table-border-left"> + <?= $this->render('project_list/project_title', array( + 'project' => $project, + )) ?> - <?= $this->url->link('<i class="fa fa-list"></i>', 'TaskListController', 'show', array('project_id' => $project['id']), false, 'dashboard-table-link', t('List')) ?> - <?= $this->url->link('<i class="fa fa-calendar"></i>', 'CalendarController', 'show', array('project_id' => $project['id']), false, 'dashboard-table-link', t('Calendar')) ?> + <?= $this->render('project_list/project_details', array( + 'project' => $project, + )) ?> - <?= $this->url->link($this->text->e($project['name']), 'BoardViewController', 'show', array('project_id' => $project['id'])) ?> - <?php if (! empty($project['description'])): ?> - <span class="tooltip" title="<?= $this->text->markdownAttribute($project['description']) ?>"> - <i class="fa fa-info-circle"></i> - </span> - <?php endif ?> - </td> - <td> - <?= $project['nb_active_tasks'] ?> - </td> - <td class="dashboard-project-stats"> - <?php foreach ($project['columns'] as $column): ?> - <strong title="<?= t('Task count') ?>"><?= $column['nb_open_tasks'] ?></strong> - <small><?= $this->text->e($column['title']) ?></small> - <?php endforeach ?> - </td> - - </tr> + <?= $this->render('project_list/project_icons', array( + 'project' => $project, + )) ?> + </div> <?php endforeach ?> - </table> + </div> <?= $paginator ?> <?php endif ?> diff --git a/app/Template/dashboard/show.php b/app/Template/dashboard/show.php deleted file mode 100644 index b1d877cf..00000000 --- a/app/Template/dashboard/show.php +++ /dev/null @@ -1,19 +0,0 @@ -<div class="filter-box margin-bottom"> - <form method="get" action="<?= $this->url->dir() ?>" class="search"> - <?= $this->form->hidden('controller', array('controller' => 'SearchController')) ?> - <?= $this->form->hidden('action', array('action' => 'index')) ?> - - <div class="input-addon"> - <?= $this->form->text('search', array(), array(), array('placeholder="'.t('Search').'"'), 'input-addon-field') ?> - <div class="input-addon-item"> - <?= $this->render('app/filters_helper') ?> - </div> - </div> - </form> -</div> - -<?= $this->render('dashboard/projects', array('paginator' => $project_paginator, 'user' => $user)) ?> -<?= $this->render('dashboard/tasks', array('paginator' => $task_paginator, 'user' => $user)) ?> -<?= $this->render('dashboard/subtasks', array('paginator' => $subtask_paginator, 'user' => $user)) ?> - -<?= $this->hook->render('template:dashboard:show', array('user' => $user)) ?> diff --git a/app/Template/dashboard/subtasks.php b/app/Template/dashboard/subtasks.php index d86b1ef9..96bb13cc 100644 --- a/app/Template/dashboard/subtasks.php +++ b/app/Template/dashboard/subtasks.php @@ -1,45 +1,49 @@ <div class="page-header"> - <h2><?= $this->url->link(t('My subtasks'), 'DashboardController', 'subtasks', array('user_id' => $user['id'])) ?> (<?= $paginator->getTotal() ?>)</h2> + <h2><?= $this->url->link(t('My subtasks'), 'DashboardController', 'subtasks', array('user_id' => $user['id'])) ?> (<?= $nb_subtasks ?>)</h2> </div> -<?php if ($paginator->isEmpty()): ?> +<?php if ($nb_subtasks == 0): ?> <p class="alert"><?= t('There is nothing assigned to you.') ?></p> <?php else: ?> - <table class="table-striped table-small table-scrolling"> - <tr> - <th class="column-5"><?= $paginator->order('Id', \Kanboard\Model\TaskModel::TABLE.'.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'), \Kanboard\Model\SubtaskModel::TABLE.'.title') ?></th> - <?= $this->hook->render('template:dashboard:subtasks:header:before-timetracking', array('paginator' => $paginator)) ?> - <th class="column-20"><?= t('Time tracking') ?></th> - </tr> - <?php foreach ($paginator->getCollection() as $subtask): ?> - <tr> - <td class="task-table color-<?= $subtask['color_id'] ?>"> - <?= $this->render('task/dropdown', array('task' => array('id' => $subtask['task_id'], 'project_id' => $subtask['project_id']))) ?> - </td> - <td> - <?= $this->url->link($this->text->e($subtask['project_name']), 'BoardViewController', 'show', array('project_id' => $subtask['project_id'])) ?> - </td> - <td> - <?= $this->url->link($this->text->e($subtask['task_name']), 'TaskViewController', 'show', array('task_id' => $subtask['task_id'], 'project_id' => $subtask['project_id'])) ?> - </td> - <td> - <?= $this->subtask->renderToggleStatus(array('project_id' => $subtask['project_id']), $subtask) ?> - </td> - <?= $this->hook->render('template:dashboard:subtasks:rows', array('subtask' => $subtask)) ?> - <td> - <?php if (! empty($subtask['time_spent'])): ?> - <strong><?= $this->text->e($subtask['time_spent']).'h' ?></strong> <?= t('spent') ?> + <div class="table-list"> + <div class="table-list-header"> + <div class="table-list-header-count"> + <?php if ($nb_subtasks > 1): ?> + <?= t('%d subtasks', $nb_subtasks) ?> + <?php else: ?> + <?= t('%d subtask', $nb_subtasks) ?> <?php endif ?> + </div> + <div class="table-list-header-menu"> + <div class="dropdown"> + <a href="#" class="dropdown-menu dropdown-menu-link-icon"><strong><?= t('Sort') ?> <i class="fa fa-caret-down"></i></strong></a> + <ul> + <li> + <?= $paginator->order(t('Task ID'), \Kanboard\Model\TaskModel::TABLE.'.id') ?> + </li> + <li> + <?= $paginator->order(t('Title'), \Kanboard\Model\TaskModel::TABLE.'.title') ?> + </li> + <li> + <?= $paginator->order(t('Priority'), \Kanboard\Model\TaskModel::TABLE.'.priority') ?> + </li> + </ul> + </div> + </div> + </div> - <?php if (! empty($subtask['time_estimated'])): ?> - <strong><?= $this->text->e($subtask['time_estimated']).'h' ?></strong> <?= t('estimated') ?> - <?php endif ?> - </td> - </tr> + <?php foreach ($paginator->getCollection() as $task): ?> + <div class="table-list-row color-<?= $task['color_id'] ?>"> + <?= $this->render('task_list/task_title', array( + 'task' => $task, + )) ?> + + <?= $this->render('task_list/task_subtasks', array( + 'task' => $task, + 'user_id' => $user['id'], + )) ?> + </div> <?php endforeach ?> - </table> + </div> <?= $paginator ?> <?php endif ?> diff --git a/app/Template/dashboard/tasks.php b/app/Template/dashboard/tasks.php index 427b903d..23aef990 100644 --- a/app/Template/dashboard/tasks.php +++ b/app/Template/dashboard/tasks.php @@ -4,50 +4,35 @@ <?php if ($paginator->isEmpty()): ?> <p class="alert"><?= t('There is nothing assigned to you.') ?></p> <?php else: ?> - <table class="table-striped table-small table-scrolling"> - <tr> - <th class="column-5"><?= $paginator->order('Id', \Kanboard\Model\TaskModel::TABLE.'.id') ?></th> - <th class="column-20"><?= $paginator->order(t('Project'), 'project_name') ?></th> - <th><?= $paginator->order(t('Task'), \Kanboard\Model\TaskModel::TABLE.'.title') ?></th> - <th class="column-8"><?= $paginator->order(t('Priority'), \Kanboard\Model\TaskModel::TABLE.'.priority') ?></th> - <th class="column-20"><?= t('Time tracking') ?></th> - <th class="column-10"><?= $paginator->order(t('Due date'), \Kanboard\Model\TaskModel::TABLE.'.date_due') ?></th> - <th class="column-10"><?= $paginator->order(t('Column'), 'column_title') ?></th> - </tr> + <div class="table-list"> + <?= $this->render('task_list/header', array( + 'paginator' => $paginator, + )) ?> + <?php foreach ($paginator->getCollection() as $task): ?> - <tr> - <td class="task-table color-<?= $task['color_id'] ?>"> - <?= $this->render('task/dropdown', array('task' => $task)) ?> - </td> - <td> - <?= $this->url->link($this->text->e($task['project_name']), 'BoardViewController', 'show', array('project_id' => $task['project_id'])) ?> - </td> - <td> - <?= $this->url->link($this->text->e($task['title']), 'TaskViewController', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?> - </td> - <td> - <?php if ($task['priority'] >= 0): ?> - P<?= $this->text->e($task['priority'])?> - <?php endif?> - </td> - <td> - <?php if (! empty($task['time_spent'])): ?> - <strong><?= $this->text->e($task['time_spent']).'h' ?></strong> <?= t('spent') ?> - <?php endif ?> + <div class="table-list-row color-<?= $task['color_id'] ?>"> + <?= $this->render('task_list/task_title', array( + 'task' => $task, + )) ?> + + <?= $this->render('task_list/task_details', array( + 'task' => $task, + )) ?> + + <?= $this->render('task_list/task_avatars', array( + 'task' => $task, + )) ?> + + <?= $this->render('task_list/task_icons', array( + 'task' => $task, + )) ?> - <?php if (! empty($task['time_estimated'])): ?> - <strong><?= $this->text->e($task['time_estimated']).'h' ?></strong> <?= t('estimated') ?> - <?php endif ?> - </td> - <td> - <?= $this->dt->date($task['date_due']) ?> - </td> - <td> - <?= $this->text->e($task['column_title']) ?> - </td> - </tr> + <?= $this->render('task_list/task_subtasks', array( + 'task' => $task, + )) ?> + </div> <?php endforeach ?> - </table> + </div> <?= $paginator ?> <?php endif ?> diff --git a/app/Template/group/user_dropdown.php b/app/Template/group/user_dropdown.php new file mode 100644 index 00000000..48acb955 --- /dev/null +++ b/app/Template/group/user_dropdown.php @@ -0,0 +1,11 @@ +<div class="dropdown"> + <a href="#" class="dropdown-menu dropdown-menu-link-icon"><strong>#<?= $user['id'] ?> <i class="fa fa-caret-down"></i></strong></a> + <ul> + <li> + <?= $this->url->icon('user', t('View profile'), 'UserViewController', 'show', array('user_id' => $user['id'])) ?> + </li> + <li> + <?= $this->modal->medium('trash', t('Remove user from group'), 'GroupListController', 'dissociate', array('group_id' => $user['group_id'], 'user_id' => $user['id'])) ?> + </li> + </ul> +</div> diff --git a/app/Template/group/users.php b/app/Template/group/users.php index 5025ca7a..2469296a 100644 --- a/app/Template/group/users.php +++ b/app/Template/group/users.php @@ -13,9 +13,20 @@ <?= $this->render('user_list/header', array('paginator' => $paginator)) ?> <?php foreach ($paginator->getCollection() as $user): ?> <div class="table-list-row table-border-left"> - <?= $this->render('user_list/user_title', array( - 'user' => $user, - )) ?> + <div> + <?= $this->render('group/user_dropdown', array('user' => $user)) ?> + <span class="table-list-title <?= $user['is_active'] == 0 ? 'status-closed' : '' ?>"> + <?= $this->avatar->small( + $user['id'], + $user['username'], + $user['name'], + $user['email'], + $user['avatar_path'], + 'avatar-inline' + ) ?> + <?= $this->url->link($this->text->e($user['name'] ?: $user['username']), 'UserViewController', 'show', array('user_id' => $user['id'])) ?> + </span> + </div> <?= $this->render('user_list/user_details', array( 'user' => $user, diff --git a/app/Template/header.php b/app/Template/header.php index 2af58d93..08523eb6 100644 --- a/app/Template/header.php +++ b/app/Template/header.php @@ -20,7 +20,7 @@ <?= $this->render('header/board_selector', array('board_selector' => $board_selector)) ?> <?php endif ?> </div> - <div class="menus-container pull-right"> + <div class="menus-container"> <?= $_top_right_corner ?> </div> </header> diff --git a/app/Template/notification/task_create.php b/app/Template/notification/task_create.php index 6e80b26a..e56c252d 100644 --- a/app/Template/notification/task_create.php +++ b/app/Template/notification/task_create.php @@ -6,7 +6,7 @@ </li> <?php if ($task['date_due']): ?> <li> - <strong><?= t('Due date:').' '.$this->dt->date($task['date_due']) ?></strong> + <strong><?= t('Due date:').' '.$this->dt->datetime($task['date_due']) ?></strong> </li> <?php endif ?> <?php if (! empty($task['creator_username'])): ?> diff --git a/app/Template/notification/task_overdue.php b/app/Template/notification/task_overdue.php index 01ad0a01..2ad4c14d 100644 --- a/app/Template/notification/task_overdue.php +++ b/app/Template/notification/task_overdue.php @@ -19,7 +19,7 @@ <?= $this->text->e($task['title']) ?> <?php endif ?> </td> - <td style="border: 1px solid #eee;"><?= $this->dt->date($task['date_due']) ?></td> + <td style="border: 1px solid #eee;"><?= $this->dt->datetime($task['date_due']) ?></td> <td style="border: 1px solid #eee;"><?= $this->text->e($task['project_name']) ?></td> <td style="border: 1px solid #eee;"> <?php if (! empty($task['assignee_username'])): ?> diff --git a/app/Template/predefined_task_description/create.php b/app/Template/predefined_task_description/create.php new file mode 100644 index 00000000..5a7a8d9f --- /dev/null +++ b/app/Template/predefined_task_description/create.php @@ -0,0 +1,14 @@ +<div class="page-header"> + <h2><?= t('Predefined Task Description') ?></h2> +</div> +<form method="post" action="<?= $this->url->href('PredefinedTaskDescriptionController', 'save', array('project_id' => $project['id'])) ?>" autocomplete="off"> + <?= $this->form->csrf() ?> + + <?= $this->form->label(t('Title'), 'title') ?> + <?= $this->form->text('title', $values, $errors, array('autofocus', 'required', 'tabindex="1"')) ?> + + <?= $this->form->label(t('Description'), 'description') ?> + <?= $this->form->textEditor('description', $values, $errors, array('tabindex' => 2)) ?> + + <?= $this->modal->submitButtons() ?> +</form> diff --git a/app/Template/predefined_task_description/edit.php b/app/Template/predefined_task_description/edit.php new file mode 100644 index 00000000..039d650b --- /dev/null +++ b/app/Template/predefined_task_description/edit.php @@ -0,0 +1,14 @@ +<div class="page-header"> + <h2><?= t('Predefined Task Description') ?></h2> +</div> +<form method="post" action="<?= $this->url->href('PredefinedTaskDescriptionController', 'update', array('project_id' => $project['id'], 'id' => $template['id'])) ?>" autocomplete="off"> + <?= $this->form->csrf() ?> + + <?= $this->form->label(t('Title'), 'title') ?> + <?= $this->form->text('title', $values, $errors, array('autofocus', 'required', 'tabindex="1"')) ?> + + <?= $this->form->label(t('Description'), 'description') ?> + <?= $this->form->textEditor('description', $values, $errors, array('tabindex' => 2)) ?> + + <?= $this->modal->submitButtons() ?> +</form> diff --git a/app/Template/predefined_task_description/remove.php b/app/Template/predefined_task_description/remove.php new file mode 100644 index 00000000..f60a8e75 --- /dev/null +++ b/app/Template/predefined_task_description/remove.php @@ -0,0 +1,15 @@ +<div class="page-header"> + <h2><?= t('Predefined Task Description') ?></h2> +</div> + +<div class="confirm"> + <p class="alert alert-info"> + <?= t('Do you really want to remove this template? "%s"', $template['title']) ?> + </p> + + <?= $this->modal->confirmButtons( + 'PredefinedTaskDescriptionController', + 'remove', + array('project_id' => $project['id'], 'id' => $template['id']) + ) ?> +</div> diff --git a/app/Template/project/dropdown.php b/app/Template/project/dropdown.php index 72c687a1..28fd9ba2 100644 --- a/app/Template/project/dropdown.php +++ b/app/Template/project/dropdown.php @@ -5,17 +5,8 @@ <?= $this->url->icon('th', t('Board'), 'BoardViewController', 'show', array('project_id' => $project['id'])) ?> </li> <li> - <?= $this->url->icon('calendar', t('Calendar'), 'CalendarController', 'show', array('project_id' => $project['id'])) ?> - </li> - <li> <?= $this->url->icon('list', t('Listing'), 'TaskListController', 'show', array('project_id' => $project['id'])) ?> </li> - <?php if ($this->user->hasProjectAccess('TaskGanttController', 'show', $project['id'])): ?> - <li> - <?= $this->url->icon('sliders', t('Gantt'), 'TaskGanttController', 'show', array('project_id' => $project['id'])) ?> - </li> - <?php endif ?> - <li> <?= $this->modal->medium('dashboard', t('Activity'), 'ActivityController', 'project', array('project_id' => $project['id'])) ?> </li> diff --git a/app/Template/project/sidebar.php b/app/Template/project/sidebar.php index 9775c7a1..4b39172c 100644 --- a/app/Template/project/sidebar.php +++ b/app/Template/project/sidebar.php @@ -13,6 +13,9 @@ <li <?= $this->app->checkMenuSelection('ProjectEditController') ?>> <?= $this->url->link(t('Edit project'), 'ProjectEditController', 'show', array('project_id' => $project['id'])) ?> </li> + <li <?= $this->app->checkMenuSelection('ProjectPredefinedContentController') ?>> + <?= $this->url->link(t('Predefined contents'), 'ProjectPredefinedContentController', 'show', array('project_id' => $project['id'])) ?> + </li> <li <?= $this->app->checkMenuSelection('ProjectViewController', 'share') ?>> <?= $this->url->link(t('Public access'), 'ProjectViewController', 'share', array('project_id' => $project['id'])) ?> </li> diff --git a/app/Template/project_edit/show.php b/app/Template/project_edit/show.php index 62bd9af6..96531007 100644 --- a/app/Template/project_edit/show.php +++ b/app/Template/project_edit/show.php @@ -9,7 +9,6 @@ <?php endif ?> <form method="post" action="<?= $this->url->href('ProjectEditController', 'update', array('project_id' => $project['id'], 'redirect' => 'edit')) ?>" autocomplete="off"> <?= $this->form->csrf() ?> - <?= $this->form->hidden('id', $values) ?> <fieldset> <legend><?= t('General') ?></legend> diff --git a/app/Template/project_gantt/show.php b/app/Template/project_gantt/show.php deleted file mode 100644 index 725f348d..00000000 --- a/app/Template/project_gantt/show.php +++ /dev/null @@ -1,42 +0,0 @@ -<section id="main"> - <div class="page-header"> - <ul> - <?php if ($this->user->hasAccess('ProjectCreationController', 'create')): ?> - <li> - <?= $this->modal->medium('plus', t('New project'), 'ProjectCreationController', 'create') ?> - </li> - <?php endif ?> - <?php if ($this->app->config('disable_private_project', 0) == 0): ?> - <li> - <?= $this->modal->medium('lock', t('New private project'), 'ProjectCreationController', 'createPrivate') ?> - </li> - <?php endif ?> - <li> - <?= $this->url->icon('folder', t('Projects list'), 'ProjectListController', 'show') ?> - </li> - <?php if ($this->user->hasAccess('ProjectUserOverviewController', 'managers')): ?> - <li> - <?= $this->url->icon('user', t('Users overview'), 'ProjectUserOverviewController', 'managers') ?> - </li> - <?php endif ?> - </ul> - </div> - <section> - <?php if (empty($projects)): ?> - <p class="alert"><?= t('No project') ?></p> - <?php else: ?> - <div - id="gantt-chart" - data-records='<?= json_encode($projects, JSON_HEX_APOS) ?>' - data-save-url="<?= $this->url->href('ProjectGanttController', 'save') ?>" - data-label-project-manager="<?= t('Project managers') ?>" - data-label-project-member="<?= t('Project members') ?>" - data-label-gantt-link="<?= t('Gantt chart for this project') ?>" - data-label-board-link="<?= t('Project board') ?>" - data-label-start-date="<?= t('Start date:') ?>" - data-label-end-date="<?= t('End date:') ?>" - data-label-not-defined="<?= t('There is no start date or end date for this project.') ?>" - ></div> - <?php endif ?> - </section> -</section> diff --git a/app/Template/project_header/search.php b/app/Template/project_header/search.php index 512e88d7..75110779 100644 --- a/app/Template/project_header/search.php +++ b/app/Template/project_header/search.php @@ -2,6 +2,7 @@ <form method="get" action="<?= $this->url->dir() ?>" class="search"> <?= $this->form->hidden('controller', $filters) ?> <?= $this->form->hidden('action', $filters) ?> + <?= $this->form->hidden('plugin', $filters) ?> <?= $this->form->hidden('project_id', $filters) ?> <div class="input-addon"> diff --git a/app/Template/project_header/views.php b/app/Template/project_header/views.php index 2684c744..4203595e 100644 --- a/app/Template/project_header/views.php +++ b/app/Template/project_header/views.php @@ -5,15 +5,9 @@ <li <?= $this->app->checkMenuSelection('BoardViewController') ?>> <?= $this->url->icon('th', t('Board'), 'BoardViewController', 'show', array('project_id' => $project['id'], 'search' => $filters['search']), false, 'view-board', t('Keyboard shortcut: "%s"', 'v b')) ?> </li> - <li <?= $this->app->checkMenuSelection('CalendarController') ?>> - <?= $this->url->icon('calendar', t('Calendar'), 'CalendarController', 'project', array('project_id' => $project['id'], 'search' => $filters['search']), false, 'view-calendar', t('Keyboard shortcut: "%s"', 'v c')) ?> - </li> <li <?= $this->app->checkMenuSelection('TaskListController') ?>> <?= $this->url->icon('list', t('List'), 'TaskListController', 'show', array('project_id' => $project['id'], 'search' => $filters['search']), false, 'view-listing', t('Keyboard shortcut: "%s"', 'v l')) ?> </li> - <?php if ($this->user->hasProjectAccess('TaskGanttController', 'show', $project['id'])): ?> - <li <?= $this->app->checkMenuSelection('TaskGanttController') ?>> - <?= $this->url->icon('sliders', t('Gantt'), 'TaskGanttController', 'show', array('project_id' => $project['id'], 'search' => $filters['search']), false, 'view-gantt', t('Keyboard shortcut: "%s"', 'v g')) ?> - </li> - <?php endif ?> + + <?= $this->hook->render('template:project-header:view-switcher', array('project' => $project, 'filters' => $filters)) ?> </ul> diff --git a/app/Template/project_list/listing.php b/app/Template/project_list/listing.php index f8c46729..6f6c93c1 100644 --- a/app/Template/project_list/listing.php +++ b/app/Template/project_list/listing.php @@ -18,10 +18,6 @@ <li><?= $this->url->icon('user', t('Users overview'), 'ProjectUserOverviewController', 'managers') ?></li> <?php endif ?> - <?php if ($this->user->hasAccess('ProjectGanttController', 'show')): ?> - <li><?= $this->url->icon('sliders', t('Projects Gantt chart'), 'ProjectGanttController', 'show') ?></li> - <?php endif ?> - <?= $this->hook->render('template:project-list:menu:after') ?> </ul> </div> diff --git a/app/Template/project_list/project_icons.php b/app/Template/project_list/project_icons.php index c7e9c4a9..348db367 100644 --- a/app/Template/project_list/project_icons.php +++ b/app/Template/project_list/project_icons.php @@ -1,4 +1,6 @@ <div class="table-list-icons"> + + <?php if ($project['is_public']): ?> <i class="fa fa-share-alt fa-fw" title="<?= t('Shared project') ?>"></i> <?php endif ?> @@ -18,6 +20,6 @@ <?php endif ?> <?php if ($project['is_active'] == 0): ?> - <i class="fa fa-ban fa-fw" aria-hidden="true" title="<?= t('Closed') ?>"></i><?= t('Closed') ?> + <i class="fa fa-ban fa-fw" aria-hidden="true" title="<?= t('Closed') ?>"></i><?= t('Closed') ?> <?php endif ?> </div> diff --git a/app/Template/project_permission/groups.php b/app/Template/project_permission/groups.php index c9914344..c241302b 100644 --- a/app/Template/project_permission/groups.php +++ b/app/Template/project_permission/groups.php @@ -46,7 +46,7 @@ 'placeholder="'.t('Enter group name...').'"', 'title="'.t('Enter group name...').'"', 'data-dst-field="group_id"', - 'data-dst-extra-field="external_id"', + 'data-dst-extra-fields="external_id"', 'data-search-url="'.$this->url->href('GroupAjaxController', 'autocomplete').'"', ), 'autocomplete') ?> diff --git a/app/Template/project_permission/index.php b/app/Template/project_permission/index.php index 689966b6..52a69fb5 100644 --- a/app/Template/project_permission/index.php +++ b/app/Template/project_permission/index.php @@ -2,36 +2,18 @@ <h2><?= t('Allowed Users') ?></h2> </div> -<?php if ($project['is_everybody_allowed']): ?> - <div class="alert"><?= t('Everybody have access to this project.') ?></div> -<?php else: ?> - <?= $this->render('project_permission/users', array( - 'project' => $project, - 'roles' => $roles, - 'users' => $users, - 'errors' => $errors, - 'values' => $values, - )) ?> +<?= $this->render('project_permission/users', array( + 'project' => $project, + 'roles' => $roles, + 'users' => $users, + 'errors' => $errors, + 'values' => $values, +)) ?> - <?= $this->render('project_permission/groups', array( - 'project' => $project, - 'roles' => $roles, - 'groups' => $groups, - 'errors' => $errors, - 'values' => $values, - )) ?> -<?php endif ?> - -<?php if ($project['is_private'] == 0): ?> -<hr/> -<form method="post" action="<?= $this->url->href('ProjectPermissionController', 'allowEverybody', array('project_id' => $project['id'])) ?>"> - <?= $this->form->csrf() ?> - - <?= $this->form->hidden('id', array('id' => $project['id'])) ?> - <?= $this->form->checkbox('is_everybody_allowed', t('Allow everybody to access to this project'), 1, $project['is_everybody_allowed']) ?> - - <div class="form-actions"> - <button type="submit" class="btn btn-blue"><?= t('Save') ?></button> - </div> -</form> -<?php endif ?> +<?= $this->render('project_permission/groups', array( + 'project' => $project, + 'roles' => $roles, + 'groups' => $groups, + 'errors' => $errors, + 'values' => $values, +)) ?> diff --git a/app/Template/project_permission/users.php b/app/Template/project_permission/users.php index bc92d060..1180fe1c 100644 --- a/app/Template/project_permission/users.php +++ b/app/Template/project_permission/users.php @@ -34,15 +34,19 @@ <?= $this->form->csrf() ?> <?= $this->form->hidden('project_id', array('project_id' => $project['id'])) ?> <?= $this->form->hidden('user_id', $values) ?> + <?= $this->form->hidden('username', $values) ?> + <?= $this->form->hidden('external_id', $values) ?> + <?= $this->form->hidden('external_id_column', $values) ?> <?= $this->form->label(t('Name'), 'name') ?> <?= $this->form->text('name', $values, $errors, array( - 'required', - 'placeholder="'.t('Enter user name...').'"', - 'title="'.t('Enter user name...').'"', - 'data-dst-field="user_id"', - 'data-search-url="'.$this->url->href('UserAjaxController', 'autocomplete').'"', - ), + 'required', + 'placeholder="'.t('Enter user name...').'"', + 'title="'.t('Enter user name...').'"', + 'data-dst-field="user_id"', + 'data-dst-extra-fields="external_id,external_id_column,username"', + 'data-search-url="'.$this->url->href('UserAjaxController', 'autocomplete').'"', + ), 'autocomplete') ?> <?= $this->form->select('role', $roles, $values, $errors) ?> diff --git a/app/Template/project_predefined_content/show.php b/app/Template/project_predefined_content/show.php new file mode 100644 index 00000000..b2785ada --- /dev/null +++ b/app/Template/project_predefined_content/show.php @@ -0,0 +1,47 @@ +<div class="page-header"> + <h2><?= t('Predefined Contents') ?></h2> + <ul> + <li> + <?= $this->modal->medium('plus', t('Add predefined task description'), 'PredefinedTaskDescriptionController', 'create', array('project_id' => $project['id'])) ?> + </li> + </ul> +</div> + +<?php if (! empty($predefined_task_descriptions)): ?> + <h3><?= t('Predefined Task Descriptions') ?></h3> + <table> + <?php foreach ($predefined_task_descriptions as $template): ?> + <tr> + <td> + <div class="dropdown"> + <a href="#" class="dropdown-menu dropdown-menu-link-icon"><i class="fa fa-cog"></i><i class="fa fa-caret-down"></i></a> + <ul> + <li> + <?= $this->modal->medium('edit', t('Edit'), 'PredefinedTaskDescriptionController', 'edit', array('project_id' => $project['id'], 'id' => $template['id'])) ?> + </li> + <li> + <?= $this->modal->confirm('trash-o', t('Remove'), 'PredefinedTaskDescriptionController', 'confirm', array('project_id' => $project['id'], 'id' => $template['id'])) ?> + </li> + </ul> + </div> + <?= $this->text->e($template['title']) ?> + <span class="tooltip" title="<?= $this->text->markdownAttribute($template['description']) ?>"> + <i class="fa fa-info-circle"></i> + </span> + </td> + </tr> + <?php endforeach ?> + </table> +<?php endif ?> + +<form method="post" action="<?= $this->url->href('ProjectPredefinedContentController', 'update', array('project_id' => $project['id'], 'redirect' => 'edit')) ?>" autocomplete="off"> + <?= $this->form->csrf() ?> + + <fieldset> + <legend><?= t('Predefined Email Subjects') ?></legend> + <?= $this->form->textarea('predefined_email_subjects', $values, $errors, array('tabindex="1"')) ?> + <p class="form-help"><?= t('Write one subject by line.') ?></p> + </fieldset> + + <?= $this->modal->submitButtons(array('tabindex' => 2)) ?> +</form> diff --git a/app/Template/project_role/show.php b/app/Template/project_role/show.php index 5377f7bb..65c9ef11 100644 --- a/app/Template/project_role/show.php +++ b/app/Template/project_role/show.php @@ -80,7 +80,11 @@ <i class="fa fa-check-circle-o fa-fw" aria-hidden="true"></i> <strong><?= $this->text->e($restriction['src_column_title']) ?> / <?= $this->text->e($restriction['dst_column_title']) ?></strong> <i class="fa fa-arrow-right fa-fw" aria-hidden="true"></i> - <?= t('Only moving task between those columns is permitted') ?> + <?php if ($restriction['only_assigned'] == 1): ?> + <?= t('Only moving task between those columns is permitted for tasks assigned to the current user') ?> + <?php else: ?> + <?= t('Only moving task between those columns is permitted') ?> + <?php endif ?> </td> <td> <?= $this->modal->confirm('trash-o', t('Remove'), 'ColumnMoveRestrictionController', 'confirm', array('project_id' => $project['id'], 'restriction_id' => $restriction['restriction_id'])) ?> diff --git a/app/Template/project_tag/create.php b/app/Template/project_tag/create.php index a0e6243b..6765e8fc 100644 --- a/app/Template/project_tag/create.php +++ b/app/Template/project_tag/create.php @@ -3,7 +3,6 @@ </div> <form method="post" action="<?= $this->url->href('ProjectTagController', '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="255"')) ?> diff --git a/app/Template/project_tag/edit.php b/app/Template/project_tag/edit.php index 8cb1e209..29290c0c 100644 --- a/app/Template/project_tag/edit.php +++ b/app/Template/project_tag/edit.php @@ -3,8 +3,6 @@ </div> <form method="post" action="<?= $this->url->href('ProjectTagController', 'update', array('tag_id' => $tag['id'], 'project_id' => $project['id'])) ?>" autocomplete="off"> <?= $this->form->csrf() ?> - <?= $this->form->hidden('id', $values) ?> - <?= $this->form->hidden('project_id', $values) ?> <?= $this->form->label(t('Name'), 'name') ?> <?= $this->form->text('name', $values, $errors, array('autofocus', 'required', 'maxlength="255"')) ?> diff --git a/app/Template/project_user_overview/layout.php b/app/Template/project_user_overview/layout.php index 9115ef3c..c97106f7 100644 --- a/app/Template/project_user_overview/layout.php +++ b/app/Template/project_user_overview/layout.php @@ -14,11 +14,6 @@ <li> <?= $this->url->icon('folder', t('Projects list'), 'ProjectListController', 'show') ?> </li> - <?php if ($this->user->hasAccess('ProjectGanttController', 'show')): ?> - <li> - <?= $this->url->icon('sliders', t('Projects Gantt chart'), 'ProjectGanttController', 'show') ?> - </li> - <?php endif ?> </ul> </div> <section class="sidebar-container"> diff --git a/app/Template/project_user_overview/roles.php b/app/Template/project_user_overview/roles.php index b8c67323..f53e7fa3 100644 --- a/app/Template/project_user_overview/roles.php +++ b/app/Template/project_user_overview/roles.php @@ -14,7 +14,6 @@ </td> <td> <?= $this->url->link('<i class="fa fa-th"></i>', 'BoardViewController', 'show', array('project_id' => $project['id']), false, 'dashboard-table-link', t('Board')) ?> - <?= $this->url->link('<i class="fa fa-sliders fa-fw"></i>', 'TaskGanttController', 'show', array('project_id' => $project['id']), false, 'dashboard-table-link', t('Gantt chart')) ?> <?= $this->url->link('<i class="fa fa-cog fa-fw"></i>', 'ProjectViewController', 'show', array('project_id' => $project['id']), false, 'dashboard-table-link', t('Project settings')) ?> <?= $this->text->e($project['project_name']) ?> diff --git a/app/Template/project_user_overview/tasks.php b/app/Template/project_user_overview/tasks.php index 8d682170..1e01a43f 100644 --- a/app/Template/project_user_overview/tasks.php +++ b/app/Template/project_user_overview/tasks.php @@ -36,7 +36,7 @@ <?= $this->dt->date($task['date_started']) ?> </td> <td> - <?= $this->dt->date($task['date_due']) ?> + <?= $this->dt->datetime($task['date_due']) ?> </td> </tr> <?php endforeach ?> diff --git a/app/Template/subtask/create.php b/app/Template/subtask/create.php index 96ad7a46..1ed36d47 100644 --- a/app/Template/subtask/create.php +++ b/app/Template/subtask/create.php @@ -2,11 +2,20 @@ <h2><?= t('Add a sub-task') ?></h2> </div> -<form method="post" action="<?= $this->url->href('SubtaskController', 'save', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?>" autocomplete="off"> +<?php if (isset($values['subtasks_added']) && $values['subtasks_added'] > 0): ?> + <p class="alert alert-success"> + <?php if ($values['subtasks_added'] == 1): ?> + <?= t('Subtask added successfully.') ?> + <?php else: ?> + <?= t('%d subtasks added successfully.', $values['subtasks_added']) ?> + <?php endif ?> + </p> +<?php endif ?> +<form method="post" action="<?= $this->url->href('SubtaskController', 'save', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?>" autocomplete="off"> <?= $this->form->csrf() ?> - <?= $this->form->hidden('task_id', $values) ?> - <?= $this->subtask->renderTitleField($values, $errors, array('autofocus')) ?> + + <?= $this->subtask->renderBulkTitleField($values, $errors, array('autofocus')) ?> <?= $this->subtask->renderAssigneeField($users_list, $values, $errors) ?> <?= $this->subtask->renderTimeEstimatedField($values, $errors) ?> diff --git a/app/Template/subtask/edit.php b/app/Template/subtask/edit.php index 7c0266a8..aed57e95 100644 --- a/app/Template/subtask/edit.php +++ b/app/Template/subtask/edit.php @@ -4,8 +4,6 @@ <form method="post" action="<?= $this->url->href('SubtaskController', '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->subtask->renderTitleField($values, $errors, array('autofocus')) ?> <?= $this->subtask->renderAssigneeField($users_list, $values, $errors) ?> diff --git a/app/Template/subtask/table.php b/app/Template/subtask/table.php index 5488796d..e1bca500 100644 --- a/app/Template/subtask/table.php +++ b/app/Template/subtask/table.php @@ -21,7 +21,7 @@ 'task' => $task, 'subtask' => $subtask, )) ?> - <?= $this->subtask->renderToggleStatus($task, $subtask, true) ?> + <?= $this->subtask->renderToggleStatus($task, $subtask, 'table') ?> <?php else: ?> <?= $this->subtask->renderTitle($subtask) ?> <?php endif ?> diff --git a/app/Template/swimlane/create.php b/app/Template/swimlane/create.php index 7d05e731..5ff8cbee 100644 --- a/app/Template/swimlane/create.php +++ b/app/Template/swimlane/create.php @@ -2,9 +2,7 @@ <h2><?= t('Add a new swimlane') ?></h2> </div> <form method="post" action="<?= $this->url->href('SwimlaneController', '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"', 'tabindex="1"')) ?> diff --git a/app/Template/swimlane/edit.php b/app/Template/swimlane/edit.php index c1c41196..b1d713ee 100644 --- a/app/Template/swimlane/edit.php +++ b/app/Template/swimlane/edit.php @@ -3,12 +3,8 @@ </div> <form method="post" action="<?= $this->url->href('SwimlaneController', 'update', array('project_id' => $project['id'], 'swimlane_id' => $values['id'])) ?>" autocomplete="off"> - <?= $this->form->csrf() ?> - <?= $this->form->hidden('id', $values) ?> - <?= $this->form->hidden('project_id', $values) ?> - <?= $this->form->label(t('Name'), 'name') ?> <?= $this->form->text('name', $values, $errors, array('autofocus', 'required', 'maxlength="50"', 'tabindex="1"')) ?> diff --git a/app/Template/task/changes.php b/app/Template/task/changes.php index 2c2bf267..6aa3d49b 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>'.t('New due date: ').$this->dt->date($task['date_due']).'</li>'; + echo '<li>'.t('New due date: ').$this->dt->datetime($task['date_due']).'</li>'; } break; case 'description': diff --git a/app/Template/task/details.php b/app/Template/task/details.php index 24099a3c..cf305743 100644 --- a/app/Template/task/details.php +++ b/app/Template/task/details.php @@ -22,7 +22,7 @@ </li> <?php if (! empty($task['reference'])): ?> <li> - <strong><?= t('Reference:') ?></strong> <span><?= $this->text->e($task['reference']) ?></span> + <strong><?= t('Reference:') ?></strong> <span><?= $this->task->renderReference($task) ?></span> </li> <?php endif ?> <?php if (! empty($task['score'])): ?> @@ -92,12 +92,6 @@ <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> @@ -116,6 +110,18 @@ </div> <div class="task-summary-column"> <ul class="no-bullet"> + <?php if ($task['date_due']): ?> + <li> + <strong><?= t('Due date:') ?></strong> + <span><?= $this->dt->datetime($task['date_due']) ?></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 ?> <li> <strong><?= t('Created:') ?></strong> <span><?= $this->dt->datetime($task['date_creation']) ?></span> @@ -130,12 +136,6 @@ <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> diff --git a/app/Template/task/dropdown.php b/app/Template/task/dropdown.php index f35abc79..5135fb77 100644 --- a/app/Template/task/dropdown.php +++ b/app/Template/task/dropdown.php @@ -1,15 +1,17 @@ <div class="dropdown"> <a href="#" class="dropdown-menu dropdown-menu-link-icon"><strong>#<?= $task['id'] ?> <i class="fa fa-caret-down"></i></strong></a> <ul> - <?php if (array_key_exists('date_started', $task) && empty($task['date_started'])): ?> - <li> - <?= $this->url->icon('play', t('Set automatically the start date'), 'TaskModificationController', 'start', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?> - </li> + <?php if ($this->projectRole->canUpdateTask($task)): ?> + <?php if (array_key_exists('date_started', $task) && empty($task['date_started'])): ?> + <li> + <?= $this->url->icon('play', t('Set automatically the start date'), 'TaskModificationController', 'start', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?> + </li> + <?php endif ?> + <li> + <?= $this->modal->large('edit', t('Edit the task'), 'TaskModificationController', 'edit', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?> + </li> <?php endif ?> <li> - <?= $this->modal->large('edit', t('Edit the task'), 'TaskModificationController', 'edit', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?> - </li> - <li> <?= $this->modal->medium('plus', t('Add a sub-task'), 'SubtaskController', 'create', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?> </li> <li> diff --git a/app/Template/task/show.php b/app/Template/task/show.php index 565f0632..892d62f2 100644 --- a/app/Template/task/show.php +++ b/app/Template/task/show.php @@ -18,7 +18,7 @@ 'task' => $task, 'subtasks' => $subtasks, 'project' => $project, - 'editable' => true, + 'editable' => $this->user->hasProjectAccess('SubtaskController', 'edit', $project['id']), )) ?> <?php endif ?> @@ -29,7 +29,7 @@ 'links' => $internal_links, 'project' => $project, 'link_label_list' => $link_label_list, - 'editable' => true, + 'editable' => $this->user->hasProjectAccess('TaskInternalLinkController', 'edit', $project['id']), 'is_public' => false, )) ?> <?php endif ?> diff --git a/app/Template/task/sidebar.php b/app/Template/task/sidebar.php index 952c3298..265c6ef0 100644 --- a/app/Template/task/sidebar.php +++ b/app/Template/task/sidebar.php @@ -29,12 +29,14 @@ <h2><?= t('Actions') ?></h2> </div> <ul> + <?php if ($this->projectRole->canUpdateTask($task)): ?> <li> <?= $this->modal->large('edit', t('Edit the task'), 'TaskModificationController', 'edit', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?> </li> <li> <?= $this->modal->medium('refresh fa-rotate-90', t('Edit recurrence'), 'TaskRecurrenceController', 'edit', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?> </li> + <?php endif ?> <li> <?= $this->modal->medium('plus', t('Add a sub-task'), 'SubtaskController', 'create', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?> </li> diff --git a/app/Template/task_bulk/show.php b/app/Template/task_bulk/show.php index acf80d8c..b13cf239 100644 --- a/app/Template/task_bulk/show.php +++ b/app/Template/task_bulk/show.php @@ -6,12 +6,16 @@ <?= $this->form->csrf() ?> <?= $this->form->hidden('column_id', $values) ?> <?= $this->form->hidden('swimlane_id', $values) ?> - <?= $this->form->hidden('project_id', $values) ?> <?= $this->task->renderColorField($values) ?> <?= $this->task->renderAssigneeField($users_list, $values, $errors) ?> <?= $this->task->renderCategoryField($categories_list, $values, $errors) ?> + <?php if (! empty($task_description_templates)): ?> + <?= $this->form->label(t('Template for the task description'), 'task_description_template_id') ?> + <?= $this->form->select('task_description_template_id', $task_description_templates, $values, $errors) ?> + <?php endif ?> + <?= $this->form->label(t('Tasks'), 'tasks') ?> <?= $this->form->textarea('tasks', $values, $errors, array('placeholder="'.t('My task title').'"')) ?> <p class="form-help"><?= t('Enter one task by line.') ?></p> diff --git a/app/Template/task_comments/show.php b/app/Template/task_comments/show.php index d34e5e95..47bb5ff2 100644 --- a/app/Template/task_comments/show.php +++ b/app/Template/task_comments/show.php @@ -25,7 +25,11 @@ <?php if ($editable): ?> <?= $this->render('task_comments/create', array( - 'values' => array(), + 'values' => array( + 'user_id' => $this->user->getId(), + 'task_id' => $task['id'], + 'project_id' => $task['project_id'], + ), 'errors' => array(), 'task' => $task, )) ?> diff --git a/app/Template/task_creation/show.php b/app/Template/task_creation/show.php index e957087f..935e0823 100644 --- a/app/Template/task_creation/show.php +++ b/app/Template/task_creation/show.php @@ -1,14 +1,14 @@ <div class="page-header"> - <h2><?= $this->text->e($project['name']) ?> > <?= t('New task') ?><?= $this->task->getNewTaskDropdown($project['id'], $values['swimlane_id'], $values['column_id']) ?></h2> + <h2><?= $this->text->e($project['name']) ?> > <?= t('New task') ?></h2> </div> <form method="post" action="<?= $this->url->href('TaskCreationController', 'save', array('project_id' => $project['id'])) ?>" autocomplete="off"> <?= $this->form->csrf() ?> - <?= $this->form->hidden('project_id', $values) ?> <div class="task-form-container"> <div class="task-form-main-column"> <?= $this->task->renderTitleField($values, $errors) ?> <?= $this->task->renderDescriptionField($values, $errors) ?> + <?= $this->task->renderDescriptionTemplateDropdown($project['id']) ?> <?= $this->task->renderTagField($project) ?> <?= $this->hook->render('template:task:form:first-column', array('values' => $values, 'errors' => $errors)) ?> diff --git a/app/Template/task_external_link/edit.php b/app/Template/task_external_link/edit.php index df10d444..e448b10f 100644 --- a/app/Template/task_external_link/edit.php +++ b/app/Template/task_external_link/edit.php @@ -2,7 +2,7 @@ <h2><?= t('Edit external link') ?></h2> </div> -<form action="<?= $this->url->href('TaskExternalLinkController', 'update', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?>" method="post" autocomplete="off"> +<form action="<?= $this->url->href('TaskExternalLinkController', 'update', array('task_id' => $task['id'], 'project_id' => $task['project_id'], 'link_id' => $link['id'])) ?>" method="post" autocomplete="off"> <?= $this->render('task_external_link/form', array('task' => $task, 'dependencies' => $dependencies, 'values' => $values, 'errors' => $errors)) ?> <?= $this->modal->submitButtons() ?> </form> diff --git a/app/Template/task_external_link/find.php b/app/Template/task_external_link/find.php index a3665c0d..29d85101 100644 --- a/app/Template/task_external_link/find.php +++ b/app/Template/task_external_link/find.php @@ -4,7 +4,6 @@ <form action="<?= $this->url->href('TaskExternalLinkController', '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( diff --git a/app/Template/task_external_link/form.php b/app/Template/task_external_link/form.php index 932ca521..4ad2b2e0 100644 --- a/app/Template/task_external_link/form.php +++ b/app/Template/task_external_link/form.php @@ -1,6 +1,4 @@ <?= $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') ?> diff --git a/app/Template/task_external_link/table.php b/app/Template/task_external_link/table.php index e345037e..5b22161a 100644 --- a/app/Template/task_external_link/table.php +++ b/app/Template/task_external_link/table.php @@ -1,12 +1,15 @@ <?php if (! empty($links)): ?> <table class="table-striped table-scrolling"> - <tr> - <th class="column-15"><?= 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> - </tr> + <thead> + <tr> + <th class="column-15"><?= 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> + </tr> + </thead> + <tbody> <?php foreach ($links as $link): ?> <tr> <td> @@ -26,7 +29,7 @@ <?= $this->text->e($link['type']) ?> </td> <td> - <a href="<?= $link['url'] ?>" target="_blank"><?= $this->text->e($link['title']) ?></a> + <a href="<?= $link['url'] ?>" title="<?= $this->text->e($link['url']) ?>" target="_blank"><?= $this->text->e($link['title']) ?></a> </td> <td> <?= $this->text->e($link['dependency_label']) ?> @@ -39,5 +42,6 @@ </td> </tr> <?php endforeach ?> + </tbody> </table> <?php endif ?> diff --git a/app/Template/task_gantt/show.php b/app/Template/task_gantt/show.php deleted file mode 100644 index 61a476b7..00000000 --- a/app/Template/task_gantt/show.php +++ /dev/null @@ -1,31 +0,0 @@ -<section id="main"> - <?= $this->projectHeader->render($project, 'TaskGanttController', 'show') ?> - <div class="menu-inline"> - <ul> - <li <?= $sorting === 'board' ? 'class="active"' : '' ?>> - <?= $this->url->icon('sort-numeric-asc', t('Sort by position'), 'TaskGanttController', 'show', array('project_id' => $project['id'], 'sorting' => 'board')) ?> - </li> - <li <?= $sorting === 'date' ? 'class="active"' : '' ?>> - <?= $this->url->icon('sort-amount-asc', t('Sort by date'), 'TaskGanttController', 'show', array('project_id' => $project['id'], 'sorting' => 'date')) ?> - </li> - <li> - <?= $this->modal->large('plus', t('Add task'), 'TaskCreationController', 'show', array('project_id' => $project['id'])) ?> - </li> - </ul> - </div> - - <?php if (! empty($tasks)): ?> - <div - id="gantt-chart" - data-records='<?= json_encode($tasks, JSON_HEX_APOS) ?>' - data-save-url="<?= $this->url->href('TaskGanttController', 'save', array('project_id' => $project['id'])) ?>" - data-label-start-date="<?= t('Start date:') ?>" - data-label-end-date="<?= t('Due date:') ?>" - data-label-assignee="<?= t('Assignee:') ?>" - data-label-not-defined="<?= t('There is no start date or due date for this task.') ?>" - ></div> - <p class="alert alert-info"><?= t('Moving or resizing a task will change the start and due date of the task.') ?></p> - <?php else: ?> - <p class="alert"><?= t('There is no task in your project.') ?></p> - <?php endif ?> -</section> diff --git a/app/Template/task_import/show.php b/app/Template/task_import/show.php index 20b020d3..342cfb76 100644 --- a/app/Template/task_import/show.php +++ b/app/Template/task_import/show.php @@ -26,6 +26,8 @@ <li><?= t('The first row must be the header') ?></li> <li><?= t('Duplicates are not verified for you') ?></li> <li><?= t('The due date must use the ISO format: YYYY-MM-DD') ?></li> + <li><?= t('Tags must be separated by a comma') ?></li> + <li><?= t('Only the task title is required') ?></li> </ul> <p class="margin-top"> <?= $this->url->icon('download', t('Download CSV template'), 'TaskImportController', 'template', array('project_id' => $project['id'])) ?> diff --git a/app/Template/task_internal_link/create.php b/app/Template/task_internal_link/create.php index 3c39b87c..bab41253 100644 --- a/app/Template/task_internal_link/create.php +++ b/app/Template/task_internal_link/create.php @@ -5,7 +5,6 @@ <form action="<?= $this->url->href('TaskInternalLinkController', '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'])) ?> <?= $this->form->hidden('opposite_task_id', $values) ?> <?= $this->form->label(t('Label'), 'link_id') ?> @@ -25,5 +24,7 @@ ), 'autocomplete') ?> + <?= $this->form->checkbox('another_tasklink', t('Create another link'), 1, isset($values['another_tasklink']) && $values['another_tasklink'] == 1) ?> + <?= $this->modal->submitButtons() ?> </form> diff --git a/app/Template/task_internal_link/edit.php b/app/Template/task_internal_link/edit.php index 5abf7b65..fab84d0b 100644 --- a/app/Template/task_internal_link/edit.php +++ b/app/Template/task_internal_link/edit.php @@ -3,10 +3,8 @@ </div> <form action="<?= $this->url->href('TaskInternalLinkController', 'update', array('task_id' => $task['id'], 'project_id' => $task['project_id'], 'link_id' => $task_link['id'])) ?>" method="post" autocomplete="off"> - <?= $this->form->csrf() ?> - <?= $this->form->hidden('id', $values) ?> - <?= $this->form->hidden('task_id', $values) ?> + <?= $this->form->hidden('opposite_task_id', $values) ?> <?= $this->form->label(t('Label'), 'link_id') ?> diff --git a/app/Template/task_list/listing.php b/app/Template/task_list/listing.php index b3c66aa6..97393972 100644 --- a/app/Template/task_list/listing.php +++ b/app/Template/task_list/listing.php @@ -1,40 +1,38 @@ -<section id="main"> - <?= $this->projectHeader->render($project, 'TaskListController', 'show') ?> +<?= $this->projectHeader->render($project, 'TaskListController', 'show') ?> - <?php if ($paginator->isEmpty()): ?> - <p class="alert"><?= t('No tasks found.') ?></p> - <?php elseif (! $paginator->isEmpty()): ?> - <div class="table-list"> - <?= $this->render('task_list/header', array( - 'paginator' => $paginator, - 'project' => $project, - )) ?> +<?php if ($paginator->isEmpty()): ?> + <p class="alert"><?= t('No tasks found.') ?></p> +<?php elseif (! $paginator->isEmpty()): ?> + <div class="table-list"> + <?= $this->render('task_list/header', array( + 'paginator' => $paginator, + 'project' => $project, + )) ?> - <?php foreach ($paginator->getCollection() as $task): ?> - <div class="table-list-row color-<?= $task['color_id'] ?>"> - <?= $this->render('task_list/task_title', array( - 'task' => $task, - )) ?> + <?php foreach ($paginator->getCollection() as $task): ?> + <div class="table-list-row color-<?= $task['color_id'] ?>"> + <?= $this->render('task_list/task_title', array( + 'task' => $task, + )) ?> - <?= $this->render('task_list/task_details', array( - 'task' => $task, - )) ?> + <?= $this->render('task_list/task_details', array( + 'task' => $task, + )) ?> - <?= $this->render('task_list/task_avatars', array( - 'task' => $task, - )) ?> + <?= $this->render('task_list/task_avatars', array( + 'task' => $task, + )) ?> - <?= $this->render('task_list/task_icons', array( - 'task' => $task, - )) ?> + <?= $this->render('task_list/task_icons', array( + 'task' => $task, + )) ?> - <?= $this->render('task_list/task_subtasks', array( - 'task' => $task, - )) ?> - </div> - <?php endforeach ?> - </div> + <?= $this->render('task_list/task_subtasks', array( + 'task' => $task, + )) ?> + </div> + <?php endforeach ?> + </div> - <?= $paginator ?> - <?php endif ?> -</section> + <?= $paginator ?> +<?php endif ?> diff --git a/app/Template/task_list/sort_menu.php b/app/Template/task_list/sort_menu.php index 48081fe0..a42fb46e 100644 --- a/app/Template/task_list/sort_menu.php +++ b/app/Template/task_list/sort_menu.php @@ -17,6 +17,9 @@ <?= $paginator->order(t('Priority'), \Kanboard\Model\TaskModel::TABLE.'.priority') ?> </li> <li> + <?= $paginator->order(t('Position'), \Kanboard\Model\TaskModel::TABLE.'.position') ?> + </li> + <li> <?= $paginator->order(t('Title'), \Kanboard\Model\TaskModel::TABLE.'.title') ?> </li> <li> @@ -26,6 +29,9 @@ <?= $paginator->order(t('Due date'), \Kanboard\Model\TaskModel::TABLE.'.date_due') ?> </li> <li> + <?= $paginator->order(t('Start date'), \Kanboard\Model\TaskModel::TABLE.'.date_started') ?> + </li> + <li> <?= $paginator->order(t('Status'), \Kanboard\Model\TaskModel::TABLE.'.is_active') ?> </li> </ul> diff --git a/app/Template/task_list/task_icons.php b/app/Template/task_list/task_icons.php index 8694d147..d02c9021 100644 --- a/app/Template/task_list/task_icons.php +++ b/app/Template/task_list/task_icons.php @@ -1,7 +1,7 @@ <div class="task-list-icons"> <?php if ($task['reference']): ?> <span class="task-board-reference" title="<?= t('Reference') ?>"> - <?= $this->text->e($task['reference']) ?> + <?= $this->task->renderReference($task) ?> </span> <?php endif ?> <?php if ($task['is_milestone'] == 1): ?> @@ -23,16 +23,23 @@ </span> <?php endif ?> + <?php if (! empty($task['date_started'])): ?> + <span title="<?= t('Start date') ?>" class="task-date"> + <i class="fa fa-clock-o"></i> + <?= $this->dt->date($task['date_started']) ?> + </span> + <?php endif ?> + <?php if (! empty($task['date_due'])): ?> - <span class="task-date - <?php if (date('Y-m-d') == date('Y-m-d', $task['date_due'])): ?> - task-date-today - <?php elseif (time() > $task['date_due']): ?> + <span title="<?= t('Due date') ?>" class="task-date + <?php if (time() > $task['date_due']): ?> task-date-overdue + <?php elseif (date('Y-m-d') == date('Y-m-d', $task['date_due'])): ?> + task-date-today <?php endif ?> "> <i class="fa fa-calendar"></i> - <?= $this->dt->date($task['date_due']) ?> + <?= $this->dt->datetime($task['date_due']) ?> </span> <?php endif ?> @@ -81,6 +88,8 @@ </span> <?php endif ?> + <span title="<?= t('Position') ?>">(<?= $task['position'] ?>)</span> + <?php if ($task['is_active'] == 1): ?> <div class="task-icon-age"> <span title="<?= t('Task age in days')?>" class="task-icon-age-total"><?= $this->dt->age($task['date_creation']) ?></span> diff --git a/app/Template/task_list/task_subtasks.php b/app/Template/task_list/task_subtasks.php index 716d6df2..9110b171 100644 --- a/app/Template/task_list/task_subtasks.php +++ b/app/Template/task_list/task_subtasks.php @@ -3,7 +3,7 @@ <?php foreach ($task['subtasks'] as $subtask): ?> <div class="task-list-subtask"> <span class="subtask-cell column-50"> - <?= $this->subtask->renderToggleStatus($task, $subtask) ?> + <?= $this->subtask->renderToggleStatus($task, $subtask, 'rows', isset($user_id) ? $user_id : 0) ?> </span> <span class="subtask-cell column-20 subtask-assignee"> <?php if (! empty($subtask['username'])): ?> diff --git a/app/Template/task_mail/create.php b/app/Template/task_mail/create.php index 9a1a26b3..f369ef99 100644 --- a/app/Template/task_mail/create.php +++ b/app/Template/task_mail/create.php @@ -1,15 +1,45 @@ <div class="page-header"> <h2><?= $this->text->e($task['title']) ?> > <?= t('Send by email') ?></h2> </div> -<form method="post" action="<?= $this->url->href('TaskMailController', 'send', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?>" autocomplete="off"> +<form method="post" action="<?= $this->url->href('TaskMailController', 'send', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?>" autocomplete="off" class="js-mail-form"> <?= $this->form->csrf() ?> <?= $this->form->label(t('Email'), 'email') ?> <?= $this->form->email('email', $values, $errors, array('autofocus', 'required', 'tabindex="1"')) ?> + <?php if (! empty($members)): ?> + <div class="dropdown"> + <a href="#" class="dropdown-menu dropdown-menu-link-icon"><i class="fa fa-address-card-o"></i><i class="fa fa-caret-down"></i></a> + <ul> + <?php foreach ($members as $member): ?> + <li data-email="<?= $this->text->e($member['email']) ?>" class="js-autocomplete-email"> + <?= $this->text->e($this->user->getFullname($member)) ?> + </li> + <?php endforeach ?> + </ul> + </div> + <?php endif ?> + <?= $this->form->label(t('Subject'), 'subject') ?> <?= $this->form->text('subject', $values, $errors, array('required', 'tabindex="2"')) ?> + <?php if (! empty($project['predefined_email_subjects'])): ?> + <div class="dropdown"> + <a href="#" class="dropdown-menu dropdown-menu-link-icon"><i class="fa fa-archive"></i><i class="fa fa-caret-down"></i></a> + <ul> + <?php foreach (explode("\r\n", trim($project['predefined_email_subjects'])) as $subject): ?> + <?php $subject = trim($subject); ?> + + <?php if (! empty($subject)): ?> + <li data-subject="<?= $this->text->e($subject) ?>" class="js-autocomplete-subject"> + <?= $this->text->e($subject) ?> + </li> + <?php endif ?> + <?php endforeach ?> + </ul> + </div> + <?php endif ?> + <?= $this->modal->submitButtons(array( 'submitLabel' => t('Send by email'), 'tabindex' => 3, diff --git a/app/Template/task_mail/email.php b/app/Template/task_mail/email.php index 70db572e..ee85b1d1 100644 --- a/app/Template/task_mail/email.php +++ b/app/Template/task_mail/email.php @@ -9,7 +9,7 @@ </li> <?php if ($task['date_due']): ?> <li> - <strong><?= t('Due date:').' '.$this->dt->date($task['date_due']) ?></strong> + <strong><?= t('Due date:').' '.$this->dt->datetime($task['date_due']) ?></strong> </li> <?php endif ?> <?php if (! empty($task['creator_username'])): ?> diff --git a/app/Template/task_modification/show.php b/app/Template/task_modification/show.php index 710abedf..c7c41ddd 100644 --- a/app/Template/task_modification/show.php +++ b/app/Template/task_modification/show.php @@ -3,13 +3,12 @@ </div> <form method="post" action="<?= $this->url->href('TaskModificationController', '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="task-form-container"> <div class="task-form-main-column"> <?= $this->task->renderTitleField($values, $errors) ?> <?= $this->task->renderDescriptionField($values, $errors) ?> + <?= $this->task->renderDescriptionTemplateDropdown($project['id']) ?> <?= $this->task->renderTagField($project, $tags) ?> <?= $this->hook->render('template:task:form:first-column', array('values' => $values, 'errors' => $errors)) ?> |
