summaryrefslogtreecommitdiff
path: root/app/Template/action/index.php
blob: 9e98554cf156fa153eeeb2d8560f07a0128932c9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
<div class="page-header">
    <h2><?= t('Automatic actions for the project "%s"', $project['name']) ?></h2>
</div>

<?php if (! empty($actions)): ?>

<h3><?= t('Defined actions') ?></h3>
<table>
    <tr>
        <th><?= t('Event name') ?></th>
        <th><?= t('Action name') ?></th>
        <th><?= t('Action parameters') ?></th>
        <th><?= t('Action') ?></th>
    </tr>

    <?php foreach ($actions as $action): ?>
    <tr>
        <td><?= $this->text->in($action['event_name'], $available_events) ?></td>
        <td><?= $this->text->in($action['action_name'], $available_actions) ?></td>
        <td>
            <ul>
            <?php foreach ($action['params'] as $param): ?>
                <li>
                    <?= $this->text->in($param['name'], $available_params) ?> =
                    <strong>
                    <?php if ($this->text->contains($param['name'], 'column_id')): ?>
                        <?= $this->text->in($param['value'], $columns_list) ?>
                    <?php elseif ($this->text->contains($param['name'], 'user_id')): ?>
                        <?= $this->text->in($param['value'], $users_list) ?>
                    <?php elseif ($this->text->contains($param['name'], 'project_id')): ?>
                        <?= $this->text->in($param['value'], $projects_list) ?>
                    <?php elseif ($this->text->contains($param['name'], 'color_id')): ?>
                        <?= $this->text->in($param['value'], $colors_list) ?>
                    <?php elseif ($this->text->contains($param['name'], 'category_id')): ?>
                        <?= $this->text->in($param['value'], $categories_list) ?>
                    <?php elseif ($this->text->contains($param['name'], 'label')): ?>
                        <?= $this->e($param['value']) ?>
                    <?php endif ?>
                    </strong>
                </li>
            <?php endforeach ?>
            </ul>
        </td>
        <td>
            <?= $this->url->link(t('Remove'), 'action', 'confirm', array('project_id' => $project['id'], 'action_id' => $action['id'])) ?>
        </td>
    </tr>
    <?php endforeach ?>
</table>

<?php endif ?>

<h3><?= t('Add an action') ?></h3>
<form method="post" action="<?= $this->url->href('action', 'event', array('project_id' => $project['id'])) ?>" class="listing">
    <?= $this->form->csrf() ?>
    <?= $this->form->hidden('project_id', $values) ?>

    <?= $this->form->label(t('Action'), 'action_name') ?>
    <?= $this->form->select('action_name', $available_actions, $values) ?><br/>

    <div class="form-actions">
        <input type="submit" value="<?= t('Next step') ?>" class="btn btn-blue"/>
    </div>
</form>