Helpers refactoring

This commit is contained in:
Frederic Guillot
2015-05-24 16:02:25 -04:00
parent 65e9e5d1be
commit eeac2329ba
239 changed files with 2441 additions and 2337 deletions

View File

@@ -8,8 +8,8 @@
</p>
<div class="form-actions">
<?= $this->a(t('Yes'), 'task', 'close', array('task_id' => $task['id'], 'project_id' => $task['project_id'], 'confirmation' => 'yes', 'redirect' => $redirect), true, 'btn btn-red') ?>
<?= $this->url->link(t('Yes'), 'task', 'close', array('task_id' => $task['id'], 'project_id' => $task['project_id'], 'confirmation' => 'yes', 'redirect' => $redirect), true, 'btn btn-red') ?>
<?= t('or') ?>
<?= $this->a(t('cancel'), 'task', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id']), false, 'close-popover') ?>
<?= $this->url->link(t('cancel'), 'task', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id']), false, 'close-popover') ?>
</div>
</div>

View File

@@ -77,7 +77,7 @@
</li>
<?php if ($project['is_public']): ?>
<li>
<?= $this->a(t('Public link'), 'task', 'readonly', array('task_id' => $task['id'], 'token' => $project['token']), false, '', '', true) ?>
<?= $this->url->link(t('Public link'), 'task', 'readonly', array('task_id' => $task['id'], 'token' => $project['token']), false, '', '', true) ?>
</li>
<?php endif ?>

View File

@@ -8,8 +8,8 @@
</p>
<div class="form-actions">
<?= $this->a(t('Yes'), 'task', 'duplicate', array('task_id' => $task['id'], 'project_id' => $task['project_id'], 'confirmation' => 'yes'), true, 'btn btn-red') ?>
<?= $this->url->link(t('Yes'), 'task', 'duplicate', array('task_id' => $task['id'], 'project_id' => $task['project_id'], 'confirmation' => 'yes'), 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>

View File

@@ -6,18 +6,18 @@
<p class="alert"><?= t('No project') ?></p>
<?php else: ?>
<form method="post" action="<?= $this->u('task', 'copy', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?>" autocomplete="off">
<form method="post" action="<?= $this->url->href('task', 'copy', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?>" autocomplete="off">
<?= $this->formCsrf() ?>
<?= $this->form->csrf() ?>
<?= $this->formHidden('id', $values) ?>
<?= $this->formLabel(t('Project'), 'project_id') ?>
<?= $this->formSelect('project_id', $projects_list, $values, $errors) ?><br/>
<?= $this->form->hidden('id', $values) ?>
<?= $this->form->label(t('Project'), 'project_id') ?>
<?= $this->form->select('project_id', $projects_list, $values, $errors) ?><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>

View File

@@ -2,16 +2,16 @@
<h2><?= t('Edit a task') ?></h2>
</div>
<section id="task-section">
<form method="post" action="<?= $this->u('task', 'update', array('task_id' => $task['id'], 'project_id' => $task['project_id'], 'ajax' => $ajax)) ?>" autocomplete="off">
<form method="post" action="<?= $this->url->href('task', 'update', array('task_id' => $task['id'], 'project_id' => $task['project_id'], 'ajax' => $ajax)) ?>" autocomplete="off">
<?= $this->formCsrf() ?>
<?= $this->form->csrf() ?>
<div class="form-column">
<?= $this->formLabel(t('Title'), 'title') ?>
<?= $this->formText('title', $values, $errors, array('required', 'maxlength="200"')) ?><br/>
<?= $this->form->label(t('Title'), 'title') ?>
<?= $this->form->text('title', $values, $errors, array('required', 'maxlength="200"')) ?><br/>
<?= $this->formLabel(t('Description'), 'description') ?>
<?= $this->form->label(t('Description'), 'description') ?>
<div class="form-tabs">
<ul class="form-tabs-nav">
@@ -23,7 +23,7 @@
</li>
</ul>
<div class="write-area">
<?= $this->formTextarea('description', $values, $errors, array('placeholder="'.t('Leave a description').'"')) ?>
<?= $this->form->textarea('description', $values, $errors, array('placeholder="'.t('Leave a description').'"')) ?>
</div>
<div class="preview-area">
<div class="markdown"></div>
@@ -35,23 +35,23 @@
</div>
<div class="form-column">
<?= $this->formHidden('id', $values) ?>
<?= $this->formHidden('project_id', $values) ?>
<?= $this->form->hidden('id', $values) ?>
<?= $this->form->hidden('project_id', $values) ?>
<?= $this->formLabel(t('Assignee'), 'owner_id') ?>
<?= $this->formSelect('owner_id', $users_list, $values, $errors) ?><br/>
<?= $this->form->label(t('Assignee'), 'owner_id') ?>
<?= $this->form->select('owner_id', $users_list, $values, $errors) ?><br/>
<?= $this->formLabel(t('Category'), 'category_id') ?>
<?= $this->formSelect('category_id', $categories_list, $values, $errors) ?><br/>
<?= $this->form->label(t('Category'), 'category_id') ?>
<?= $this->form->select('category_id', $categories_list, $values, $errors) ?><br/>
<?= $this->formLabel(t('Color'), 'color_id') ?>
<?= $this->formSelect('color_id', $colors_list, $values, $errors) ?><br/>
<?= $this->form->label(t('Color'), 'color_id') ?>
<?= $this->form->select('color_id', $colors_list, $values, $errors) ?><br/>
<?= $this->formLabel(t('Complexity'), 'score') ?>
<?= $this->formNumber('score', $values, $errors) ?><br/>
<?= $this->form->label(t('Complexity'), 'score') ?>
<?= $this->form->number('score', $values, $errors) ?><br/>
<?= $this->formLabel(t('Due Date'), 'date_due') ?>
<?= $this->formText('date_due', $values, $errors, array('placeholder="'.$this->inList($date_format, $date_formats).'"'), 'form-date') ?><br/>
<?= $this->form->label(t('Due Date'), 'date_due') ?>
<?= $this->form->text('date_due', $values, $errors, array('placeholder="'.$this->text->in($date_format, $date_formats).'"'), 'form-date') ?><br/>
<div class="form-help"><?= t('Others formats accepted: %s and %s', date('Y-m-d'), date('Y_m_d')) ?></div>
</div>
@@ -59,9 +59,9 @@
<input type="submit" value="<?= t('Save') ?>" class="btn btn-blue"/>
<?= t('or') ?>
<?php if ($ajax): ?>
<?= $this->a(t('cancel'), 'board', 'show', array('project_id' => $task['project_id']), false, 'close-popover') ?>
<?= $this->url->link(t('cancel'), 'board', 'show', array('project_id' => $task['project_id']), false, 'close-popover') ?>
<?php else: ?>
<?= $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'])) ?>
<?php endif ?>
</div>
</form>

View File

@@ -2,10 +2,10 @@
<h2><?= t('Edit the description') ?></h2>
</div>
<form method="post" action="<?= $this->u('task', 'description', array('task_id' => $task['id'], 'project_id' => $task['project_id'], 'ajax' => $ajax)) ?>" autocomplete="off">
<form method="post" action="<?= $this->url->href('task', 'description', array('task_id' => $task['id'], 'project_id' => $task['project_id'], 'ajax' => $ajax)) ?>" autocomplete="off">
<?= $this->formCsrf() ?>
<?= $this->formHidden('id', $values) ?>
<?= $this->form->csrf() ?>
<?= $this->form->hidden('id', $values) ?>
<div class="form-tabs">
<ul class="form-tabs-nav">
@@ -17,7 +17,7 @@
</li>
</ul>
<div class="write-area">
<?= $this->formTextarea('description', $values, $errors, array('autofocus', 'placeholder="'.t('Leave a description').'"'), 'description-textarea') ?>
<?= $this->form->textarea('description', $values, $errors, array('autofocus', 'placeholder="'.t('Leave a description').'"'), 'description-textarea') ?>
</div>
<div class="preview-area">
<div class="markdown"></div>
@@ -30,9 +30,9 @@
<input type="submit" value="<?= t('Save') ?>" class="btn btn-blue"/>
<?= t('or') ?>
<?php if ($ajax): ?>
<?= $this->a(t('cancel'), 'board', 'show', array('project_id' => $task['project_id'])) ?>
<?= $this->url->link(t('cancel'), 'board', 'show', array('project_id' => $task['project_id'])) ?>
<?php else: ?>
<?= $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'])) ?>
<?php endif ?>
</div>
</form>

View File

@@ -15,36 +15,36 @@
<?php if ($task['recurrence_status'] != \Model\Task::RECURRING_STATUS_PROCESSED): ?>
<form method="post" action="<?= $this->u('task', 'recurrence', array('task_id' => $task['id'], 'project_id' => $task['project_id'], 'ajax' => $ajax)) ?>" autocomplete="off">
<form method="post" action="<?= $this->url->href('task', 'recurrence', array('task_id' => $task['id'], 'project_id' => $task['project_id'], 'ajax' => $ajax)) ?>" autocomplete="off">
<?= $this->formCsrf() ?>
<?= $this->form->csrf() ?>
<?= $this->formHidden('id', $values) ?>
<?= $this->formHidden('project_id', $values) ?>
<?= $this->form->hidden('id', $values) ?>
<?= $this->form->hidden('project_id', $values) ?>
<?= $this->formLabel(t('Generate recurrent task'), 'recurrence_status') ?>
<?= $this->formSelect('recurrence_status', $recurrence_status_list, $values, $errors) ?>
<?= $this->form->label(t('Generate recurrent task'), 'recurrence_status') ?>
<?= $this->form->select('recurrence_status', $recurrence_status_list, $values, $errors) ?>
<?= $this->formLabel(t('Trigger to generate recurrent task'), 'recurrence_trigger') ?>
<?= $this->formSelect('recurrence_trigger', $recurrence_trigger_list, $values, $errors) ?>
<?= $this->form->label(t('Trigger to generate recurrent task'), 'recurrence_trigger') ?>
<?= $this->form->select('recurrence_trigger', $recurrence_trigger_list, $values, $errors) ?>
<?= $this->formLabel(t('Factor to calculate new due date'), 'recurrence_factor') ?>
<?= $this->formNumber('recurrence_factor', $values, $errors) ?>
<?= $this->form->label(t('Factor to calculate new due date'), 'recurrence_factor') ?>
<?= $this->form->number('recurrence_factor', $values, $errors) ?>
<?= $this->formLabel(t('Timeframe to calculate new due date'), 'recurrence_timeframe') ?>
<?= $this->formSelect('recurrence_timeframe', $recurrence_timeframe_list, $values, $errors) ?>
<?= $this->form->label(t('Timeframe to calculate new due date'), 'recurrence_timeframe') ?>
<?= $this->form->select('recurrence_timeframe', $recurrence_timeframe_list, $values, $errors) ?>
<?= $this->formLabel(t('Base date to calculate new due date'), 'recurrence_basedate') ?>
<?= $this->formSelect('recurrence_basedate', $recurrence_basedate_list, $values, $errors) ?>
<?= $this->form->label(t('Base date to calculate new due date'), 'recurrence_basedate') ?>
<?= $this->form->select('recurrence_basedate', $recurrence_basedate_list, $values, $errors) ?>
<div class="form-actions">
<input type="submit" value="<?= t('Save') ?>" class="btn btn-blue"/>
<?= t('or') ?>
<?php if ($ajax): ?>
<?= $this->a(t('cancel'), 'board', 'show', array('project_id' => $task['project_id'])) ?>
<?= $this->url->link(t('cancel'), 'board', 'show', array('project_id' => $task['project_id'])) ?>
<?php else: ?>
<?= $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'])) ?>
<?php endif ?>
</div>
</form>

View File

@@ -3,11 +3,11 @@
<ul>
<li>
<i class="fa fa-table fa-fw"></i>
<?= $this->a(t('Back to the board'), 'board', 'show', array('project_id' => $task['project_id'])) ?>
<?= $this->url->link(t('Back to the board'), 'board', 'show', array('project_id' => $task['project_id'])) ?>
</li>
<li>
<i class="fa fa-calendar fa-fw"></i>
<?= $this->a(t('Calendar'), 'calendar', 'show', array('project_id' => $task['project_id'])) ?>
<?= $this->url->link(t('Calendar'), 'calendar', 'show', array('project_id' => $task['project_id'])) ?>
</li>
</ul>
</div>

View File

@@ -6,18 +6,18 @@
<p class="alert"><?= t('No project') ?></p>
<?php else: ?>
<form method="post" action="<?= $this->u('task', 'move', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?>" autocomplete="off">
<form method="post" action="<?= $this->url->href('task', 'move', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?>" autocomplete="off">
<?= $this->formCsrf() ?>
<?= $this->form->csrf() ?>
<?= $this->formHidden('id', $values) ?>
<?= $this->formLabel(t('Project'), 'project_id') ?>
<?= $this->formSelect('project_id', $projects_list, $values, $errors) ?><br/>
<?= $this->form->hidden('id', $values) ?>
<?= $this->form->label(t('Project'), 'project_id') ?>
<?= $this->form->select('project_id', $projects_list, $values, $errors) ?><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>

View File

@@ -1,7 +1,7 @@
<?php if (! $ajax): ?>
<div class="page-header">
<ul>
<li><i class="fa fa-table fa-fw"></i><?= $this->a(t('Back to the board'), 'board', 'show', array('project_id' => $values['project_id'])) ?></li>
<li><i class="fa fa-table fa-fw"></i><?= $this->url->link(t('Back to the board'), 'board', 'show', array('project_id' => $values['project_id'])) ?></li>
</ul>
</div>
<?php else: ?>
@@ -11,15 +11,15 @@
<?php endif ?>
<section id="task-section">
<form method="post" action="<?= $this->u('task', 'save', array('project_id' => $values['project_id'])) ?>" autocomplete="off">
<form method="post" action="<?= $this->url->href('task', 'save', array('project_id' => $values['project_id'])) ?>" autocomplete="off">
<?= $this->formCsrf() ?>
<?= $this->form->csrf() ?>
<div class="form-column">
<?= $this->formLabel(t('Title'), 'title') ?>
<?= $this->formText('title', $values, $errors, array('autofocus', 'required', 'maxlength="200"'), 'form-input-large') ?><br/>
<?= $this->form->label(t('Title'), 'title') ?>
<?= $this->form->text('title', $values, $errors, array('autofocus', 'required', 'maxlength="200"'), 'form-input-large') ?><br/>
<?= $this->formLabel(t('Description'), 'description') ?>
<?= $this->form->label(t('Description'), 'description') ?>
<div class="form-tabs">
<ul class="form-tabs-nav">
@@ -31,7 +31,7 @@
</li>
</ul>
<div class="write-area">
<?= $this->formTextarea('description', $values, $errors, array('placeholder="'.t('Leave a description').'"')) ?>
<?= $this->form->textarea('description', $values, $errors, array('placeholder="'.t('Leave a description').'"')) ?>
</div>
<div class="preview-area">
<div class="markdown"></div>
@@ -41,44 +41,44 @@
<div class="form-help"><a href="http://kanboard.net/documentation/syntax-guide" target="_blank" rel="noreferrer"><?= t('Write your text in Markdown') ?></a></div>
<?php if (! isset($duplicate)): ?>
<?= $this->formCheckbox('another_task', t('Create another task'), 1, isset($values['another_task']) && $values['another_task'] == 1) ?>
<?= $this->form->checkbox('another_task', t('Create another task'), 1, isset($values['another_task']) && $values['another_task'] == 1) ?>
<?php endif ?>
</div>
<div class="form-column">
<?= $this->formHidden('project_id', $values) ?>
<?= $this->form->hidden('project_id', $values) ?>
<?= $this->formLabel(t('Assignee'), 'owner_id') ?>
<?= $this->formSelect('owner_id', $users_list, $values, $errors) ?><br/>
<?= $this->form->label(t('Assignee'), 'owner_id') ?>
<?= $this->form->select('owner_id', $users_list, $values, $errors) ?><br/>
<?= $this->formLabel(t('Category'), 'category_id') ?>
<?= $this->formSelect('category_id', $categories_list, $values, $errors) ?><br/>
<?= $this->form->label(t('Category'), 'category_id') ?>
<?= $this->form->select('category_id', $categories_list, $values, $errors) ?><br/>
<?php if (! (count($swimlanes_list) === 1 && key($swimlanes_list) === 0)): ?>
<?= $this->formLabel(t('Swimlane'), 'swimlane_id') ?>
<?= $this->formSelect('swimlane_id', $swimlanes_list, $values, $errors) ?><br/>
<?= $this->form->label(t('Swimlane'), 'swimlane_id') ?>
<?= $this->form->select('swimlane_id', $swimlanes_list, $values, $errors) ?><br/>
<?php endif ?>
<?= $this->formLabel(t('Column'), 'column_id') ?>
<?= $this->formSelect('column_id', $columns_list, $values, $errors) ?><br/>
<?= $this->form->label(t('Column'), 'column_id') ?>
<?= $this->form->select('column_id', $columns_list, $values, $errors) ?><br/>
<?= $this->formLabel(t('Color'), 'color_id') ?>
<?= $this->formSelect('color_id', $colors_list, $values, $errors) ?><br/>
<?= $this->form->label(t('Color'), 'color_id') ?>
<?= $this->form->select('color_id', $colors_list, $values, $errors) ?><br/>
<?= $this->formLabel(t('Complexity'), 'score') ?>
<?= $this->formNumber('score', $values, $errors) ?><br/>
<?= $this->form->label(t('Complexity'), 'score') ?>
<?= $this->form->number('score', $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('Due Date'), 'date_due') ?>
<?= $this->formText('date_due', $values, $errors, array('placeholder="'.$this->inList($date_format, $date_formats).'"'), 'form-date') ?><br/>
<?= $this->form->label(t('Due Date'), 'date_due') ?>
<?= $this->form->text('date_due', $values, $errors, array('placeholder="'.$this->text->in($date_format, $date_formats).'"'), 'form-date') ?><br/>
<div class="form-help"><?= t('Others formats accepted: %s and %s', date('Y-m-d'), date('Y_m_d')) ?></div>
</div>
<div class="form-actions">
<input type="submit" value="<?= t('Save') ?>" class="btn btn-blue"/>
<?= t('or') ?> <?= $this->a(t('cancel'), 'board', 'show', array('project_id' => $values['project_id']), false, 'close-popover') ?>
<?= t('or') ?> <?= $this->url->link(t('cancel'), 'board', 'show', array('project_id' => $values['project_id']), false, 'close-popover') ?>
</div>
</form>
</section>

View File

@@ -8,8 +8,8 @@
</p>
<div class="form-actions">
<?= $this->a(t('Yes'), 'task', 'open', array('task_id' => $task['id'], 'project_id' => $task['project_id'], 'confirmation' => 'yes'), true, 'btn btn-red') ?>
<?= $this->url->link(t('Yes'), 'task', 'open', array('task_id' => $task['id'], 'project_id' => $task['project_id'], 'confirmation' => 'yes'), 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>

View File

@@ -2,7 +2,7 @@
<?= $this->render('task/details', array('task' => $task, 'project' => $project, 'not_editable' => true)) ?>
<p class="pull-right"><?= $this->a(t('Back to the board'), 'board', 'readonly', array('token' => $project['token'])) ?></p>
<p class="pull-right"><?= $this->url->link(t('Back to the board'), 'board', 'readonly', array('token' => $project['token'])) ?></p>
<?= $this->render('task/show_description', array(
'task' => $task,

View File

@@ -24,13 +24,13 @@
<?php if ($task['recurrence_parent']): ?>
<li>
<?= t('This task has been created by: ') ?>
<?= $this->a('#'.$task['recurrence_parent'], 'task', 'show', array('task_id' => $task['recurrence_parent'], 'project_id' => $task['project_id'])) ?>
<?= $this->url->link('#'.$task['recurrence_parent'], 'task', 'show', array('task_id' => $task['recurrence_parent'], 'project_id' => $task['project_id'])) ?>
</li>
<?php endif ?>
<?php if ($task['recurrence_child']): ?>
<li>
<?= t('This task has created this child task: ') ?>
<?= $this->a('#'.$task['recurrence_child'], 'task', 'show', array('task_id' => $task['recurrence_child'], 'project_id' => $task['project_id'])) ?>
<?= $this->url->link('#'.$task['recurrence_child'], 'task', 'show', array('task_id' => $task['recurrence_child'], 'project_id' => $task['project_id'])) ?>
</li>
<?php endif ?>
<?php endif ?>

View File

@@ -8,8 +8,8 @@
</p>
<div class="form-actions">
<?= $this->a(t('Yes'), 'task', 'remove', array('task_id' => $task['id'], 'project_id' => $task['project_id'], 'confirmation' => 'yes'), true, 'btn btn-red') ?>
<?= $this->url->link(t('Yes'), 'task', 'remove', array('task_id' => $task['id'], 'project_id' => $task['project_id'], 'confirmation' => 'yes'), 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>

View File

@@ -1,9 +1,9 @@
<?= $this->render('task/details', array(
'task' => $task,
'project' => $project,
'recurrence_trigger_list' => $this->task->getRecurrenceTriggerList(),
'recurrence_timeframe_list' => $this->task->getRecurrenceTimeframeList(),
'recurrence_basedate_list' => $this->task->getRecurrenceBasedateList(),
'recurrence_trigger_list' => $this->task->recurrenceTriggers(),
'recurrence_timeframe_list' => $this->task->recurrenceTimeframes(),
'recurrence_basedate_list' => $this->task->recurrenceBasedates(),
)) ?>
<?= $this->render('task/time', array('task' => $task, 'values' => $values, 'date_format' => $date_format, 'date_formats' => $date_formats)) ?>

View File

@@ -6,7 +6,7 @@
<article class="markdown task-show-description">
<?php if (! isset($is_public)): ?>
<?= $this->markdown(
<?= $this->text->markdown(
$task['description'],
array(
'controller' => 'task',
@@ -17,7 +17,7 @@
)
) ?>
<?php else: ?>
<?= $this->markdown(
<?= $this->text->markdown(
$task['description'],
array(
'controller' => 'task',

View File

@@ -2,65 +2,65 @@
<h2><?= t('Information') ?></h2>
<ul>
<li>
<?= $this->a(t('Summary'), 'task', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?>
<?= $this->url->link(t('Summary'), 'task', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?>
</li>
<li>
<?= $this->a(t('Activity stream'), 'task', 'activites', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?>
<?= $this->url->link(t('Activity stream'), 'task', 'activites', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?>
</li>
<li>
<?= $this->a(t('Transitions'), 'task', 'transitions', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?>
<?= $this->url->link(t('Transitions'), 'task', 'transitions', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?>
</li>
<?php if ($task['time_estimated'] > 0 || $task['time_spent'] > 0): ?>
<li>
<?= $this->a(t('Time tracking'), 'task', 'timesheet', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?>
<?= $this->url->link(t('Time tracking'), 'task', 'timesheet', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?>
</li>
<?php endif ?>
</ul>
<h2><?= t('Actions') ?></h2>
<ul>
<li>
<?= $this->a(t('Edit the task'), 'task', 'edit', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?>
<?= $this->url->link(t('Edit the task'), 'task', 'edit', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?>
</li>
<li>
<?= $this->a(t('Edit the description'), 'task', 'description', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?>
<?= $this->url->link(t('Edit the description'), 'task', 'description', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?>
</li>
<li>
<?= $this->a(t('Edit recurrence'), 'task', 'recurrence', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?>
<?= $this->url->link(t('Edit recurrence'), 'task', 'recurrence', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?>
</li>
<li>
<?= $this->a(t('Add a sub-task'), 'subtask', 'create', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?>
<?= $this->url->link(t('Add a sub-task'), 'subtask', 'create', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?>
</li>
<li>
<?= $this->a(t('Add a link'), 'tasklink', 'create', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?>
<?= $this->url->link(t('Add a link'), 'tasklink', 'create', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?>
</li>
<li>
<?= $this->a(t('Add a comment'), 'comment', 'create', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?>
<?= $this->url->link(t('Add a comment'), 'comment', 'create', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?>
</li>
<li>
<?= $this->a(t('Attach a document'), 'file', 'create', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?>
<?= $this->url->link(t('Attach a document'), 'file', 'create', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?>
</li>
<li>
<?= $this->a(t('Add a screenshot'), 'file', 'screenshot', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?>
<?= $this->url->link(t('Add a screenshot'), 'file', 'screenshot', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?>
</li>
<li>
<?= $this->a(t('Duplicate'), 'task', 'duplicate', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?>
<?= $this->url->link(t('Duplicate'), 'task', 'duplicate', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?>
</li>
<li>
<?= $this->a(t('Duplicate to another project'), 'task', 'copy', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?>
<?= $this->url->link(t('Duplicate to another project'), 'task', 'copy', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?>
</li>
<li>
<?= $this->a(t('Move to another project'), 'task', 'move', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?>
<?= $this->url->link(t('Move to another project'), 'task', 'move', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?>
</li>
<li>
<?php if ($task['is_active'] == 1): ?>
<?= $this->a(t('Close this task'), 'task', 'close', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?>
<?= $this->url->link(t('Close this task'), 'task', 'close', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?>
<?php else: ?>
<?= $this->a(t('Open this task'), 'task', 'open', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?>
<?= $this->url->link(t('Open this task'), 'task', 'open', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?>
<?php endif ?>
</li>
<?php if ($this->taskPermission->canRemoveTask($task)): ?>
<?php if ($this->task->canRemove($task)): ?>
<li>
<?= $this->a(t('Remove'), 'task', 'remove', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?>
<?= $this->url->link(t('Remove'), 'task', 'remove', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?>
</li>
<?php endif ?>
</ul>

View File

@@ -13,16 +13,16 @@
<?php foreach ($paginator->getCollection() as $task): ?>
<tr>
<td class="task-table color-<?= $task['color_id'] ?>">
<?= $this->a('#'.$this->e($task['id']), 'task', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id']), false, '', t('View this task')) ?>
<?= $this->url->link('#'.$this->e($task['id']), 'task', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id']), false, '', t('View this task')) ?>
</td>
<td>
<?= $this->inList($task['column_id'], $columns) ?>
<?= $this->text->in($task['column_id'], $columns) ?>
</td>
<td>
<?= $this->inList($task['category_id'], $categories, '') ?>
<?= $this->text->in($task['category_id'], $categories, '') ?>
</td>
<td>
<?= $this->a($this->e($task['title']), 'task', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id']), false, '', t('View this task')) ?>
<?= $this->url->link($this->e($task['title']), 'task', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id']), false, '', t('View this task')) ?>
</td>
<td>
<?php if ($task['assignee_username']): ?>

View File

@@ -1,15 +1,15 @@
<form method="post" action="<?= $this->u('task', 'time', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?>" class="form-inline task-time-form" autocomplete="off">
<?= $this->formCsrf() ?>
<?= $this->formHidden('id', $values) ?>
<form method="post" action="<?= $this->url->href('task', 'time', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?>" class="form-inline task-time-form" autocomplete="off">
<?= $this->form->csrf() ?>
<?= $this->form->hidden('id', $values) ?>
<?= $this->formLabel(t('Start date'), 'date_started') ?>
<?= $this->formText('date_started', $values, array(), array('placeholder="'.$this->inList($date_format, $date_formats).'"'), 'form-date') ?>
<?= $this->form->label(t('Start date'), 'date_started') ?>
<?= $this->form->text('date_started', $values, array(), array('placeholder="'.$this->text->in($date_format, $date_formats).'"'), 'form-date') ?>
<?= $this->formLabel(t('Time estimated'), 'time_estimated') ?>
<?= $this->formNumeric('time_estimated', $values, array(), array('placeholder="'.t('hours').'"')) ?>
<?= $this->form->label(t('Time estimated'), 'time_estimated') ?>
<?= $this->form->numeric('time_estimated', $values, array(), array('placeholder="'.t('hours').'"')) ?>
<?= $this->formLabel(t('Time spent'), 'time_spent') ?>
<?= $this->formNumeric('time_spent', $values, array(), array('placeholder="'.t('hours').'"')) ?>
<?= $this->form->label(t('Time spent'), 'time_spent') ?>
<?= $this->form->numeric('time_spent', $values, array(), array('placeholder="'.t('hours').'"')) ?>
<input type="submit" value="<?= t('Save') ?>" class="btn btn-blue"/>
</form>

View File

@@ -14,7 +14,7 @@
</tr>
<?php foreach ($subtask_paginator->getCollection() as $record): ?>
<tr>
<td><?= $this->a($this->e($record['user_fullname'] ?: $record['username']), 'user', 'show', array('user_id' => $record['user_id'])) ?></td>
<td><?= $this->url->link($this->e($record['user_fullname'] ?: $record['username']), 'user', 'show', array('user_id' => $record['user_id'])) ?></td>
<td><?= t($record['subtask_title']) ?></td>
<td><?= dt('%B %e, %Y at %k:%M %p', $record['start']) ?></td>
<td><?= dt('%B %e, %Y at %k:%M %p', $record['end']) ?></td>

View File

@@ -18,7 +18,7 @@
<td><?= dt('%B %e, %Y at %k:%M %p', $transition['date']) ?></td>
<td><?= $this->e($transition['src_column']) ?></td>
<td><?= $this->e($transition['dst_column']) ?></td>
<td><?= $this->a($this->e($transition['name'] ?: $transition['username']), 'user', 'show', array('user_id' => $transition['user_id'])) ?></td>
<td><?= $this->url->link($this->e($transition['name'] ?: $transition['username']), 'user', 'show', array('user_id' => $transition['user_id'])) ?></td>
<td><?= n(round($transition['time_spent'] / 3600, 2)).' '.t('hours') ?></td>
</tr>
<?php endforeach ?>