summaryrefslogtreecommitdiff
path: root/templates
diff options
context:
space:
mode:
Diffstat (limited to 'templates')
-rw-r--r--templates/action_index.php73
-rw-r--r--templates/action_params.php38
-rw-r--r--templates/action_remove.php16
-rw-r--r--templates/config_index.php2
-rw-r--r--templates/project_index.php3
5 files changed, 131 insertions, 1 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
diff --git a/templates/action_params.php b/templates/action_params.php
new file mode 100644
index 00000000..e7efcda5
--- /dev/null
+++ b/templates/action_params.php
@@ -0,0 +1,38 @@
+<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>
+
+ <h3><?= t('Define action parameters') ?></h3>
+ <form method="post" action="?controller=action&amp;action=create&amp;project_id=<?= $project['id'] ?>" autocomplete="off">
+
+ <?= Helper\form_hidden('project_id', $values) ?>
+ <?= Helper\form_hidden('event_name', $values) ?>
+ <?= Helper\form_hidden('action_name', $values) ?>
+
+ <?php foreach ($action_params as $param_name => $param_desc): ?>
+
+ <?php if (Helper\contains($param_name, 'column_id')): ?>
+ <?= Helper\form_label($param_desc, $param_name) ?>
+ <?= Helper\form_select('params['.$param_name.']', $columns_list, $values) ?><br/>
+ <?php elseif (Helper\contains($param_name, 'user_id')): ?>
+ <?= Helper\form_label($param_desc, $param_name) ?>
+ <?= Helper\form_select('params['.$param_name.']', $users_list, $values) ?><br/>
+ <?php elseif (Helper\contains($param_name, 'project_id')): ?>
+ <?= Helper\form_label($param_desc, $param_name) ?>
+ <?= Helper\form_select('params['.$param_name.']', $projects_list, $values) ?><br/>
+ <?php endif ?>
+
+ <?php endforeach ?>
+
+ <div class="form-actions">
+ <input type="submit" value="<?= t('Save this action') ?>" class="btn btn-blue"/>
+ <?= t('or') ?> <a href="?controller=action&amp;action=index&amp;project_id=<?= $project['id'] ?>"><?= t('cancel') ?></a>
+ </div>
+ </form>
+ </section>
+</section> \ No newline at end of file
diff --git a/templates/action_remove.php b/templates/action_remove.php
new file mode 100644
index 00000000..b90136e8
--- /dev/null
+++ b/templates/action_remove.php
@@ -0,0 +1,16 @@
+<section id="main">
+ <div class="page-header">
+ <h2><?= t('Remove an automatic action') ?></h2>
+ </div>
+
+ <div class="confirm">
+ <p class="alert alert-info">
+ <?= t('Do you really want to remove this action: "%s"?', Helper\in_list($action['event_name'], $available_events).'/'.Helper\in_list($action['action_name'], $available_actions)) ?>
+ </p>
+
+ <div class="form-actions">
+ <a href="?controller=action&amp;action=remove&amp;action_id=<?= $action['id'] ?>" class="btn btn-red"><?= t('Yes') ?></a>
+ <?= t('or') ?> <a href="?controller=action&amp;action=index&amp;project_id=<?= $action['project_id'] ?>"><?= t('cancel') ?></a>
+ </div>
+ </div>
+</section> \ No newline at end of file
diff --git a/templates/config_index.php b/templates/config_index.php
index d94ee8b9..0af2f9c2 100644
--- a/templates/config_index.php
+++ b/templates/config_index.php
@@ -45,7 +45,7 @@
</li>
<li>
<?= t('Application version:') ?>
- <?= Model\Base::APP_VERSION ?>
+ <?= APP_VERSION ?>
</li>
</ul>
</section>
diff --git a/templates/project_index.php b/templates/project_index.php
index 7d3e1844..74d807f6 100644
--- a/templates/project_index.php
+++ b/templates/project_index.php
@@ -69,6 +69,9 @@
<a href="?controller=board&amp;action=edit&amp;project_id=<?= $project['id'] ?>"><?= t('Edit board') ?></a>
</li>
<li>
+ <a href="?controller=action&amp;action=index&amp;project_id=<?= $project['id'] ?>"><?= t('Automatic actions') ?></a>
+ </li>
+ <li>
<?php if ($project['is_active']): ?>
<a href="?controller=project&amp;action=disable&amp;project_id=<?= $project['id'] ?>"><?= t('Disable') ?></a>
<?php else: ?>