feat: add functionality to import tasks from a project

This commit is contained in:
mundry
2022-11-14 12:33:23 +01:00
committed by Frédéric Guillot
parent d90987a09c
commit ac94004ea9
7 changed files with 100 additions and 1 deletions

View File

@@ -50,6 +50,9 @@
</li>
<li <?= $this->app->checkMenuSelection('ProjectViewController', 'duplicate') ?>>
<?= $this->url->link(t('Duplicate'), 'ProjectViewController', 'duplicate', array('project_id' => $project['id'])) ?>
</li>
<li <?= $this->app->checkMenuSelection('ProjectViewController', 'importTasks') ?>>
<?= $this->url->link(t('Import Tasks'), 'ProjectViewController', 'importTasks', array('project_id' => $project['id'])) ?>
</li>
<?php if ($project['is_active']): ?>
<li>

View File

@@ -0,0 +1,21 @@
<div class="page-header">
<h2><?= t('Import Tasks') ?></h2>
</div>
<p><?= t('Please choose a project you want to copy the tasks from.') ?></p>
<?php if (count($projects) > 0) { ?>
<form method="post" action="<?= $this->url->href('ProjectViewController', 'doTasksImport', ['project_id' => $project['id']]) ?>">
<?= $this->form->csrf() ?>
<select name="projects" id="projects">
<option value="" disabled selected><?= t('Choose a project') ?></option>
<?php foreach ($projects as $projectId => $projectName) { ?>
<option value="<?= $projectId?>"><?= $projectName ?></option>
<?php } ?>
</select>
<div class="form-actions">
<button type="submit" class="btn btn-red"><?= t('Copy') ?></button>
<?= t('or') ?> <?= $this->url->link(t('cancel'), 'ProjectViewController', 'show', array('project_id' => $project['id'])) ?>
</div>
</form>
<?php } else { ?>
<p class="no-projects"><?= t('No other projects found.') ?></p>
<?php } ?>