Helpers refactoring
This commit is contained in:
@@ -2,26 +2,26 @@
|
||||
<h2><?= t('Add a sub-task') ?></h2>
|
||||
</div>
|
||||
|
||||
<form method="post" action="<?= $this->u('subtask', 'save', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?>" autocomplete="off">
|
||||
<form method="post" action="<?= $this->url->href('subtask', 'save', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?>" autocomplete="off">
|
||||
|
||||
<?= $this->formCsrf() ?>
|
||||
<?= $this->form->csrf() ?>
|
||||
|
||||
<?= $this->formHidden('task_id', $values) ?>
|
||||
<?= $this->form->hidden('task_id', $values) ?>
|
||||
|
||||
<?= $this->formLabel(t('Title'), 'title') ?>
|
||||
<?= $this->formText('title', $values, $errors, array('required', 'autofocus', 'maxlength="255"')) ?><br/>
|
||||
<?= $this->form->label(t('Title'), 'title') ?>
|
||||
<?= $this->form->text('title', $values, $errors, array('required', 'autofocus', 'maxlength="255"')) ?><br/>
|
||||
|
||||
<?= $this->formLabel(t('Assignee'), 'user_id') ?>
|
||||
<?= $this->formSelect('user_id', $users_list, $values, $errors) ?><br/>
|
||||
<?= $this->form->label(t('Assignee'), 'user_id') ?>
|
||||
<?= $this->form->select('user_id', $users_list, $values, $errors) ?><br/>
|
||||
|
||||
<?= $this->formLabel(t('Original estimate'), 'time_estimated') ?>
|
||||
<?= $this->formNumeric('time_estimated', $values, $errors) ?> <?= t('hours') ?><br/>
|
||||
<?= $this->form->label(t('Original estimate'), 'time_estimated') ?>
|
||||
<?= $this->form->numeric('time_estimated', $values, $errors) ?> <?= t('hours') ?><br/>
|
||||
|
||||
<?= $this->formCheckbox('another_subtask', t('Create another sub-task'), 1, isset($values['another_subtask']) && $values['another_subtask'] == 1) ?>
|
||||
<?= $this->form->checkbox('another_subtask', t('Create another sub-task'), 1, isset($values['another_subtask']) && $values['another_subtask'] == 1) ?>
|
||||
|
||||
<div class="form-actions">
|
||||
<input type="submit" value="<?= t('Save') ?>" class="btn btn-blue"/>
|
||||
<?= t('or') ?>
|
||||
<?= $this->a(t('cancel'), 'task', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?>
|
||||
<?= $this->url->link(t('cancel'), 'task', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
@@ -2,28 +2,28 @@
|
||||
<h2><?= t('Edit a sub-task') ?></h2>
|
||||
</div>
|
||||
|
||||
<form method="post" action="<?= $this->u('subtask', 'update', array('task_id' => $task['id'], 'project_id' => $task['project_id'], 'subtask_id' => $subtask['id'])) ?>" autocomplete="off">
|
||||
<form method="post" action="<?= $this->url->href('subtask', 'update', array('task_id' => $task['id'], 'project_id' => $task['project_id'], 'subtask_id' => $subtask['id'])) ?>" autocomplete="off">
|
||||
|
||||
<?= $this->formCsrf() ?>
|
||||
<?= $this->form->csrf() ?>
|
||||
|
||||
<?= $this->formHidden('id', $values) ?>
|
||||
<?= $this->formHidden('task_id', $values) ?>
|
||||
<?= $this->form->hidden('id', $values) ?>
|
||||
<?= $this->form->hidden('task_id', $values) ?>
|
||||
|
||||
<?= $this->formLabel(t('Title'), 'title') ?>
|
||||
<?= $this->formText('title', $values, $errors, array('required', 'autofocus', 'maxlength="255"')) ?><br/>
|
||||
<?= $this->form->label(t('Title'), 'title') ?>
|
||||
<?= $this->form->text('title', $values, $errors, array('required', 'autofocus', 'maxlength="255"')) ?><br/>
|
||||
|
||||
<?= $this->formLabel(t('Assignee'), 'user_id') ?>
|
||||
<?= $this->formSelect('user_id', $users_list, $values, $errors) ?><br/>
|
||||
<?= $this->form->label(t('Assignee'), 'user_id') ?>
|
||||
<?= $this->form->select('user_id', $users_list, $values, $errors) ?><br/>
|
||||
|
||||
<?= $this->formLabel(t('Original estimate'), 'time_estimated') ?>
|
||||
<?= $this->formNumeric('time_estimated', $values, $errors) ?> <?= t('hours') ?><br/>
|
||||
<?= $this->form->label(t('Original estimate'), 'time_estimated') ?>
|
||||
<?= $this->form->numeric('time_estimated', $values, $errors) ?> <?= t('hours') ?><br/>
|
||||
|
||||
<?= $this->formLabel(t('Time spent'), 'time_spent') ?>
|
||||
<?= $this->formNumeric('time_spent', $values, $errors) ?> <?= t('hours') ?><br/>
|
||||
<?= $this->form->label(t('Time spent'), 'time_spent') ?>
|
||||
<?= $this->form->numeric('time_spent', $values, $errors) ?> <?= t('hours') ?><br/>
|
||||
|
||||
<div class="form-actions">
|
||||
<input type="submit" value="<?= t('Save') ?>" class="btn btn-blue"/>
|
||||
<?= t('or') ?>
|
||||
<?= $this->a(t('cancel'), 'task', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?>
|
||||
<?= $this->url->link(t('cancel'), 'task', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
@@ -10,8 +10,8 @@
|
||||
<p><strong><?= $this->e($subtask['title']) ?></strong></p>
|
||||
|
||||
<div class="form-actions">
|
||||
<?= $this->a(t('Yes'), 'subtask', 'remove', array('task_id' => $task['id'], 'project_id' => $task['project_id'], 'subtask_id' => $subtask['id']), true, 'btn btn-red') ?>
|
||||
<?= $this->url->link(t('Yes'), 'subtask', 'remove', array('task_id' => $task['id'], 'project_id' => $task['project_id'], 'subtask_id' => $subtask['id']), true, 'btn btn-red') ?>
|
||||
<?= t('or') ?>
|
||||
<?= $this->a(t('cancel'), 'task', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?>
|
||||
<?= $this->url->link(t('cancel'), 'task', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?>
|
||||
</div>
|
||||
</div>
|
||||
@@ -2,14 +2,14 @@
|
||||
<h2><?= t('You already have one subtask in progress') ?></h2>
|
||||
</div>
|
||||
|
||||
<form action="<?= $this->u('subtask', 'changeRestrictionStatus', array('task_id' => $task['id'], 'project_id' => $task['project_id'], 'subtask_id' => $subtask['id'])) ?>" method="post">
|
||||
<form action="<?= $this->url->href('subtask', 'changeRestrictionStatus', array('task_id' => $task['id'], 'project_id' => $task['project_id'], 'subtask_id' => $subtask['id'])) ?>" method="post">
|
||||
|
||||
<?= $this->formCsrf() ?>
|
||||
<?= $this->formHidden('redirect', array('redirect' => $redirect)) ?>
|
||||
<?= $this->form->csrf() ?>
|
||||
<?= $this->form->hidden('redirect', array('redirect' => $redirect)) ?>
|
||||
|
||||
<p><?= t('Select the new status of the subtask: "%s"', $subtask_inprogress['title']) ?></p>
|
||||
<?= $this->formRadios('status', $status_list) ?>
|
||||
<?= $this->formHidden('id', $subtask_inprogress) ?>
|
||||
<?= $this->form->radios('status', $status_list) ?>
|
||||
<?= $this->form->hidden('id', $subtask_inprogress) ?>
|
||||
|
||||
<div class="form-actions">
|
||||
<input type="submit" value="<?= t('Save') ?>" class="btn btn-red"/>
|
||||
|
||||
@@ -22,14 +22,14 @@
|
||||
<tr>
|
||||
<td>
|
||||
<?php if (! isset($not_editable)): ?>
|
||||
<?= $this->toggleSubtaskStatus($subtask, 'task') ?>
|
||||
<?= $this->subtask->toggleStatus($subtask, 'task') ?>
|
||||
<?php else: ?>
|
||||
<?= $this->render('subtask/icons', array('subtask' => $subtask)) . $this->e($subtask['title']) ?>
|
||||
<?php endif ?>
|
||||
</td>
|
||||
<td>
|
||||
<?php if (! empty($subtask['username'])): ?>
|
||||
<?= $this->a($this->e($subtask['name'] ?: $subtask['username']), 'user', 'show', array('user_id' => $subtask['user_id'])) ?>
|
||||
<?= $this->url->link($this->e($subtask['name'] ?: $subtask['username']), 'user', 'show', array('user_id' => $subtask['user_id'])) ?>
|
||||
<?php endif ?>
|
||||
</td>
|
||||
<td>
|
||||
@@ -46,19 +46,19 @@
|
||||
<ul>
|
||||
<?php if ($subtask['position'] != $first_position): ?>
|
||||
<li>
|
||||
<?= $this->a(t('Move Up'), 'subtask', 'movePosition', array('project_id' => $project['id'], 'task_id' => $subtask['task_id'], 'subtask_id' => $subtask['id'], 'direction' => 'up'), true) ?>
|
||||
<?= $this->url->link(t('Move Up'), 'subtask', 'movePosition', array('project_id' => $project['id'], 'task_id' => $subtask['task_id'], 'subtask_id' => $subtask['id'], 'direction' => 'up'), true) ?>
|
||||
</li>
|
||||
<?php endif ?>
|
||||
<?php if ($subtask['position'] != $last_position): ?>
|
||||
<li>
|
||||
<?= $this->a(t('Move Down'), 'subtask', 'movePosition', array('project_id' => $project['id'], 'task_id' => $subtask['task_id'], 'subtask_id' => $subtask['id'], 'direction' => 'down'), true) ?>
|
||||
<?= $this->url->link(t('Move Down'), 'subtask', 'movePosition', array('project_id' => $project['id'], 'task_id' => $subtask['task_id'], 'subtask_id' => $subtask['id'], 'direction' => 'down'), true) ?>
|
||||
</li>
|
||||
<?php endif ?>
|
||||
<li>
|
||||
<?= $this->a(t('Edit'), 'subtask', 'edit', array('task_id' => $task['id'], 'project_id' => $task['project_id'], 'subtask_id' => $subtask['id'])) ?>
|
||||
<?= $this->url->link(t('Edit'), 'subtask', 'edit', array('task_id' => $task['id'], 'project_id' => $task['project_id'], 'subtask_id' => $subtask['id'])) ?>
|
||||
</li>
|
||||
<li>
|
||||
<?= $this->a(t('Remove'), 'subtask', 'confirm', array('task_id' => $task['id'], 'project_id' => $task['project_id'], 'subtask_id' => $subtask['id'])) ?>
|
||||
<?= $this->url->link(t('Remove'), 'subtask', 'confirm', array('task_id' => $task['id'], 'project_id' => $task['project_id'], 'subtask_id' => $subtask['id'])) ?>
|
||||
</li>
|
||||
</ul>
|
||||
</td>
|
||||
@@ -68,10 +68,10 @@
|
||||
</table>
|
||||
|
||||
<?php if (! isset($not_editable)): ?>
|
||||
<form method="post" action="<?= $this->u('subtask', 'save', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?>" autocomplete="off">
|
||||
<?= $this->formCsrf() ?>
|
||||
<?= $this->formHidden('task_id', array('task_id' => $task['id'])) ?>
|
||||
<?= $this->formText('title', array(), array(), array('required', 'placeholder="'.t('Type here to create a new sub-task').'"')) ?>
|
||||
<form method="post" action="<?= $this->url->href('subtask', 'save', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?>" autocomplete="off">
|
||||
<?= $this->form->csrf() ?>
|
||||
<?= $this->form->hidden('task_id', array('task_id' => $task['id'])) ?>
|
||||
<?= $this->form->text('title', array(), array(), array('required', 'placeholder="'.t('Type here to create a new sub-task').'"')) ?>
|
||||
<input type="submit" value="<?= t('Add') ?>" class="btn btn-blue"/>
|
||||
</form>
|
||||
<?php endif ?>
|
||||
|
||||
Reference in New Issue
Block a user