diff options
-rw-r--r-- | app/Controller/Base.php | 2 | ||||
-rw-r--r-- | app/Controller/Project.php | 56 | ||||
-rw-r--r-- | app/Template/app/dashboard.php | 2 | ||||
-rw-r--r-- | app/Template/project/activity.php (renamed from app/Template/project_activity.php) | 2 | ||||
-rw-r--r-- | app/Template/project/disable.php (renamed from app/Template/project_disable.php) | 0 | ||||
-rw-r--r-- | app/Template/project/duplicate.php (renamed from app/Template/project_duplicate.php) | 0 | ||||
-rw-r--r-- | app/Template/project/edit.php (renamed from app/Template/project_edit.php) | 0 | ||||
-rw-r--r-- | app/Template/project/enable.php (renamed from app/Template/project_enable.php) | 0 | ||||
-rw-r--r-- | app/Template/project/events.php (renamed from app/Template/project_events.php) | 0 | ||||
-rw-r--r-- | app/Template/project/feed.php (renamed from app/Template/project_feed.php) | 0 | ||||
-rw-r--r-- | app/Template/project/index.php (renamed from app/Template/project_index.php) | 0 | ||||
-rw-r--r-- | app/Template/project/layout.php (renamed from app/Template/project_layout.php) | 2 | ||||
-rw-r--r-- | app/Template/project/new.php (renamed from app/Template/project_new.php) | 0 | ||||
-rw-r--r-- | app/Template/project/remove.php (renamed from app/Template/project_remove.php) | 0 | ||||
-rw-r--r-- | app/Template/project/search.php (renamed from app/Template/project_search.php) | 0 | ||||
-rw-r--r-- | app/Template/project/share.php (renamed from app/Template/project_share.php) | 0 | ||||
-rw-r--r-- | app/Template/project/show.php (renamed from app/Template/project_show.php) | 0 | ||||
-rw-r--r-- | app/Template/project/sidebar.php | 56 | ||||
-rw-r--r-- | app/Template/project/tasks.php (renamed from app/Template/project_tasks.php) | 0 | ||||
-rw-r--r-- | app/Template/project/users.php (renamed from app/Template/project_users.php) | 2 | ||||
-rw-r--r-- | app/Template/project_sidebar.php | 56 | ||||
-rw-r--r-- | app/Template/task_public.php | 2 |
22 files changed, 85 insertions, 95 deletions
diff --git a/app/Controller/Base.php b/app/Controller/Base.php index 92a3d068..9f799a8f 100644 --- a/app/Controller/Base.php +++ b/app/Controller/Base.php @@ -300,7 +300,7 @@ abstract class Base $params['title'] = $params['project']['name'] === $params['title'] ? $params['title'] : $params['project']['name'].' > '.$params['title']; $params['board_selector'] = $this->projectPermission->getAllowedProjects($this->acl->getUserId()); - return $this->template->layout('project_layout', $params); + return $this->template->layout('project/layout', $params); } /** diff --git a/app/Controller/Project.php b/app/Controller/Project.php index fc5ffea4..83c81cae 100644 --- a/app/Controller/Project.php +++ b/app/Controller/Project.php @@ -33,7 +33,7 @@ class Project extends Base } } - $this->response->html($this->template->layout('project_index', array( + $this->response->html($this->template->layout('project/index', array( 'board_selector' => $this->projectPermission->getAllowedProjects($this->acl->getUserId()), 'active_projects' => $active_projects, 'inactive_projects' => $inactive_projects, @@ -51,7 +51,7 @@ class Project extends Base { $project = $this->getProject(); - $this->response->html($this->projectLayout('project_show', array( + $this->response->html($this->projectLayout('project/show', array( 'project' => $project, 'stats' => $this->project->getStats($project['id']), 'webhook_token' => $this->config->get('webhook_token'), @@ -148,7 +148,7 @@ class Project extends Base $this->response->redirect('?controller=project&action=share&project_id='.$project['id']); } - $this->response->html($this->projectLayout('project_share', array( + $this->response->html($this->projectLayout('project/share', array( 'project' => $project, 'title' => t('Public access'), ))); @@ -159,13 +159,13 @@ class Project extends Base * * @access public */ - public function edit() + public function edit(array $values = array(), array $errors = array()) { $project = $this->getProjectManagement(); - $this->response->html($this->projectLayout('project_edit', array( - 'errors' => array(), - 'values' => $project, + $this->response->html($this->projectLayout('project/edit', array( + 'values' => empty($values) ? $project : $values, + 'errors' => $errors, 'project' => $project, 'title' => t('Edit project') ))); @@ -193,12 +193,7 @@ class Project extends Base } } - $this->response->html($this->projectLayout('project_edit', array( - 'errors' => $errors, - 'values' => $values, - 'project' => $project, - 'title' => t('Edit Project') - ))); + $this->edit($values, $errors); } /** @@ -210,7 +205,7 @@ class Project extends Base { $project = $this->getProjectManagement(); - $this->response->html($this->projectLayout('project_users', array( + $this->response->html($this->projectLayout('project/users', array( 'project' => $project, 'users' => $this->projectPermission->getAllUsers($project['id']), 'title' => t('Edit project access list') @@ -315,7 +310,7 @@ class Project extends Base $this->response->redirect('?controller=project'); } - $this->response->html($this->projectLayout('project_remove', array( + $this->response->html($this->projectLayout('project/remove', array( 'project' => $project, 'title' => t('Remove project') ))); @@ -344,7 +339,7 @@ class Project extends Base $this->response->redirect('?controller=project'); } - $this->response->html($this->projectLayout('project_duplicate', array( + $this->response->html($this->projectLayout('project/duplicate', array( 'project' => $project, 'title' => t('Clone this project') ))); @@ -372,7 +367,7 @@ class Project extends Base $this->response->redirect('?controller=project&action=show&project_id='.$project['id']); } - $this->response->html($this->projectLayout('project_disable', array( + $this->response->html($this->projectLayout('project/disable', array( 'project' => $project, 'title' => t('Project activation') ))); @@ -400,7 +395,7 @@ class Project extends Base $this->response->redirect('?controller=project&action=show&project_id='.$project['id']); } - $this->response->html($this->projectLayout('project_enable', array( + $this->response->html($this->projectLayout('project/enable', array( 'project' => $project, 'title' => t('Project activation') ))); @@ -421,7 +416,7 @@ class Project extends Base $this->forbidden(true); } - $this->response->xml($this->template->load('project_feed', array( + $this->response->xml($this->template->load('project/feed', array( 'events' => $this->projectActivity->getProject($project['id']), 'project' => $project, ))); @@ -436,7 +431,7 @@ class Project extends Base { $project = $this->getProject(); - $this->response->html($this->template->layout('project_activity', array( + $this->response->html($this->template->layout('project/activity', array( 'board_selector' => $this->projectPermission->getAllowedProjects($this->acl->getUserId()), 'events' => $this->projectActivity->getProject($project['id']), 'project' => $project, @@ -465,7 +460,7 @@ class Project extends Base $nb_tasks = $this->taskPaginator->countSearchTasks($project['id'], $search); } - $this->response->html($this->template->layout('project_search', array( + $this->response->html($this->template->layout('project/search', array( 'board_selector' => $this->projectPermission->getAllowedProjects($this->acl->getUserId()), 'tasks' => $tasks, 'nb_tasks' => $nb_tasks, @@ -508,7 +503,7 @@ class Project extends Base $tasks = $this->taskPaginator->closedTasks($project['id'], $offset, $limit, $order, $direction); $nb_tasks = $this->taskPaginator->countClosedTasks($project['id']); - $this->response->html($this->template->layout('project_tasks', array( + $this->response->html($this->template->layout('project/tasks', array( 'board_selector' => $this->projectPermission->getAllowedProjects($this->acl->getUserId()), 'pagination' => array( 'controller' => 'project', @@ -534,16 +529,14 @@ class Project extends Base * * @access public */ - public function create() + public function create(array $values = array(), array $errors = array()) { $is_private = $this->request->getIntegerParam('private', $this->acl->isRegularUser()); - $this->response->html($this->template->layout('project_new', array( + $this->response->html($this->template->layout('project/new', array( 'board_selector' => $this->projectPermission->getAllowedProjects($this->acl->getUserId()), - 'errors' => array(), - 'values' => array( - 'is_private' => $is_private, - ), + 'values' => empty($values) ? array('is_private' => $is_private) : $values, + 'errors' => $errors, 'title' => $is_private ? t('New private project') : t('New project'), ))); } @@ -571,11 +564,6 @@ class Project extends Base } } - $this->response->html($this->template->layout('project_new', array( - 'board_selector' => $this->projectPermission->getAllowedProjects($this->acl->getUserId()), - 'errors' => $errors, - 'values' => $values, - 'title' => ! empty($values['is_private']) ? t('New private project') : t('New project'), - ))); + $this->create($values, $errors); } } diff --git a/app/Template/app/dashboard.php b/app/Template/app/dashboard.php index 9bcd69f6..22b77eaa 100644 --- a/app/Template/app/dashboard.php +++ b/app/Template/app/dashboard.php @@ -20,7 +20,7 @@ </div> <div class="dashboard-right-column"> <h2><?= t('Activity stream') ?></h2> - <?= Helper\template('project_events', array('events' => $events)) ?> + <?= Helper\template('project/events', array('events' => $events)) ?> </div> </section> </section>
\ No newline at end of file diff --git a/app/Template/project_activity.php b/app/Template/project/activity.php index d60dfb8f..cdc25df8 100644 --- a/app/Template/project_activity.php +++ b/app/Template/project/activity.php @@ -11,6 +11,6 @@ <p class="pull-right"><i class="fa fa-rss-square"></i> <?= Helper\a(t('RSS feed'), 'project', 'feed', array('token' => $project['token'])) ?></p> <?php endif ?> - <?= Helper\template('project_events', array('events' => $events)) ?> + <?= Helper\template('project/events', array('events' => $events)) ?> </section> </section>
\ No newline at end of file diff --git a/app/Template/project_disable.php b/app/Template/project/disable.php index 7a729fa3..7a729fa3 100644 --- a/app/Template/project_disable.php +++ b/app/Template/project/disable.php diff --git a/app/Template/project_duplicate.php b/app/Template/project/duplicate.php index a926dcd1..a926dcd1 100644 --- a/app/Template/project_duplicate.php +++ b/app/Template/project/duplicate.php diff --git a/app/Template/project_edit.php b/app/Template/project/edit.php index 8eb2110d..8eb2110d 100644 --- a/app/Template/project_edit.php +++ b/app/Template/project/edit.php diff --git a/app/Template/project_enable.php b/app/Template/project/enable.php index f2a1b0e7..f2a1b0e7 100644 --- a/app/Template/project_enable.php +++ b/app/Template/project/enable.php diff --git a/app/Template/project_events.php b/app/Template/project/events.php index 1b606414..1b606414 100644 --- a/app/Template/project_events.php +++ b/app/Template/project/events.php diff --git a/app/Template/project_feed.php b/app/Template/project/feed.php index 9d10ecb1..9d10ecb1 100644 --- a/app/Template/project_feed.php +++ b/app/Template/project/feed.php diff --git a/app/Template/project_index.php b/app/Template/project/index.php index 6c04449e..6c04449e 100644 --- a/app/Template/project_index.php +++ b/app/Template/project/index.php diff --git a/app/Template/project_layout.php b/app/Template/project/layout.php index 3608df58..27a93021 100644 --- a/app/Template/project_layout.php +++ b/app/Template/project/layout.php @@ -7,7 +7,7 @@ </div> <section class="sidebar-container" id="project-section"> - <?= Helper\template('project_sidebar', array('project' => $project)) ?> + <?= Helper\template('project/sidebar', array('project' => $project)) ?> <div class="sidebar-content"> <?= $project_content_for_layout ?> diff --git a/app/Template/project_new.php b/app/Template/project/new.php index f3926a65..f3926a65 100644 --- a/app/Template/project_new.php +++ b/app/Template/project/new.php diff --git a/app/Template/project_remove.php b/app/Template/project/remove.php index a98f94eb..a98f94eb 100644 --- a/app/Template/project_remove.php +++ b/app/Template/project/remove.php diff --git a/app/Template/project_search.php b/app/Template/project/search.php index 11e207d2..11e207d2 100644 --- a/app/Template/project_search.php +++ b/app/Template/project/search.php diff --git a/app/Template/project_share.php b/app/Template/project/share.php index 8edcbbc0..8edcbbc0 100644 --- a/app/Template/project_share.php +++ b/app/Template/project/share.php diff --git a/app/Template/project_show.php b/app/Template/project/show.php index 907d1b70..907d1b70 100644 --- a/app/Template/project_show.php +++ b/app/Template/project/show.php diff --git a/app/Template/project/sidebar.php b/app/Template/project/sidebar.php new file mode 100644 index 00000000..376a1427 --- /dev/null +++ b/app/Template/project/sidebar.php @@ -0,0 +1,56 @@ +<div class="sidebar"> + <h2><?= t('Actions') ?></h2> + <ul> + <li> + <?= Helper\a(t('Summary'), 'project', 'show', array('project_id' => $project['id'])) ?> + </li> + + <?php if (Helper\is_admin() || $project['is_private']): ?> + <li> + <?= Helper\a(t('Public access'), 'project', 'share', array('project_id' => $project['id'])) ?> + </li> + <li> + <?= Helper\a(t('Edit project'), 'project', 'edit', array('project_id' => $project['id'])) ?> + </li> + <li> + <?= Helper\a(t('Edit board'), 'board', 'edit', array('project_id' => $project['id'])) ?> + </li> + <li> + <?= Helper\a(t('Category management'), 'category', 'index', array('project_id' => $project['id'])) ?> + </li> + <?php if (Helper\is_admin()): ?> + <li> + <?= Helper\a(t('User management'), 'project', 'users', array('project_id' => $project['id'])) ?> + </li> + <?php endif ?> + <li> + <?= Helper\a(t('Automatic actions'), 'action', 'index', array('project_id' => $project['id'])) ?> + </li> + <li> + <?= Helper\a(t('Duplicate'), 'project', 'duplicate', array('project_id' => $project['id']), true) ?> + </li> + <li> + <?php if ($project['is_active']): ?> + <?= Helper\a(t('Disable'), 'project', 'disable', array('project_id' => $project['id']), true) ?> + <?php else: ?> + <?= Helper\a(t('Enable'), 'project', 'enable', array('project_id' => $project['id']), true) ?> + <?php endif ?> + </li> + <li> + <?= Helper\a(t('Remove'), 'project', 'remove', array('project_id' => $project['id'])) ?> + </li> + <?php endif ?> + </ul> + + <?php if (Helper\is_admin() || $project['is_private']): ?> + <h2><?= t('Exports') ?></h2> + <ul> + <li> + <?= Helper\a(t('Tasks'), 'project', 'exportTasks', array('project_id' => $project['id'])) ?> + </li> + <li> + <?= Helper\a(t('Daily project summary'), 'project', 'exportDailyProjectSummary', array('project_id' => $project['id'])) ?> + </li> + </li> + <?php endif ?> +</div>
\ No newline at end of file diff --git a/app/Template/project_tasks.php b/app/Template/project/tasks.php index 638e4c31..638e4c31 100644 --- a/app/Template/project_tasks.php +++ b/app/Template/project/tasks.php diff --git a/app/Template/project_users.php b/app/Template/project/users.php index 1e1f259f..0908533f 100644 --- a/app/Template/project_users.php +++ b/app/Template/project/users.php @@ -26,6 +26,7 @@ <?php endif ?> <?php if ($project['is_private'] == 0 && ! empty($users['not_allowed'])): ?> + <hr/> <form method="post" action="<?= Helper\u('project', 'allow', array('project_id' => $project['id'])) ?>" autocomplete="off"> <?= Helper\form_csrf() ?> @@ -44,6 +45,7 @@ <?php endif ?> <?php if ($project['is_private'] == 0): ?> +<hr/> <form method="post" action="<?= Helper\u('project', 'allowEverybody', array('project_id' => $project['id'])) ?>"> <?= Helper\form_csrf() ?> diff --git a/app/Template/project_sidebar.php b/app/Template/project_sidebar.php deleted file mode 100644 index bd56edaf..00000000 --- a/app/Template/project_sidebar.php +++ /dev/null @@ -1,56 +0,0 @@ -<div class="sidebar"> - <h2><?= t('Actions') ?></h2> - <ul> - <li> - <a href="?controller=project&action=show&project_id=<?= $project['id'] ?>"><?= t('Summary') ?></a> - </li> - - <?php if (Helper\is_admin() || $project['is_private']): ?> - <li> - <a href="?controller=project&action=share&project_id=<?= $project['id'] ?>"><?= t('Public access') ?></a> - </li> - <li> - <a href="?controller=project&action=edit&project_id=<?= $project['id'] ?>"><?= t('Edit project') ?></a> - </li> - <li> - <a href="?controller=board&action=edit&project_id=<?= $project['id'] ?>"><?= t('Edit board') ?></a> - </li> - <li> - <a href="?controller=category&action=index&project_id=<?= $project['id'] ?>"><?= t('Category management') ?></a> - </li> - <?php if (Helper\is_admin()): ?> - <li> - <a href="?controller=project&action=users&project_id=<?= $project['id'] ?>"><?= t('User management') ?></a> - </li> - <?php endif ?> - <li> - <a href="?controller=action&action=index&project_id=<?= $project['id'] ?>"><?= t('Automatic actions') ?></a> - </li> - <li> - <a href="?controller=project&action=duplicate&project_id=<?= $project['id'].Helper\param_csrf() ?>"><?= t('Duplicate') ?></a> - </li> - <li> - <?php if ($project['is_active']): ?> - <a href="?controller=project&action=disable&project_id=<?= $project['id'].Helper\param_csrf() ?>"><?= t('Disable') ?></a> - <?php else: ?> - <a href="?controller=project&action=enable&project_id=<?= $project['id'].Helper\param_csrf() ?>"><?= t('Enable') ?></a> - <?php endif ?> - </li> - <li> - <a href="?controller=project&action=remove&project_id=<?= $project['id'] ?>"><?= t('Remove') ?></a> - </li> - <?php endif ?> - </ul> - - <?php if (Helper\is_admin() || $project['is_private']): ?> - <h2><?= t('Exports') ?></h2> - <ul> - <li> - <?= Helper\a(t('Tasks'), 'project', 'exportTasks', array('project_id' => $project['id'])) ?> - </li> - <li> - <?= Helper\a(t('Daily project summary'), 'project', 'exportDailyProjectSummary', array('project_id' => $project['id'])) ?> - </li> - </li> - <?php endif ?> -</div>
\ No newline at end of file diff --git a/app/Template/task_public.php b/app/Template/task_public.php index 13fef1ed..370204ce 100644 --- a/app/Template/task_public.php +++ b/app/Template/task_public.php @@ -10,7 +10,7 @@ 'is_public' => true )) ?> - <?= Helper\template('subtask_show', array( + <?= Helper\template('subtask/show', array( 'task' => $task, 'subtasks' => $subtasks, 'not_editable' => true |