diff options
Diffstat (limited to 'app/Template')
-rw-r--r-- | app/Template/project/sidebar.php | 3 | ||||
-rw-r--r-- | app/Template/task_import/step1.php | 34 | ||||
-rw-r--r-- | app/Template/user/index.php | 3 | ||||
-rw-r--r-- | app/Template/user_import/step1.php | 46 |
4 files changed, 84 insertions, 2 deletions
diff --git a/app/Template/project/sidebar.php b/app/Template/project/sidebar.php index d8b35e3b..971ed950 100644 --- a/app/Template/project/sidebar.php +++ b/app/Template/project/sidebar.php @@ -45,6 +45,9 @@ <?= $this->url->link(t('Enable'), 'project', 'enable', array('project_id' => $project['id']), true) ?> <?php endif ?> </li> + <li <?= $this->app->getRouterController() === 'taskImport' && $this->app->getRouterAction() === 'step1' ? 'class="active"' : '' ?>> + <?= $this->url->link(t('Import'), 'taskImport', 'step1', array('project_id' => $project['id'])) ?> + </li> <?php if ($this->user->isProjectAdministrationAllowed($project['id'])): ?> <li <?= $this->app->getRouterController() === 'project' && $this->app->getRouterAction() === 'remove' ? 'class="active"' : '' ?>> <?= $this->url->link(t('Remove'), 'project', 'remove', array('project_id' => $project['id'])) ?> diff --git a/app/Template/task_import/step1.php b/app/Template/task_import/step1.php new file mode 100644 index 00000000..7619216a --- /dev/null +++ b/app/Template/task_import/step1.php @@ -0,0 +1,34 @@ +<div class="page-header"> + <h2><?= t('Tasks Importation') ?></h2> +</div> +<form action="<?= $this->url->href('taskImport', 'step2', array('project_id' => $project['id'])) ?>" method="post" enctype="multipart/form-data"> + <?= $this->form->csrf() ?> + + <?= $this->form->label(t('Delimiter'), 'delimiter') ?> + <?= $this->form->select('delimiter', $delimiters, $values) ?> + + <?= $this->form->label(t('Enclosure'), 'enclosure') ?> + <?= $this->form->select('enclosure', $enclosures, $values) ?> + + <?= $this->form->label(t('CSV File'), 'file') ?> + <?= $this->form->file('file', $errors) ?> + + <p class="form-help"><?= t('Maximum size: ') ?><?= is_integer($max_size) ? $this->text->bytes($max_size) : $max_size ?></p> + + <div class="form-actions"> + <input type="submit" value="<?= t('Import') ?>" class="btn btn-blue"> + </div> +</form> +<div class="page-header"> + <h2><?= t('Instructions') ?></h2> +</div> +<div class="alert"> + <ul> + <li><?= t('Your file must use the predefined CSV format') ?></li> + <li><?= t('Your file must be encoded in UTF-8') ?></li> + <li><?= t('The first row must be the header') ?></li> + <li><?= t('Duplicates are not verified for you') ?></li> + <li><?= t('The due date must use the ISO format: YYYY-MM-DD') ?></li> + </ul> +</div> +<p><i class="fa fa-download fa-fw"></i><?= $this->url->link(t('Download CSV template'), 'taskImport', 'template', array('project_id' => $project['id'])) ?></p>
\ No newline at end of file diff --git a/app/Template/user/index.php b/app/Template/user/index.php index d74aa748..4008b920 100644 --- a/app/Template/user/index.php +++ b/app/Template/user/index.php @@ -4,10 +4,10 @@ <ul> <li><i class="fa fa-plus fa-fw"></i><?= $this->url->link(t('New local user'), 'user', 'create') ?></li> <li><i class="fa fa-plus fa-fw"></i><?= $this->url->link(t('New remote user'), 'user', 'create', array('remote' => 1)) ?></li> + <li><i class="fa fa-upload fa-fw"></i><?= $this->url->link(t('Import'), 'userImport', 'step1') ?></li> </ul> <?php endif ?> </div> - <section> <?php if ($paginator->isEmpty()): ?> <p class="alert"><?= t('No user') ?></p> <?php else: ?> @@ -62,5 +62,4 @@ <?= $paginator ?> <?php endif ?> - </section> </section> diff --git a/app/Template/user_import/step1.php b/app/Template/user_import/step1.php new file mode 100644 index 00000000..7256bfa6 --- /dev/null +++ b/app/Template/user_import/step1.php @@ -0,0 +1,46 @@ +<section id="main"> + <div class="page-header"> + <?php if ($this->user->isAdmin()): ?> + <ul> + <li><i class="fa fa-user fa-fw"></i><?= $this->url->link(t('All users'), 'user', 'index') ?></li> + <li><i class="fa fa-plus fa-fw"></i><?= $this->url->link(t('New local user'), 'user', 'create') ?></li> + <li><i class="fa fa-plus fa-fw"></i><?= $this->url->link(t('New remote user'), 'user', 'create', array('remote' => 1)) ?></li> + </ul> + <?php endif ?> + </div> + <div class="page-header"> + <h2><?= t('Import') ?></h2> + </div> + <form action="<?= $this->url->href('userImport', 'step2') ?>" method="post" enctype="multipart/form-data"> + <?= $this->form->csrf() ?> + + <?= $this->form->label(t('Delimiter'), 'delimiter') ?> + <?= $this->form->select('delimiter', $delimiters, $values) ?> + + <?= $this->form->label(t('Enclosure'), 'enclosure') ?> + <?= $this->form->select('enclosure', $enclosures, $values) ?> + + <?= $this->form->label(t('CSV File'), 'file') ?> + <?= $this->form->file('file', $errors) ?> + + <p class="form-help"><?= t('Maximum size: ') ?><?= is_integer($max_size) ? $this->text->bytes($max_size) : $max_size ?></p> + + <div class="form-actions"> + <input type="submit" value="<?= t('Import') ?>" class="btn btn-blue"> + </div> + </form> + <div class="page-header"> + <h2><?= t('Instructions') ?></h2> + </div> + <div class="alert"> + <ul> + <li><?= t('Your file must use the predefined CSV format') ?></li> + <li><?= t('Your file must be encoded in UTF-8') ?></li> + <li><?= t('The first row must be the header') ?></li> + <li><?= t('Duplicates are not imported') ?></li> + <li><?= t('Usernames must be lowercase and unique') ?></li> + <li><?= t('Passwords will be encrypted if present') ?></li> + </ul> + </div> + <p><i class="fa fa-download fa-fw"></i><?= $this->url->link(t('Download CSV template'), 'userImport', 'template') ?></p> +</section>
\ No newline at end of file |