Open task import in modal box

This commit is contained in:
Frederic Guillot 2017-01-08 12:01:13 -05:00
parent 6bfafb6e82
commit bb222a79cd
7 changed files with 16 additions and 25 deletions

View File

@ -8,6 +8,7 @@ Improvements:
* Remove TaskGanttCreationController
* Add helpers to open modal boxes
* Make icons clickable in menus
* Open task import in modal box
Version 1.0.36 (Dec 30, 2016)
-----------------------------

View File

@ -23,15 +23,14 @@ class TaskImportController extends BaseController
{
$project = $this->getProject();
$this->response->html($this->helper->layout->project('task_import/show', array(
$this->response->html($this->template->render('task_import/show', array(
'project' => $project,
'values' => $values,
'errors' => $errors,
'max_size' => get_upload_max_size(),
'delimiters' => Csv::getDelimiters(),
'enclosures' => Csv::getEnclosures(),
'title' => t('Import tasks from CSV file'),
), 'task_import/sidebar'));
)));
}
/**
@ -58,7 +57,7 @@ class TaskImportController extends BaseController
$this->flash->failure(t('Nothing have been imported!'));
}
$this->response->redirect($this->helper->url->to('TaskImportController', 'show', array('project_id' => $project['id'])));
$this->response->redirect($this->helper->url->to('TaskImportController', 'show', array('project_id' => $project['id'])), true);
}
}

View File

@ -58,7 +58,7 @@
<?php if ($this->user->hasProjectAccess('TaskImportController', 'tasks', $project['id'])): ?>
<li>
<?= $this->url->icon('download', t('Imports'), 'TaskImportController', 'show', array('project_id' => $project['id'])) ?>
<?= $this->modal->medium('download', t('Import tasks'), 'TaskImportController', 'show', array('project_id' => $project['id'])) ?>
</li>
<?php endif ?>

View File

@ -15,14 +15,11 @@
<p class="form-help"><?= t('Maximum size: ') ?><?= is_integer($max_size) ? $this->text->bytes($max_size) : $max_size ?></p>
<div class="form-actions">
<button type="submit" class="btn btn-blue"><?= t('Import') ?></button>
</div>
<?= $this->modal->submitButtons(array('submitLabel' => t('Import'))) ?>
</form>
<div class="page-header">
<h2><?= t('Instructions') ?></h2>
</div>
<div class="alert">
<div class="panel">
<h3><?= t('Instructions') ?></h3>
<ul>
<li><?= t('Your file must use the predefined CSV format') ?></li>
<li><?= t('Your file must be encoded in UTF-8') ?></li>
@ -30,5 +27,7 @@
<li><?= t('Duplicates are not verified for you') ?></li>
<li><?= t('The due date must use the ISO format: YYYY-MM-DD') ?></li>
</ul>
<p class="margin-top">
<?= $this->url->icon('download', t('Download CSV template'), 'TaskImportController', 'template', array('project_id' => $project['id'])) ?>
</p>
</div>
<p><?= $this->url->icon('download', t('Download CSV template'), 'TaskImportController', 'template', array('project_id' => $project['id'])) ?></p>

View File

@ -1,8 +0,0 @@
<div class="sidebar">
<ul>
<li <?= $this->app->checkMenuSelection('TaskImportController', 'show') ?>>
<?= $this->url->link(t('Tasks').' (CSV)', 'TaskImportController', 'show', array('project_id' => $project['id'])) ?>
</li>
<?= $this->hook->render('template:task-import:sidebar') ?>
</ul>
</div>

File diff suppressed because one or more lines are too long

View File

@ -1,3 +1,6 @@
.margin-top
margin-top: 20px
.pull-right
text-align: right
@ -5,9 +8,6 @@ ul.no-bullet li
list-style-type: none
margin-left: 0
.chosen-select
min-height: 27px
#app-loading-icon
position: fixed
right: 3px