show and make disabled editable, don't show disabled user in creation

This commit is contained in:
team-devstage 2020-08-03 11:42:51 +02:00
parent 507222ab1d
commit 224714b16d
4 changed files with 6 additions and 4 deletions

View File

@ -505,9 +505,9 @@ class StateUsersController extends AppController
}
$this->Flash->error(__('The state user could not be saved. Please, try again.'));
}
$indices = $this->StateUsers->Indices->find('list', ['limit' => 200]);
$stateGroups = $this->StateUsers->StateGroups->find('list', ['limit' => 200]);
$this->set(compact('stateUser', 'indices', 'stateGroups'));
$this->set(compact('stateUser', 'stateGroups'));
}
/**

View File

@ -266,6 +266,7 @@ class TransactionCreationsController extends AppController
->find('all')
->select(['id', 'first_name', 'last_name', 'email'])
//->order(['id'])
->where(['disabled' => 0])
->order(['first_name', 'last_name'])
->contain(['TransactionCreations' => [
'fields' => [

View File

@ -31,8 +31,7 @@
<fieldset>
<legend><?= __('Edit State User') ?></legend>
<?php
echo $this->Form->control('index_id');
echo $this->Form->control('state_group_id', ['options' => $stateGroups]);
echo $this->Form->control('disabled');
?>
</fieldset>
<?= $this->Form->button(__('Submit')) ?>

View File

@ -32,6 +32,7 @@
<th scope="col"><?= $this->Paginator->sort('last_name') ?>
<th scope="col"><?= $this->Paginator->sort('username') ?>
<th scope="col"><?= $this->Paginator->sort('email') ?>
<th scope="col"><?= $this->Paginator->sort('disabled') ?>
<th scope="col" class="actions"><?= __('Actions') ?></th>
</tr>
</thead>
@ -45,6 +46,7 @@
<td><?= $stateUser->last_name ?></td>
<td><?= $stateUser->username ?></td>
<td><?= $stateUser->email ?></td>
<td><?= $stateUser->disabled ?></td>
<td class="actions">
<?= $this->Html->link(__('View'), ['action' => 'view', $stateUser->id]) ?>
<?= $this->Html->link(__('Edit'), ['action' => 'edit', $stateUser->id]) ?>