summaryrefslogtreecommitdiff
path: root/app/Templates
diff options
context:
space:
mode:
authorFrédéric Guillot <fred@kanboard.net>2014-10-05 19:40:57 -0400
committerFrédéric Guillot <fred@kanboard.net>2014-10-05 19:40:57 -0400
commitd138834dcf902534f78237939926e97fd9a0eebe (patch)
treea6247b9ed98079899c9e21d43044030b69088bee /app/Templates
parent7f5a871f84639a90eebd0ac1d0ee7f759e220cf6 (diff)
Regular users are able to create private projects
Diffstat (limited to 'app/Templates')
-rw-r--r--app/Templates/action_remove.php4
-rw-r--r--app/Templates/board_edit.php6
-rw-r--r--app/Templates/board_remove.php4
-rw-r--r--app/Templates/project_disable.php4
-rw-r--r--app/Templates/project_duplicate.php4
-rw-r--r--app/Templates/project_edit.php4
-rw-r--r--app/Templates/project_enable.php4
-rw-r--r--app/Templates/project_index.php17
-rw-r--r--app/Templates/project_layout.php4
-rw-r--r--app/Templates/project_new.php9
-rw-r--r--app/Templates/project_remove.php4
-rw-r--r--app/Templates/project_share.php12
-rw-r--r--app/Templates/project_show.php12
-rw-r--r--app/Templates/project_sidebar.php22
-rw-r--r--app/Templates/project_users.php6
15 files changed, 64 insertions, 52 deletions
diff --git a/app/Templates/action_remove.php b/app/Templates/action_remove.php
index 4b574f11..668067da 100644
--- a/app/Templates/action_remove.php
+++ b/app/Templates/action_remove.php
@@ -8,7 +8,7 @@
</p>
<div class="form-actions">
- <a href="?controller=action&amp;action=remove&amp;action_id=<?= $action['id'].Helper\param_csrf() ?>" 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>
+ <?= Helper\a(t('Yes'), 'action', 'remove', array('project_id' => $project['id'], 'action_id' => $action['id']), true, 'btn btn-red') ?>
+ <?= t('or') ?> <?= Helper\a(t('cancel'), 'action', 'index', array('project_id' => $project['id'])) ?>
</div>
</div> \ No newline at end of file
diff --git a/app/Templates/board_edit.php b/app/Templates/board_edit.php
index 8832e71d..cfaebc50 100644
--- a/app/Templates/board_edit.php
+++ b/app/Templates/board_edit.php
@@ -23,16 +23,16 @@
<ul>
<?php if ($column['position'] != 1): ?>
<li>
- <a href="?controller=board&amp;action=moveUp&amp;project_id=<?= $project['id'] ?>&amp;column_id=<?= $column['id'].Helper\param_csrf() ?>"><?= t('Move Up') ?></a>
+ <?= Helper\a(t('Move Up'), 'board', 'moveColumn', array('project_id' => $project['id'], 'column_id' => $column['id'], 'direction' => 'up'), true) ?>
</li>
<?php endif ?>
<?php if ($column['position'] != count($columns)): ?>
<li>
- <a href="?controller=board&amp;action=moveDown&amp;project_id=<?= $project['id'] ?>&amp;column_id=<?= $column['id'].Helper\param_csrf() ?>"><?= t('Move Down') ?></a>
+ <?= Helper\a(t('Move Down'), 'board', 'moveColumn', array('project_id' => $project['id'], 'column_id' => $column['id'], 'direction' => 'down'), true) ?>
</li>
<?php endif ?>
<li>
- <a href="?controller=board&amp;action=confirm&amp;project_id=<?= $project['id'] ?>&amp;column_id=<?= $column['id'] ?>"><?= t('Remove') ?></a>
+ <?= Helper\a(t('Remove'), 'board', 'remove', array('project_id' => $project['id'], 'column_id' => $column['id'])) ?>
</li>
</ul>
</td>
diff --git a/app/Templates/board_remove.php b/app/Templates/board_remove.php
index d6fa9a88..4529063b 100644
--- a/app/Templates/board_remove.php
+++ b/app/Templates/board_remove.php
@@ -9,7 +9,7 @@
</p>
<div class="form-actions">
- <a href="?controller=board&amp;action=remove&amp;column_id=<?= $column['id'].Helper\param_csrf() ?>" class="btn btn-red"><?= t('Yes') ?></a>
- <?= t('or') ?> <a href="?controller=board&amp;action=edit&amp;project_id=<?= $column['project_id'] ?>"><?= t('cancel') ?></a>
+ <?= Helper\a(t('Yes'), 'board', 'remove', array('project_id' => $project['id'], 'column_id' => $column['id'], 'remove' => 'yes'), true, 'btn btn-red') ?>
+ <?= t('or') ?> <?= Helper\a(t('cancel'), 'board', 'edit', array('project_id' => $project['id'])) ?>
</div>
</div> \ No newline at end of file
diff --git a/app/Templates/project_disable.php b/app/Templates/project_disable.php
index 39f55570..7a729fa3 100644
--- a/app/Templates/project_disable.php
+++ b/app/Templates/project_disable.php
@@ -8,7 +8,7 @@
</p>
<div class="form-actions">
- <a href="?controller=project&amp;action=disable&amp;project_id=<?= $project['id'].Helper\param_csrf() ?>" class="btn btn-red"><?= t('Yes') ?></a>
- <?= t('or') ?> <a href="?controller=project&amp;action=show&amp;project_id=<?= $project['id'] ?>"><?= t('cancel') ?></a>
+ <?= Helper\a(t('Yes'), 'project', 'disable', array('project_id' => $project['id'], 'disable' => 'yes'), true, 'btn btn-red') ?>
+ <?= t('or') ?> <?= Helper\a(t('cancel'), 'project', 'show', array('project_id' => $project['id'])) ?>
</div>
</div> \ No newline at end of file
diff --git a/app/Templates/project_duplicate.php b/app/Templates/project_duplicate.php
index 32cbd5d8..a926dcd1 100644
--- a/app/Templates/project_duplicate.php
+++ b/app/Templates/project_duplicate.php
@@ -8,7 +8,7 @@
</p>
<div class="form-actions">
- <a href="?controller=project&amp;action=duplicate&amp;project_id=<?= $project['id'].Helper\param_csrf() ?>" class="btn btn-red"><?= t('Yes') ?></a>
- <?= t('or') ?> <a href="?controller=project&amp;action=show&amp;project_id=<?= $project['id'] ?>"><?= t('cancel') ?></a>
+ <?= Helper\a(t('Yes'), 'project', 'duplicate', array('project_id' => $project['id'], 'duplicate' => 'yes'), true, 'btn btn-red') ?>
+ <?= t('or') ?> <?= Helper\a(t('cancel'), 'project', 'show', array('project_id' => $project['id'])) ?>
</div>
</div> \ No newline at end of file
diff --git a/app/Templates/project_edit.php b/app/Templates/project_edit.php
index 4c9420f0..8eb2110d 100644
--- a/app/Templates/project_edit.php
+++ b/app/Templates/project_edit.php
@@ -1,7 +1,7 @@
<div class="page-header">
<h2><?= t('Edit project') ?></h2>
</div>
-<form method="post" action="?controller=project&amp;action=update&amp;project_id=<?= $values['id'] ?>" autocomplete="off">
+<form method="post" action="<?= Helper\u('project', 'update', array('project_id' => $values['id'])) ?>" autocomplete="off">
<?= Helper\form_csrf() ?>
<?= Helper\form_hidden('id', $values) ?>
@@ -9,8 +9,6 @@
<?= Helper\form_label(t('Name'), 'name') ?>
<?= Helper\form_text('name', $values, $errors, array('required')) ?>
- <?= Helper\form_checkbox('is_active', t('Activated'), 1, isset($values['is_active']) && $values['is_active'] == 1) ?><br/>
-
<div class="form-actions">
<input type="submit" value="<?= t('Save') ?>" class="btn btn-blue"/>
</div>
diff --git a/app/Templates/project_enable.php b/app/Templates/project_enable.php
index d2fce9f3..f2a1b0e7 100644
--- a/app/Templates/project_enable.php
+++ b/app/Templates/project_enable.php
@@ -8,7 +8,7 @@
</p>
<div class="form-actions">
- <a href="?controller=project&amp;action=enable&amp;project_id=<?= $project['id'].Helper\param_csrf() ?>" class="btn btn-red"><?= t('Yes') ?></a>
- <?= t('or') ?> <a href="?controller=project&amp;action=show&amp;project_id=<?= $project['id'] ?>"><?= t('cancel') ?></a>
+ <?= Helper\a(t('Yes'), 'project', 'enable', array('project_id' => $project['id'], 'enable' => 'yes'), true, 'btn btn-red') ?>
+ <?= t('or') ?> <?= Helper\a(t('cancel'), 'project', 'show', array('project_id' => $project['id'])) ?>
</div>
</div> \ No newline at end of file
diff --git a/app/Templates/project_index.php b/app/Templates/project_index.php
index 8b103c52..044ab95f 100644
--- a/app/Templates/project_index.php
+++ b/app/Templates/project_index.php
@@ -1,11 +1,12 @@
<section id="main">
<div class="page-header">
<h2><?= t('Projects') ?><span id="page-counter"> (<?= $nb_projects ?>)</span></h2>
- <?php if (Helper\is_admin()): ?>
<ul>
- <li><a href="?controller=project&amp;action=create"><?= t('New project') ?></a></li>
+ <?php if (Helper\is_admin()): ?>
+ <li><?= Helper\a(t('New project'), 'project', 'create') ?></li>
+ <?php endif ?>
+ <li><?= Helper\a(t('New private project'), 'project', 'create', array('private' => 1)) ?></li>
</ul>
- <?php endif ?>
</div>
<section>
<?php if (empty($active_projects) && empty($inactive_projects)): ?>
@@ -17,7 +18,10 @@
<ul class="project-listing">
<?php foreach ($active_projects as $project): ?>
<li>
- <a href="?controller=project&amp;action=show&amp;project_id=<?= $project['id'] ?>"><?= Helper\escape($project['name']) ?></a>
+ <?php if ($project['is_private']): ?>
+ <i class="fa fa-lock"></i>
+ <?php endif ?>
+ <?= Helper\a(Helper\escape($project['name']), 'project', 'show', array('project_id' => $project['id'])) ?>
</li>
<?php endforeach ?>
</ul>
@@ -28,7 +32,10 @@
<ul class="project-listing">
<?php foreach ($inactive_projects as $project): ?>
<li>
- <a href="?controller=project&amp;action=show&amp;project_id=<?= $project['id'] ?>"><?= Helper\escape($project['name']) ?></a>
+ <?php if ($project['is_private']): ?>
+ <i class="fa fa-lock"></i>
+ <?php endif ?>
+ <?= Helper\a(Helper\escape($project['name']), 'project', 'show', array('project_id' => $project['id'])) ?>
</li>
<?php endforeach ?>
</ul>
diff --git a/app/Templates/project_layout.php b/app/Templates/project_layout.php
index 3af77a09..d69bbd53 100644
--- a/app/Templates/project_layout.php
+++ b/app/Templates/project_layout.php
@@ -2,8 +2,8 @@
<div class="page-header">
<h2><?= t('Project "%s"', $project['name']) ?> (#<?= $project['id'] ?>)</h2>
<ul>
- <li><a href="?controller=board&amp;action=show&amp;project_id=<?= $project['id'] ?>"><?= t('Back to the board') ?></a></li>
- <li><a href="?controller=project"><?= t('All projects') ?></a></li>
+ <li><?= Helper\a(t('Back to the board'), 'board', 'show', array('project_id' => $project['id'])) ?></li>
+ <li><?= Helper\a(t('All projects'), 'project', 'index') ?></li>
</ul>
</div>
<section class="project-show" id="project-section">
diff --git a/app/Templates/project_new.php b/app/Templates/project_new.php
index b4ed9990..e1ea5af7 100644
--- a/app/Templates/project_new.php
+++ b/app/Templates/project_new.php
@@ -1,20 +1,21 @@
<section id="main">
<div class="page-header">
- <h2><?= t('New project') ?></h2>
+ <h2><?= empty($values['is_private']) ? t('New project') : t('New private project') ?></h2>
<ul>
- <li><a href="?controller=project"><?= t('All projects') ?></a></li>
+ <li><?= Helper\a(t('All projects'), 'project', 'index') ?></li>
</ul>
</div>
<section>
- <form method="post" action="?controller=project&amp;action=save" autocomplete="off">
+ <form method="post" action="<?= Helper\u('project', 'save') ?>" autocomplete="off">
<?= Helper\form_csrf() ?>
+ <?= Helper\form_hidden('is_private', $values) ?>
<?= Helper\form_label(t('Name'), 'name') ?>
<?= Helper\form_text('name', $values, $errors, array('autofocus', 'required')) ?>
<div class="form-actions">
<input type="submit" value="<?= t('Save') ?>" class="btn btn-blue"/>
- <?= t('or') ?> <a href="?controller=project"><?= t('cancel') ?></a>
+ <?= t('or') ?> <?= Helper\a(t('cancel'), 'project', 'index') ?>
</div>
</form>
</section>
diff --git a/app/Templates/project_remove.php b/app/Templates/project_remove.php
index 00771b5f..a98f94eb 100644
--- a/app/Templates/project_remove.php
+++ b/app/Templates/project_remove.php
@@ -8,7 +8,7 @@
</p>
<div class="form-actions">
- <a href="?controller=project&amp;action=remove&amp;project_id=<?= $project['id'].Helper\param_csrf() ?>" class="btn btn-red"><?= t('Yes') ?></a>
- <?= t('or') ?> <a href="?controller=project&amp;action=show&amp;project_id=<?= $project['id'] ?>"><?= t('cancel') ?></a>
+ <?= Helper\a(t('Yes'), 'project', 'remove', array('project_id' => $project['id'], 'remove' => 'yes'), true, 'btn btn-red') ?>
+ <?= t('or') ?> <?= Helper\a(t('cancel'), 'project', 'show', array('project_id' => $project['id'])) ?>
</div>
</div> \ No newline at end of file
diff --git a/app/Templates/project_share.php b/app/Templates/project_share.php
index f06d7671..8edcbbc0 100644
--- a/app/Templates/project_share.php
+++ b/app/Templates/project_share.php
@@ -6,16 +6,14 @@
<div class="listing">
<ul class="no-bullet">
- <li><strong><i class="fa fa-share-alt"></i> <a href="?controller=board&amp;action=readonly&amp;token=<?= $project['token'] ?>" target="_blank"><?= t('Public link') ?></a></strong></li>
- <li><strong><i class="fa fa-rss-square"></i> <a href="?controller=project&amp;action=feed&amp;token=<?= $project['token'] ?>" target="_blank"><?= t('RSS feed') ?></a></strong></li>
+ <li><strong><i class="fa fa-share-alt"></i> <?= Helper\a(t('Public link'), 'board', 'readonly', array('token' => $project['token'])) ?></strong></li>
+ <li><strong><i class="fa fa-rss-square"></i> <?= Helper\a(t('RSS feed'), 'project', 'feed', array('token' => $project['token'])) ?></strong></li>
</ul>
- <input type="text" readonly="readonly" value="<?= Helper\get_current_base_url() ?>?controller=board&amp;action=readonly&amp;token=<?= $project['token'] ?>"/>
+ <input type="text" readonly="readonly" value="<?= Helper\get_current_base_url().Helper\u('board', 'readonly', array('token' => $project['token'])) ?>"/>
</div>
- <a href="?controller=project&amp;action=disablePublic&amp;project_id=<?= $project['id'].Helper\param_csrf() ?>" class="btn btn-red"><?= t('Disable public access') ?></a>
+ <?= Helper\a(t('Disable public access'), 'project', 'share', array('project_id' => $project['id'], 'switch' => 'disable'), true, 'btn btn-red') ?>
<?php else: ?>
-
- <a href="?controller=project&amp;action=enablePublic&amp;project_id=<?= $project['id'].Helper\param_csrf() ?>" class="btn btn-blue"><?= t('Enable public access') ?></a>
-
+ <?= Helper\a(t('Enable public access'), 'project', 'share', array('project_id' => $project['id'], 'switch' => 'enable'), true, 'btn btn-blue') ?>
<?php endif ?>
diff --git a/app/Templates/project_show.php b/app/Templates/project_show.php
index 96b9e404..facdc60a 100644
--- a/app/Templates/project_show.php
+++ b/app/Templates/project_show.php
@@ -4,9 +4,13 @@
<ul class="listing">
<li><strong><?= $project['is_active'] ? t('Active') : t('Inactive') ?></strong></li>
+ <?php if ($project['is_private']): ?>
+ <li><i class="fa fa-lock"></i> <?= t('This project is private') ?></li>
+ <?php endif ?>
+
<?php if ($project['is_public']): ?>
- <li><i class="fa fa-share-alt"></i> <a href="?controller=board&amp;action=readonly&amp;token=<?= $project['token'] ?>" target="_blank"><?= t('Public link') ?></a></li>
- <li><i class="fa fa-rss-square"></i> <a href="?controller=project&amp;action=feed&amp;token=<?= $project['token'] ?>" target="_blank"><?= t('RSS feed') ?></a></li>
+ <li><i class="fa fa-share-alt"></i> <?= Helper\a(t('Public link'), 'board', 'readonly', array('token' => $project['token'])) ?></li>
+ <li><i class="fa fa-rss-square"></i> <?= Helper\a(t('RSS feed'), 'project', 'feed', array('token' => $project['token'])) ?></li>
<?php else: ?>
<li><?= t('Public access disabled') ?></li>
<?php endif ?>
@@ -18,11 +22,11 @@
<?php if ($stats['nb_tasks'] > 0): ?>
<?php if ($stats['nb_active_tasks'] > 0): ?>
- <li><a href="?controller=board&amp;action=show&amp;project_id=<?= $project['id'] ?>"><?= t('%d tasks on the board', $stats['nb_active_tasks']) ?></a></li>
+ <li><?= Helper\a(t('%d tasks on the board', $stats['nb_active_tasks']), 'board', 'show', array('project_id' => $project['id'])) ?></li>
<?php endif ?>
<?php if ($stats['nb_inactive_tasks'] > 0): ?>
- <li><a href="?controller=project&amp;action=tasks&amp;project_id=<?= $project['id'] ?>"><?= t('%d closed tasks', $stats['nb_inactive_tasks']) ?></a></li>
+ <li><?= Helper\a(t('%d closed tasks', $stats['nb_inactive_tasks']), 'project', 'tasks', array('project_id' => $project['id'])) ?></li>
<?php endif ?>
<li><?= t('%d tasks in total', $stats['nb_tasks']) ?></li>
diff --git a/app/Templates/project_sidebar.php b/app/Templates/project_sidebar.php
index 41f1d447..7bad1f0e 100644
--- a/app/Templates/project_sidebar.php
+++ b/app/Templates/project_sidebar.php
@@ -5,11 +5,11 @@
<li>
<a href="?controller=project&amp;action=show&amp;project_id=<?= $project['id'] ?>"><?= t('Summary') ?></a>
</li>
+
+ <?php if (Helper\is_admin() || $project['is_private']): ?>
<li>
<a href="?controller=project&amp;action=export&amp;project_id=<?= $project['id'] ?>"><?= t('Tasks Export') ?></a>
</li>
-
- <?php if (Helper\is_admin()): ?>
<li>
<a href="?controller=project&amp;action=share&amp;project_id=<?= $project['id'] ?>"><?= t('Public access') ?></a>
</li>
@@ -20,26 +20,28 @@
<a href="?controller=board&amp;action=edit&amp;project_id=<?= $project['id'] ?>"><?= t('Edit board') ?></a>
</li>
<li>
- <a href="?controller=category&amp;action=index&amp;project_id=<?= $project['id'] ?>"><?= t('Categories management') ?></a>
- </li>
- <li>
- <a href="?controller=project&amp;action=users&amp;project_id=<?= $project['id'] ?>"><?= t('User management') ?></a>
+ <a href="?controller=category&amp;action=index&amp;project_id=<?= $project['id'] ?>"><?= t('Category management') ?></a>
</li>
+ <?php if (Helper\is_admin()): ?>
+ <li>
+ <a href="?controller=project&amp;action=users&amp;project_id=<?= $project['id'] ?>"><?= t('User management') ?></a>
+ </li>
+ <?php endif ?>
<li>
<a href="?controller=action&amp;action=index&amp;project_id=<?= $project['id'] ?>"><?= t('Automatic actions') ?></a>
</li>
<li>
- <a href="?controller=project&amp;action=confirmDuplicate&amp;project_id=<?= $project['id'].Helper\param_csrf() ?>"><?= t('Duplicate') ?></a>
+ <a href="?controller=project&amp;action=duplicate&amp;project_id=<?= $project['id'].Helper\param_csrf() ?>"><?= t('Duplicate') ?></a>
</li>
<li>
<?php if ($project['is_active']): ?>
- <a href="?controller=project&amp;action=confirmDisable&amp;project_id=<?= $project['id'].Helper\param_csrf() ?>"><?= t('Disable') ?></a>
+ <a href="?controller=project&amp;action=disable&amp;project_id=<?= $project['id'].Helper\param_csrf() ?>"><?= t('Disable') ?></a>
<?php else: ?>
- <a href="?controller=project&amp;action=confirmEnable&amp;project_id=<?= $project['id'].Helper\param_csrf() ?>"><?= t('Enable') ?></a>
+ <a href="?controller=project&amp;action=enable&amp;project_id=<?= $project['id'].Helper\param_csrf() ?>"><?= t('Enable') ?></a>
<?php endif ?>
</li>
<li>
- <a href="?controller=project&amp;action=confirmRemove&amp;project_id=<?= $project['id'] ?>"><?= t('Remove') ?></a>
+ <a href="?controller=project&amp;action=remove&amp;project_id=<?= $project['id'] ?>"><?= t('Remove') ?></a>
</li>
<?php endif ?>
</ul>
diff --git a/app/Templates/project_users.php b/app/Templates/project_users.php
index 8d75f39f..3b0de7f0 100644
--- a/app/Templates/project_users.php
+++ b/app/Templates/project_users.php
@@ -11,7 +11,9 @@
<?php foreach ($users['allowed'] as $user_id => $username): ?>
<li>
<strong><?= Helper\escape($username) ?></strong>
- (<a href="?controller=project&amp;action=revoke&amp;project_id=<?= $project['id'] ?>&amp;user_id=<?= $user_id.Helper\param_csrf() ?>"><?= t('revoke') ?></a>)
+ <?php if ($project['is_private'] == 0): ?>
+ (<a href="?controller=project&amp;action=revoke&amp;project_id=<?= $project['id'] ?>&amp;user_id=<?= $user_id.Helper\param_csrf() ?>"><?= t('revoke') ?></a>)
+ <?php endif ?>
</li>
<?php endforeach ?>
</ul>
@@ -19,7 +21,7 @@
</div>
<?php endif ?>
-<?php if (! empty($users['not_allowed'])): ?>
+<?php if ($project['is_private'] == 0 && ! empty($users['not_allowed'])): ?>
<form method="post" action="?controller=project&amp;action=allow&amp;project_id=<?= $project['id'] ?>" autocomplete="off">
<?= Helper\form_csrf() ?>