Skip to content

Commit

Permalink
Auto reset
Browse files Browse the repository at this point in the history
  • Loading branch information
dereuromark committed Mar 8, 2019
1 parent 5aebcc8 commit 8ef07d0
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 14 deletions.
11 changes: 11 additions & 0 deletions src/Controller/Admin/QueuedJobsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,17 @@ public function import() {

unset($data['id']);
$data['created'] = new FrozenTime($data['created']);

if ($this->request->getData('reset')) {
$data['fetched'] = null;
$data['completed'] = null;
$data['progress'] = null;
$data['failed'] = 0;
$data['failure_message'] = null;
$data['workerkey'] = null;
$data['status'] = null;
}

if ($data['notbefore']) {
$data['notbefore'] = new FrozenTime($data['notbefore']);
}
Expand Down
29 changes: 15 additions & 14 deletions src/Template/Admin/QueuedJobs/import.ctp
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,22 @@
*/
?>
<nav class="large-3 medium-4 columns" id="actions-sidebar">
<ul class="side-nav">
<li class="heading"><?= __('Actions') ?></li>
<li><?= $this->Html->link('Back', ['action' => 'index']); ?></li>
</ul>
<ul class="side-nav">
<li class="heading"><?= __('Actions') ?></li>
<li><?= $this->Html->link('Back', ['action' => 'index']); ?></li>
</ul>
</nav>
<div class="releases form large-9 medium-8 columns content">
<h2>Import</h2>
<h2>Import</h2>

<?= $this->Form->create(null, ['type' => 'file']) ?>
<fieldset>
<legend><?= __('Import Job from exported JSON') ?></legend>
<?php
echo $this->Form->control('file', ['type' => 'file', 'required' => true, 'accept' => '.json']);
?>
</fieldset>
<?= $this->Form->button(__('Submit')) ?>
<?= $this->Form->end() ?>
<?= $this->Form->create(null, ['type' => 'file']) ?>
<fieldset>
<legend><?= __('Import Job from exported JSON') ?></legend>
<?php
echo $this->Form->control('file', ['type' => 'file', 'required' => true, 'accept' => '.json']);
echo $this->Form->control('reset', ['type' => 'checkbox', 'default' => true]);
?>
</fieldset>
<?= $this->Form->button(__('Submit')) ?>
<?= $this->Form->end() ?>
</div>

0 comments on commit 8ef07d0

Please sign in to comment.