Projects management refactoring

This commit is contained in:
Frédéric Guillot 2014-08-30 14:08:46 -08:00
parent e1eba08398
commit 9194a2604d
39 changed files with 1160 additions and 822 deletions

View File

@ -17,15 +17,9 @@ class Action extends Base
*/
public function index()
{
$project_id = $this->request->getIntegerParam('project_id');
$project = $this->project->getById($project_id);
$project = $this->getProject();
if (! $project) {
$this->session->flashError(t('Project not found.'));
$this->response->redirect('?controller=project');
}
$this->response->html($this->template->layout('action_index', array(
$this->response->html($this->projectLayout('action_index', array(
'values' => array('project_id' => $project['id']),
'project' => $project,
'actions' => $this->action->getAllByProject($project['id']),
@ -49,18 +43,11 @@ class Action extends Base
*/
public function params()
{
$project_id = $this->request->getIntegerParam('project_id');
$project = $this->project->getById($project_id);
if (! $project) {
$this->session->flashError(t('Project not found.'));
$this->response->redirect('?controller=project');
}
$project = $this->getProject();
$values = $this->request->getValues();
$action = $this->action->load($values['action_name'], $values['project_id']);
$this->response->html($this->template->layout('action_params', array(
$this->response->html($this->projectLayout('action_params', array(
'values' => $values,
'action_params' => $action->getActionRequiredParameters(),
'columns_list' => $this->board->getColumnsList($project['id']),
@ -81,14 +68,7 @@ class Action extends Base
*/
public function create()
{
$project_id = $this->request->getIntegerParam('project_id');
$project = $this->project->getById($project_id);
if (! $project) {
$this->session->flashError(t('Project not found.'));
$this->response->redirect('?controller=project');
}
$project = $this->getProject();
$values = $this->request->getValues();
list($valid,) = $this->action->validateCreation($values);
@ -113,10 +93,13 @@ class Action extends Base
*/
public function confirm()
{
$this->response->html($this->template->layout('action_remove', array(
$project = $this->getProject();
$this->response->html($this->projectLayout('action_remove', array(
'action' => $this->action->getById($this->request->getIntegerParam('action_id')),
'available_events' => $this->action->getAvailableEvents(),
'available_actions' => $this->action->getAvailableActions(),
'project' => $project,
'menu' => 'projects',
'title' => t('Remove an action')
)));

View File

@ -211,6 +211,22 @@ abstract class Base
return $this->template->layout('task_layout', $params);
}
/**
* Common layout for project views
*
* @access protected
* @param string $template Template name
* @param array $params Template parameters
* @return string
*/
protected function projectLayout($template, array $params)
{
$content = $this->template->load($template, $params);
$params['project_content_for_layout'] = $content;
return $this->template->layout('project_layout', $params);
}
/**
* Common method to get a task for task views
*

View File

@ -212,12 +212,8 @@ class Board extends Base
*/
public function edit()
{
$project_id = $this->request->getIntegerParam('project_id');
$project = $this->project->getById($project_id);
if (! $project) $this->notfound();
$columns = $this->board->getColumns($project_id);
$project = $this->getProject();
$columns = $this->board->getColumns($project['id']);
$values = array();
foreach ($columns as $column) {
@ -225,9 +221,9 @@ class Board extends Base
$values['task_limit['.$column['id'].']'] = $column['task_limit'] ?: null;
}
$this->response->html($this->template->layout('board_edit', array(
$this->response->html($this->projectLayout('board_edit', array(
'errors' => array(),
'values' => $values + array('project_id' => $project_id),
'values' => $values + array('project_id' => $project['id']),
'columns' => $columns,
'project' => $project,
'menu' => 'projects',
@ -242,12 +238,8 @@ class Board extends Base
*/
public function update()
{
$project_id = $this->request->getIntegerParam('project_id');
$project = $this->project->getById($project_id);
if (! $project) $this->notfound();
$columns = $this->board->getColumns($project_id);
$project = $this->getProject();
$columns = $this->board->getColumns($project['id']);
$data = $this->request->getValues();
$values = $columns_list = array();
@ -270,9 +262,9 @@ class Board extends Base
}
}
$this->response->html($this->template->layout('board_edit', array(
$this->response->html($this->projectLayout('board_edit', array(
'errors' => $errors,
'values' => $values + array('project_id' => $project_id),
'values' => $values + array('project_id' => $project['id']),
'columns' => $columns,
'project' => $project,
'menu' => 'projects',
@ -287,11 +279,7 @@ class Board extends Base
*/
public function add()
{
$project_id = $this->request->getIntegerParam('project_id');
$project = $this->project->getById($project_id);
if (! $project) $this->notfound();
$project = $this->getProject();
$columns = $this->board->getColumnsList($project_id);
$data = $this->request->getValues();
$values = array();
@ -313,7 +301,7 @@ class Board extends Base
}
}
$this->response->html($this->template->layout('board_edit', array(
$this->response->html($this->projectLayout('board_edit', array(
'errors' => $errors,
'values' => $values + $data,
'columns' => $columns,
@ -330,8 +318,11 @@ class Board extends Base
*/
public function confirm()
{
$this->response->html($this->template->layout('board_remove', array(
$project = $this->getProject();
$this->response->html($this->projectLayout('board_remove', array(
'column' => $this->board->getColumn($this->request->getIntegerParam('column_id')),
'project' => $project,
'menu' => 'projects',
'title' => t('Remove a column from a board')
)));

View File

@ -38,7 +38,7 @@ class Category extends Base
{
$project = $this->getProject();
$this->response->html($this->template->layout('category_index', array(
$this->response->html($this->projectLayout('category_index', array(
'categories' => $this->category->getList($project['id'], false),
'values' => array('project_id' => $project['id']),
'errors' => array(),
@ -71,7 +71,7 @@ class Category extends Base
}
}
$this->response->html($this->template->layout('category_index', array(
$this->response->html($this->projectLayout('category_index', array(
'categories' => $this->category->getList($project['id'], false),
'values' => $values,
'errors' => $errors,
@ -91,7 +91,7 @@ class Category extends Base
$project = $this->getProject();
$category = $this->getCategory($project['id']);
$this->response->html($this->template->layout('category_edit', array(
$this->response->html($this->projectLayout('category_edit', array(
'values' => $category,
'errors' => array(),
'project' => $project,
@ -123,7 +123,7 @@ class Category extends Base
}
}
$this->response->html($this->template->layout('category_edit', array(
$this->response->html($this->projectLayout('category_edit', array(
'values' => $values,
'errors' => $errors,
'project' => $project,
@ -142,7 +142,7 @@ class Category extends Base
$project = $this->getProject();
$category = $this->getCategory($project['id']);
$this->response->html($this->template->layout('category_remove', array(
$this->response->html($this->projectLayout('category_remove', array(
'project' => $project,
'category' => $category,
'menu' => 'projects',

View File

@ -13,26 +13,52 @@ use Core\Translator;
*/
class Project extends Base
{
/**
* List of projects
*
* @access public
*/
public function index()
{
$projects = $this->project->getAll($this->acl->isRegularUser());
$nb_projects = count($projects);
$active_projects = array();
$inactive_projects = array();
/**
* Clone Project
*
* @author Antonio Rabelo
* @access public
*/
public function duplicate()
{
$this->checkCSRFParam();
$project_id = $this->request->getIntegerParam('project_id');
foreach ($projects as $project) {
if ($project['is_active'] == 1) {
$active_projects[] = $project;
}
else {
$inactive_projects[] = $project;
}
}
if ($project_id && $this->project->duplicate($project_id)) {
$this->session->flash(t('Project cloned successfully.'));
} else {
$this->session->flashError(t('Unable to clone this project.'));
}
$this->response->html($this->template->layout('project_index', array(
'active_projects' => $active_projects,
'inactive_projects' => $inactive_projects,
'nb_projects' => $nb_projects,
'menu' => 'projects',
'title' => t('Projects').' ('.$nb_projects.')'
)));
}
$this->response->redirect('?controller=project');
}
/**
* Show the project information page
*
* @access public
*/
public function show()
{
$project = $this->getProject();
$this->response->html($this->projectLayout('project_show', array(
'project' => $project,
'stats' => $this->project->getStats($project['id']),
'menu' => 'projects',
'title' => $project['name'],
)));
}
/**
* Task export
@ -52,7 +78,7 @@ class Project extends Base
$this->response->csv($data);
}
$this->response->html($this->template->layout('project_export', array(
$this->response->html($this->projectLayout('project_export', array(
'values' => array(
'controller' => 'project',
'action' => 'export',
@ -67,6 +93,319 @@ class Project extends Base
)));
}
/**
* Public access management
*
* @access public
*/
public function share()
{
$project = $this->getProject();
$this->response->html($this->projectLayout('project_share', array(
'project' => $project,
'menu' => 'projects',
'title' => t('Public access'),
)));
}
/**
* Enable public access for a project
*
* @access public
*/
public function enablePublic()
{
$this->checkCSRFParam();
$project_id = $this->request->getIntegerParam('project_id');
if ($project_id && $this->project->enablePublicAccess($project_id)) {
$this->session->flash(t('Project updated successfully.'));
} else {
$this->session->flashError(t('Unable to update this project.'));
}
$this->response->redirect('?controller=project&action=share&project_id='.$project_id);
}
/**
* Disable public access for a project
*
* @access public
*/
public function disablePublic()
{
$this->checkCSRFParam();
$project_id = $this->request->getIntegerParam('project_id');
if ($project_id && $this->project->disablePublicAccess($project_id)) {
$this->session->flash(t('Project updated successfully.'));
} else {
$this->session->flashError(t('Unable to update this project.'));
}
$this->response->redirect('?controller=project&action=share&project_id='.$project_id);
}
/**
* Display a form to edit a project
*
* @access public
*/
public function edit()
{
$project = $this->getProject();
$this->response->html($this->projectLayout('project_edit', array(
'errors' => array(),
'values' => $project,
'project' => $project,
'menu' => 'projects',
'title' => t('Edit project')
)));
}
/**
* Validate and update a project
*
* @access public
*/
public function update()
{
$project = $this->getProject();
$values = $this->request->getValues() + array('is_active' => 0);
list($valid, $errors) = $this->project->validateModification($values);
if ($valid) {
if ($this->project->update($values)) {
$this->session->flash(t('Project updated successfully.'));
$this->response->redirect('?controller=project&action=edit&project_id='.$project['id']);
}
else {
$this->session->flashError(t('Unable to update this project.'));
}
}
$this->response->html($this->projectLayout('project_edit', array(
'errors' => $errors,
'values' => $values,
'project' => $project,
'menu' => 'projects',
'title' => t('Edit Project')
)));
}
/**
* Users list for the selected project
*
* @access public
*/
public function users()
{
$project = $this->getProject();
$this->response->html($this->projectLayout('project_users', array(
'project' => $project,
'users' => $this->project->getAllUsers($project['id']),
'menu' => 'projects',
'title' => t('Edit project access list')
)));
}
/**
* Allow a specific user for the selected project
*
* @access public
*/
public function allow()
{
$values = $this->request->getValues();
list($valid,) = $this->project->validateUserAccess($values);
if ($valid) {
if ($this->project->allowUser($values['project_id'], $values['user_id'])) {
$this->session->flash(t('Project updated successfully.'));
}
else {
$this->session->flashError(t('Unable to update this project.'));
}
}
$this->response->redirect('?controller=project&action=users&project_id='.$values['project_id']);
}
/**
* Revoke user access
*
* @access public
*/
public function revoke()
{
$this->checkCSRFParam();
$values = array(
'project_id' => $this->request->getIntegerParam('project_id'),
'user_id' => $this->request->getIntegerParam('user_id'),
);
list($valid,) = $this->project->validateUserAccess($values);
if ($valid) {
if ($this->project->revokeUser($values['project_id'], $values['user_id'])) {
$this->session->flash(t('Project updated successfully.'));
}
else {
$this->session->flashError(t('Unable to update this project.'));
}
}
$this->response->redirect('?controller=project&action=users&project_id='.$values['project_id']);
}
/**
* Confirmation dialog before to remove a project
*
* @access public
*/
public function confirmRemove()
{
$project = $this->getProject();
$this->response->html($this->projectLayout('project_remove', array(
'project' => $project,
'menu' => 'projects',
'title' => t('Remove project')
)));
}
/**
* Remove a project
*
* @access public
*/
public function remove()
{
$this->checkCSRFParam();
$project_id = $this->request->getIntegerParam('project_id');
if ($project_id && $this->project->remove($project_id)) {
$this->session->flash(t('Project removed successfully.'));
} else {
$this->session->flashError(t('Unable to remove this project.'));
}
$this->response->redirect('?controller=project');
}
/**
* Confirmation dialog before to clone a project
*
* @access public
*/
public function confirmDuplicate()
{
$project = $this->getProject();
$this->response->html($this->projectLayout('project_duplicate', array(
'project' => $project,
'menu' => 'projects',
'title' => t('Clone this project')
)));
}
/**
* Duplicate a project
*
* @author Antonio Rabelo
* @access public
*/
public function duplicate()
{
$this->checkCSRFParam();
$project_id = $this->request->getIntegerParam('project_id');
if ($project_id && $this->project->duplicate($project_id)) {
$this->session->flash(t('Project cloned successfully.'));
} else {
$this->session->flashError(t('Unable to clone this project.'));
}
$this->response->redirect('?controller=project');
}
/**
* Confirmation dialog before to disable a project
*
* @access public
*/
public function confirmDisable()
{
$project = $this->getProject();
$this->response->html($this->projectLayout('project_disable', array(
'project' => $project,
'menu' => 'projects',
'title' => t('Project activation')
)));
}
/**
* Disable a project
*
* @access public
*/
public function disable()
{
$this->checkCSRFParam();
$project_id = $this->request->getIntegerParam('project_id');
if ($project_id && $this->project->disable($project_id)) {
$this->session->flash(t('Project disabled successfully.'));
} else {
$this->session->flashError(t('Unable to disable this project.'));
}
$this->response->redirect('?controller=project&action=show&project_id='.$project_id);
}
/**
* Confirmation dialog before to enable a project
*
* @access public
*/
public function confirmEnable()
{
$project = $this->getProject();
$this->response->html($this->projectLayout('project_enable', array(
'project' => $project,
'menu' => 'projects',
'title' => t('Project activation')
)));
}
/**
* Enable a project
*
* @access public
*/
public function enable()
{
$this->checkCSRFParam();
$project_id = $this->request->getIntegerParam('project_id');
if ($project_id && $this->project->enable($project_id)) {
$this->session->flash(t('Project activated successfully.'));
} else {
$this->session->flashError(t('Unable to activate this project.'));
}
$this->response->redirect('?controller=project&action=show&project_id='.$project_id);
}
/**
* Task search for a given project
*
@ -138,24 +477,6 @@ class Project extends Base
)));
}
/**
* List of projects
*
* @access public
*/
public function index()
{
$projects = $this->project->getAll(true, $this->acl->isRegularUser());
$nb_projects = count($projects);
$this->response->html($this->template->layout('project_index', array(
'projects' => $projects,
'nb_projects' => $nb_projects,
'menu' => 'projects',
'title' => t('Projects').' ('.$nb_projects.')'
)));
}
/**
* Display a form to create a new project
*
@ -199,192 +520,4 @@ class Project extends Base
'title' => t('New Project')
)));
}
/**
* Display a form to edit a project
*
* @access public
*/
public function edit()
{
$project = $this->getProject();
$this->response->html($this->template->layout('project_edit', array(
'errors' => array(),
'values' => $project,
'menu' => 'projects',
'title' => t('Edit project')
)));
}
/**
* Validate and update a project
*
* @access public
*/
public function update()
{
$values = $this->request->getValues() + array('is_active' => 0);
list($valid, $errors) = $this->project->validateModification($values);
if ($valid) {
if ($this->project->update($values)) {
$this->session->flash(t('Project updated successfully.'));
$this->response->redirect('?controller=project');
}
else {
$this->session->flashError(t('Unable to update this project.'));
}
}
$this->response->html($this->template->layout('project_edit', array(
'errors' => $errors,
'values' => $values,
'menu' => 'projects',
'title' => t('Edit Project')
)));
}
/**
* Confirmation dialog before to remove a project
*
* @access public
*/
public function confirm()
{
$project = $this->getProject();
$this->response->html($this->template->layout('project_remove', array(
'project' => $project,
'menu' => 'projects',
'title' => t('Remove project')
)));
}
/**
* Remove a project
*
* @access public
*/
public function remove()
{
$this->checkCSRFParam();
$project_id = $this->request->getIntegerParam('project_id');
if ($project_id && $this->project->remove($project_id)) {
$this->session->flash(t('Project removed successfully.'));
} else {
$this->session->flashError(t('Unable to remove this project.'));
}
$this->response->redirect('?controller=project');
}
/**
* Enable a project
*
* @access public
*/
public function enable()
{
$this->checkCSRFParam();
$project_id = $this->request->getIntegerParam('project_id');
if ($project_id && $this->project->enable($project_id)) {
$this->session->flash(t('Project activated successfully.'));
} else {
$this->session->flashError(t('Unable to activate this project.'));
}
$this->response->redirect('?controller=project');
}
/**
* Disable a project
*
* @access public
*/
public function disable()
{
$this->checkCSRFParam();
$project_id = $this->request->getIntegerParam('project_id');
if ($project_id && $this->project->disable($project_id)) {
$this->session->flash(t('Project disabled successfully.'));
} else {
$this->session->flashError(t('Unable to disable this project.'));
}
$this->response->redirect('?controller=project');
}
/**
* Users list for the selected project
*
* @access public
*/
public function users()
{
$project = $this->getProject();
$this->response->html($this->template->layout('project_users', array(
'project' => $project,
'users' => $this->project->getAllUsers($project['id']),
'menu' => 'projects',
'title' => t('Edit project access list')
)));
}
/**
* Allow a specific user for the selected project
*
* @access public
*/
public function allow()
{
$values = $this->request->getValues();
list($valid,) = $this->project->validateUserAccess($values);
if ($valid) {
if ($this->project->allowUser($values['project_id'], $values['user_id'])) {
$this->session->flash(t('Project updated successfully.'));
}
else {
$this->session->flashError(t('Unable to update this project.'));
}
}
$this->response->redirect('?controller=project&action=users&project_id='.$values['project_id']);
}
/**
* Revoke user access
*
* @access public
*/
public function revoke()
{
$this->checkCSRFParam();
$values = array(
'project_id' => $this->request->getIntegerParam('project_id'),
'user_id' => $this->request->getIntegerParam('user_id'),
);
list($valid,) = $this->project->validateUserAccess($values);
if ($valid) {
if ($this->project->revokeUser($values['project_id'], $values['user_id'])) {
$this->session->flash(t('Project updated successfully.'));
}
else {
$this->session->flashError(t('Unable to update this project.'));
}
}
$this->response->redirect('?controller=project&action=users&project_id='.$values['project_id']);
}
}

View File

@ -176,7 +176,7 @@ return array(
'List of projects' => 'Liste der Projekte',
'Completed tasks for "%s"' => 'Abgeschlossene Aufgaben für "%s"',
'%d closed tasks' => '%d abgeschlossene Aufgaben',
'no task for this project' => 'Keine Aufgaben in diesem Projekt',
'No task for this project' => 'Keine Aufgaben in diesem Projekt',
'Public link' => 'Öffentlicher Link',
'There is no column in your project!' => 'Es gibt keine Spalte in deinem Projekt!',
'Change assignee' => 'Zuständigkeit ändern',
@ -191,7 +191,6 @@ return array(
'Edit project access list' => 'Zugriffsberechtigungen des Projektes bearbeiten',
'Edit users access' => 'Benutzerzugriff ändern',
'Allow this user' => 'Diesen Benutzer autorisieren',
'Project access list for "%s"' => 'Zugriffsliste für Projekt "%s"',
'Only those users have access to this project:' => 'Nur diese Benutzer haben Zugang zum Projekt:',
'Don\'t forget that administrators have access to everything.' => 'Nicht vergessen: Administratoren haben überall Zugang.',
'revoke' => 'entfernen',
@ -422,4 +421,17 @@ return array(
// '[Kanboard] Notification' => '',
// 'I want to receive notifications only for those projects:' => '',
// 'view the task on Kanboard' => '',
// 'Public access' => '',
// 'Categories management' => '',
// 'Users management' => '',
// 'Active tasks' => '',
// 'Disable public access' => '',
// 'Enable public access' => '',
// 'Active projects' => '',
// 'Inactive projects' => '',
// 'Public access disabled' => '',
// 'Do you really want to disable this project: "%s"?' => '',
// 'Do you really want to duplicate this project: "%s"?' => '',
// 'Do you really want to enable this project: "%s"?' => '',
// 'Project activation' => '',
);

View File

@ -176,7 +176,7 @@ return array(
'List of projects' => 'Lista de los proyectos',
'Completed tasks for "%s"' => 'Tarea completada por « %s »',
'%d closed tasks' => '%d tareas completadas',
'no task for this project' => 'ninguna tarea para este proyecto',
'No task for this project' => 'Ninguna tarea para este proyecto',
'Public link' => 'Enlace público',
'There is no column in your project!' => '¡No hay ninguna columna para este proyecto!',
'Change assignee' => 'Cambiar la persona asignada',
@ -191,7 +191,6 @@ return array(
'Edit project access list' => 'Editar los permisos del proyecto',
'Edit users access' => 'Editar los permisos de usuario',
'Allow this user' => 'Autorizar este usuario',
'Project access list for "%s"' => 'Permisos del proyecto « %s »',
'Only those users have access to this project:' => 'Solo estos usuarios tienen acceso a este proyecto:',
'Don\'t forget that administrators have access to everything.' => 'No olvide que los administradores tienen acceso a todo.',
'revoke' => 'revocar',
@ -422,4 +421,17 @@ return array(
'[Kanboard] Notification' => '[Kanboard] Notificación',
'I want to receive notifications only for those projects:' => 'Quiero recibir notificaciones solo de estos proyectos:',
'view the task on Kanboard' => 'ver la tarea en Kanboard',
// 'Public access' => '',
// 'Categories management' => '',
// 'Users management' => '',
// 'Active tasks' => '',
// 'Disable public access' => '',
// 'Enable public access' => '',
// 'Active projects' => '',
// 'Inactive projects' => '',
// 'Public access disabled' => '',
// 'Do you really want to disable this project: "%s"?' => '',
// 'Do you really want to duplicate this project: "%s"?' => '',
// 'Do you really want to enable this project: "%s"?' => '',
// 'Project activation' => '',
);

View File

@ -176,7 +176,7 @@ return array(
'List of projects' => 'Projektit',
'Completed tasks for "%s"' => 'Suoritetut tehtävät projektille %s',
'%d closed tasks' => '%d suljettua tehtävää',
'no task for this project' => 'ei tehtävää tälle projektille',
'No task for this project' => 'Ei tehtävää tälle projektille',
'Public link' => 'Julkinen linkki',
'There is no column in your project!' => 'Projektilta puuttuu sarakkeet!',
'Change assignee' => 'Vaihda suorittajaa',
@ -191,7 +191,6 @@ return array(
'Edit project access list' => 'Muuta projektin käyttäjiä',
'Edit users access' => 'Muuta käyttäjien pääsyä',
'Allow this user' => 'Salli tämä projekti',
'Project access list for "%s"' => 'Projektin pääsylista "%s"',
'Only those users have access to this project:' => 'Vain näillä käyttäjillä on pääsy projektiin:',
'Don\'t forget that administrators have access to everything.' => 'Muista että ylläpitäjät pääsevät kaikkialle.',
'revoke' => 'poista',
@ -422,4 +421,17 @@ return array(
// '[Kanboard] Notification' => '',
// 'I want to receive notifications only for those projects:' => '',
// 'view the task on Kanboard' => '',
// 'Public access' => '',
// 'Categories management' => '',
// 'Users management' => '',
// 'Active tasks' => '',
// 'Disable public access' => '',
// 'Enable public access' => '',
// 'Active projects' => '',
// 'Inactive projects' => '',
// 'Public access disabled' => '',
// 'Do you really want to disable this project: "%s"?' => '',
// 'Do you really want to duplicate this project: "%s"?' => '',
// 'Do you really want to enable this project: "%s"?' => '',
// 'Project activation' => '',
);

View File

@ -176,8 +176,8 @@ return array(
'List of projects' => 'Liste des projets',
'Completed tasks for "%s"' => 'Tâches terminées pour « %s »',
'%d closed tasks' => '%d tâches terminées',
'no task for this project' => 'aucune tâche pour ce projet',
'Public link' => 'Accès public',
'No task for this project' => 'Aucune tâche pour ce projet',
'Public link' => 'Lien publique',
'There is no column in your project!' => 'Il n\'y a aucune colonne dans votre projet !',
'Change assignee' => 'Changer la personne assignée',
'Change assignee for the task "%s"' => 'Changer la personne assignée pour la tâche « %s »',
@ -191,7 +191,6 @@ return array(
'Edit project access list' => 'Modifier l\'accès au projet',
'Edit users access' => 'Modifier les utilisateurs autorisés',
'Allow this user' => 'Autoriser cet utilisateur',
'Project access list for "%s"' => 'Liste des accès au projet « %s »',
'Only those users have access to this project:' => 'Seulement ces utilisateurs ont accès à ce projet :',
'Don\'t forget that administrators have access to everything.' => 'N\'oubliez pas que les administrateurs ont accès à tout.',
'revoke' => 'révoquer',
@ -422,4 +421,17 @@ return array(
'[Kanboard] Notification' => '[Kanboard] Notification',
'I want to receive notifications only for those projects:' => 'Je souhaite reçevoir les notifications uniquement pour les projets sélectionnés :',
'view the task on Kanboard' => 'voir la tâche sur Kanboard',
'Public access' => 'Accès publique',
'Categories management' => 'Gestion des catégories',
'Users management' => 'Gestion des utilisateurs',
'Active tasks' => 'Tâches actives',
'Disable public access' => 'Désactiver l\'accès publique',
'Enable public access' => 'Activer l\'accès publique',
'Active projects' => 'Projets activés',
'Inactive projects' => 'Projets désactivés',
'Public access disabled' => 'Accès publique désactivé',
'Do you really want to disable this project: "%s"?' => 'Voulez-vous vraiment désactiver ce projet : « %s » ?',
'Do you really want to duplicate this project: "%s"?' => 'Voulez-vous vraiment dupliquer ce projet : « %s » ?',
'Do you really want to enable this project: "%s"?' => 'Voulez-vous vraiment activer ce projet : « %s » ?',
'Project activation' => 'Activation du projet',
);

View File

@ -176,7 +176,7 @@ return array(
'List of projects' => 'Lista di progetti',
'Completed tasks for "%s"' => 'Compiti fatti da « %s »',
'%d closed tasks' => '%d compiti chiusi',
'no task for this project' => 'nessun compito per questo progetto',
'No task for this project' => 'Nessun compito per questo progetto',
'Public link' => 'Link pubblico',
'There is no column in your project!' => 'Non c\'è nessuna colonna per questo progetto!',
'Change assignee' => 'Cambiare la persona assegnata',
@ -191,7 +191,6 @@ return array(
'Edit project access list' => 'Modificare i permessi del progetto',
'Edit users access' => 'Modificare i permessi degli utenti',
'Allow this user' => 'Permettere a questo utente',
'Project access list for "%s"' => 'Permessi del progetto « %s »',
'Only those users have access to this project:' => 'Solo questi utenti hanno accesso a questo progetto:',
'Don\'t forget that administrators have access to everything.' => 'Non dimenticare che gli amministratori hanno accesso a tutto.',
'revoke' => 'revocare',
@ -422,4 +421,17 @@ return array(
'[Kanboard] Notification' => '[Kanboard] Notification',
'I want to receive notifications only for those projects:' => 'Vorrei ricevere le notifiche solo da questi progetti:',
'view the task on Kanboard' => 'vedere il compito su Kanboard',
// 'Public access' => '',
// 'Categories management' => '',
// 'Users management' => '',
// 'Active tasks' => '',
// 'Disable public access' => '',
// 'Enable public access' => '',
// 'Active projects' => '',
// 'Inactive projects' => '',
// 'Public access disabled' => '',
// 'Do you really want to disable this project: "%s"?' => '',
// 'Do you really want to duplicate this project: "%s"?' => '',
// 'Do you really want to enable this project: "%s"?' => '',
// 'Project activation' => '',
);

View File

@ -176,7 +176,7 @@ return array(
'List of projects' => 'Lista projektów',
'Completed tasks for "%s"' => 'Zadania zakończone dla "%s"',
'%d closed tasks' => '%d zamkniętych zadań',
'no task for this project' => 'brak zadań dla tego projektu',
'No task for this project' => 'Brak zadań dla tego projektu',
'Public link' => 'Link publiczny',
'There is no column in your project!' => 'Brak kolumny w Twoim projekcie',
'Change assignee' => 'Zmień odpowiedzialną osobę',
@ -191,7 +191,6 @@ return array(
'Edit project access list' => 'Edycja list dostępu dla projektu',
'Edit users access' => 'Edytuj dostęp',
'Allow this user' => 'Dodaj użytkownika',
'Project access list for "%s"' => 'Lista uprawnionych dla projektu "%s"',
'Only those users have access to this project:' => 'Użytkownicy mający dostęp:',
'Don\'t forget that administrators have access to everything.' => 'Pamiętaj: Administratorzy mają zawsze dostęp do wszystkiego!',
'revoke' => 'odbierz dostęp',
@ -422,4 +421,17 @@ return array(
// '[Kanboard] Notification' => '',
// 'I want to receive notifications only for those projects:' => '',
// 'view the task on Kanboard' => '',
// 'Public access' => '',
// 'Categories management' => '',
// 'Users management' => '',
// 'Active tasks' => '',
// 'Disable public access' => '',
// 'Enable public access' => '',
// 'Active projects' => '',
// 'Inactive projects' => '',
// 'Public access disabled' => '',
// 'Do you really want to disable this project: "%s"?' => '',
// 'Do you really want to duplicate this project: "%s"?' => '',
// 'Do you really want to enable this project: "%s"?' => '',
// 'Project activation' => '',
);

View File

@ -176,7 +176,7 @@ return array(
'List of projects' => 'Lista de projetos',
'Completed tasks for "%s"' => 'Tarefas completadas por "%s"',
'%d closed tasks' => '%d tarefas encerradas',
'no task for this project' => 'nenhuma tarefa para este projeto',
'No task for this project' => 'Nenhuma tarefa para este projeto',
'Public link' => 'Link público',
'There is no column in your project!' => 'Não há colunas no seu projeto!',
'Change assignee' => 'Mudar a designação',
@ -191,7 +191,6 @@ return array(
'Edit project access list' => 'Editar lista de acesso ao projeto',
'Edit users access' => 'Editar acesso de usuários',
'Allow this user' => 'Permitir esse usuário',
'Project access list for "%s"' => 'Lista de acesso ao projeto para "%s"',
'Only those users have access to this project:' => 'Somente estes usuários têm acesso a este projeto:',
'Don\'t forget that administrators have access to everything.' => 'Não esqueça que administradores têm acesso a tudo.',
'revoke' => 'revogar',
@ -422,4 +421,17 @@ return array(
// '[Kanboard] Notification' => '',
// 'I want to receive notifications only for those projects:' => '',
// 'view the task on Kanboard' => '',
// 'Public access' => '',
// 'Categories management' => '',
// 'Users management' => '',
// 'Active tasks' => '',
// 'Disable public access' => '',
// 'Enable public access' => '',
// 'Active projects' => '',
// 'Inactive projects' => '',
// 'Public access disabled' => '',
// 'Do you really want to disable this project: "%s"?' => '',
// 'Do you really want to duplicate this project: "%s"?' => '',
// 'Do you really want to enable this project: "%s"?' => '',
// 'Project activation' => '',
);

View File

@ -176,7 +176,7 @@ return array(
'List of projects' => 'Lista med projekt',
'Completed tasks for "%s"' => 'Slutföra uppgifter för "%s"',
'%d closed tasks' => '%d stängda uppgifter',
'no task for this project' => 'inga uppgifter i detta projekt',
'No task for this project' => 'Inga uppgifter i detta projekt',
'Public link' => 'Publik länk',
'There is no column in your project!' => 'Det saknas kolumner i ditt projekt!',
'Change assignee' => 'Ändra uppdragsinnehavare',
@ -191,7 +191,6 @@ return array(
'Edit project access list' => 'Ändra projektåtkomst lista',
'Edit users access' => 'Användaråtkomst',
'Allow this user' => 'Tillåt användare',
'Project access list for "%s"' => 'Behörighetslista för "%s"',
'Only those users have access to this project:' => 'Bara de användarna har tillgång till detta projekt.',
'Don\'t forget that administrators have access to everything.' => 'Glöm inte att administratörerna har rätt att göra allt.',
'revoke' => 'Dra tillbaka behörighet',
@ -422,4 +421,17 @@ return array(
'[Kanboard] Notification' => '[Kanboard] Notis',
'I want to receive notifications only for those projects:' => 'Jag vill endast få notiser för dessa projekt:',
'view the task on Kanboard' => 'Visa uppgiften på Kanboard',
// 'Public access' => '',
// 'Categories management' => '',
// 'Users management' => '',
// 'Active tasks' => '',
// 'Disable public access' => '',
// 'Enable public access' => '',
// 'Active projects' => '',
// 'Inactive projects' => '',
// 'Public access disabled' => '',
// 'Do you really want to disable this project: "%s"?' => '',
// 'Do you really want to duplicate this project: "%s"?' => '',
// 'Do you really want to enable this project: "%s"?' => '',
// 'Project activation' => '',
);

View File

@ -176,7 +176,7 @@ return array(
'List of projects' => '项目列表',
'Completed tasks for "%s"' => '任务因"%s"原因完成',
'%d closed tasks' => '%d个已关闭任务',
'no task for this project' => '该项目尚无任务',
'No task for this project' => '该项目尚无任务',
'Public link' => '公开链接',
'There is no column in your project!' => '该项目尚无栏目项!',
'Change assignee' => '被指派人变更',
@ -191,7 +191,6 @@ return array(
'Edit project access list' => '编辑项目存取列表',
'Edit users access' => '编辑用户存取权限',
'Allow this user' => '允许该用户',
'Project access list for "%s"' => '"%s"的项目存取列表',
'Only those users have access to this project:' => '只有这些用户有该项目的存取权限:',
'Don\'t forget that administrators have access to everything.' => '别忘了管理员有一切的权限。',
'revoke' => '撤销',
@ -422,4 +421,17 @@ return array(
// '[Kanboard] Notification' => '',
// 'I want to receive notifications only for those projects:' => '',
// 'view the task on Kanboard' => '',
// 'Public access' => '',
// 'Categories management' => '',
// 'Users management' => '',
// 'Active tasks' => '',
// 'Disable public access' => '',
// 'Enable public access' => '',
// 'Active projects' => '',
// 'Inactive projects' => '',
// 'Public access disabled' => '',
// 'Do you really want to disable this project: "%s"?' => '',
// 'Do you really want to duplicate this project: "%s"?' => '',
// 'Do you really want to enable this project: "%s"?' => '',
// 'Project activation' => '',
);

View File

@ -31,7 +31,7 @@ class Acl extends Base
private $user_actions = array(
'app' => array('index'),
'board' => array('index', 'show', 'assign', 'assigntask', 'save', 'check'),
'project' => array('tasks', 'index', 'forbidden', 'search'),
'project' => array('tasks', 'index', 'forbidden', 'search', 'export', 'show'),
'user' => array('index', 'edit', 'update', 'forbidden', 'logout', 'index', 'unlinkgoogle', 'unlinkgithub'),
'config' => array('index', 'removeremembermetoken', 'notifications'),
'comment' => array('create', 'save', 'confirm', 'remove', 'update', 'edit', 'forbidden'),

View File

@ -227,7 +227,7 @@ class Project extends Base
*/
public function getByToken($token)
{
return $this->db->table(self::TABLE)->eq('token', $token)->findOne();
return $this->db->table(self::TABLE)->eq('token', $token)->eq('is_public', 1)->findOne();
}
/**
@ -245,46 +245,23 @@ class Project extends Base
* Get all projects, optionaly fetch stats for each project and can check users permissions
*
* @access public
* @param bool $fetch_stats If true, return metrics about each projects
* @param bool $check_permissions If true, remove projects not allowed for the current user
* @param bool $filter_permissions If true, remove projects not allowed for the current user
* @return array
*/
public function getAll($fetch_stats = false, $check_permissions = false)
public function getAll($filter_permissions = false)
{
if (! $fetch_stats) {
return $this->db->table(self::TABLE)->asc('name')->findAll();
}
$projects = $this->db->table(self::TABLE)->asc('name')->findAll();
$this->db->startTransaction();
if ($filter_permissions) {
$projects = $this->db
->table(self::TABLE)
->asc('name')
->findAll();
foreach ($projects as $key => $project) {
foreach ($projects as $pkey => &$project) {
if ($check_permissions && ! $this->isUserAllowed($project['id'], $this->acl->getUserId())) {
unset($projects[$pkey]);
}
else {
$columns = $this->board->getcolumns($project['id']);
$project['nb_active_tasks'] = 0;
foreach ($columns as &$column) {
$column['nb_active_tasks'] = $this->task->countByColumnId($project['id'], $column['id']);
$project['nb_active_tasks'] += $column['nb_active_tasks'];
if (! $this->isUserAllowed($project['id'], $this->acl->getUserId())) {
unset($projects[$key]);
}
$project['columns'] = $columns;
$project['nb_tasks'] = $this->task->countByProjectId($project['id']);
$project['nb_inactive_tasks'] = $project['nb_tasks'] - $project['nb_active_tasks'];
}
}
$this->db->closeTransaction();
return $projects;
}
@ -382,6 +359,31 @@ class Project extends Base
return $this->filterListByAccess($this->getListByStatus(self::ACTIVE), $user_id);
}
/**
* Gather some task metrics for a given project
*
* @access public
* @param integer $project_id Project id
* @return array
*/
public function getStats($project_id)
{
$stats = array();
$columns = $this->board->getcolumns($project_id);
$stats['nb_active_tasks'] = 0;
foreach ($columns as &$column) {
$column['nb_active_tasks'] = $this->task->countByColumnId($project_id, $column['id']);
$stats['nb_active_tasks'] += $column['nb_active_tasks'];
}
$stats['columns'] = $columns;
$stats['nb_tasks'] = $this->task->countByProjectId($project_id);
$stats['nb_inactive_tasks'] = $stats['nb_tasks'] - $stats['nb_active_tasks'];
return $stats;
}
/**
* Create a project from another one.
*
@ -397,7 +399,7 @@ class Project extends Base
'name' => $project_name.' ('.t('Clone').')',
'is_active' => true,
'last_modified' => 0,
'token' => Security::generateToken(),
'token' => '',
);
if (! $this->db->table(self::TABLE)->save($project)) {
@ -486,7 +488,7 @@ class Project extends Base
{
$this->db->startTransaction();
$values['token'] = Security::generateToken();
$values['token'] = '';
if (! $this->db->table(self::TABLE)->save($values)) {
$this->db->cancelTransaction();
@ -591,6 +593,36 @@ class Project extends Base
->save(array('is_active' => 0));
}
/**
* Enable public access for a project
*
* @access public
* @param integer $project_id Project id
* @return bool
*/
public function enablePublicAccess($project_id)
{
return $this->db
->table(self::TABLE)
->eq('id', $project_id)
->save(array('is_public' => 1, 'token' => Security::generateToken()));
}
/**
* Disable public access for a project
*
* @access public
* @param integer $project_id Project id
* @return bool
*/
public function disablePublicAccess($project_id)
{
return $this->db
->table(self::TABLE)
->eq('id', $project_id)
->save(array('is_public' => 0, 'token' => ''));
}
/**
* Validate project creation
*

View File

@ -4,7 +4,12 @@ namespace Schema;
use Core\Security;
const VERSION = 23;
const VERSION = 24;
function version_24($pdo)
{
$pdo->exec("ALTER TABLE projects ADD COLUMN is_public TINYINT(1) DEFAULT '0'");
}
function version_23($pdo)
{

View File

@ -4,7 +4,12 @@ namespace Schema;
use Core\Security;
const VERSION = 4;
const VERSION = 5;
function version_5($pdo)
{
$pdo->exec("ALTER TABLE projects ADD COLUMN is_public BOOLEAN DEFAULT '0'");
}
function version_4($pdo)
{

View File

@ -4,7 +4,12 @@ namespace Schema;
use Core\Security;
const VERSION = 23;
const VERSION = 24;
function version_24($pdo)
{
$pdo->exec('ALTER TABLE projects ADD COLUMN is_public INTEGER DEFAULT "0"');
}
function version_23($pdo)
{
@ -238,19 +243,6 @@ function version_4($pdo)
function version_3($pdo)
{
$pdo->exec('ALTER TABLE projects ADD COLUMN token TEXT');
// For each existing project, assign a different token
$rq = $pdo->prepare("SELECT id FROM projects WHERE token IS NULL");
$rq->execute();
$results = $rq->fetchAll(\PDO::FETCH_ASSOC);
if ($results !== false) {
foreach ($results as &$result) {
$rq = $pdo->prepare('UPDATE projects SET token=? WHERE id=?');
$rq->execute(array(Security::generateToken(), $result['id']));
}
}
}
function version_2($pdo)

View File

@ -1,77 +1,70 @@
<section id="main">
<div class="page-header">
<h2><?= t('Automatic actions for the project "%s"', $project['name']) ?></h2>
<ul>
<li><a href="?controller=project"><?= t('All projects') ?></a></li>
</ul>
<div class="page-header">
<h2><?= t('Automatic actions for the project "%s"', $project['name']) ?></h2>
</div>
<?php if (! empty($actions)): ?>
<h3><?= t('Defined actions') ?></h3>
<table>
<tr>
<th><?= t('Event name') ?></th>
<th><?= t('Action name') ?></th>
<th><?= t('Action parameters') ?></th>
<th><?= t('Action') ?></th>
</tr>
<?php foreach ($actions as $action): ?>
<tr>
<td><?= Helper\in_list($action['event_name'], $available_events) ?></td>
<td><?= Helper\in_list($action['action_name'], $available_actions) ?></td>
<td>
<ul>
<?php foreach ($action['params'] as $param): ?>
<li>
<?= Helper\in_list($param['name'], $available_params) ?> =
<strong>
<?php if (Helper\contains($param['name'], 'column_id')): ?>
<?= Helper\in_list($param['value'], $columns_list) ?>
<?php elseif (Helper\contains($param['name'], 'user_id')): ?>
<?= Helper\in_list($param['value'], $users_list) ?>
<?php elseif (Helper\contains($param['name'], 'project_id')): ?>
<?= Helper\in_list($param['value'], $projects_list) ?>
<?php elseif (Helper\contains($param['name'], 'color_id')): ?>
<?= Helper\in_list($param['value'], $colors_list) ?>
<?php elseif (Helper\contains($param['name'], 'category_id')): ?>
<?= Helper\in_list($param['value'], $categories_list) ?>
<?php endif ?>
</strong>
</li>
<?php endforeach ?>
</ul>
</td>
<td>
<a href="?controller=action&amp;action=confirm&amp;project_id=<?= $project['id'] ?>&amp;action_id=<?= $action['id'] ?>"><?= t('Remove') ?></a>
</td>
</tr>
<?php endforeach ?>
</table>
<?php endif ?>
<h3><?= t('Add an action') ?></h3>
<form method="post" action="?controller=action&amp;action=params&amp;project_id=<?= $project['id'] ?>" autocomplete="off">
<?= Helper\form_csrf() ?>
<?= Helper\form_hidden('project_id', $values) ?>
<?= Helper\form_label(t('Event'), 'event_name') ?>
<?= Helper\form_select('event_name', $available_events, $values) ?><br/>
<?= Helper\form_label(t('Action'), 'action_name') ?>
<?= Helper\form_select('action_name', $available_actions, $values) ?><br/>
<div class="form-help">
<?= t('When the selected event occurs execute the corresponding action.') ?>
</div>
<section>
<?php if (! empty($actions)): ?>
<h3><?= t('Defined actions') ?></h3>
<table>
<tr>
<th><?= t('Event name') ?></th>
<th><?= t('Action name') ?></th>
<th><?= t('Action parameters') ?></th>
<th><?= t('Action') ?></th>
</tr>
<?php foreach ($actions as $action): ?>
<tr>
<td><?= Helper\in_list($action['event_name'], $available_events) ?></td>
<td><?= Helper\in_list($action['action_name'], $available_actions) ?></td>
<td>
<ul>
<?php foreach ($action['params'] as $param): ?>
<li>
<?= Helper\in_list($param['name'], $available_params) ?> =
<strong>
<?php if (Helper\contains($param['name'], 'column_id')): ?>
<?= Helper\in_list($param['value'], $columns_list) ?>
<?php elseif (Helper\contains($param['name'], 'user_id')): ?>
<?= Helper\in_list($param['value'], $users_list) ?>
<?php elseif (Helper\contains($param['name'], 'project_id')): ?>
<?= Helper\in_list($param['value'], $projects_list) ?>
<?php elseif (Helper\contains($param['name'], 'color_id')): ?>
<?= Helper\in_list($param['value'], $colors_list) ?>
<?php elseif (Helper\contains($param['name'], 'category_id')): ?>
<?= Helper\in_list($param['value'], $categories_list) ?>
<?php endif ?>
</strong>
</li>
<?php endforeach ?>
</ul>
</td>
<td>
<a href="?controller=action&amp;action=confirm&amp;action_id=<?= $action['id'] ?>"><?= t('Remove') ?></a>
</td>
</tr>
<?php endforeach ?>
</table>
<?php endif ?>
<h3><?= t('Add an action') ?></h3>
<form method="post" action="?controller=action&amp;action=params&amp;project_id=<?= $project['id'] ?>" autocomplete="off">
<?= Helper\form_csrf() ?>
<?= Helper\form_hidden('project_id', $values) ?>
<?= Helper\form_label(t('Event'), 'event_name') ?>
<?= Helper\form_select('event_name', $available_events, $values) ?><br/>
<?= Helper\form_label(t('Action'), 'action_name') ?>
<?= Helper\form_select('action_name', $available_actions, $values) ?><br/>
<div class="form-help">
<?= t('When the selected event occurs execute the corresponding action.') ?>
</div>
<div class="form-actions">
<input type="submit" value="<?= t('Next step') ?>" class="btn btn-blue"/>
</div>
</form>
</section>
</section>
<div class="form-actions">
<input type="submit" value="<?= t('Next step') ?>" class="btn btn-blue"/>
</div>
</form>

View File

@ -1,43 +1,37 @@
<section id="main">
<div class="page-header">
<h2><?= t('Automatic actions for the project "%s"', $project['name']) ?></h2>
<ul>
<li><a href="?controller=project"><?= t('All projects') ?></a></li>
</ul>
<div class="page-header">
<h2><?= t('Automatic actions for the project "%s"', $project['name']) ?></h2>
</div>
<section>
<h3><?= t('Define action parameters') ?></h3>
<form method="post" action="?controller=action&amp;action=create&amp;project_id=<?= $project['id'] ?>" autocomplete="off">
<?= Helper\form_csrf() ?>
<?= Helper\form_hidden('project_id', $values) ?>
<?= Helper\form_hidden('event_name', $values) ?>
<?= Helper\form_hidden('action_name', $values) ?>
<?php foreach ($action_params as $param_name => $param_desc): ?>
<?php if (Helper\contains($param_name, 'column_id')): ?>
<?= Helper\form_label($param_desc, $param_name) ?>
<?= Helper\form_select('params['.$param_name.']', $columns_list, $values) ?><br/>
<?php elseif (Helper\contains($param_name, 'user_id')): ?>
<?= Helper\form_label($param_desc, $param_name) ?>
<?= Helper\form_select('params['.$param_name.']', $users_list, $values) ?><br/>
<?php elseif (Helper\contains($param_name, 'project_id')): ?>
<?= Helper\form_label($param_desc, $param_name) ?>
<?= Helper\form_select('params['.$param_name.']', $projects_list, $values) ?><br/>
<?php elseif (Helper\contains($param_name, 'color_id')): ?>
<?= Helper\form_label($param_desc, $param_name) ?>
<?= Helper\form_select('params['.$param_name.']', $colors_list, $values) ?><br/>
<?php elseif (Helper\contains($param_name, 'category_id')): ?>
<?= Helper\form_label($param_desc, $param_name) ?>
<?= Helper\form_select('params['.$param_name.']', $categories_list, $values) ?><br/>
<?php endif ?>
<?php endforeach ?>
<div class="form-actions">
<input type="submit" value="<?= t('Save this action') ?>" class="btn btn-blue"/>
<?= t('or') ?> <a href="?controller=action&amp;action=index&amp;project_id=<?= $project['id'] ?>"><?= t('cancel') ?></a>
</div>
<section>
<h3><?= t('Define action parameters') ?></h3>
<form method="post" action="?controller=action&amp;action=create&amp;project_id=<?= $project['id'] ?>" autocomplete="off">
<?= Helper\form_csrf() ?>
<?= Helper\form_hidden('project_id', $values) ?>
<?= Helper\form_hidden('event_name', $values) ?>
<?= Helper\form_hidden('action_name', $values) ?>
<?php foreach ($action_params as $param_name => $param_desc): ?>
<?php if (Helper\contains($param_name, 'column_id')): ?>
<?= Helper\form_label($param_desc, $param_name) ?>
<?= Helper\form_select('params['.$param_name.']', $columns_list, $values) ?><br/>
<?php elseif (Helper\contains($param_name, 'user_id')): ?>
<?= Helper\form_label($param_desc, $param_name) ?>
<?= Helper\form_select('params['.$param_name.']', $users_list, $values) ?><br/>
<?php elseif (Helper\contains($param_name, 'project_id')): ?>
<?= Helper\form_label($param_desc, $param_name) ?>
<?= Helper\form_select('params['.$param_name.']', $projects_list, $values) ?><br/>
<?php elseif (Helper\contains($param_name, 'color_id')): ?>
<?= Helper\form_label($param_desc, $param_name) ?>
<?= Helper\form_select('params['.$param_name.']', $colors_list, $values) ?><br/>
<?php elseif (Helper\contains($param_name, 'category_id')): ?>
<?= Helper\form_label($param_desc, $param_name) ?>
<?= Helper\form_select('params['.$param_name.']', $categories_list, $values) ?><br/>
<?php endif ?>
<?php endforeach ?>
<div class="form-actions">
<input type="submit" value="<?= t('Save this action') ?>" class="btn btn-blue"/>
<?= t('or') ?> <a href="?controller=action&amp;action=index&amp;project_id=<?= $project['id'] ?>"><?= t('cancel') ?></a>
</div>
</form>
</section>
</section>
</form>

View File

@ -1,16 +1,14 @@
<section id="main">
<div class="page-header">
<h2><?= t('Remove an automatic action') ?></h2>
</div>
<div class="page-header">
<h2><?= t('Remove an automatic action') ?></h2>
</div>
<div class="confirm">
<p class="alert alert-info">
<?= t('Do you really want to remove this action: "%s"?', Helper\in_list($action['event_name'], $available_events).'/'.Helper\in_list($action['action_name'], $available_actions)) ?>
</p>
<div class="confirm">
<p class="alert alert-info">
<?= t('Do you really want to remove this action: "%s"?', Helper\in_list($action['event_name'], $available_events).'/'.Helper\in_list($action['action_name'], $available_actions)) ?>
</p>
<div class="form-actions">
<a href="?controller=action&amp;action=remove&amp;action_id=<?= $action['id'].Helper\param_csrf() ?>" class="btn btn-red"><?= t('Yes') ?></a>
<?= t('or') ?> <a href="?controller=action&amp;action=index&amp;project_id=<?= $action['project_id'] ?>"><?= t('cancel') ?></a>
</div>
<div class="form-actions">
<a href="?controller=action&amp;action=remove&amp;action_id=<?= $action['id'].Helper\param_csrf() ?>" class="btn btn-red"><?= t('Yes') ?></a>
<?= t('or') ?> <a href="?controller=action&amp;action=index&amp;project_id=<?= $action['project_id'] ?>"><?= t('cancel') ?></a>
</div>
</section>
</div>

View File

@ -1,66 +1,58 @@
<section id="main">
<div class="page-header">
<h2><?= t('Edit the board for "%s"', $project['name']) ?></h2>
<ul>
<li><a href="?controller=project"><?= t('All projects') ?></a></li>
</ul>
<div class="page-header">
<h2><?= t('Edit the board for "%s"', $project['name']) ?></h2>
</div>
<section>
<h3><?= t('Change columns') ?></h3>
<form method="post" action="?controller=board&amp;action=update&amp;project_id=<?= $project['id'] ?>" autocomplete="off">
<?= Helper\form_csrf() ?>
<?php $i = 0; ?>
<table>
<tr>
<th><?= t('Position') ?></th>
<th><?= t('Column title') ?></th>
<th><?= t('Task limit') ?></th>
<th><?= t('Actions') ?></th>
</tr>
<?php foreach ($columns as $column): ?>
<tr>
<td><?= Helper\form_label(t('Column %d', ++$i), 'title['.$column['id'].']', array('title="column_id='.$column['id'].'"')) ?></td>
<td><?= Helper\form_text('title['.$column['id'].']', $values, $errors, array('required')) ?></td>
<td><?= Helper\form_number('task_limit['.$column['id'].']', $values, $errors, array('placeholder="'.t('limit').'"')) ?></td>
<td>
<ul>
<?php if ($column['position'] != 1): ?>
<li>
<a href="?controller=board&amp;action=moveUp&amp;project_id=<?= $project['id'] ?>&amp;column_id=<?= $column['id'].Helper\param_csrf() ?>"><?= t('Move Up') ?></a>
</li>
<?php endif ?>
<?php if ($column['position'] != count($columns)): ?>
<li>
<a href="?controller=board&amp;action=moveDown&amp;project_id=<?= $project['id'] ?>&amp;column_id=<?= $column['id'].Helper\param_csrf() ?>"><?= t('Move Down') ?></a>
</li>
<?php endif ?>
<li>
<a href="?controller=board&amp;action=confirm&amp;project_id=<?= $project['id'] ?>&amp;column_id=<?= $column['id'] ?>"><?= t('Remove') ?></a>
</li>
</ul>
</td>
</tr>
<?php endforeach ?>
</table>
<div class="form-actions">
<input type="submit" value="<?= t('Update') ?>" class="btn btn-blue"/>
</div>
<section>
</form>
<h3><?= t('Change columns') ?></h3>
<form method="post" action="?controller=board&amp;action=update&amp;project_id=<?= $project['id'] ?>" autocomplete="off">
<?= Helper\form_csrf() ?>
<?php $i = 0; ?>
<table>
<tr>
<th><?= t('Position') ?></th>
<th><?= t('Column title') ?></th>
<th><?= t('Task limit') ?></th>
<th><?= t('Actions') ?></th>
</tr>
<?php foreach ($columns as $column): ?>
<tr>
<td><?= Helper\form_label(t('Column %d', ++$i), 'title['.$column['id'].']', array('title="column_id='.$column['id'].'"')) ?></td>
<td><?= Helper\form_text('title['.$column['id'].']', $values, $errors, array('required')) ?></td>
<td><?= Helper\form_number('task_limit['.$column['id'].']', $values, $errors, array('placeholder="'.t('limit').'"')) ?></td>
<td>
<ul>
<?php if ($column['position'] != 1): ?>
<li>
<a href="?controller=board&amp;action=moveUp&amp;project_id=<?= $project['id'] ?>&amp;column_id=<?= $column['id'].Helper\param_csrf() ?>"><?= t('Move Up') ?></a>
</li>
<?php endif ?>
<?php if ($column['position'] != count($columns)): ?>
<li>
<a href="?controller=board&amp;action=moveDown&amp;project_id=<?= $project['id'] ?>&amp;column_id=<?= $column['id'].Helper\param_csrf() ?>"><?= t('Move Down') ?></a>
</li>
<?php endif ?>
<li>
<a href="?controller=board&amp;action=confirm&amp;project_id=<?= $project['id'] ?>&amp;column_id=<?= $column['id'] ?>"><?= t('Remove') ?></a>
</li>
</ul>
</td>
</tr>
<?php endforeach ?>
</table>
<h3><?= t('Add a new column') ?></h3>
<form method="post" action="?controller=board&amp;action=add&amp;project_id=<?= $project['id'] ?>" autocomplete="off">
<?= Helper\form_csrf() ?>
<?= Helper\form_hidden('project_id', $values) ?>
<?= Helper\form_label(t('Title'), 'title') ?>
<?= Helper\form_text('title', $values, $errors, array('required')) ?>
<div class="form-actions">
<input type="submit" value="<?= t('Update') ?>" class="btn btn-blue"/>
<?= t('or') ?> <a href="?controller=project"><?= t('cancel') ?></a>
</div>
</form>
<h3><?= t('Add a new column') ?></h3>
<form method="post" action="?controller=board&amp;action=add&amp;project_id=<?= $project['id'] ?>" autocomplete="off">
<?= Helper\form_csrf() ?>
<?= Helper\form_hidden('project_id', $values) ?>
<?= Helper\form_label(t('Title'), 'title') ?>
<?= Helper\form_text('title', $values, $errors, array('required')) ?>
<div class="form-actions">
<input type="submit" value="<?= t('Add this column') ?>" class="btn btn-blue"/>
<?= t('or') ?> <a href="?controller=project"><?= t('cancel') ?></a>
</div>
</form>
</section>
</section>
<div class="form-actions">
<input type="submit" value="<?= t('Add this column') ?>" class="btn btn-blue"/>
</div>
</form>

View File

@ -1,17 +1,15 @@
<section id="main">
<div class="page-header">
<h2><?= t('Remove a column') ?></h2>
</div>
<div class="page-header">
<h2><?= t('Remove a column') ?></h2>
</div>
<div class="confirm">
<p class="alert alert-info">
<?= t('Do you really want to remove this column: "%s"?', $column['title']) ?>
<?= t('This action will REMOVE ALL TASKS associated to this column!') ?>
</p>
<div class="confirm">
<p class="alert alert-info">
<?= t('Do you really want to remove this column: "%s"?', $column['title']) ?>
<?= t('This action will REMOVE ALL TASKS associated to this column!') ?>
</p>
<div class="form-actions">
<a href="?controller=board&amp;action=remove&amp;column_id=<?= $column['id'].Helper\param_csrf() ?>" class="btn btn-red"><?= t('Yes') ?></a>
<?= t('or') ?> <a href="?controller=board&amp;action=edit&amp;project_id=<?= $column['project_id'] ?>"><?= t('cancel') ?></a>
</div>
<div class="form-actions">
<a href="?controller=board&amp;action=remove&amp;column_id=<?= $column['id'].Helper\param_csrf() ?>" class="btn btn-red"><?= t('Yes') ?></a>
<?= t('or') ?> <a href="?controller=board&amp;action=edit&amp;project_id=<?= $column['project_id'] ?>"><?= t('cancel') ?></a>
</div>
</section>
</div>

View File

@ -1,24 +1,16 @@
<section id="main">
<div class="page-header">
<h2><?= t('Category modification for the project "%s"', $project['name']) ?></h2>
<ul>
<li><a href="?controller=project"><?= t('All projects') ?></a></li>
</ul>
<div class="page-header">
<h2><?= t('Category modification for the project "%s"', $project['name']) ?></h2>
</div>
<form method="post" action="?controller=category&amp;action=update&amp;project_id=<?= $project['id'] ?>" autocomplete="off">
<?= Helper\form_csrf() ?>
<?= Helper\form_hidden('id', $values) ?>
<?= Helper\form_hidden('project_id', $values) ?>
<?= Helper\form_label(t('Category Name'), 'name') ?>
<?= Helper\form_text('name', $values, $errors, array('autofocus required')) ?>
<div class="form-actions">
<input type="submit" value="<?= t('Save') ?>" class="btn btn-blue"/>
</div>
<section>
<form method="post" action="?controller=category&amp;action=update&amp;project_id=<?= $project['id'] ?>" autocomplete="off">
<?= Helper\form_csrf() ?>
<?= Helper\form_hidden('id', $values) ?>
<?= Helper\form_hidden('project_id', $values) ?>
<?= Helper\form_label(t('Category Name'), 'name') ?>
<?= Helper\form_text('name', $values, $errors, array('autofocus required')) ?>
<div class="form-actions">
<input type="submit" value="<?= t('Save') ?>" class="btn btn-blue"/>
</div>
</form>
</section>
</section>
</form>

View File

@ -1,49 +1,41 @@
<section id="main">
<div class="page-header">
<h2><?= t('Categories for the project "%s"', $project['name']) ?></h2>
<ul>
<li><a href="?controller=project"><?= t('All projects') ?></a></li>
</ul>
<div class="page-header">
<h2><?= t('Categories') ?></h2>
</div>
<?php if (! empty($categories)): ?>
<table>
<tr>
<th><?= t('Category Name') ?></th>
<th><?= t('Actions') ?></th>
</tr>
<?php foreach ($categories as $category_id => $category_name): ?>
<tr>
<td><?= Helper\escape($category_name) ?></td>
<td>
<ul>
<li>
<a href="?controller=category&amp;action=edit&amp;project_id=<?= $project['id'] ?>&amp;category_id=<?= $category_id ?>"><?= t('Edit') ?></a>
</li>
<li>
<a href="?controller=category&amp;action=confirm&amp;project_id=<?= $project['id'] ?>&amp;category_id=<?= $category_id ?>"><?= t('Remove') ?></a>
</li>
</ul>
</td>
</tr>
<?php endforeach ?>
</table>
<?php endif ?>
<h3><?= t('Add a new category') ?></h3>
<form method="post" action="?controller=category&amp;action=save&amp;project_id=<?= $project['id'] ?>" autocomplete="off">
<?= Helper\form_csrf() ?>
<?= Helper\form_hidden('project_id', $values) ?>
<?= Helper\form_label(t('Category Name'), 'name') ?>
<?= Helper\form_text('name', $values, $errors, array('autofocus required')) ?>
<div class="form-actions">
<input type="submit" value="<?= t('Save') ?>" class="btn btn-blue"/>
</div>
<section>
<?php if (! empty($categories)): ?>
<table>
<tr>
<th><?= t('Category Name') ?></th>
<th><?= t('Actions') ?></th>
</tr>
<?php foreach ($categories as $category_id => $category_name): ?>
<tr>
<td><?= Helper\escape($category_name) ?></td>
<td>
<ul>
<li>
<a href="?controller=category&amp;action=edit&amp;project_id=<?= $project['id'] ?>&amp;category_id=<?= $category_id ?>"><?= t('Edit') ?></a>
</li>
<li>
<a href="?controller=category&amp;action=confirm&amp;project_id=<?= $project['id'] ?>&amp;category_id=<?= $category_id ?>"><?= t('Remove') ?></a>
</li>
</ul>
</td>
</tr>
<?php endforeach ?>
</table>
<?php endif ?>
<h3><?= t('Add a new category') ?></h3>
<form method="post" action="?controller=category&amp;action=save&amp;project_id=<?= $project['id'] ?>" autocomplete="off">
<?= Helper\form_csrf() ?>
<?= Helper\form_hidden('project_id', $values) ?>
<?= Helper\form_label(t('Category Name'), 'name') ?>
<?= Helper\form_text('name', $values, $errors, array('autofocus required')) ?>
<div class="form-actions">
<input type="submit" value="<?= t('Save') ?>" class="btn btn-blue"/>
</div>
</form>
</section>
</section>
</form>

View File

@ -0,0 +1,14 @@
<div class="page-header">
<h2><?= t('Project activation') ?></h2>
</div>
<div class="confirm">
<p class="alert alert-info">
<?= t('Do you really want to disable this project: "%s"?', $project['name']) ?>
</p>
<div class="form-actions">
<a href="?controller=project&amp;action=disable&amp;project_id=<?= $project['id'].Helper\param_csrf() ?>" class="btn btn-red"><?= t('Yes') ?></a>
<?= t('or') ?> <a href="?controller=project&amp;action=show&amp;project_id=<?= $project['id'] ?>"><?= t('cancel') ?></a>
</div>
</div>

View File

@ -0,0 +1,14 @@
<div class="page-header">
<h2><?= t('Clone this project') ?></h2>
</div>
<div class="confirm">
<p class="alert alert-info">
<?= t('Do you really want to duplicate this project: "%s"?', $project['name']) ?>
</p>
<div class="form-actions">
<a href="?controller=project&amp;action=duplicate&amp;project_id=<?= $project['id'].Helper\param_csrf() ?>" class="btn btn-red"><?= t('Yes') ?></a>
<?= t('or') ?> <a href="?controller=project&amp;action=show&amp;project_id=<?= $project['id'] ?>"><?= t('cancel') ?></a>
</div>
</div>

View File

@ -1,25 +1,17 @@
<section id="main">
<div class="page-header">
<h2><?= t('Edit project') ?></h2>
<ul>
<li><a href="?controller=project"><?= t('All projects') ?></a></li>
</ul>
<div class="page-header">
<h2><?= t('Edit project') ?></h2>
</div>
<form method="post" action="?controller=project&amp;action=update&amp;project_id=<?= $values['id'] ?>" autocomplete="off">
<?= Helper\form_csrf() ?>
<?= Helper\form_hidden('id', $values) ?>
<?= Helper\form_label(t('Name'), 'name') ?>
<?= Helper\form_text('name', $values, $errors, array('required')) ?>
<?= Helper\form_checkbox('is_active', t('Activated'), 1, isset($values['is_active']) && $values['is_active'] == 1) ?><br/>
<div class="form-actions">
<input type="submit" value="<?= t('Save') ?>" class="btn btn-blue"/>
</div>
<section>
<form method="post" action="?controller=project&amp;action=update&amp;project_id=<?= $values['id'] ?>" autocomplete="off">
<?= Helper\form_csrf() ?>
<?= Helper\form_hidden('id', $values) ?>
<?= Helper\form_label(t('Name'), 'name') ?>
<?= Helper\form_text('name', $values, $errors, array('required')) ?>
<?= Helper\form_checkbox('is_active', t('Activated'), 1, isset($values['is_active']) && $values['is_active'] == 1 ? true : false) ?><br/>
<div class="form-actions">
<input type="submit" value="<?= t('Save') ?>" class="btn btn-blue"/>
<?= t('or') ?> <a href="?controller=project"><?= t('cancel') ?></a>
</div>
</form>
</section>
</section>
</form>

View File

@ -0,0 +1,14 @@
<div class="page-header">
<h2><?= t('Project activation') ?></h2>
</div>
<div class="confirm">
<p class="alert alert-info">
<?= t('Do you really want to enable this project: "%s"?', $project['name']) ?>
</p>
<div class="form-actions">
<a href="?controller=project&amp;action=enable&amp;project_id=<?= $project['id'].Helper\param_csrf() ?>" class="btn btn-red"><?= t('Yes') ?></a>
<?= t('or') ?> <a href="?controller=project&amp;action=show&amp;project_id=<?= $project['id'] ?>"><?= t('cancel') ?></a>
</div>
</div>

View File

@ -1,33 +1,24 @@
<section id="main">
<div class="page-header">
<h2>
<?= t('Tasks exportation for "%s"', $project['name']) ?>
</h2>
<ul>
<li><a href="?controller=board&amp;action=show&amp;project_id=<?= $project['id'] ?>"><?= t('Back to the board') ?></a></li>
<li><a href="?controller=project&amp;action=index"><?= t('List of projects') ?></a></li>
</ul>
<div class="page-header">
<h2>
<?= t('Tasks exportation for "%s"', $project['name']) ?>
</h2>
</div>
<form method="get" action="?" autocomplete="off">
<?= Helper\form_hidden('controller', $values) ?>
<?= Helper\form_hidden('action', $values) ?>
<?= Helper\form_hidden('project_id', $values) ?>
<?= Helper\form_label(t('Start Date'), 'from') ?>
<?= Helper\form_text('from', $values, $errors, array('required', 'placeholder="'.t('month/day/year').'"'), 'form-date') ?><br/>
<?= Helper\form_label(t('End Date'), 'to') ?>
<?= Helper\form_text('to', $values, $errors, array('required', 'placeholder="'.t('month/day/year').'"'), 'form-date') ?>
<div class="form-help"><?= t('Others formats accepted: %s and %s', date('Y-m-d'), date('Y_m_d')) ?></div>
<div class="form-actions">
<input type="submit" value="<?= t('Execute') ?>" class="btn btn-blue"/>
</div>
<section id="project-section">
<form method="get" action="?" autocomplete="off">
<?= Helper\form_hidden('controller', $values) ?>
<?= Helper\form_hidden('action', $values) ?>
<?= Helper\form_hidden('project_id', $values) ?>
<?= Helper\form_label(t('Start Date'), 'from') ?>
<?= Helper\form_text('from', $values, $errors, array('required', 'placeholder="'.t('month/day/year').'"'), 'form-date') ?><br/>
<?= Helper\form_label(t('End Date'), 'to') ?>
<?= Helper\form_text('to', $values, $errors, array('required', 'placeholder="'.t('month/day/year').'"'), 'form-date') ?>
<div class="form-help"><?= t('Others formats accepted: %s and %s', date('Y-m-d'), date('Y_m_d')) ?></div>
<div class="form-actions">
<input type="submit" value="<?= t('Execute') ?>" class="btn btn-blue"/>
</div>
</form>
</section>
</section>
</form>

View File

@ -8,99 +8,32 @@
<?php endif ?>
</div>
<section>
<?php if (empty($projects)): ?>
<?php if (empty($active_projects) && empty($inactive_projects)): ?>
<p class="alert"><?= t('No project') ?></p>
<?php else: ?>
<table>
<tr>
<th><?= t('Project') ?></th>
<th><?= t('Status') ?></th>
<th><?= t('Tasks') ?></th>
<th><?= t('Board') ?></th>
<?php if (Helper\is_admin()): ?>
<th><?= t('Actions') ?></th>
<?php endif ?>
</tr>
<?php foreach ($projects as $project): ?>
<tr>
<td>
<a href="?controller=board&amp;action=show&amp;project_id=<?= $project['id'] ?>" title="project_id=<?= $project['id'] ?>"><?= Helper\escape($project['name']) ?></a>
</td>
<td>
<?= $project['is_active'] ? t('Active') : t('Inactive') ?>
</td>
<td>
<ul>
<?php if ($project['nb_tasks'] > 0): ?>
<?php if (! empty($active_projects)): ?>
<h3><?= t('Active projects') ?></h3>
<ul class="project-listing">
<?php foreach ($active_projects as $project): ?>
<li>
<a href="?controller=project&amp;action=show&amp;project_id=<?= $project['id'] ?>"><?= Helper\escape($project['name']) ?></a>
</li>
<?php endforeach ?>
</ul>
<?php endif ?>
<?php if ($project['nb_active_tasks'] > 0): ?>
<li><a href="?controller=board&amp;action=show&amp;project_id=<?= $project['id'] ?>"><?= t('%d tasks on the board', $project['nb_active_tasks']) ?></a></li>
<?php endif ?>
<?php if (! empty($inactive_projects)): ?>
<h3><?= t('Inactive projects') ?></h3>
<ul class="project-listing">
<?php foreach ($inactive_projects as $project): ?>
<li>
<a href="?controller=project&amp;action=show&amp;project_id=<?= $project['id'] ?>"><?= Helper\escape($project['name']) ?></a>
</li>
<?php endforeach ?>
</ul>
<?php endif ?>
<?php if ($project['nb_inactive_tasks'] > 0): ?>
<li><a href="?controller=project&amp;action=tasks&amp;project_id=<?= $project['id'] ?>"><?= t('%d closed tasks', $project['nb_inactive_tasks']) ?></a></li>
<?php endif ?>
<li><?= t('%d tasks in total', $project['nb_tasks']) ?></li>
<?php else: ?>
<li><?= t('no task for this project') ?></li>
<?php endif ?>
</ul>
</td>
<td>
<ul>
<?php foreach ($project['columns'] as $column): ?>
<li>
<span title="column_id=<?= $column['id'] ?>"><?= Helper\escape($column['title']) ?></span> (<?= $column['nb_active_tasks'] ?>)
</li>
<?php endforeach ?>
</ul>
</td>
<?php if (Helper\is_admin()): ?>
<td>
<ul>
<li>
<a href="?controller=category&amp;action=index&amp;project_id=<?= $project['id'] ?>"><?= t('Categories') ?></a>
</li>
<li>
<a href="?controller=project&amp;action=edit&amp;project_id=<?= $project['id'] ?>"><?= t('Edit project') ?></a>
</li>
<li>
<a href="?controller=project&amp;action=users&amp;project_id=<?= $project['id'] ?>"><?= t('Edit users access') ?></a>
</li>
<li>
<a href="?controller=board&amp;action=edit&amp;project_id=<?= $project['id'] ?>"><?= t('Edit board') ?></a>
</li>
<li>
<a href="?controller=action&amp;action=index&amp;project_id=<?= $project['id'] ?>"><?= t('Automatic actions') ?></a>
</li>
<li>
<?php if ($project['is_active']): ?>
<a href="?controller=project&amp;action=disable&amp;project_id=<?= $project['id'].Helper\param_csrf() ?>"><?= t('Disable') ?></a>
<?php else: ?>
<a href="?controller=project&amp;action=enable&amp;project_id=<?= $project['id'].Helper\param_csrf() ?>"><?= t('Enable') ?></a>
<?php endif ?>
</li>
<li>
<a href="?controller=project&amp;action=confirm&amp;project_id=<?= $project['id'] ?>"><?= t('Remove') ?></a>
</li>
<li>
<a href="?controller=board&amp;action=readonly&amp;token=<?= $project['token'] ?>" target="_blank"><?= t('Public link') ?></a>
</li>
<li>
<a href="?controller=project&amp;action=export&amp;project_id=<?= $project['id'] ?>"><?= t('Tasks Export') ?></a>
</li>
<li>
<a href="?controller=project&amp;action=duplicate&amp;project_id=<?= $project['id'].Helper\param_csrf() ?>"><?= t('Clone Project') ?></a>
</li>
</ul>
</td>
<?php endif ?>
</tr>
<?php endforeach ?>
</table>
<?php endif ?>
</section>
</section>

View File

@ -0,0 +1,17 @@
<section id="main">
<div class="page-header">
<h2><?= t('Project "%s"', $project['name']) ?></h2>
<ul>
<li><a href="?controller=board&amp;action=show&amp;project_id=<?= $project['id'] ?>"><?= t('Back to the board') ?></a></li>
<li><a href="?controller=project"><?= t('All projects') ?></a></li>
</ul>
</div>
<section class="project-show" id="project-section">
<?= Helper\template('project_sidebar', array('project' => $project)) ?>
<div class="project-show-main">
<?= $project_content_for_layout ?>
</div>
</section>
</section>

View File

@ -1,16 +1,14 @@
<section id="main">
<div class="page-header">
<h2><?= t('Remove project') ?></h2>
</div>
<div class="page-header">
<h2><?= t('Remove project') ?></h2>
</div>
<div class="confirm">
<p class="alert alert-info">
<?= t('Do you really want to remove this project: "%s"?', $project['name']) ?>
</p>
<div class="confirm">
<p class="alert alert-info">
<?= t('Do you really want to remove this project: "%s"?', $project['name']) ?>
</p>
<div class="form-actions">
<a href="?controller=project&amp;action=remove&amp;project_id=<?= $project['id'].Helper\param_csrf() ?>" class="btn btn-red"><?= t('Yes') ?></a>
<?= t('or') ?> <a href="?controller=project"><?= t('cancel') ?></a>
</div>
<div class="form-actions">
<a href="?controller=project&amp;action=remove&amp;project_id=<?= $project['id'].Helper\param_csrf() ?>" class="btn btn-red"><?= t('Yes') ?></a>
<?= t('or') ?> <a href="?controller=project&amp;action=show&amp;project_id=<?= $project['id'] ?>"><?= t('cancel') ?></a>
</div>
</section>
</div>

View File

@ -0,0 +1,18 @@
<div class="page-header">
<h2><?= t('Public access') ?></h2>
</div>
<?php if ($project['is_public']): ?>
<div class="settings">
<strong><a href="?controller=board&amp;action=readonly&amp;token=<?= $project['token'] ?>" target="_blank"><?= t('Public link') ?></a></strong><br/>
<input type="text" readonly="readonly" value="<?= Helper\get_current_base_url() ?>?controller=board&amp;action=readonly&amp;token=<?= $project['token'] ?>"/>
</div>
<a href="?controller=project&amp;action=disablePublic&amp;project_id=<?= $project['id'].Helper\param_csrf() ?>" class="btn btn-red"><?= t('Disable public access') ?></a>
<?php else: ?>
<a href="?controller=project&amp;action=enablePublic&amp;project_id=<?= $project['id'].Helper\param_csrf() ?>" class="btn btn-blue"><?= t('Enable public access') ?></a>
<?php endif ?>

View File

@ -0,0 +1,50 @@
<div class="page-header">
<h2><?= t('Summary') ?></h2>
</div>
<ul class="settings">
<li><strong><?= $project['is_active'] ? t('Active') : t('Inactive') ?></strong></li>
<?php if ($project['is_public']): ?>
<li><a href="?controller=board&amp;action=readonly&amp;token=<?= $project['token'] ?>" target="_blank"><?= t('Public link') ?></a></li>
<?php else: ?>
<li><?= t('Public access disabled') ?></li>
<?php endif ?>
<?php if ($project['last_modified']): ?>
<li><?= dt('Last modified on %B %e, %Y at %k:%M %p', $project['last_modified']) ?></li>
<?php endif ?>
<?php if ($stats['nb_tasks'] > 0): ?>
<?php if ($stats['nb_active_tasks'] > 0): ?>
<li><a href="?controller=board&amp;action=show&amp;project_id=<?= $project['id'] ?>"><?= t('%d tasks on the board', $stats['nb_active_tasks']) ?></a></li>
<?php endif ?>
<?php if ($stats['nb_inactive_tasks'] > 0): ?>
<li><a href="?controller=project&amp;action=tasks&amp;project_id=<?= $project['id'] ?>"><?= t('%d closed tasks', $stats['nb_inactive_tasks']) ?></a></li>
<?php endif ?>
<li><?= t('%d tasks in total', $stats['nb_tasks']) ?></li>
<?php else: ?>
<li><?= t('No task for this project') ?></li>
<?php endif ?>
</ul>
<div class="page-header">
<h2><?= t('Board') ?></h2>
</div>
<table class="table-stripped">
<tr>
<th width="50%"><?= t('Column') ?></th>
<th><?= t('Task limit') ?></th>
<th><?= t('Active tasks') ?></th>
</tr>
<?php foreach ($stats['columns'] as $column): ?>
<tr>
<td><?= Helper\escape($column['title']) ?></td>
<td><?= $column['task_limit'] ?: '∞' ?></td>
<td><?= $column['nb_active_tasks'] ?></td>
</tr>
<?php endforeach ?>
</table>

View File

@ -0,0 +1,47 @@
<div class="project-show-sidebar">
<h2><?= t('Actions') ?></h2>
<div class="project-show-actions">
<ul>
<li>
<a href="?controller=project&amp;action=show&amp;project_id=<?= $project['id'] ?>"><?= t('Summary') ?></a>
</li>
<li>
<a href="?controller=project&amp;action=export&amp;project_id=<?= $project['id'] ?>"><?= t('Tasks Export') ?></a>
</li>
<?php if (Helper\is_admin()): ?>
<li>
<a href="?controller=project&amp;action=share&amp;project_id=<?= $project['id'] ?>"><?= t('Public access') ?></a>
</li>
<li>
<a href="?controller=project&amp;action=edit&amp;project_id=<?= $project['id'] ?>"><?= t('Edit project') ?></a>
</li>
<li>
<a href="?controller=board&amp;action=edit&amp;project_id=<?= $project['id'] ?>"><?= t('Edit board') ?></a>
</li>
<li>
<a href="?controller=category&amp;action=index&amp;project_id=<?= $project['id'] ?>"><?= t('Categories management') ?></a>
</li>
<li>
<a href="?controller=project&amp;action=users&amp;project_id=<?= $project['id'] ?>"><?= t('Users management') ?></a>
</li>
<li>
<a href="?controller=action&amp;action=index&amp;project_id=<?= $project['id'] ?>"><?= t('Automatic actions') ?></a>
</li>
<li>
<a href="?controller=project&amp;action=confirmDuplicate&amp;project_id=<?= $project['id'].Helper\param_csrf() ?>"><?= t('Duplicate') ?></a>
</li>
<li>
<?php if ($project['is_active']): ?>
<a href="?controller=project&amp;action=confirmDisable&amp;project_id=<?= $project['id'].Helper\param_csrf() ?>"><?= t('Disable') ?></a>
<?php else: ?>
<a href="?controller=project&amp;action=confirmEnable&amp;project_id=<?= $project['id'].Helper\param_csrf() ?>"><?= t('Enable') ?></a>
<?php endif ?>
</li>
<li>
<a href="?controller=project&amp;action=confirmRemove&amp;project_id=<?= $project['id'] ?>"><?= t('Remove') ?></a>
</li>
<?php endif ?>
</ul>
</div>
</div>

View File

@ -1,46 +1,36 @@
<section id="main">
<div class="page-header">
<h2><?= t('Project access list for "%s"', $project['name']) ?></h2>
<ul>
<li><a href="?controller=project"><?= t('All projects') ?></a></li>
</ul>
</div>
<section>
<div class="page-header">
<h2><?= t('List of authorized users') ?></h2>
</div>
<?php if (! empty($users['not_allowed'])): ?>
<form method="post" action="?controller=project&amp;action=allow&amp;project_id=<?= $project['id'] ?>" autocomplete="off">
<?php if (empty($users['allowed'])): ?>
<div class="alert alert-info"><?= t('Everybody have access to this project.') ?></div>
<?php else: ?>
<div class="listing">
<p><?= t('Only those users have access to this project:') ?></p>
<ul>
<?php foreach ($users['allowed'] as $user_id => $username): ?>
<li>
<strong><?= Helper\escape($username) ?></strong>
(<a href="?controller=project&amp;action=revoke&amp;project_id=<?= $project['id'] ?>&amp;user_id=<?= $user_id.Helper\param_csrf() ?>"><?= t('revoke') ?></a>)
</li>
<?php endforeach ?>
</ul>
<p><?= t('Don\'t forget that administrators have access to everything.') ?></p>
</div>
<?php endif ?>
<?= Helper\form_csrf() ?>
<?php if (! empty($users['not_allowed'])): ?>
<form method="post" action="?controller=project&amp;action=allow&amp;project_id=<?= $project['id'] ?>" autocomplete="off">
<?= Helper\form_hidden('project_id', array('project_id' => $project['id'])) ?>
<?= Helper\form_csrf() ?>
<?= Helper\form_label(t('User'), 'user_id') ?>
<?= Helper\form_select('user_id', $users['not_allowed']) ?><br/>
<?= Helper\form_hidden('project_id', array('project_id' => $project['id'])) ?>
<div class="form-actions">
<input type="submit" value="<?= t('Allow this user') ?>" class="btn btn-blue"/>
<?= t('or') ?> <a href="?controller=project"><?= t('cancel') ?></a>
</div>
</form>
<?php endif ?>
<?= Helper\form_label(t('User'), 'user_id') ?>
<?= Helper\form_select('user_id', $users['not_allowed']) ?><br/>
<h3><?= t('List of authorized users') ?></h3>
<?php if (empty($users['allowed'])): ?>
<div class="alert alert-info"><?= t('Everybody have access to this project.') ?></div>
<?php else: ?>
<div class="listing">
<p><?= t('Only those users have access to this project:') ?></p>
<ul>
<?php foreach ($users['allowed'] as $user_id => $username): ?>
<li>
<strong><?= Helper\escape($username) ?></strong>
(<a href="?controller=project&amp;action=revoke&amp;project_id=<?= $project['id'] ?>&amp;user_id=<?= $user_id.Helper\param_csrf() ?>"><?= t('revoke') ?></a>)
</li>
<?php endforeach ?>
</ul>
<p><?= t('Don\'t forget that administrators have access to everything.') ?></p>
</div>
<?php endif ?>
</section>
</section>
<div class="form-actions">
<input type="submit" value="<?= t('Allow this user') ?>" class="btn btn-blue"/>
</div>
</form>
<?php endif ?>

View File

@ -420,13 +420,16 @@ a.btn-red:hover,
background: #c53727;
}
a.btn-blue,
.btn-blue {
border-color: #3079ed;
background: #4d90fe;
color: #fff;
}
a.btn-blue:hover,
.btn-blue:hover,
a.btn-blue:focus,
.btn-blue:focus {
border-color: #2f5bb7;
background: #357ae8;
@ -673,14 +676,17 @@ a.task-board-nobody {
}
/* task view */
.project-show,
.task-show {
position: relative;
}
.project-show-main,
.task-show-main {
margin-left: 330px;
}
.project-show-sidebar,
.task-show-sidebar {
position: absolute;
left: 0px;
@ -693,6 +699,7 @@ a.task-board-nobody {
border-radius: 5px;
}
.project-show-sidebar li,
.task-show-sidebar li {
list-style-type: square;
margin-left: 30px;
@ -968,6 +975,35 @@ tr td.task-orange,
margin-bottom: 15px;
}
/* project view */
.project-listing {
border-left: 3px solid #000;
margin-left: 35px;
padding-bottom: 10px;
width: 700px;
}
.project-listing li {
font-size: 1.3em;
line-height: 1.7em;
list-style-type: none;
margin-left: 20px;
border-bottom: 1px dashed #ccc;
}
.project-listing li:hover {
border-color: #333;
}
.project-listing a {
text-decoration: none;
}
.project-listing a:hover,
.project-listing a:focus {
color: #000;
}
/* confirmation box */
.confirm {
max-width: 700px;