Helper refactoring

This commit is contained in:
Frederic Guillot
2016-03-04 20:10:34 -05:00
parent f32507d423
commit 8f3e2b2e5c
141 changed files with 562 additions and 445 deletions

View File

@@ -26,10 +26,10 @@
<span class="board-column-title">
<?php if ($not_editable): ?>
<?= $this->e($column['title']) ?>
<?= $this->text->e($column['title']) ?>
<?php else: ?>
<span class="dropdown">
<a href="#" class="dropdown-menu"><?= $this->e($column['title']) ?> <i class="fa fa-caret-down"></i></a>
<a href="#" class="dropdown-menu"><?= $this->text->e($column['title']) ?> <i class="fa fa-caret-down"></i></a>
<ul>
<li>
<i class="fa fa-minus-square fa-fw"></i>
@@ -47,7 +47,7 @@
</span>
<?php if (! $not_editable && ! empty($column['description'])): ?>
<span class="tooltip pull-right" title='<?= $this->e($this->text->markdown($column['description'])) ?>'>
<span class="tooltip pull-right" title='<?= $this->text->e($this->text->markdown($column['description'])) ?>'>
&nbsp;<i class="fa fa-info-circle"></i>
</span>
<?php endif ?>
@@ -60,7 +60,7 @@
<?php if ($column['task_limit']): ?>
<span title="<?= t('Task limit') ?>">
(<span id="task-number-column-<?= $column['id'] ?>"><?= $column['nb_tasks'] ?></span>/<?= $this->e($column['task_limit']) ?>)
(<span id="task-number-column-<?= $column['id'] ?>"><?= $column['nb_tasks'] ?></span>/<?= $this->text->e($column['task_limit']) ?>)
</span>
<?php else: ?>
<span title="<?= t('Task count') ?>" class="board-column-header-task-count">

View File

@@ -8,7 +8,7 @@
</a>
<?php endif ?>
<?= $this->e($swimlane['name']) ?>
<?= $this->text->e($swimlane['name']) ?>
<?php if (! $not_editable && ! empty($swimlane['description'])): ?>
<span

View File

@@ -22,7 +22,7 @@
<div class="board-column-collapsed">
<div class="board-rotation-wrapper">
<div class="board-column-title board-rotation board-toggle-column-view" data-column-id="<?= $column['id'] ?>" title="<?= t('Show this column') ?>">
<i class="fa fa-plus-square tooltip" title="<?= $this->e($column['title']) ?>"></i> <?= $this->e($column['title']) ?>
<i class="fa fa-plus-square tooltip" title="<?= $this->text->e($column['title']) ?>"></i> <?= $this->text->e($column['title']) ?>
</div>
</div>
</div>

View File

@@ -2,10 +2,10 @@
<div class="task-board-category-container">
<span class="task-board-category">
<?php if ($not_editable): ?>
<?= $this->e($task['category_name']) ?>
<?= $this->text->e($task['category_name']) ?>
<?php else: ?>
<?= $this->url->link(
$this->e($task['category_name']),
$this->text->e($task['category_name']),
'boardPopover',
'changeCategory',
array('task_id' => $task['id'], 'project_id' => $task['project_id']),
@@ -61,11 +61,11 @@
<?php endif ?>
<?php if ($task['score']): ?>
<span class="task-score"><?= $this->e($task['score']) ?></span>
<span class="task-score"><?= $this->text->e($task['score']) ?></span>
<?php endif ?>
<?php if (! empty($task['time_estimated'])): ?>
<span class="task-time-estimated" title="<?= t('Time estimated') ?>"><?= $this->e($task['time_estimated']).'h' ?></span>
<span class="task-time-estimated" title="<?= t('Time estimated') ?>"><?= $this->text->e($task['time_estimated']).'h' ?></span>
<?php endif ?>
<?php if ($task['is_milestone'] == 1): ?>

View File

@@ -23,11 +23,11 @@
<?php endif ?>
<?php if (! empty($task['assignee_username'])): ?>
<span title="<?= $this->e($task['assignee_name'] ?: $task['assignee_username']) ?>">
<?= $this->e($this->user->getInitials($task['assignee_name'] ?: $task['assignee_username'])) ?>
<span title="<?= $this->text->e($task['assignee_name'] ?: $task['assignee_username']) ?>">
<?= $this->text->e($this->user->getInitials($task['assignee_name'] ?: $task['assignee_username'])) ?>
</span> -
<?php endif ?>
<?= $this->url->link($this->e($task['title']), 'task', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id']), false, 'task-board-collapsed-title tooltip', $this->e($task['title'])) ?>
<?= $this->url->link($this->text->e($task['title']), 'task', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id']), false, 'task-board-collapsed-title tooltip', $this->text->e($task['title'])) ?>
</div>
<?php else: ?>
<div class="task-board-expanded">
@@ -57,7 +57,7 @@
t('Change assignee')
) ?>
<?php else: ?>
<?= $this->e($task['assignee_name'] ?: $task['assignee_username']) ?>
<?= $this->text->e($task['assignee_name'] ?: $task['assignee_username']) ?>
<?php endif ?>
</span>
<?php endif ?>
@@ -72,7 +72,7 @@
<?php endif ?>
<div class="task-board-title">
<?= $this->url->link($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->text->e($task['title']), 'task', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id']), false, '', t('View this task')) ?>
</div>
<?= $this->render('board/task_footer', array(

View File

@@ -19,7 +19,7 @@
</span>
<div class="task-board-title">
<?= $this->url->link($this->e($task['title']), 'task', 'readonly', array('task_id' => $task['id'], 'token' => $project['token'])) ?>
<?= $this->url->link($this->text->e($task['title']), 'task', 'readonly', array('task_id' => $task['id'], 'token' => $project['token'])) ?>
</div>
<?= $this->render('board/task_footer', array(

View File

@@ -2,7 +2,7 @@
<?php foreach ($comments as $comment): ?>
<p class="comment-title">
<?php if (! empty($comment['username'])): ?>
<span class="comment-username"><?= $this->e($comment['name'] ?: $comment['username']) ?></span> @
<span class="comment-username"><?= $this->text->e($comment['name'] ?: $comment['username']) ?></span> @
<?php endif ?>
<span class="comment-date"><?= $this->dt->datetime($comment['date_creation']) ?></span>
</p>

View File

@@ -10,10 +10,10 @@
<?= $link['type'] ?>
</td>
<td>
<a href="<?= $link['url'] ?>" target="_blank"><?= $this->e($link['title']) ?></a>
<a href="<?= $link['url'] ?>" target="_blank"><?= $this->text->e($link['title']) ?></a>
</td>
<td>
<?= $this->e($link['dependency_label']) ?>
<?= $this->text->e($link['dependency_label']) ?>
</td>
</tr>
<?php endforeach ?>

View File

@@ -3,7 +3,7 @@
<tr>
<th>
<i class="fa <?= $this->file->icon($file['name']) ?> fa-fw"></i>
<?= $this->e($file['name']) ?>
<?= $this->text->e($file['name']) ?>
</th>
</tr>
<tr>

View File

@@ -6,7 +6,7 @@
</td>
<td>
<?php if (! empty($subtask['username'])): ?>
<?= $this->e($subtask['name'] ?: $subtask['username']) ?>
<?= $this->text->e($subtask['name'] ?: $subtask['username']) ?>
<?php endif ?>
</td>
</tr>

View File

@@ -6,13 +6,13 @@
<dd>
<span class="progress"><?= $this->task->getProgress($link).'%' ?></span>
<?= $this->url->link(
$this->e('#'.$link['task_id'].' '.$link['title']),
$this->text->e('#'.$link['task_id'].' '.$link['title']),
'task', 'show', array('task_id' => $link['task_id'], 'project_id' => $link['project_id']),
false,
$link['is_active'] ? '' : 'task-link-closed'
) ?>
<?php if (! empty($link['task_assignee_username'])): ?>
[<?= $this->e($link['task_assignee_name'] ?: $link['task_assignee_username']) ?>]
[<?= $this->text->e($link['task_assignee_name'] ?: $link['task_assignee_username']) ?>]
<?php endif ?>
<?php if ($task['project_id'] != $link['project_id']): ?>
(<i><?= $link['project_name'] ?></i>)