diff options
author | Frederic Guillot <fred@kanboard.net> | 2016-01-31 17:46:19 -0500 |
---|---|---|
committer | Frederic Guillot <fred@kanboard.net> | 2016-01-31 17:46:19 -0500 |
commit | fc21d3873e3ac63222ad4065a593c715bef4c251 (patch) | |
tree | b1795031eda0774aeb1af9fb20606fe38611e0eb /app/Template | |
parent | 1500ff92b2dc3d3932c8e06755bec23f9017e8a4 (diff) |
When creating a new project, have the possibility to select another project to duplicate
Diffstat (limited to 'app/Template')
-rw-r--r-- | app/Template/app/layout.php | 6 | ||||
-rw-r--r-- | app/Template/gantt/projects.php | 6 | ||||
-rw-r--r-- | app/Template/header.php | 18 | ||||
-rw-r--r-- | app/Template/project/duplicate.php | 6 | ||||
-rw-r--r-- | app/Template/project/index.php | 4 | ||||
-rw-r--r-- | app/Template/project/new.php | 24 | ||||
-rw-r--r-- | app/Template/project_creation/create.php | 42 | ||||
-rw-r--r-- | app/Template/project_edit/general.php | 2 | ||||
-rw-r--r-- | app/Template/project_user/layout.php | 7 |
9 files changed, 66 insertions, 49 deletions
diff --git a/app/Template/app/layout.php b/app/Template/app/layout.php index ad1d5a9e..d5bb1d8e 100644 --- a/app/Template/app/layout.php +++ b/app/Template/app/layout.php @@ -1,15 +1,15 @@ <section id="main"> <div class="page-header page-header-mobile"> <ul> - <?php if ($this->user->hasAccess('project', 'create')): ?> + <?php if ($this->user->hasAccess('ProjectCreation', 'create')): ?> <li> <i class="fa fa-plus fa-fw"></i> - <?= $this->url->link(t('New project'), 'project', 'create') ?> + <?= $this->url->link(t('New project'), 'ProjectCreation', 'create') ?> </li> <?php endif ?> <li> <i class="fa fa-lock fa-fw"></i> - <?= $this->url->link(t('New private project'), 'project', 'createPrivate') ?> + <?= $this->url->link(t('New private project'), 'ProjectCreation', 'createPrivate') ?> </li> <li> <i class="fa fa-search fa-fw"></i> diff --git a/app/Template/gantt/projects.php b/app/Template/gantt/projects.php index 46d2af91..84b260bb 100644 --- a/app/Template/gantt/projects.php +++ b/app/Template/gantt/projects.php @@ -1,12 +1,6 @@ <section id="main"> <div class="page-header"> <ul> - <?php if ($this->user->hasAccess('project', 'create')): ?> - <li><i class="fa fa-plus fa-fw"></i><?= $this->url->link(t('New project'), 'project', 'create') ?></li> - <?php endif ?> - <li> - <i class="fa fa-lock fa-fw"></i><?= $this->url->link(t('New private project'), 'project', 'create', array('private' => 1)) ?> - </li> <li> <i class="fa fa-folder fa-fw"></i><?= $this->url->link(t('Projects list'), 'project', 'index') ?> </li> diff --git a/app/Template/header.php b/app/Template/header.php index 405d07b3..074f8fd3 100644 --- a/app/Template/header.php +++ b/app/Template/header.php @@ -31,14 +31,26 @@ </select> </li> <?php endif ?> - <li> + <li class="user-links"> <?php if ($this->user->hasNotifications()): ?> <span class="notification"> <?= $this->url->link('<i class="fa fa-bell web-notification-icon"></i>', 'app', 'notifications', array('user_id' => $this->user->getId()), false, '', t('Unread notifications')) ?> </span> <?php endif ?> - <span class="dropdown"> + <div class="dropdown"> + <a href="#" class="dropdown-menu dropdown-menu-link-icon"><i class="fa fa-plus fa-fw"></i><i class="fa fa-caret-down"></i></a> + <ul> + <?php if ($this->user->hasAccess('ProjectCreation', 'create')): ?> + <li><i class="fa fa-plus fa-fw"></i><?= $this->url->link(t('New project'), 'ProjectCreation', 'create') ?></li> + <?php endif ?> + <li> + <i class="fa fa-lock fa-fw"></i><?= $this->url->link(t('New private project'), 'ProjectCreation', 'createPrivate') ?> + </li> + </ul> + </div> + + <div class="dropdown"> <a href="#" class="dropdown-menu dropdown-menu-link-icon"><i class="fa fa-user fa-fw"></i><i class="fa fa-caret-down"></i></a> <ul> <li class="no-hover"><strong><?= $this->e($this->user->getFullname()) ?></strong></li> @@ -46,7 +58,7 @@ <li><?= $this->url->link(t('My profile'), 'user', 'show', array('user_id' => $this->user->getId())) ?></li> <li><?= $this->url->link(t('Logout'), 'auth', 'logout') ?></li> </ul> - </span> + </div> </li> </ul> </nav> diff --git a/app/Template/project/duplicate.php b/app/Template/project/duplicate.php index 8967c306..ca7d3302 100644 --- a/app/Template/project/duplicate.php +++ b/app/Template/project/duplicate.php @@ -10,13 +10,17 @@ <?= $this->form->csrf() ?> + <?php if ($project['is_private'] == 0): ?> + <?= $this->form->checkbox('projectPermission', t('Permissions'), 1, true) ?> + <?php endif ?> + <?= $this->form->checkbox('category', t('Categories'), 1, true) ?> <?= $this->form->checkbox('action', t('Actions'), 1, true) ?> <?= $this->form->checkbox('swimlane', t('Swimlanes'), 1, false) ?> <?= $this->form->checkbox('task', t('Tasks'), 1, false) ?> <div class="form-actions"> - <input type="submit" value="<?= t('Duplicate') ?>" class="btn btn-red"/> + <input type="submit" value="<?= t('Duplicate') ?>" class="btn btn-red"> <?= t('or') ?> <?= $this->url->link(t('cancel'), 'project', 'show', array('project_id' => $project['id'])) ?> </div> </form> diff --git a/app/Template/project/index.php b/app/Template/project/index.php index 3d2a33ea..c5dd267c 100644 --- a/app/Template/project/index.php +++ b/app/Template/project/index.php @@ -1,10 +1,6 @@ <section id="main"> <div class="page-header"> <ul> - <?php if ($this->user->hasAccess('project', 'create')): ?> - <li><i class="fa fa-plus fa-fw"></i><?= $this->url->link(t('New project'), 'project', 'create') ?></li> - <?php endif ?> - <li><i class="fa fa-lock fa-fw"></i><?= $this->url->link(t('New private project'), 'project', 'createPrivate') ?></li> <?php if ($this->user->hasAccess('projectuser', 'managers')): ?> <li><i class="fa fa-user fa-fw"></i><?= $this->url->link(t('Users overview'), 'projectuser', 'managers') ?></li> <?php endif ?> diff --git a/app/Template/project/new.php b/app/Template/project/new.php deleted file mode 100644 index 8e4ccfec..00000000 --- a/app/Template/project/new.php +++ /dev/null @@ -1,24 +0,0 @@ -<section id="main"> - <div class="page-header"> - <ul> - <li><i class="fa fa-folder fa-fw"></i><?= $this->url->link(t('All projects'), 'project', 'index') ?></li> - </ul> - </div> - <form method="post" action="<?= $this->url->href('project', 'save') ?>" autocomplete="off"> - - <?= $this->form->csrf() ?> - <?= $this->form->hidden('is_private', $values) ?> - <?= $this->form->label(t('Name'), 'name') ?> - <?= $this->form->text('name', $values, $errors, array('autofocus', 'required', 'maxlength="50"')) ?> - - <div class="form-actions"> - <input type="submit" value="<?= t('Save') ?>" class="btn btn-blue"/> - <?= t('or') ?> <?= $this->url->link(t('cancel'), 'project', 'index') ?> - </div> - </form> - <?php if (isset($is_private) && $is_private): ?> - <div class="alert alert-info"> - <p><?= t('There is no user management for private projects.') ?></p> - </div> - <?php endif ?> -</section>
\ No newline at end of file diff --git a/app/Template/project_creation/create.php b/app/Template/project_creation/create.php new file mode 100644 index 00000000..6caa36af --- /dev/null +++ b/app/Template/project_creation/create.php @@ -0,0 +1,42 @@ +<section id="main"> + <div class="page-header"> + <ul> + <li><i class="fa fa-folder fa-fw"></i><?= $this->url->link(t('All projects'), 'project', 'index') ?></li> + </ul> + </div> + <form class="form-popover" id="project-creation-form" method="post" action="<?= $this->url->href('ProjectCreation', 'save') ?>" autocomplete="off"> + + <?= $this->form->csrf() ?> + <?= $this->form->hidden('is_private', $values) ?> + + <?= $this->form->label(t('Name'), 'name') ?> + <?= $this->form->text('name', $values, $errors, array('autofocus', 'required', 'maxlength="50"')) ?> + + <?php if (count($projects_list) > 1): ?> + <?= $this->form->label(t('Create from another project'), 'src_project_id') ?> + <?= $this->form->select('src_project_id', $projects_list, $values) ?> + <?php endif ?> + + <div class="project-creation-options" <?= isset($values['src_project_id']) && $values['src_project_id'] > 0 ? '' : 'style="display: none"' ?>> + <p class="alert"><?= t('Which parts of the project do you want to duplicate?') ?></p> + + <?php if (! $is_private): ?> + <?= $this->form->checkbox('projectPermission', t('Permissions'), 1, true) ?> + <?php endif ?> + + <?= $this->form->checkbox('category', t('Categories'), 1, true) ?> + <?= $this->form->checkbox('action', t('Actions'), 1, true) ?> + <?= $this->form->checkbox('swimlane', t('Swimlanes'), 1, true) ?> + <?= $this->form->checkbox('task', t('Tasks'), 1, false) ?> + </div> + + <div class="form-actions"> + <input type="submit" value="<?= t('Save') ?>" class="btn btn-blue"> + </div> + </form> + <?php if ($is_private): ?> + <div class="alert alert-info"> + <p><?= t('There is no user management for private projects.') ?></p> + </div> + <?php endif ?> +</section>
\ No newline at end of file diff --git a/app/Template/project_edit/general.php b/app/Template/project_edit/general.php index 5caefa2d..28cbb66a 100644 --- a/app/Template/project_edit/general.php +++ b/app/Template/project_edit/general.php @@ -24,7 +24,7 @@ <?= $this->form->select('owner_id', $owners, $values, $errors) ?> </div> - <?php if ($this->user->hasProjectAccess('project', 'create', $project['id'])): ?> + <?php if ($this->user->hasProjectAccess('ProjectCreation', 'create', $project['id'])): ?> <hr> <?= $this->form->checkbox('is_private', t('Private project'), 1, $project['is_private'] == 1) ?> <p class="form-help"><?= t('Private projects do not have users and groups management.') ?></p> diff --git a/app/Template/project_user/layout.php b/app/Template/project_user/layout.php index 3a569da4..a87efbff 100644 --- a/app/Template/project_user/layout.php +++ b/app/Template/project_user/layout.php @@ -1,13 +1,6 @@ <section id="main"> <div class="page-header"> <ul> - <?php if ($this->user->hasAccess('project', 'create')): ?> - <li><i class="fa fa-plus fa-fw"></i><?= $this->url->link(t('New project'), 'project', 'create') ?></li> - <?php endif ?> - <li> - <i class="fa fa-lock fa-fw"></i> - <?= $this->url->link(t('New private project'), 'project', 'create', array('private' => 1)) ?> - </li> <li> <i class="fa fa-folder fa-fw"></i> <?= $this->url->link(t('Projects list'), 'project', 'index') ?> |