diff options
Diffstat (limited to 'app/Template')
-rw-r--r-- | app/Template/user/index.php | 2 | ||||
-rw-r--r-- | app/Template/user_import/show.php | 41 | ||||
-rw-r--r-- | app/Template/user_import/step1.php | 46 |
3 files changed, 42 insertions, 47 deletions
diff --git a/app/Template/user/index.php b/app/Template/user/index.php index 0b5da17c..00cd0c82 100644 --- a/app/Template/user/index.php +++ b/app/Template/user/index.php @@ -4,7 +4,7 @@ <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> + <li><i class="fa fa-upload fa-fw"></i><?= $this->url->link(t('Import'), 'UserImportController', 'show', array(), false, 'popover') ?></li> <li><i class="fa fa-users fa-fw"></i><?= $this->url->link(t('View all groups'), 'group', 'index') ?></li> </ul> <?php endif ?> diff --git a/app/Template/user_import/show.php b/app/Template/user_import/show.php new file mode 100644 index 00000000..54a66237 --- /dev/null +++ b/app/Template/user_import/show.php @@ -0,0 +1,41 @@ +<div class="page-header"> + <h2><?= t('Import users from CSV file') ?></h2> + <ul> + <li> + <i class="fa fa-download fa-fw"></i> + <?= $this->url->link(t('Download CSV template'), 'UserImportController', 'template') ?> + </li> + </ul> +</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> + +<form action="<?= $this->url->href('UserImportController', 'save') ?>" 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"> + <button type="submit" class="btn btn-blue"><?= t('Import') ?></button> + <?= t('or') ?> + <?= $this->url->link(t('cancel'), 'user', 'index', array(), false, 'close-popover') ?> + </div> +</form> diff --git a/app/Template/user_import/step1.php b/app/Template/user_import/step1.php deleted file mode 100644 index 592587a3..00000000 --- a/app/Template/user_import/step1.php +++ /dev/null @@ -1,46 +0,0 @@ -<section id="main"> - <div class="page-header"> - <?php if ($this->user->hasAccess('user', 'create')): ?> - <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"> - <button type="submit" class="btn btn-blue"><?= t('Import') ?></button> - </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 |