summaryrefslogtreecommitdiff
path: root/templates/action_index.php
diff options
context:
space:
mode:
authorFrédéric Guillot <fguillot@users.noreply.github.com>2014-03-09 23:21:23 -0400
committerFrédéric Guillot <fguillot@users.noreply.github.com>2014-03-09 23:21:23 -0400
commit7749b8ed569f6d27b0bb2ed4c2040e8b61ed4422 (patch)
treeee101992e87d740bdf0362e35ea040c866986f5a /templates/action_index.php
parent7bd4697dfca41a21f5857f83d6b29108fafb9a1e (diff)
Automatic actions
Diffstat (limited to 'templates/action_index.php')
-rw-r--r--templates/action_index.php73
1 files changed, 73 insertions, 0 deletions
diff --git a/templates/action_index.php b/templates/action_index.php
new file mode 100644
index 00000000..6e62949e
--- /dev/null
+++ b/templates/action_index.php
@@ -0,0 +1,73 @@
+<section id="main">
+ <div class="page-header">
+ <h2><?= t('Automatic actions for the project "%s"', $project['name']) ?></h2>
+ <ul>
+ <li><a href="?controller=project"><?= t('All projects') ?></a></li>
+ </ul>
+ </div>
+ <section>
+
+ <?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><?= Helper\in_list($action['event_name'], $available_events) ?></td>
+ <td><?= Helper\in_list($action['action_name'], $available_actions) ?></td>
+ <td>
+ <ul>
+ <?php foreach ($action['params'] as $param): ?>
+ <li>
+ <?= Helper\in_list($param['name'], $available_params) ?> =
+ <strong>
+ <?php if (Helper\contains($param['name'], 'column_id')): ?>
+ <?= Helper\in_list($param['value'], $columns_list) ?>
+ <?php elseif (Helper\contains($param['name'], 'user_id')): ?>
+ <?= Helper\in_list($param['value'], $users_list) ?>
+ <?php elseif (Helper\contains($param['name'], 'project_id')): ?>
+ <?= Helper\in_list($param['value'], $projects_list) ?>
+ <?php endif ?>
+ </strong>
+ </li>
+ <?php endforeach ?>
+ </ul>
+ </td>
+ <td>
+ <a href="?controller=action&amp;action=confirm&amp;action_id=<?= $action['id'] ?>"><?= t('Remove') ?></a>
+ </td>
+ </tr>
+ <?php endforeach ?>
+
+ </table>
+
+ <?php endif ?>
+
+ <h3><?= t('Add an action') ?></h3>
+ <form method="post" action="?controller=action&amp;action=params&amp;project_id=<?= $project['id'] ?>" autocomplete="off">
+
+ <?= Helper\form_hidden('project_id', $values) ?>
+
+ <?= Helper\form_label(t('Event'), 'event_name') ?>
+ <?= Helper\form_select('event_name', $available_events, $values) ?><br/>
+
+ <?= Helper\form_label(t('Action'), 'action_name') ?>
+ <?= Helper\form_select('action_name', $available_actions, $values) ?><br/>
+
+ <div class="form-help">
+ <?= t('When the selected event occurs execute the corresponding action.') ?>
+ </div>
+
+ <div class="form-actions">
+ <input type="submit" value="<?= t('Next step') ?>" class="btn btn-blue"/>
+ </div>
+ </form>
+ </section>
+</section> \ No newline at end of file