When creating a new project, have the possibility to select another project to duplicate

This commit is contained in:
Frederic Guillot
2016-01-31 17:46:19 -05:00
parent 1500ff92b2
commit fc21d3873e
30 changed files with 694 additions and 342 deletions

View File

@@ -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>

View File

@@ -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>

View File

@@ -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>

View File

@@ -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>

View File

@@ -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 ?>

View File

@@ -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>

View File

@@ -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>

View File

@@ -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>

View File

@@ -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') ?>