diff options
Diffstat (limited to 'app/Template/project')
-rw-r--r-- | app/Template/project/dropdown.php | 11 | ||||
-rw-r--r-- | app/Template/project/duplicate.php | 6 | ||||
-rw-r--r-- | app/Template/project/edit.php | 50 | ||||
-rw-r--r-- | app/Template/project/filters.php | 101 | ||||
-rw-r--r-- | app/Template/project/index.php | 41 | ||||
-rw-r--r-- | app/Template/project/integrations.php | 24 | ||||
-rw-r--r-- | app/Template/project/layout.php | 2 | ||||
-rw-r--r-- | app/Template/project/new.php | 24 | ||||
-rw-r--r-- | app/Template/project/notifications.php | 2 | ||||
-rw-r--r-- | app/Template/project/show.php | 10 | ||||
-rw-r--r-- | app/Template/project/sidebar.php | 49 | ||||
-rw-r--r-- | app/Template/project/users.php | 82 |
12 files changed, 70 insertions, 332 deletions
diff --git a/app/Template/project/dropdown.php b/app/Template/project/dropdown.php index 1eb87b0e..980f9a44 100644 --- a/app/Template/project/dropdown.php +++ b/app/Template/project/dropdown.php @@ -2,10 +2,13 @@ <i class="fa fa-dashboard fa-fw"></i> <?= $this->url->link(t('Activity'), 'activity', 'project', array('project_id' => $project['id'])) ?> </li> + +<?php if ($this->user->hasProjectAccess('customfilter', 'index', $project['id'])): ?> <li> <i class="fa fa-filter fa-fw"></i> <?= $this->url->link(t('Custom filters'), 'customfilter', 'index', array('project_id' => $project['id'])) ?> </li> +<?php endif ?> <?php if ($project['is_public']): ?> <li> @@ -15,15 +18,21 @@ <?= $this->hook->render('template:project:dropdown', array('project' => $project)) ?> -<?php if ($this->user->isProjectManagementAllowed($project['id'])): ?> +<?php if ($this->user->hasProjectAccess('analytic', 'tasks', $project['id'])): ?> <li> <i class="fa fa-line-chart fa-fw"></i> <?= $this->url->link(t('Analytics'), 'analytic', 'tasks', array('project_id' => $project['id'])) ?> </li> +<?php endif ?> + +<?php if ($this->user->hasProjectAccess('export', 'tasks', $project['id'])): ?> <li> <i class="fa fa-download fa-fw"></i> <?= $this->url->link(t('Exports'), 'export', 'tasks', array('project_id' => $project['id'])) ?> </li> +<?php endif ?> + +<?php if ($this->user->hasProjectAccess('ProjectEdit', 'edit', $project['id'])): ?> <li> <i class="fa fa-cog fa-fw"></i> <?= $this->url->link(t('Settings'), 'project', 'show', array('project_id' => $project['id'])) ?> diff --git a/app/Template/project/duplicate.php b/app/Template/project/duplicate.php index 8967c306..ca7d3302 100644 --- a/app/Template/project/duplicate.php +++ b/app/Template/project/duplicate.php @@ -10,13 +10,17 @@ <?= $this->form->csrf() ?> + <?php if ($project['is_private'] == 0): ?> + <?= $this->form->checkbox('projectPermission', t('Permissions'), 1, true) ?> + <?php endif ?> + <?= $this->form->checkbox('category', t('Categories'), 1, true) ?> <?= $this->form->checkbox('action', t('Actions'), 1, true) ?> <?= $this->form->checkbox('swimlane', t('Swimlanes'), 1, false) ?> <?= $this->form->checkbox('task', t('Tasks'), 1, false) ?> <div class="form-actions"> - <input type="submit" value="<?= t('Duplicate') ?>" class="btn btn-red"/> + <input type="submit" value="<?= t('Duplicate') ?>" class="btn btn-red"> <?= t('or') ?> <?= $this->url->link(t('cancel'), 'project', 'show', array('project_id' => $project['id'])) ?> </div> </form> diff --git a/app/Template/project/edit.php b/app/Template/project/edit.php deleted file mode 100644 index 8dcbb88f..00000000 --- a/app/Template/project/edit.php +++ /dev/null @@ -1,50 +0,0 @@ -<div class="page-header"> - <h2><?= t('Edit project') ?></h2> -</div> -<form method="post" action="<?= $this->url->href('project', 'update', array('project_id' => $project['id'])) ?>" autocomplete="off"> - - <?= $this->form->csrf() ?> - <?= $this->form->hidden('id', $values) ?> - - <?= $this->form->label(t('Name'), 'name') ?> - <?= $this->form->text('name', $values, $errors, array('required', 'maxlength="50"')) ?> - - <?= $this->form->label(t('Identifier'), 'identifier') ?> - <?= $this->form->text('identifier', $values, $errors, array('maxlength="50"')) ?> - <p class="form-help"><?= t('The project identifier is an optional alphanumeric code used to identify your project.') ?></p> - - <?= $this->form->label(t('Start date'), 'start_date') ?> - <?= $this->form->text('start_date', $values, $errors, array('maxlength="10"'), 'form-date') ?> - - <?= $this->form->label(t('End date'), 'end_date') ?> - <?= $this->form->text('end_date', $values, $errors, array('maxlength="10"'), 'form-date') ?> - - <?php if ($this->user->isAdmin() || $this->user->isProjectAdministrationAllowed($project['id'])): ?> - <?= $this->form->checkbox('is_private', t('Private project'), 1, $project['is_private'] == 1) ?> - <?php endif ?> - - <?= $this->form->label(t('Description'), 'description') ?> - - <div class="form-tabs"> - - <div class="write-area"> - <?= $this->form->textarea('description', $values, $errors) ?> - </div> - <div class="preview-area"> - <div class="markdown"></div> - </div> - <ul class="form-tabs-nav"> - <li class="form-tab form-tab-selected"> - <i class="fa fa-pencil-square-o fa-fw"></i><a id="markdown-write" href="#"><?= t('Write') ?></a> - </li> - <li class="form-tab"> - <a id="markdown-preview" href="#"><i class="fa fa-eye fa-fw"></i><?= t('Preview') ?></a> - </li> - </ul> - </div> - <div class="form-help"><?= $this->url->doc(t('Write your text in Markdown'), 'syntax-guide') ?></div> - - <div class="form-actions"> - <input type="submit" value="<?= t('Save') ?>" class="btn btn-blue"/> - </div> -</form> diff --git a/app/Template/project/filters.php b/app/Template/project/filters.php deleted file mode 100644 index c17cfb3c..00000000 --- a/app/Template/project/filters.php +++ /dev/null @@ -1,101 +0,0 @@ -<div class="page-header"> - <div class="dropdown"> - <i class="fa fa-caret-down"></i> <a href="#" class="dropdown-menu"><?= t('Actions') ?></a> - <ul> - <?php if (isset($is_board)): ?> - <li> - <span class="filter-display-mode" <?= $this->board->isCollapsed($project['id']) ? '' : 'style="display: none;"' ?>> - <i class="fa fa-expand fa-fw"></i> - <?= $this->url->link(t('Expand tasks'), 'board', 'expand', array('project_id' => $project['id']), false, 'board-display-mode', t('Keyboard shortcut: "%s"', 's')) ?> - </span> - <span class="filter-display-mode" <?= $this->board->isCollapsed($project['id']) ? 'style="display: none;"' : '' ?>> - <i class="fa fa-compress fa-fw"></i> - <?= $this->url->link(t('Collapse tasks'), 'board', 'collapse', array('project_id' => $project['id']), false, 'board-display-mode', t('Keyboard shortcut: "%s"', 's')) ?> - </span> - </li> - <li> - <span class="filter-compact"> - <i class="fa fa-th fa-fw"></i> <a href="#" class="filter-toggle-scrolling" title="<?= t('Keyboard shortcut: "%s"', 'c') ?>"><?= t('Compact view') ?></a> - </span> - <span class="filter-wide" style="display: none"> - <i class="fa fa-arrows-h fa-fw"></i> <a href="#" class="filter-toggle-scrolling" title="<?= t('Keyboard shortcut: "%s"', 'c') ?>"><?= t('Horizontal scrolling') ?></a> - </span> - </li> - <li> - <span class="filter-max-height" style="display: none"> - <i class="fa fa-arrows-v fa-fw"></i> <a href="#" class="filter-toggle-height"><?= t('Set maximum column height') ?></a> - </span> - <span class="filter-min-height"> - <i class="fa fa-arrows-v fa-fw"></i> <a href="#" class="filter-toggle-height"><?= t('Remove maximum column height') ?></a> - </span> - </li> - <?php endif ?> - <?= $this->render('project/dropdown', array('project' => $project)) ?> - </ul> - </div> - <ul class="views"> - <li <?= $filters['controller'] === 'board' ? 'class="active"' : '' ?>> - <i class="fa fa-th fa-fw"></i> - <?= $this->url->link(t('Board'), 'board', 'show', array('project_id' => $project['id'], 'search' => $filters['search']), false, 'view-board', t('Keyboard shortcut: "%s"', 'v b')) ?> - </li> - <li <?= $filters['controller'] === 'calendar' ? 'class="active"' : '' ?>> - <i class="fa fa-calendar fa-fw"></i> - <?= $this->url->link(t('Calendar'), 'calendar', 'show', array('project_id' => $project['id'], 'search' => $filters['search']), false, 'view-calendar', t('Keyboard shortcut: "%s"', 'v c')) ?> - </li> - <li <?= $filters['controller'] === 'listing' ? 'class="active"' : '' ?>> - <i class="fa fa-list fa-fw"></i> - <?= $this->url->link(t('List'), 'listing', 'show', array('project_id' => $project['id'], 'search' => $filters['search']), false, 'view-listing', t('Keyboard shortcut: "%s"', 'v l')) ?> - </li> - <?php if ($this->user->isProjectManagementAllowed($project['id'])): ?> - <li <?= $filters['controller'] === 'gantt' ? 'class="active"' : '' ?>> - <i class="fa fa-sliders fa-fw"></i> - <?= $this->url->link(t('Gantt'), 'gantt', 'project', array('project_id' => $project['id'], 'search' => $filters['search']), false, 'view-gantt', t('Keyboard shortcut: "%s"', 'v g')) ?> - </li> - <?php endif ?> - </ul> - <form method="get" action="<?= $this->url->dir() ?>" class="search"> - <?= $this->form->hidden('controller', $filters) ?> - <?= $this->form->hidden('action', $filters) ?> - <?= $this->form->hidden('project_id', $filters) ?> - <?= $this->form->text('search', $filters, array(), array('placeholder="'.t('Filter').'"'), 'form-input-large') ?> - </form> - - <div class="filter-dropdowns"> - <?= $this->render('app/filters_helper', array('reset' => 'status:open')) ?> - - <?php if (isset($custom_filters_list) && ! empty($custom_filters_list)): ?> - <div class="dropdown filters"> - <i class="fa fa-caret-down"></i> <a href="#" class="dropdown-menu"><?= t('My filters') ?></a> - <ul> - <?php foreach ($custom_filters_list as $filter): ?> - <li><a href="#" class="filter-helper" data-<?php if ($filter['append']): ?><?= 'append-' ?><?php endif ?>filter='<?= $this->e($filter['filter']) ?>'><?= $this->e($filter['name']) ?></a></li> - <?php endforeach ?> - </ul> - </div> - <?php endif ?> - - <?php if (isset($users_list)): ?> - <div class="dropdown filters"> - <i class="fa fa-caret-down"></i> <a href="#" class="dropdown-menu"><?= t('Users') ?></a> - <ul> - <li><a href="#" class="filter-helper" data-append-filter="assignee:nobody"><?= t('Not assigned') ?></a></li> - <?php foreach ($users_list as $user): ?> - <li><a href="#" class="filter-helper" data-append-filter='assignee:"<?= $this->e($user) ?>"'><?= $this->e($user) ?></a></li> - <?php endforeach ?> - </ul> - </div> - <?php endif ?> - - <?php if (isset($categories_list) && ! empty($categories_list)): ?> - <div class="dropdown filters"> - <i class="fa fa-caret-down"></i> <a href="#" class="dropdown-menu"><?= t('Categories') ?></a> - <ul> - <li><a href="#" class="filter-helper" data-append-filter="category:none"><?= t('No category') ?></a></li> - <?php foreach ($categories_list as $category): ?> - <li><a href="#" class="filter-helper" data-append-filter='category:"<?= $this->e($category) ?>"'><?= $this->e($category) ?></a></li> - <?php endforeach ?> - </ul> - </div> - <?php endif ?> - </div> -</div>
\ No newline at end of file diff --git a/app/Template/project/index.php b/app/Template/project/index.php index 4b62a27f..8d384e58 100644 --- a/app/Template/project/index.php +++ b/app/Template/project/index.php @@ -1,12 +1,10 @@ <section id="main"> <div class="page-header"> <ul> - <?php if ($this->user->isProjectAdmin() || $this->user->isAdmin()): ?> - <li><i class="fa fa-plus fa-fw"></i><?= $this->url->link(t('New project'), 'project', 'create') ?></li> - <?php endif ?> - <li><i class="fa fa-lock fa-fw"></i><?= $this->url->link(t('New private project'), 'project', 'create', array('private' => 1)) ?></li> - <?php if ($this->user->isProjectAdmin() || $this->user->isAdmin()): ?> + <?php if ($this->user->hasAccess('projectuser', 'managers')): ?> <li><i class="fa fa-user fa-fw"></i><?= $this->url->link(t('Users overview'), 'projectuser', 'managers') ?></li> + <?php endif ?> + <?php if ($this->user->hasAccess('gantt', 'projects')): ?> <li><i class="fa fa-sliders fa-fw"></i><?= $this->url->link(t('Projects Gantt chart'), 'gantt', 'projects') ?></li> <?php endif ?> </ul> @@ -21,9 +19,9 @@ <th class="column-15"><?= $paginator->order(t('Project'), 'name') ?></th> <th class="column-8"><?= $paginator->order(t('Start date'), 'start_date') ?></th> <th class="column-8"><?= $paginator->order(t('End date'), 'end_date') ?></th> - <?php if ($this->user->isAdmin() || $this->user->isProjectAdmin()): ?> - <th class="column-12"><?= t('Managers') ?></th> - <th class="column-12"><?= t('Members') ?></th> + <th class="column-15"><?= $paginator->order(t('Owner'), 'owner_id') ?></th> + <?php if ($this->user->hasAccess('projectuser', 'managers')): ?> + <th class="column-10"><?= t('Users') ?></th> <?php endif ?> <th><?= t('Columns') ?></th> </tr> @@ -59,30 +57,21 @@ <?= $this->url->link($this->e($project['name']), 'project', 'show', array('project_id' => $project['id'])) ?> </td> <td> - <?= $project['start_date'] ?> - </td> - <td> - <?= $project['end_date'] ?> + <?= $this->dt->date($project['start_date']) ?> </td> - <?php if ($this->user->isAdmin() || $this->user->isProjectAdmin()): ?> <td> - <ul class="no-bullet"> - <?php foreach ($project['managers'] as $user_id => $user_name): ?> - <li><?= $this->url->link($this->e($user_name), 'projectuser', 'opens', array('user_id' => $user_id)) ?></li> - <?php endforeach ?> - </ul> + <?= $this->dt->date($project['end_date']) ?> </td> <td> - <?php if ($project['is_everybody_allowed'] == 1): ?> - <?= t('Everybody') ?> - <?php else: ?> - <ul class="no-bullet"> - <?php foreach ($project['members'] as $user_id => $user_name): ?> - <li><?= $this->url->link($this->e($user_name), 'projectuser', 'opens', array('user_id' => $user_id)) ?></li> - <?php endforeach ?> - </ul> + <?php if ($project['owner_id'] > 0): ?> + <?= $this->e($project['owner_name'] ?: $project['owner_username']) ?> <?php endif ?> </td> + <?php if ($this->user->hasAccess('projectuser', 'managers')): ?> + <td> + <i class="fa fa-users fa-fw"></i> + <a href="#" class="tooltip" title="<?= t('Members') ?>" data-href="<?= $this->url->href('Projectuser', 'users', array('project_id' => $project['id'])) ?>"><?= t('Members') ?></a> + </td> <?php endif ?> <td class="dashboard-project-stats"> <?php foreach ($project['columns'] as $column): ?> diff --git a/app/Template/project/integrations.php b/app/Template/project/integrations.php index c4d9385b..54720c69 100644 --- a/app/Template/project/integrations.php +++ b/app/Template/project/integrations.php @@ -5,23 +5,11 @@ <form method="post" action="<?= $this->url->href('project', 'integrations', array('project_id' => $project['id'])) ?>" autocomplete="off"> <?= $this->form->csrf() ?> - <?= $this->hook->render('template:project:integrations', array('values' => $values)) ?> + <?php $integrations = $this->hook->render('template:project:integrations', array('project' => $project, 'values' => $values, 'webhook_token' => $webhook_token)) ?> - <h3><i class="fa fa-github fa-fw"></i> <?= t('Github webhooks') ?></h3> - <div class="listing"> - <input type="text" class="auto-select" readonly="readonly" value="<?= $this->url->href('webhook', 'github', array('token' => $webhook_token, 'project_id' => $project['id']), false, '', true) ?>"/><br/> - <p class="form-help"><?= $this->url->doc(t('Help on Github webhooks'), 'github-webhooks') ?></p> - </div> - - <h3><img src="<?= $this->url->dir() ?>assets/img/gitlab-icon.png"/> <?= t('Gitlab webhooks') ?></h3> - <div class="listing"> - <input type="text" class="auto-select" readonly="readonly" value="<?= $this->url->href('webhook', 'gitlab', array('token' => $webhook_token, 'project_id' => $project['id']), false, '', true) ?>"/><br/> - <p class="form-help"><?= $this->url->doc(t('Help on Gitlab webhooks'), 'gitlab-webhooks') ?></p> - </div> - - <h3><i class="fa fa-bitbucket fa-fw"></i> <?= t('Bitbucket webhooks') ?></h3> - <div class="listing"> - <input type="text" class="auto-select" readonly="readonly" value="<?= $this->url->href('webhook', 'bitbucket', array('token' => $webhook_token, 'project_id' => $project['id']), false, '', true) ?>"/><br/> - <p class="form-help"><?= $this->url->doc(t('Help on Bitbucket webhooks'), 'bitbucket-webhooks') ?></p> - </div> + <?php if (empty($integrations)): ?> + <p class="alert"><?= t('There is no integration registered at the moment.') ?></p> + <?php else: ?> + <?= $integrations ?> + <?php endif ?> </form>
\ No newline at end of file diff --git a/app/Template/project/layout.php b/app/Template/project/layout.php index 8ba92ef9..eb391ae5 100644 --- a/app/Template/project/layout.php +++ b/app/Template/project/layout.php @@ -30,7 +30,7 @@ <?= $this->render($sidebar_template, array('project' => $project)) ?> <div class="sidebar-content"> - <?= $project_content_for_layout ?> + <?= $content_for_sublayout ?> </div> </section> </section>
\ No newline at end of file diff --git a/app/Template/project/new.php b/app/Template/project/new.php deleted file mode 100644 index 8e4ccfec..00000000 --- a/app/Template/project/new.php +++ /dev/null @@ -1,24 +0,0 @@ -<section id="main"> - <div class="page-header"> - <ul> - <li><i class="fa fa-folder fa-fw"></i><?= $this->url->link(t('All projects'), 'project', 'index') ?></li> - </ul> - </div> - <form method="post" action="<?= $this->url->href('project', 'save') ?>" autocomplete="off"> - - <?= $this->form->csrf() ?> - <?= $this->form->hidden('is_private', $values) ?> - <?= $this->form->label(t('Name'), 'name') ?> - <?= $this->form->text('name', $values, $errors, array('autofocus', 'required', 'maxlength="50"')) ?> - - <div class="form-actions"> - <input type="submit" value="<?= t('Save') ?>" class="btn btn-blue"/> - <?= t('or') ?> <?= $this->url->link(t('cancel'), 'project', 'index') ?> - </div> - </form> - <?php if (isset($is_private) && $is_private): ?> - <div class="alert alert-info"> - <p><?= t('There is no user management for private projects.') ?></p> - </div> - <?php endif ?> -</section>
\ No newline at end of file diff --git a/app/Template/project/notifications.php b/app/Template/project/notifications.php index ac743087..b39d6c05 100644 --- a/app/Template/project/notifications.php +++ b/app/Template/project/notifications.php @@ -2,7 +2,7 @@ <h2><?= t('Notifications') ?></h2> </div> <?php if (empty($types)): ?> - <p class="alert"><?= t('There is no notification method registered.') ?></p> + <p class="alert"><?= t('No plugin has registered a project notification method. You can still configure individual notifications in your user profile.') ?></p> <?php else: ?> <form method="post" action="<?= $this->url->href('project', 'notifications', array('project_id' => $project['id'])) ?>" autocomplete="off"> diff --git a/app/Template/project/show.php b/app/Template/project/show.php index 5a65a26e..166b8902 100644 --- a/app/Template/project/show.php +++ b/app/Template/project/show.php @@ -4,6 +4,10 @@ <ul class="listing"> <li><strong><?= $project['is_active'] ? t('Active') : t('Inactive') ?></strong></li> + <?php if ($project['owner_id'] > 0): ?> + <li><?= t('Project owner: ') ?><strong><?= $this->e($project['owner_name'] ?: $project['owner_username']) ?></strong></li> + <?php endif ?> + <?php if ($project['is_private']): ?> <li><i class="fa fa-lock"></i> <?= t('This project is private') ?></li> <?php endif ?> @@ -17,15 +21,15 @@ <?php endif ?> <?php if ($project['last_modified']): ?> - <li><?= dt('Last modified on %B %e, %Y at %k:%M %p', $project['last_modified']) ?></li> + <li><?= t('Modified:').' '.$this->dt->datetime($project['last_modified']) ?></li> <?php endif ?> <?php if ($project['start_date']): ?> - <li><?= t('Start date: %s', $project['start_date']) ?></li> + <li><?= t('Start date: ').$this->dt->date($project['start_date']) ?></li> <?php endif ?> <?php if ($project['end_date']): ?> - <li><?= t('End date: %s', $project['end_date']) ?></li> + <li><?= t('End date: ').$this->dt->date($project['end_date']) ?></li> <?php endif ?> <?php if ($stats['nb_tasks'] > 0): ?> diff --git a/app/Template/project/sidebar.php b/app/Template/project/sidebar.php index fb5dd3bd..304b4aee 100644 --- a/app/Template/project/sidebar.php +++ b/app/Template/project/sidebar.php @@ -1,65 +1,66 @@ <div class="sidebar"> <h2><?= t('Actions') ?></h2> <ul> - <li <?= $this->app->getRouterAction() === 'show' ? 'class="active"' : '' ?>> + <li <?= $this->app->checkMenuSelection('project', 'show') ?>> <?= $this->url->link(t('Summary'), 'project', 'show', array('project_id' => $project['id'])) ?> </li> - <li <?= $this->app->getRouterController() === 'customfilter' && $this->app->getRouterAction() === 'index' ? 'class="active"' : '' ?>> + <?php if ($this->user->hasProjectAccess('customfilter', 'index', $project['id'])): ?> + <li <?= $this->app->checkMenuSelection('customfilter') ?>> <?= $this->url->link(t('Custom filters'), 'customfilter', 'index', array('project_id' => $project['id'])) ?> </li> + <?php endif ?> - <?php if ($this->user->isProjectManagementAllowed($project['id'])): ?> - <li <?= $this->app->getRouterController() === 'project' && $this->app->getRouterAction() === 'share' ? 'class="active"' : '' ?>> + <?php if ($this->user->hasProjectAccess('ProjectEdit', 'edit', $project['id'])): ?> + <li <?= $this->app->checkMenuSelection('ProjectEdit', 'edit') ?>> + <?= $this->url->link(t('Edit project'), 'ProjectEdit', 'edit', array('project_id' => $project['id'])) ?> + </li> + <li <?= $this->app->checkMenuSelection('project', 'share') ?>> <?= $this->url->link(t('Public access'), 'project', 'share', array('project_id' => $project['id'])) ?> </li> - <li <?= $this->app->getRouterController() === 'project' && $this->app->getRouterAction() === 'notifications' ? 'class="active"' : '' ?>> + <li <?= $this->app->checkMenuSelection('project', 'notifications') ?>> <?= $this->url->link(t('Notifications'), 'project', 'notifications', array('project_id' => $project['id'])) ?> </li> - <li <?= $this->app->getRouterController() === 'project' && $this->app->getRouterAction() === 'integrations' ? 'class="active"' : '' ?>> + <li <?= $this->app->checkMenuSelection('project', 'integrations') ?>> <?= $this->url->link(t('Integrations'), 'project', 'integrations', array('project_id' => $project['id'])) ?> </li> - <li <?= $this->app->getRouterController() === 'project' && $this->app->getRouterAction() === 'edit' ? 'class="active"' : '' ?>> - <?= $this->url->link(t('Edit project'), 'project', 'edit', array('project_id' => $project['id'])) ?> - </li> - <li <?= $this->app->getRouterController() === 'column' ? 'class="active"' : '' ?>> + <li <?= $this->app->checkMenuSelection('column') ?>> <?= $this->url->link(t('Columns'), 'column', 'index', array('project_id' => $project['id'])) ?> </li> - <li <?= $this->app->getRouterController() === 'swimlane' ? 'class="active"' : '' ?>> + <li <?= $this->app->checkMenuSelection('swimlane') ?>> <?= $this->url->link(t('Swimlanes'), 'swimlane', 'index', array('project_id' => $project['id'])) ?> </li> - <li <?= $this->app->getRouterController() === 'category' ? 'class="active"' : '' ?>> + <li <?= $this->app->checkMenuSelection('category') ?>> <?= $this->url->link(t('Categories'), 'category', 'index', array('project_id' => $project['id'])) ?> </li> - <?php if ($this->user->isAdmin() || $project['is_private'] == 0): ?> - <li <?= $this->app->getRouterController() === 'project' && $this->app->getRouterAction() === 'users' ? 'class="active"' : '' ?>> - <?= $this->url->link(t('Users'), 'project', 'users', array('project_id' => $project['id'])) ?> + <?php if ($project['is_private'] == 0): ?> + <li <?= $this->app->checkMenuSelection('ProjectPermission') ?>> + <?= $this->url->link(t('Permissions'), 'ProjectPermission', 'index', array('project_id' => $project['id'])) ?> </li> <?php endif ?> - <li <?= $this->app->getRouterController() === 'action' ? 'class="active"' : '' ?>> + <li <?= $this->app->checkMenuSelection('action') ?>> <?= $this->url->link(t('Automatic actions'), 'action', 'index', array('project_id' => $project['id'])) ?> </li> - <li <?= $this->app->getRouterController() === 'project' && $this->app->getRouterAction() === 'duplicate' ? 'class="active"' : '' ?>> + <li <?= $this->app->checkMenuSelection('project', 'duplicate') ?>> <?= $this->url->link(t('Duplicate'), 'project', 'duplicate', array('project_id' => $project['id'])) ?> </li> - <li <?= $this->app->getRouterController() === 'project' && ($this->app->getRouterAction() === 'disable' || $this->app->getRouterAction() === 'enable') ? 'class="active"' : '' ?>> <?php if ($project['is_active']): ?> + <li <?= $this->app->checkMenuSelection('project', 'disable') ?>> <?= $this->url->link(t('Disable'), 'project', 'disable', array('project_id' => $project['id']), true) ?> <?php else: ?> + <li <?= $this->app->checkMenuSelection('project', 'enable') ?>> <?= $this->url->link(t('Enable'), 'project', 'enable', array('project_id' => $project['id']), true) ?> <?php endif ?> </li> - <li <?= $this->app->getRouterController() === 'taskImport' && $this->app->getRouterAction() === 'step1' ? 'class="active"' : '' ?>> + <li <?= $this->app->checkMenuSelection('taskImport') ?>> <?= $this->url->link(t('Import'), 'taskImport', 'step1', array('project_id' => $project['id'])) ?> </li> - <?php if ($this->user->isProjectAdministrationAllowed($project['id'])): ?> - <li <?= $this->app->getRouterController() === 'project' && $this->app->getRouterAction() === 'remove' ? 'class="active"' : '' ?>> + <?php if ($this->user->hasProjectAccess('project', 'remove', $project['id'])): ?> + <li <?= $this->app->checkMenuSelection('project', 'remove') ?>> <?= $this->url->link(t('Remove'), 'project', 'remove', array('project_id' => $project['id'])) ?> </li> <?php endif ?> <?php endif ?> - <?= $this->hook->render('template:project:sidebar') ?> + <?= $this->hook->render('template:project:sidebar', array('project' => $project)) ?> </ul> - <div class="sidebar-collapse"><a href="#" title="<?= t('Hide sidebar') ?>"><i class="fa fa-chevron-left"></i></a></div> - <div class="sidebar-expand" style="display: none"><a href="#" title="<?= t('Expand sidebar') ?>"><i class="fa fa-chevron-right"></i></a></div> </div> diff --git a/app/Template/project/users.php b/app/Template/project/users.php deleted file mode 100644 index 8863a1e4..00000000 --- a/app/Template/project/users.php +++ /dev/null @@ -1,82 +0,0 @@ -<div class="page-header"> - <h2><?= t('List of authorized users') ?></h2> -</div> - -<?php if ($project['is_everybody_allowed']): ?> - <div class="alert"><?= t('Everybody have access to this project.') ?></div> -<?php else: ?> - - <?php if (empty($users['allowed'])): ?> - <div class="alert alert-error"><?= t('Nobody have access to this project.') ?></div> - <?php else: ?> - <table> - <tr> - <th><?= t('User') ?></th> - <th><?= t('Role for this project') ?></th> - <?php if ($project['is_private'] == 0): ?> - <th><?= t('Actions') ?></th> - <?php endif ?> - </tr> - <?php foreach ($users['allowed'] as $user_id => $username): ?> - <tr> - <td><?= $this->e($username) ?></td> - <td><?= isset($users['managers'][$user_id]) ? t('Project manager') : t('Project member') ?></td> - <?php if ($project['is_private'] == 0): ?> - <td> - <ul> - <li><?= $this->url->link(t('Revoke'), 'project', 'revoke', array('project_id' => $project['id'], 'user_id' => $user_id), true) ?></li> - <li> - <?php if (isset($users['managers'][$user_id])): ?> - <?= $this->url->link(t('Set project member'), 'project', 'role', array('project_id' => $project['id'], 'user_id' => $user_id, 'is_owner' => 0), true) ?> - <?php else: ?> - <?= $this->url->link(t('Set project manager'), 'project', 'role', array('project_id' => $project['id'], 'user_id' => $user_id, 'is_owner' => 1), true) ?> - <?php endif ?> - </li> - </ul> - </td> - <?php endif ?> - </tr> - <?php endforeach ?> - </table> - <?php endif ?> - - <?php if ($project['is_private'] == 0 && ! empty($users['not_allowed'])): ?> - <hr/> - <form method="post" action="<?= $this->url->href('project', 'allow', array('project_id' => $project['id'])) ?>" autocomplete="off"> - - <?= $this->form->csrf() ?> - - <?= $this->form->hidden('project_id', array('project_id' => $project['id'])) ?> - - <?= $this->form->label(t('User'), 'user_id') ?> - <?= $this->form->select('user_id', $users['not_allowed'], array(), array(), array('data-notfound="'.t('No results match:').'"'), 'chosen-select') ?><br/> - - <div class="form-actions"> - <input type="submit" value="<?= t('Allow this user') ?>" class="btn btn-blue"/> - </div> - </form> - <?php endif ?> - -<?php endif ?> - -<?php if ($project['is_private'] == 0): ?> -<hr/> -<form method="post" action="<?= $this->url->href('project', 'allowEverybody', array('project_id' => $project['id'])) ?>"> - <?= $this->form->csrf() ?> - - <?= $this->form->hidden('id', array('id' => $project['id'])) ?> - <?= $this->form->checkbox('is_everybody_allowed', t('Allow everybody to access to this project'), 1, $project['is_everybody_allowed']) ?> - - <div class="form-actions"> - <input type="submit" value="<?= t('Save') ?>" class="btn btn-blue"/> - </div> -</form> -<?php endif ?> - -<div class="alert alert-info"> - <ul> - <li><?= t('A project manager can change the settings of the project and have more privileges than a standard user.') ?></li> - <li><?= t('Don\'t forget that administrators have access to everything.') ?></li> - <li><?= $this->url->doc(t('Help with project permissions'), 'project-permissions') ?></li> - </ul> -</div> |