diff options
141 files changed, 559 insertions, 442 deletions
diff --git a/app/Controller/Base.php b/app/Controller/Base.php index 884c439c..2453be18 100644 --- a/app/Controller/Base.php +++ b/app/Controller/Base.php @@ -331,7 +331,7 @@ abstract class Base extends \Kanboard\Core\Base protected function getProjectDescription(array &$project) { if ($project['owner_id'] > 0) { - $description = t('Project owner: ').'**'.$this->template->e($project['owner_name'] ?: $project['owner_username']).'**'.PHP_EOL.PHP_EOL; + $description = t('Project owner: ').'**'.$this->helper->text->e($project['owner_name'] ?: $project['owner_username']).'**'.PHP_EOL.PHP_EOL; if (! empty($project['description'])) { $description .= '***'.PHP_EOL.PHP_EOL; diff --git a/app/Core/Helper.php b/app/Core/Helper.php index 759209f6..3764a67c 100644 --- a/app/Core/Helper.php +++ b/app/Core/Helper.php @@ -10,18 +10,18 @@ use Pimple\Container; * @package core * @author Frederic Guillot * - * @property \Kanboard\Helper\App $app - * @property \Kanboard\Helper\Asset $asset - * @property \Kanboard\Helper\Dt $dt - * @property \Kanboard\Helper\File $file - * @property \Kanboard\Helper\Form $form - * @property \Kanboard\Helper\Subtask $subtask - * @property \Kanboard\Helper\Task $task - * @property \Kanboard\Helper\Text $text - * @property \Kanboard\Helper\Url $url - * @property \Kanboard\Helper\User $user - * @property \Kanboard\Helper\Layout $layout - * @property \Kanboard\Helper\Model $model + * @property \Kanboard\Helper\AppHelper $app + * @property \Kanboard\Helper\AssetHelper $asset + * @property \Kanboard\Helper\DateHelper $dt + * @property \Kanboard\Helper\FileHelper $file + * @property \Kanboard\Helper\FormHelper $form + * @property \Kanboard\Helper\ModelHelper $model + * @property \Kanboard\Helper\SubtaskHelper $subtask + * @property \Kanboard\Helper\TaskHelper $task + * @property \Kanboard\Helper\TextHelper $text + * @property \Kanboard\Helper\UrlHelper $url + * @property \Kanboard\Helper\UserHelper $user + * @property \Kanboard\Helper\LayoutHelper $layout */ class Helper { @@ -29,17 +29,17 @@ class Helper * Helper instances * * @access private - * @var array + * @var \Pimple\Container */ - private $helpers = array(); + private $helpers; /** * Container instance * - * @access protected + * @access private * @var \Pimple\Container */ - protected $container; + private $container; /** * Constructor @@ -50,33 +50,49 @@ class Helper public function __construct(Container $container) { $this->container = $container; + $this->helpers = new Container; } /** - * Load automatically helpers + * Expose helpers with magic getter * * @access public - * @param string $name Helper name + * @param string $helper * @return mixed */ - public function __get($name) + public function __get($helper) { - if (! isset($this->helpers[$name])) { - $class = '\Kanboard\Helper\\'.ucfirst($name); - $this->helpers[$name] = new $class($this->container); - } + return $this->getHelper($helper); + } - return $this->helpers[$name]; + /** + * Expose helpers with method + * + * @access public + * @param string $helper + * @return mixed + */ + public function getHelper($helper) + { + return $this->helpers[$helper]; } /** - * HTML escaping + * Register a new Helper * - * @param string $value Value to escape - * @return string + * @access public + * @param string $property + * @param string $className + * @return Helper */ - public function e($value) + public function register($property, $className) { - return htmlspecialchars($value, ENT_QUOTES, 'UTF-8', false); + $container = $this->container; + + $this->helpers[$property] = function() use($className, $container) { + return new $className($container); + }; + + return $this; } } diff --git a/app/Core/Template.php b/app/Core/Template.php index 8ded6f7c..fa7b65ec 100644 --- a/app/Core/Template.php +++ b/app/Core/Template.php @@ -3,63 +3,50 @@ namespace Kanboard\Core; /** - * Template class + * Template * * @package core * @author Frederic Guillot */ -class Template extends Helper +class Template { /** - * List of template overrides + * Helper object * * @access private - * @var array + * @var Helper */ - private $overrides = array(); + private $helper; /** - * Rendering start time - * - * @access private - * @var float - */ - private $startTime = 0; - - /** - * Total rendering time + * List of template overrides * * @access private - * @var float + * @var array */ - private $renderingTime = 0; + private $overrides = array(); /** - * Method executed before the rendering + * Template constructor * - * @access protected - * @param string $template + * @access public + * @param Helper $helper */ - protected function beforeRender($template) + public function __construct(Helper $helper) { - if (DEBUG) { - $this->startTime = microtime(true); - } + $this->helper = $helper; } /** - * Method executed after the rendering + * Expose helpers with magic getter * - * @access protected - * @param string $template + * @access public + * @param string $helper + * @return mixed */ - protected function afterRender($template) + public function __get($helper) { - if (DEBUG) { - $duration = microtime(true) - $this->startTime; - $this->renderingTime += $duration; - $this->container['logger']->debug('Rendering '.$template.' in '.$duration.'s, total='.$this->renderingTime); - } + return $this->helper->getHelper($helper); } /** @@ -76,16 +63,10 @@ class Template extends Helper */ public function render($__template_name, array $__template_args = array()) { - $this->beforeRender($__template_name); - extract($__template_args); ob_start(); include $this->getTemplateFile($__template_name); - $html = ob_get_clean(); - - $this->afterRender($__template_name); - - return $html; + return ob_get_clean(); } /** diff --git a/app/Helper/App.php b/app/Helper/AppHelper.php index 79afa5b9..e6f6412d 100644 --- a/app/Helper/App.php +++ b/app/Helper/AppHelper.php @@ -5,12 +5,12 @@ namespace Kanboard\Helper; use Kanboard\Core\Base; /** - * Application helpers + * Application Helper * * @package helper * @author Frederic Guillot */ -class App extends Base +class AppHelper extends Base { /** * Get config variable @@ -116,11 +116,11 @@ class App extends Base $failure_message = $this->flash->getMessage('failure'); if (! empty($success_message)) { - return '<div class="alert alert-success alert-fade-out">'.$this->helper->e($success_message).'</div>'; + return '<div class="alert alert-success alert-fade-out">'.$this->helper->text->e($success_message).'</div>'; } if (! empty($failure_message)) { - return '<div class="alert alert-error">'.$this->helper->e($failure_message).'</div>'; + return '<div class="alert alert-error">'.$this->helper->text->e($failure_message).'</div>'; } return ''; diff --git a/app/Helper/Asset.php b/app/Helper/AssetHelperHelper.php index c4178e8c..7040a40a 100644 --- a/app/Helper/Asset.php +++ b/app/Helper/AssetHelperHelper.php @@ -2,13 +2,15 @@ namespace Kanboard\Helper; +use Kanboard\Core\Base; + /** - * Assets helpers + * Asset Helper * * @package helper * @author Frederic Guillot */ -class Asset extends \Kanboard\Core\Base +class AssetHelper extends Base { /** * Add a Javascript asset diff --git a/app/Helper/Board.php b/app/Helper/BoardHelper.php index 430d1858..a86a6c18 100644 --- a/app/Helper/Board.php +++ b/app/Helper/BoardHelper.php @@ -2,13 +2,15 @@ namespace Kanboard\Helper; +use Kanboard\Core\Base; + /** * Board Helper * * @package helper * @author Frederic Guillot */ -class Board extends \Kanboard\Core\Base +class BoardHelper extends Base { /** * Return true if tasks are collapsed diff --git a/app/Helper/Dt.php b/app/Helper/DateHelper.php index eb3f93b3..3844ce64 100644 --- a/app/Helper/Dt.php +++ b/app/Helper/DateHelper.php @@ -3,6 +3,7 @@ namespace Kanboard\Helper; use DateTime; +use Kanboard\Core\Base; /** * DateTime helpers @@ -10,7 +11,7 @@ use DateTime; * @package helper * @author Frederic Guillot */ -class Dt extends \Kanboard\Core\Base +class DateHelper extends Base { /** * Get formatted time diff --git a/app/Helper/File.php b/app/Helper/FileHelper.php index b493e64f..cabf371c 100644 --- a/app/Helper/File.php +++ b/app/Helper/FileHelper.php @@ -2,13 +2,15 @@ namespace Kanboard\Helper; +use Kanboard\Core\Base; + /** * File helpers * * @package helper * @author Frederic Guillot */ -class File extends \Kanboard\Core\Base +class FileHelper extends Base { /** * Get file icon diff --git a/app/Helper/Form.php b/app/Helper/FormHelper.php index bfd75ee3..161fd54c 100644 --- a/app/Helper/Form.php +++ b/app/Helper/FormHelper.php @@ -10,7 +10,7 @@ use Kanboard\Core\Base; * @package helper * @author Frederic Guillot */ -class Form extends Base +class FormHelper extends Base { /** * Hidden CSRF token field @@ -52,7 +52,7 @@ class Form extends Base $html = '<select name="'.$name.'" id="form-'.$name.'" class="'.$class.'" '.implode(' ', $attributes).'>'; foreach ($options as $id => $value) { - $html .= '<option value="'.$this->helper->e($id).'"'; + $html .= '<option value="'.$this->helper->text->e($id).'"'; if (isset($values->$name) && $id == $values->$name) { $html .= ' selected="selected"'; @@ -61,7 +61,7 @@ class Form extends Base $html .= ' selected="selected"'; } - $html .= '>'.$this->helper->e($value).'</option>'; + $html .= '>'.$this->helper->text->e($value).'</option>'; } $html .= '</select>'; @@ -103,7 +103,7 @@ class Form extends Base */ public function radio($name, $label, $value, $selected = false, $class = '') { - return '<label><input type="radio" name="'.$name.'" class="'.$class.'" value="'.$this->helper->e($value).'" '.($selected ? 'checked="checked"' : '').'> '.$this->helper->e($label).'</label>'; + return '<label><input type="radio" name="'.$name.'" class="'.$class.'" value="'.$this->helper->text->e($value).'" '.($selected ? 'checked="checked"' : '').'> '.$this->helper->text->e($label).'</label>'; } /** @@ -139,7 +139,7 @@ class Form extends Base */ public function checkbox($name, $label, $value, $checked = false, $class = '') { - return '<label><input type="checkbox" name="'.$name.'" class="'.$class.'" value="'.$this->helper->e($value).'" '.($checked ? 'checked="checked"' : '').'> '.$this->helper->e($label).'</label>'; + return '<label><input type="checkbox" name="'.$name.'" class="'.$class.'" value="'.$this->helper->text->e($value).'" '.($checked ? 'checked="checked"' : '').'> '.$this->helper->text->e($label).'</label>'; } /** @@ -153,7 +153,7 @@ class Form extends Base */ public function label($label, $name, array $attributes = array()) { - return '<label for="form-'.$name.'" '.implode(' ', $attributes).'>'.$this->helper->e($label).'</label>'; + return '<label for="form-'.$name.'" '.implode(' ', $attributes).'>'.$this->helper->text->e($label).'</label>'; } /** @@ -173,7 +173,7 @@ class Form extends Base $html = '<textarea name="'.$name.'" id="form-'.$name.'" class="'.$class.'" '; $html .= implode(' ', $attributes).'>'; - $html .= isset($values->$name) ? $this->helper->e($values->$name) : isset($values[$name]) ? $values[$name] : ''; + $html .= isset($values->$name) ? $this->helper->text->e($values->$name) : isset($values[$name]) ? $values[$name] : ''; $html .= '</textarea>'; $html .= $this->errorList($errors, $name); @@ -334,7 +334,7 @@ class Form extends Base $html .= '<ul class="form-errors">'; foreach ($errors[$name] as $error) { - $html .= '<li>'.$this->helper->e($error).'</li>'; + $html .= '<li>'.$this->helper->text->e($error).'</li>'; } $html .= '</ul>'; @@ -354,9 +354,9 @@ class Form extends Base private function formValue($values, $name) { if (isset($values->$name)) { - return 'value="'.$this->helper->e($values->$name).'"'; + return 'value="'.$this->helper->text->e($values->$name).'"'; } - return isset($values[$name]) ? 'value="'.$this->helper->e($values[$name]).'"' : ''; + return isset($values[$name]) ? 'value="'.$this->helper->text->e($values[$name]).'"' : ''; } } diff --git a/app/Helper/Hook.php b/app/Helper/HookHelper.php index 7b691949..e8abc875 100644 --- a/app/Helper/Hook.php +++ b/app/Helper/HookHelper.php @@ -2,13 +2,15 @@ namespace Kanboard\Helper; +use Kanboard\Core\Base; + /** * Template Hook helpers * * @package helper * @author Frederic Guillot */ -class Hook extends \Kanboard\Core\Base +class HookHelper extends Base { /** * Add assets JS or CSS diff --git a/app/Helper/Layout.php b/app/Helper/LayoutHelper.php index 3db23920..064c11ac 100644 --- a/app/Helper/Layout.php +++ b/app/Helper/LayoutHelper.php @@ -10,7 +10,7 @@ use Kanboard\Core\Base; * @package helper * @author Frederic Guillot */ -class Layout extends Base +class LayoutHelper extends Base { /** * Render a template without the layout if Ajax request diff --git a/app/Helper/Model.php b/app/Helper/ModelHelper.php index 68a52542..d49637c8 100644 --- a/app/Helper/Model.php +++ b/app/Helper/ModelHelper.php @@ -10,7 +10,7 @@ use Kanboard\Core\Base; * @package helper * @author Frederic Guillot */ -class Model extends Base +class ModelHelper extends Base { /** * Remove keys from an array diff --git a/app/Helper/Subtask.php b/app/Helper/SubtaskHelper.php index 1784a2bf..afa3c14e 100644 --- a/app/Helper/Subtask.php +++ b/app/Helper/SubtaskHelper.php @@ -2,13 +2,15 @@ namespace Kanboard\Helper; +use Kanboard\Core\Base; + /** * Subtask helpers * * @package helper * @author Frederic Guillot */ -class Subtask extends \Kanboard\Core\Base +class SubtaskHelper extends Base { public function getTitle(array $subtask) { @@ -20,7 +22,7 @@ class Subtask extends \Kanboard\Core\Base $html = '<i class="fa fa-check-square-o fa-fw"></i>'; } - return $html.$this->helper->e($subtask['title']); + return $html.$this->helper->text->e($subtask['title']); } /** diff --git a/app/Helper/Task.php b/app/Helper/TaskHelper.php index 6058c099..4857d0ee 100644 --- a/app/Helper/Task.php +++ b/app/Helper/TaskHelper.php @@ -10,7 +10,7 @@ use Kanboard\Core\Base; * @package helper * @author Frederic Guillot */ -class Task extends Base +class TaskHelper extends Base { /** * Local cache for project columns diff --git a/app/Helper/Text.php b/app/Helper/TextHelper.php index 83f1e3f9..e5aefdcf 100644 --- a/app/Helper/Text.php +++ b/app/Helper/TextHelper.php @@ -11,9 +11,20 @@ use Kanboard\Core\Base; * @package helper * @author Frederic Guillot */ -class Text extends Base +class TextHelper extends Base { /** + * HTML escaping + * + * @param string $value Value to escape + * @return string + */ + public function e($value) + { + return htmlspecialchars($value, ENT_QUOTES, 'UTF-8', false); + } + + /** * Markdown transformation * * @param string $text Markdown content @@ -88,7 +99,7 @@ class Text extends Base public function in($id, array $listing, $default_value = '?') { if (isset($listing[$id])) { - return $this->helper->e($listing[$id]); + return $this->helper->text->e($listing[$id]); } return $default_value; diff --git a/app/Helper/Url.php b/app/Helper/UrlHelper.php index 7de8a571..96c6735a 100644 --- a/app/Helper/Url.php +++ b/app/Helper/UrlHelper.php @@ -5,12 +5,12 @@ namespace Kanboard\Helper; use Kanboard\Core\Base; /** - * Url helpers + * Url Helper * * @package helper * @author Frederic Guillot */ -class Url extends Base +class UrlHelper extends Base { private $base = ''; private $directory = ''; diff --git a/app/Helper/User.php b/app/Helper/UserHelper.php index 29844dfb..cbdb4af8 100644 --- a/app/Helper/User.php +++ b/app/Helper/UserHelper.php @@ -2,13 +2,15 @@ namespace Kanboard\Helper; +use Kanboard\Core\Base; + /** * User helpers * * @package helper * @author Frederic Guillot */ -class User extends \Kanboard\Core\Base +class UserHelper extends Base { /** * Return true if the logged user as unread notifications @@ -168,7 +170,7 @@ class User extends \Kanboard\Core\Base public function avatar($email, $alt = '') { if (! empty($email) && $this->config->get('integration_gravatar') == 1) { - return '<img class="avatar" src="https://www.gravatar.com/avatar/'.md5(strtolower($email)).'?s=25" alt="'.$this->helper->e($alt).'" title="'.$this->helper->e($alt).'">'; + return '<img class="avatar" src="https://www.gravatar.com/avatar/'.md5(strtolower($email)).'?s=25" alt="'.$this->helper->text->e($alt).'" title="'.$this->helper->text->e($alt).'">'; } return ''; diff --git a/app/ServiceProvider/ClassProvider.php b/app/ServiceProvider/ClassProvider.php index f939a9b5..b883c905 100644 --- a/app/ServiceProvider/ClassProvider.php +++ b/app/ServiceProvider/ClassProvider.php @@ -117,9 +117,7 @@ class ClassProvider implements ServiceProviderInterface ), 'Core' => array( 'DateParser', - 'Helper', 'Lexer', - 'Template', ), 'Core\Event' => array( 'EventManager', diff --git a/app/ServiceProvider/HelperProvider.php b/app/ServiceProvider/HelperProvider.php new file mode 100644 index 00000000..42a0c85e --- /dev/null +++ b/app/ServiceProvider/HelperProvider.php @@ -0,0 +1,34 @@ +<?php + +namespace Kanboard\ServiceProvider; + +use Kanboard\Core\Helper; +use Kanboard\Core\Template; +use Pimple\Container; +use Pimple\ServiceProviderInterface; + +class HelperProvider implements ServiceProviderInterface +{ + public function register(Container $container) + { + $container['helper'] = new Helper($container); + $container['helper']->register('app', '\Kanboard\Helper\AppHelper'); + $container['helper']->register('asset', '\Kanboard\Helper\AssetHelper'); + $container['helper']->register('board', '\Kanboard\Helper\BoardHelper'); + $container['helper']->register('dt', '\Kanboard\Helper\DateHelper'); + $container['helper']->register('file', '\Kanboard\Helper\FileHelper'); + $container['helper']->register('form', '\Kanboard\Helper\FormHelper'); + $container['helper']->register('hook', '\Kanboard\Helper\HookHelper'); + $container['helper']->register('layout', '\Kanboard\Helper\LayoutHelper'); + $container['helper']->register('model', '\Kanboard\Helper\ModelHelper'); + $container['helper']->register('subtask', '\Kanboard\Helper\SubtaskHelper'); + $container['helper']->register('task', '\Kanboard\Helper\TaskHelper'); + $container['helper']->register('text', '\Kanboard\Helper\TextHelper'); + $container['helper']->register('url', '\Kanboard\Helper\UrlHelper'); + $container['helper']->register('user', '\Kanboard\Helper\UserHelper'); + + $container['template'] = new Template($container['helper']); + + return $container; + } +} diff --git a/app/Template/action/index.php b/app/Template/action/index.php index 66cfed77..f3165251 100644 --- a/app/Template/action/index.php +++ b/app/Template/action/index.php @@ -45,7 +45,7 @@ <?php elseif ($this->text->contains($param_name, 'link_id')): ?> <?= $this->text->in($param_value, $links_list) ?> <?php else: ?> - <?= $this->e($param_value) ?> + <?= $this->text->e($param_value) ?> <?php endif ?> </strong> </li> diff --git a/app/Template/analytic/avg_time_columns.php b/app/Template/analytic/avg_time_columns.php index 7b9d7cf9..5f6c6b35 100644 --- a/app/Template/analytic/avg_time_columns.php +++ b/app/Template/analytic/avg_time_columns.php @@ -16,7 +16,7 @@ </tr> <?php foreach ($metrics as $column): ?> <tr> - <td><?= $this->e($column['title']) ?></td> + <td><?= $this->text->e($column['title']) ?></td> <td><?= $this->dt->duration($column['average']) ?></td> </tr> <?php endforeach ?> diff --git a/app/Template/analytic/compare_hours.php b/app/Template/analytic/compare_hours.php index bb145d61..8249e7ba 100644 --- a/app/Template/analytic/compare_hours.php +++ b/app/Template/analytic/compare_hours.php @@ -4,8 +4,8 @@ <div class="listing"> <ul> - <li><?= t('Estimated hours: ').'<strong>'.$this->e($metrics['open']['time_estimated'] + $metrics['closed']['time_estimated']) ?></strong></li> - <li><?= t('Actual hours: ').'<strong>'.$this->e($metrics['open']['time_spent'] + $metrics['closed']['time_spent']) ?></strong></li> + <li><?= t('Estimated hours: ').'<strong>'.$this->text->e($metrics['open']['time_estimated'] + $metrics['closed']['time_estimated']) ?></strong></li> + <li><?= t('Actual hours: ').'<strong>'.$this->text->e($metrics['open']['time_spent'] + $metrics['closed']['time_spent']) ?></strong></li> </ul> </div> @@ -34,10 +34,10 @@ <?php foreach ($paginator->getCollection() as $task): ?> <tr> <td class="task-table color-<?= $task['color_id'] ?>"> - <?= $this->url->link('#'.$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->text->e($task['id']), 'task', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id']), false, '', t('View this task')) ?> </td> <td> - <?= $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')) ?> </td> <td> <?php if ($task['is_active'] == \Kanboard\Model\Task::STATUS_OPEN): ?> @@ -47,10 +47,10 @@ <?php endif ?> </td> <td> - <?= $this->e($task['time_estimated']) ?> + <?= $this->text->e($task['time_estimated']) ?> </td> <td> - <?= $this->e($task['time_spent']) ?> + <?= $this->text->e($task['time_spent']) ?> </td> </tr> <?php endforeach ?> diff --git a/app/Template/analytic/tasks.php b/app/Template/analytic/tasks.php index 7392ee56..9e7b1fd7 100644 --- a/app/Template/analytic/tasks.php +++ b/app/Template/analytic/tasks.php @@ -18,7 +18,7 @@ <?php foreach ($metrics as $metric): ?> <tr> <td> - <?= $this->e($metric['column_title']) ?> + <?= $this->text->e($metric['column_title']) ?> </td> <td> <?= $metric['nb_tasks'] ?> diff --git a/app/Template/analytic/users.php b/app/Template/analytic/users.php index 514d7133..9d1d3a1e 100644 --- a/app/Template/analytic/users.php +++ b/app/Template/analytic/users.php @@ -18,7 +18,7 @@ <?php foreach ($metrics as $metric): ?> <tr> <td> - <?= $this->e($metric['user']) ?> + <?= $this->text->e($metric['user']) ?> </td> <td> <?= $metric['nb_tasks'] ?> diff --git a/app/Template/app/projects.php b/app/Template/app/projects.php index 61899c96..668b87c3 100644 --- a/app/Template/app/projects.php +++ b/app/Template/app/projects.php @@ -29,9 +29,9 @@ <?= $this->url->link('<i class="fa fa-list"></i>', 'listing', 'show', array('project_id' => $project['id']), false, 'dashboard-table-link', t('List')) ?> <?= $this->url->link('<i class="fa fa-calendar"></i>', 'calendar', 'show', array('project_id' => $project['id']), false, 'dashboard-table-link', t('Calendar')) ?> - <?= $this->url->link($this->e($project['name']), 'board', 'show', array('project_id' => $project['id'])) ?> + <?= $this->url->link($this->text->e($project['name']), 'board', 'show', array('project_id' => $project['id'])) ?> <?php if (! empty($project['description'])): ?> - <span class="tooltip" title='<?= $this->e($this->text->markdown($project['description'])) ?>'> + <span class="tooltip" title='<?= $this->text->e($this->text->markdown($project['description'])) ?>'> <i class="fa fa-info-circle"></i> </span> <?php endif ?> @@ -39,7 +39,7 @@ <td class="dashboard-project-stats"> <?php foreach ($project['columns'] as $column): ?> <strong title="<?= t('Task count') ?>"><?= $column['nb_tasks'] ?></strong> - <span><?= $this->e($column['title']) ?></span> + <span><?= $this->text->e($column['title']) ?></span> <?php endforeach ?> </td> </tr> diff --git a/app/Template/app/sidebar.php b/app/Template/app/sidebar.php index 3f0d988b..66d15b14 100644 --- a/app/Template/app/sidebar.php +++ b/app/Template/app/sidebar.php @@ -1,5 +1,5 @@ <div class="sidebar"> - <h2><?= $this->e($user['name'] ?: $user['username']) ?></h2> + <h2><?= $this->text->e($user['name'] ?: $user['username']) ?></h2> <ul> <li <?= $this->app->checkMenuSelection('app', 'index') ?>> <?= $this->url->link(t('Overview'), 'app', 'index', array('user_id' => $user['id'])) ?> diff --git a/app/Template/app/subtasks.php b/app/Template/app/subtasks.php index 6848112c..cca09481 100644 --- a/app/Template/app/subtasks.php +++ b/app/Template/app/subtasks.php @@ -18,21 +18,21 @@ <?= $this->render('task/dropdown', array('task' => array('id' => $subtask['task_id'], 'project_id' => $subtask['project_id']))) ?> </td> <td> - <?= $this->url->link($this->e($subtask['project_name']), 'board', 'show', array('project_id' => $subtask['project_id'])) ?> + <?= $this->url->link($this->text->e($subtask['project_name']), 'board', 'show', array('project_id' => $subtask['project_id'])) ?> </td> <td> - <?= $this->url->link($this->e($subtask['task_name']), 'task', 'show', array('task_id' => $subtask['task_id'], 'project_id' => $subtask['project_id'])) ?> + <?= $this->url->link($this->text->e($subtask['task_name']), 'task', 'show', array('task_id' => $subtask['task_id'], 'project_id' => $subtask['project_id'])) ?> </td> <td> <?= $this->subtask->toggleStatus($subtask, $subtask['project_id']) ?> </td> <td> <?php if (! empty($subtask['time_spent'])): ?> - <strong><?= $this->e($subtask['time_spent']).'h' ?></strong> <?= t('spent') ?> + <strong><?= $this->text->e($subtask['time_spent']).'h' ?></strong> <?= t('spent') ?> <?php endif ?> <?php if (! empty($subtask['time_estimated'])): ?> - <strong><?= $this->e($subtask['time_estimated']).'h' ?></strong> <?= t('estimated') ?> + <strong><?= $this->text->e($subtask['time_estimated']).'h' ?></strong> <?= t('estimated') ?> <?php endif ?> </td> </tr> diff --git a/app/Template/app/tasks.php b/app/Template/app/tasks.php index 786d7159..d7826fb7 100644 --- a/app/Template/app/tasks.php +++ b/app/Template/app/tasks.php @@ -18,18 +18,18 @@ <?= $this->render('task/dropdown', array('task' => $task)) ?> </td> <td> - <?= $this->url->link($this->e($task['project_name']), 'board', 'show', array('project_id' => $task['project_id'])) ?> + <?= $this->url->link($this->text->e($task['project_name']), 'board', 'show', array('project_id' => $task['project_id'])) ?> </td> <td> - <?= $this->url->link($this->e($task['title']), 'task', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?> + <?= $this->url->link($this->text->e($task['title']), 'task', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?> </td> <td> <?php if (! empty($task['time_spent'])): ?> - <strong><?= $this->e($task['time_spent']).'h' ?></strong> <?= t('spent') ?> + <strong><?= $this->text->e($task['time_spent']).'h' ?></strong> <?= t('spent') ?> <?php endif ?> <?php if (! empty($task['time_estimated'])): ?> - <strong><?= $this->e($task['time_estimated']).'h' ?></strong> <?= t('estimated') ?> + <strong><?= $this->text->e($task['time_estimated']).'h' ?></strong> <?= t('estimated') ?> <?php endif ?> </td> <td> diff --git a/app/Template/auth/index.php b/app/Template/auth/index.php index 41441e69..3fcb6bbf 100644 --- a/app/Template/auth/index.php +++ b/app/Template/auth/index.php @@ -3,7 +3,7 @@ <?= $this->hook->render('template:auth:login-form:before') ?> <?php if (isset($errors['login'])): ?> - <p class="alert alert-error"><?= $this->e($errors['login']) ?></p> + <p class="alert alert-error"><?= $this->text->e($errors['login']) ?></p> <?php endif ?> <?php if (! HIDE_LOGIN_FORM): ?> diff --git a/app/Template/board/table_column.php b/app/Template/board/table_column.php index 58dcaf32..48538c88 100644 --- a/app/Template/board/table_column.php +++ b/app/Template/board/table_column.php @@ -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'])) ?>'> <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"> diff --git a/app/Template/board/table_swimlane.php b/app/Template/board/table_swimlane.php index 44607859..349b9acb 100644 --- a/app/Template/board/table_swimlane.php +++ b/app/Template/board/table_swimlane.php @@ -8,7 +8,7 @@ </a> <?php endif ?> - <?= $this->e($swimlane['name']) ?> + <?= $this->text->e($swimlane['name']) ?> <?php if (! $not_editable && ! empty($swimlane['description'])): ?> <span diff --git a/app/Template/board/table_tasks.php b/app/Template/board/table_tasks.php index e99e14fb..fd9ce5e7 100644 --- a/app/Template/board/table_tasks.php +++ b/app/Template/board/table_tasks.php @@ -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> diff --git a/app/Template/board/task_footer.php b/app/Template/board/task_footer.php index 73e68602..d8b21a5b 100644 --- a/app/Template/board/task_footer.php +++ b/app/Template/board/task_footer.php @@ -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): ?> diff --git a/app/Template/board/task_private.php b/app/Template/board/task_private.php index 4880af00..50efe2f6 100644 --- a/app/Template/board/task_private.php +++ b/app/Template/board/task_private.php @@ -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( diff --git a/app/Template/board/task_public.php b/app/Template/board/task_public.php index d02722bb..9058f897 100644 --- a/app/Template/board/task_public.php +++ b/app/Template/board/task_public.php @@ -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( diff --git a/app/Template/board/tooltip_comments.php b/app/Template/board/tooltip_comments.php index ca91e13f..6665bc7d 100644 --- a/app/Template/board/tooltip_comments.php +++ b/app/Template/board/tooltip_comments.php @@ -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> diff --git a/app/Template/board/tooltip_external_links.php b/app/Template/board/tooltip_external_links.php index 7681c06c..24cd1d88 100644 --- a/app/Template/board/tooltip_external_links.php +++ b/app/Template/board/tooltip_external_links.php @@ -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 ?> diff --git a/app/Template/board/tooltip_files.php b/app/Template/board/tooltip_files.php index 4fa14b57..39823757 100644 --- a/app/Template/board/tooltip_files.php +++ b/app/Template/board/tooltip_files.php @@ -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> diff --git a/app/Template/board/tooltip_subtasks.php b/app/Template/board/tooltip_subtasks.php index dc076d26..126a319f 100644 --- a/app/Template/board/tooltip_subtasks.php +++ b/app/Template/board/tooltip_subtasks.php @@ -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> diff --git a/app/Template/board/tooltip_tasklinks.php b/app/Template/board/tooltip_tasklinks.php index b51f90ed..cabe43d8 100644 --- a/app/Template/board/tooltip_tasklinks.php +++ b/app/Template/board/tooltip_tasklinks.php @@ -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>) diff --git a/app/Template/category/index.php b/app/Template/category/index.php index e99b6d52..7b1adf78 100644 --- a/app/Template/category/index.php +++ b/app/Template/category/index.php @@ -9,7 +9,7 @@ </tr> <?php foreach ($categories as $category_id => $category_name): ?> <tr> - <td><?= $this->e($category_name) ?></td> + <td><?= $this->text->e($category_name) ?></td> <td> <div class="dropdown"> <a href="#" class="dropdown-menu dropdown-menu-link-icon"><i class="fa fa-cog fa-fw"></i><i class="fa fa-caret-down"></i></a> diff --git a/app/Template/column/index.php b/app/Template/column/index.php index 1aa44688..eef176f3 100644 --- a/app/Template/column/index.php +++ b/app/Template/column/index.php @@ -26,15 +26,15 @@ <tr data-column-id="<?= $column['id'] ?>"> <td> <i class="fa fa-arrows-alt draggable-row-handle" title="<?= t('Change column position') ?>"></i> - <?= $this->e($column['title']) ?> + <?= $this->text->e($column['title']) ?> <?php if (! empty($column['description'])): ?> - <span class="tooltip" title='<?= $this->e($this->text->markdown($column['description'])) ?>'> + <span class="tooltip" title='<?= $this->text->e($this->text->markdown($column['description'])) ?>'> <i class="fa fa-info-circle"></i> </span> <?php endif ?> </td> <td> - <?= $this->e($column['task_limit']) ?> + <?= $this->text->e($column['task_limit']) ?> </td> <td> <div class="dropdown"> diff --git a/app/Template/comment/show.php b/app/Template/comment/show.php index 2c9b426f..873e1470 100644 --- a/app/Template/comment/show.php +++ b/app/Template/comment/show.php @@ -6,7 +6,7 @@ <?php endif ?> <?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> diff --git a/app/Template/config/about.php b/app/Template/config/about.php index f8534029..968b109a 100644 --- a/app/Template/config/about.php +++ b/app/Template/config/about.php @@ -29,7 +29,7 @@ <ul> <li> <?= t('Database driver:') ?> - <strong><?= $this->e(DB_DRIVER) ?></strong> + <strong><?= $this->text->e(DB_DRIVER) ?></strong> </li> <?php if (DB_DRIVER === 'sqlite'): ?> <li> diff --git a/app/Template/config/api.php b/app/Template/config/api.php index 489f1968..3ebbb956 100644 --- a/app/Template/config/api.php +++ b/app/Template/config/api.php @@ -5,7 +5,7 @@ <ul> <li> <?= t('API token:') ?> - <strong><?= $this->e($values['api_token']) ?></strong> + <strong><?= $this->text->e($values['api_token']) ?></strong> </li> <li> <?= t('API endpoint:') ?> diff --git a/app/Template/config/plugins.php b/app/Template/config/plugins.php index 4a263ce7..04b3f095 100644 --- a/app/Template/config/plugins.php +++ b/app/Template/config/plugins.php @@ -17,14 +17,14 @@ <tr> <td> <?php if ($plugin->getPluginHomepage()): ?> - <a href="<?= $plugin->getPluginHomepage() ?>" target="_blank" rel="noreferrer"><?= $this->e($plugin->getPluginName()) ?></a> + <a href="<?= $plugin->getPluginHomepage() ?>" target="_blank" rel="noreferrer"><?= $this->text->e($plugin->getPluginName()) ?></a> <?php else: ?> - <?= $this->e($plugin->getPluginName()) ?> + <?= $this->text->e($plugin->getPluginName()) ?> <?php endif ?> </td> - <td><?= $this->e($plugin->getPluginAuthor()) ?></td> - <td><?= $this->e($plugin->getPluginVersion()) ?></td> - <td><?= $this->e($plugin->getPluginDescription()) ?></td> + <td><?= $this->text->e($plugin->getPluginAuthor()) ?></td> + <td><?= $this->text->e($plugin->getPluginVersion()) ?></td> + <td><?= $this->text->e($plugin->getPluginDescription()) ?></td> </tr> <?php endforeach ?> <?php endif ?>
\ No newline at end of file diff --git a/app/Template/config/webhook.php b/app/Template/config/webhook.php index f1a98f8b..bcf95787 100644 --- a/app/Template/config/webhook.php +++ b/app/Template/config/webhook.php @@ -22,7 +22,7 @@ <ul> <li> <?= t('Webhook token:') ?> - <strong><?= $this->e($values['webhook_token']) ?></strong> + <strong><?= $this->text->e($values['webhook_token']) ?></strong> </li> <li> <?= t('URL for task creation:') ?> diff --git a/app/Template/currency/index.php b/app/Template/currency/index.php index 07b58a8b..f3e20026 100644 --- a/app/Template/currency/index.php +++ b/app/Template/currency/index.php @@ -12,7 +12,7 @@ <?php foreach ($rates as $rate): ?> <tr> <td> - <strong><?= $this->e($rate['currency']) ?></strong> + <strong><?= $this->text->e($rate['currency']) ?></strong> </td> <td> <?= n($rate['rate']) ?> diff --git a/app/Template/custom_filter/index.php b/app/Template/custom_filter/index.php index 28b6a878..12a4eece 100644 --- a/app/Template/custom_filter/index.php +++ b/app/Template/custom_filter/index.php @@ -14,8 +14,8 @@ </tr> <?php foreach ($custom_filters as $filter): ?> <tr> - <td><?= $this->e($filter['name']) ?></td> - <td><?= $this->e($filter['filter']) ?></td> + <td><?= $this->text->e($filter['name']) ?></td> + <td><?= $this->text->e($filter['filter']) ?></td> <td> <?php if ($filter['is_shared'] == 1): ?> <?= t('Yes') ?> @@ -30,7 +30,7 @@ <?= t('Replace') ?> <?php endif ?> </td> - <td><?= $this->e($filter['owner_name'] ?: $filter['owner_username']) ?></td> + <td><?= $this->text->e($filter['owner_name'] ?: $filter['owner_username']) ?></td> <td> <?php if ($filter['user_id'] == $this->user->getId() || $this->user->hasProjectAccess('customfilter', 'edit', $project['id'])): ?> <div class="dropdown"> diff --git a/app/Template/event/comment_create.php b/app/Template/event/comment_create.php index 462f15ca..063736b3 100644 --- a/app/Template/event/comment_create.php +++ b/app/Template/event/comment_create.php @@ -2,11 +2,11 @@ <p class="activity-title"> <?= e('%s commented the task %s', - $this->e($author), + $this->text->e($author), $this->url->link(t('#%d', $task['id']), 'task', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ) ?> </p> <div class="activity-description"> - <em><?= $this->e($task['title']) ?></em><br/> + <em><?= $this->text->e($task['title']) ?></em><br/> <div class="markdown"><?= $this->text->markdown($comment['comment']) ?></div> </div>
\ No newline at end of file diff --git a/app/Template/event/comment_update.php b/app/Template/event/comment_update.php index 0cb10bf6..93f24d8a 100644 --- a/app/Template/event/comment_update.php +++ b/app/Template/event/comment_update.php @@ -2,10 +2,10 @@ <p class="activity-title"> <?= e('%s updated a comment on the task %s', - $this->e($author), + $this->text->e($author), $this->url->link(t('#%d', $task['id']), 'task', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ) ?> </p> <div class="activity-description"> - <em><?= $this->e($task['title']) ?></em><br/> + <em><?= $this->text->e($task['title']) ?></em><br/> </div>
\ No newline at end of file diff --git a/app/Template/event/subtask_create.php b/app/Template/event/subtask_create.php index ca23aa9c..532783d5 100644 --- a/app/Template/event/subtask_create.php +++ b/app/Template/event/subtask_create.php @@ -2,16 +2,16 @@ <p class="activity-title"> <?= e('%s created a subtask for the task %s', - $this->e($author), + $this->text->e($author), $this->url->link(t('#%d', $task['id']), 'task', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ) ?> </p> <div class="activity-description"> - <p><em><?= $this->e($task['title']) ?></em></p> + <p><em><?= $this->text->e($task['title']) ?></em></p> <ul> <li> - <?= $this->e($subtask['title']) ?> (<strong><?= $this->e($subtask['status_name']) ?></strong>) + <?= $this->text->e($subtask['title']) ?> (<strong><?= $this->text->e($subtask['status_name']) ?></strong>) </li> <li> <?php if ($subtask['username']): ?> diff --git a/app/Template/event/subtask_update.php b/app/Template/event/subtask_update.php index 11a778de..e9ff6ac6 100644 --- a/app/Template/event/subtask_update.php +++ b/app/Template/event/subtask_update.php @@ -2,16 +2,16 @@ <p class="activity-title"> <?= e('%s updated a subtask for the task %s', - $this->e($author), + $this->text->e($author), $this->url->link(t('#%d', $task['id']), 'task', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ) ?> </p> <div class="activity-description"> - <p><em><?= $this->e($task['title']) ?></em></p> + <p><em><?= $this->text->e($task['title']) ?></em></p> <ul> <li> - <?= $this->e($subtask['title']) ?> (<strong><?= $this->e($subtask['status_name']) ?></strong>) + <?= $this->text->e($subtask['title']) ?> (<strong><?= $this->text->e($subtask['status_name']) ?></strong>) </li> <li> <?php if ($subtask['username']): ?> diff --git a/app/Template/event/task_assignee_change.php b/app/Template/event/task_assignee_change.php index cdec8743..580176c7 100644 --- a/app/Template/event/task_assignee_change.php +++ b/app/Template/event/task_assignee_change.php @@ -5,14 +5,14 @@ <?php if (! empty($assignee)): ?> <?= e('%s changed the assignee of the task %s to %s', - $this->e($author), + $this->text->e($author), $this->url->link(t('#%d', $task['id']), 'task', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id'])), - $this->e($assignee) + $this->text->e($assignee) ) ?> <?php else: ?> - <?= e('%s remove the assignee of the task %s', $this->e($author), $this->url->link(t('#%d', $task['id']), 'task', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id']))) ?> + <?= e('%s remove the assignee of the task %s', $this->text->e($author), $this->url->link(t('#%d', $task['id']), 'task', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id']))) ?> <?php endif ?> </p> <p class="activity-description"> - <em><?= $this->e($task['title']) ?></em> + <em><?= $this->text->e($task['title']) ?></em> </p>
\ No newline at end of file diff --git a/app/Template/event/task_close.php b/app/Template/event/task_close.php index 3d8670a6..361458d3 100644 --- a/app/Template/event/task_close.php +++ b/app/Template/event/task_close.php @@ -2,10 +2,10 @@ <p class="activity-title"> <?= e('%s closed the task %s', - $this->e($author), + $this->text->e($author), $this->url->link(t('#%d', $task['id']), 'task', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ) ?> </p> <p class="activity-description"> - <em><?= $this->e($task['title']) ?></em> + <em><?= $this->text->e($task['title']) ?></em> </p>
\ No newline at end of file diff --git a/app/Template/event/task_create.php b/app/Template/event/task_create.php index 773f401c..655bf8f3 100644 --- a/app/Template/event/task_create.php +++ b/app/Template/event/task_create.php @@ -2,10 +2,10 @@ <p class="activity-title"> <?= e('%s created the task %s', - $this->e($author), + $this->text->e($author), $this->url->link(t('#%d', $task['id']), 'task', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ) ?> </p> <p class="activity-description"> - <em><?= $this->e($task['title']) ?></em> + <em><?= $this->text->e($task['title']) ?></em> </p>
\ No newline at end of file diff --git a/app/Template/event/task_file_create.php b/app/Template/event/task_file_create.php index 1a36bc8f..61bf3d61 100644 --- a/app/Template/event/task_file_create.php +++ b/app/Template/event/task_file_create.php @@ -2,10 +2,10 @@ <p class="activity-title"> <?= e('%s attached a new file to the task %s', - $this->e($author), + $this->text->e($author), $this->url->link(t('#%d', $task['id']), 'task', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ) ?> </p> <p class="activity-description"> - <em><?= $this->e($file['name']) ?></em> + <em><?= $this->text->e($file['name']) ?></em> </p>
\ No newline at end of file diff --git a/app/Template/event/task_move_column.php b/app/Template/event/task_move_column.php index ca482e46..904c956c 100644 --- a/app/Template/event/task_move_column.php +++ b/app/Template/event/task_move_column.php @@ -2,11 +2,11 @@ <p class="activity-title"> <?= e('%s moved the task %s to the column "%s"', - $this->e($author), + $this->text->e($author), $this->url->link(t('#%d', $task['id']), 'task', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id'])), - $this->e($task['column_title']) + $this->text->e($task['column_title']) ) ?> </p> <p class="activity-description"> - <em><?= $this->e($task['title']) ?></em> + <em><?= $this->text->e($task['title']) ?></em> </p>
\ No newline at end of file diff --git a/app/Template/event/task_move_position.php b/app/Template/event/task_move_position.php index dcdd3e1b..6580bb79 100644 --- a/app/Template/event/task_move_position.php +++ b/app/Template/event/task_move_position.php @@ -2,12 +2,12 @@ <p class="activity-title"> <?= e('%s moved the task %s to the position #%d in the column "%s"', - $this->e($author), + $this->text->e($author), $this->url->link(t('#%d', $task['id']), 'task', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id'])), $task['position'], - $this->e($task['column_title']) + $this->text->e($task['column_title']) ) ?> </p> <p class="activity-description"> - <em><?= $this->e($task['title']) ?></em> + <em><?= $this->text->e($task['title']) ?></em> </p>
\ No newline at end of file diff --git a/app/Template/event/task_move_swimlane.php b/app/Template/event/task_move_swimlane.php index ca440dbf..9ffa554c 100644 --- a/app/Template/event/task_move_swimlane.php +++ b/app/Template/event/task_move_swimlane.php @@ -3,17 +3,17 @@ <p class="activity-title"> <?php if ($task['swimlane_id'] == 0): ?> <?= e('%s moved the task %s to the first swimlane', - $this->e($author), + $this->text->e($author), $this->url->link(t('#%d', $task['id']), 'task', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ) ?> <?php else: ?> <?= e('%s moved the task %s to the swimlane "%s"', - $this->e($author), + $this->text->e($author), $this->url->link(t('#%d', $task['id']), 'task', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id'])), - $this->e($task['swimlane_name']) + $this->text->e($task['swimlane_name']) ) ?> <?php endif ?> </p> <p class="activity-description"> - <em><?= $this->e($task['title']) ?></em> + <em><?= $this->text->e($task['title']) ?></em> </p>
\ No newline at end of file diff --git a/app/Template/event/task_open.php b/app/Template/event/task_open.php index 11fec64b..9db2e3c9 100644 --- a/app/Template/event/task_open.php +++ b/app/Template/event/task_open.php @@ -2,10 +2,10 @@ <p class="activity-title"> <?= e('%s opened the task %s', - $this->e($author), + $this->text->e($author), $this->url->link(t('#%d', $task['id']), 'task', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ) ?> </p> <p class="activity-description"> - <em><?= $this->e($task['title']) ?></em> + <em><?= $this->text->e($task['title']) ?></em> </p>
\ No newline at end of file diff --git a/app/Template/event/task_update.php b/app/Template/event/task_update.php index e8254bcb..72d70495 100644 --- a/app/Template/event/task_update.php +++ b/app/Template/event/task_update.php @@ -2,12 +2,12 @@ <p class="activity-title"> <?= e('%s updated the task %s', - $this->e($author), + $this->text->e($author), $this->url->link(t('#%d', $task['id']), 'task', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ) ?> </p> <p class="activity-description"> - <em><?= $this->e($task['title']) ?></em> + <em><?= $this->text->e($task['title']) ?></em> <?php if (isset($changes)): ?> <div class="activity-changes"> <?= $this->render('task/changes', array('changes' => $changes, 'task' => $task)) ?> diff --git a/app/Template/feed/project.php b/app/Template/feed/project.php index 76cf6cf0..1c6d1166 100644 --- a/app/Template/feed/project.php +++ b/app/Template/feed/project.php @@ -15,7 +15,7 @@ <published><?= date(DATE_ATOM, $e['date_creation']) ?></published> <updated><?= date(DATE_ATOM, $e['date_creation']) ?></updated> <author> - <name><?= $this->e($e['author']) ?></name> + <name><?= $this->text->e($e['author']) ?></name> </author> <content type="html"> <![CDATA[ diff --git a/app/Template/feed/user.php b/app/Template/feed/user.php index 3e9606c6..28847f1f 100644 --- a/app/Template/feed/user.php +++ b/app/Template/feed/user.php @@ -15,7 +15,7 @@ <published><?= date(DATE_ATOM, $e['date_creation']) ?></published> <updated><?= date(DATE_ATOM, $e['date_creation']) ?></updated> <author> - <name><?= $this->e($e['author']) ?></name> + <name><?= $this->text->e($e['author']) ?></name> </author> <content type="html"> <![CDATA[ diff --git a/app/Template/file_viewer/show.php b/app/Template/file_viewer/show.php index c71ef91c..191aaa6c 100644 --- a/app/Template/file_viewer/show.php +++ b/app/Template/file_viewer/show.php @@ -1,9 +1,9 @@ <div class="page-header"> - <h2><?= $this->e($file['name']) ?></h2> + <h2><?= $this->text->e($file['name']) ?></h2> </div> <div class="file-viewer"> <?php if ($file['is_image']): ?> - <img src="<?= $this->url->href('FileViewer', 'image', $params) ?>" alt="<?= $this->e($file['name']) ?>"> + <img src="<?= $this->url->href('FileViewer', 'image', $params) ?>" alt="<?= $this->text->e($file['name']) ?>"> <?php elseif ($type === 'markdown'): ?> <article class="markdown"> <?= $this->text->markdown($content) ?> diff --git a/app/Template/group/index.php b/app/Template/group/index.php index d111b5d9..8302e5a8 100644 --- a/app/Template/group/index.php +++ b/app/Template/group/index.php @@ -21,10 +21,10 @@ #<?= $group['id'] ?> </td> <td> - <?= $this->e($group['external_id']) ?> + <?= $this->text->e($group['external_id']) ?> </td> <td> - <?= $this->e($group['name']) ?> + <?= $this->text->e($group['name']) ?> </td> <td> <div class="dropdown"> diff --git a/app/Template/group/users.php b/app/Template/group/users.php index f79cb9ad..bbd41525 100644 --- a/app/Template/group/users.php +++ b/app/Template/group/users.php @@ -22,13 +22,13 @@ <?= $this->url->link('#'.$user['id'], 'user', 'show', array('user_id' => $user['id'])) ?> </td> <td> - <?= $this->url->link($this->e($user['username']), 'user', 'show', array('user_id' => $user['id'])) ?> + <?= $this->url->link($this->text->e($user['username']), 'user', 'show', array('user_id' => $user['id'])) ?> </td> <td> - <?= $this->e($user['name']) ?> + <?= $this->text->e($user['name']) ?> </td> <td> - <a href="mailto:<?= $this->e($user['email']) ?>"><?= $this->e($user['email']) ?></a> + <a href="mailto:<?= $this->text->e($user['email']) ?>"><?= $this->text->e($user['email']) ?></a> </td> <td> <?= $this->url->link(t('Remove this user'), 'group', 'dissociate', array('group_id' => $group['id'], 'user_id' => $user['id'])) ?> diff --git a/app/Template/header.php b/app/Template/header.php index e646012a..d891118c 100644 --- a/app/Template/header.php +++ b/app/Template/header.php @@ -5,10 +5,10 @@ <?= $this->url->link('K<span>B</span>', 'app', 'index', array(), false, '', t('Dashboard')) ?> </span> <span class="title"> - <?= $this->e($title) ?> + <?= $this->text->e($title) ?> </span> <?php if (! empty($description)): ?> - <span class="tooltip" title='<?= $this->e($this->text->markdown($description)) ?>'> + <span class="tooltip" title='<?= $this->text->e($this->text->markdown($description)) ?>'> <i class="fa fa-info-circle"></i> </span> <?php endif ?> @@ -26,7 +26,7 @@ data-redirect-url="<?= $this->url->href('board', 'show', array('project_id' => 'PROJECT_ID')) ?>"> <option value=""></option> <?php foreach ($board_selector as $board_id => $board_name): ?> - <option value="<?= $board_id ?>"><?= $this->e($board_name) ?></option> + <option value="<?= $board_id ?>"><?= $this->text->e($board_name) ?></option> <?php endforeach ?> </select> </li> @@ -60,7 +60,7 @@ <div class="dropdown"> <a href="#" class="dropdown-menu dropdown-menu-link-icon"><i class="fa fa-user fa-fw"></i><i class="fa fa-caret-down"></i></a> <ul> - <li class="no-hover"><strong><?= $this->e($this->user->getFullname()) ?></strong></li> + <li class="no-hover"><strong><?= $this->text->e($this->user->getFullname()) ?></strong></li> <li> <i class="fa fa-tachometer fa-fw"></i> <?= $this->url->link(t('My dashboard'), 'app', 'index', array('user_id' => $this->user->getId())) ?> diff --git a/app/Template/layout.php b/app/Template/layout.php index 0c81aac2..a694a96a 100644 --- a/app/Template/layout.php +++ b/app/Template/layout.php @@ -30,7 +30,7 @@ <link rel="apple-touch-icon" sizes="114x114" href="<?= $this->url->dir() ?>assets/img/touch-icon-iphone-retina.png"> <link rel="apple-touch-icon" sizes="144x144" href="<?= $this->url->dir() ?>assets/img/touch-icon-ipad-retina.png"> - <title><?= isset($title) ? $this->e($title) : 'Kanboard' ?></title> + <title><?= isset($title) ? $this->text->e($title) : 'Kanboard' ?></title> <?= $this->hook->render('template:layout:head') ?> </head> diff --git a/app/Template/listing/show.php b/app/Template/listing/show.php index 9a5992e3..10dcedcc 100644 --- a/app/Template/listing/show.php +++ b/app/Template/listing/show.php @@ -27,20 +27,20 @@ <?= $this->render('task/dropdown', array('task' => $task)) ?> </td> <td> - <?= $this->e($task['swimlane_name'] ?: $task['default_swimlane']) ?> + <?= $this->text->e($task['swimlane_name'] ?: $task['default_swimlane']) ?> </td> <td> - <?= $this->e($task['column_name']) ?> + <?= $this->text->e($task['column_name']) ?> </td> <td> - <?= $this->e($task['category_name']) ?> + <?= $this->text->e($task['category_name']) ?> </td> <td> - <?= $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')) ?> </td> <td> <?php if ($task['assignee_username']): ?> - <?= $this->e($task['assignee_name'] ?: $task['assignee_username']) ?> + <?= $this->text->e($task['assignee_name'] ?: $task['assignee_username']) ?> <?php else: ?> <?= t('Unassigned') ?> <?php endif ?> diff --git a/app/Template/notification/comment_create.php b/app/Template/notification/comment_create.php index 2f2c0fa6..fefc8ba1 100644 --- a/app/Template/notification/comment_create.php +++ b/app/Template/notification/comment_create.php @@ -1,4 +1,4 @@ -<h2><?= $this->e($task['title']) ?> (#<?= $task['id'] ?>)</h2> +<h2><?= $this->text->e($task['title']) ?> (#<?= $task['id'] ?>)</h2> <?php if (! empty($comment['username'])): ?> <h3><?= t('New comment posted by %s', $comment['name'] ?: $comment['username']) ?></h3> diff --git a/app/Template/notification/comment_update.php b/app/Template/notification/comment_update.php index a15e5d6d..2477d8b3 100644 --- a/app/Template/notification/comment_update.php +++ b/app/Template/notification/comment_update.php @@ -1,4 +1,4 @@ -<h2><?= $this->e($task['title']) ?> (#<?= $task['id'] ?>)</h2> +<h2><?= $this->text->e($task['title']) ?> (#<?= $task['id'] ?>)</h2> <h3><?= t('Comment updated') ?></h3> diff --git a/app/Template/notification/comment_user_mention.php b/app/Template/notification/comment_user_mention.php index 59f5127e..372183df 100644 --- a/app/Template/notification/comment_user_mention.php +++ b/app/Template/notification/comment_user_mention.php @@ -1,6 +1,6 @@ <h2><?= t('You were mentioned in a comment on the task #%d', $task['id']) ?></h2> -<p><?= $this->e($task['title']) ?></p> +<p><?= $this->text->e($task['title']) ?></p> <?= $this->text->markdown($comment['comment']) ?> diff --git a/app/Template/notification/subtask_create.php b/app/Template/notification/subtask_create.php index e1c62b73..f6f8ba13 100644 --- a/app/Template/notification/subtask_create.php +++ b/app/Template/notification/subtask_create.php @@ -1,15 +1,15 @@ -<h2><?= $this->e($task['title']) ?> (#<?= $task['id'] ?>)</h2> +<h2><?= $this->text->e($task['title']) ?> (#<?= $task['id'] ?>)</h2> <h3><?= t('New sub-task') ?></h3> <ul> - <li><?= t('Title:') ?> <?= $this->e($subtask['title']) ?></li> - <li><?= t('Status:') ?> <?= $this->e($subtask['status_name']) ?></li> - <li><?= t('Assignee:') ?> <?= $this->e($subtask['name'] ?: $subtask['username'] ?: '?') ?></li> + <li><?= t('Title:') ?> <?= $this->text->e($subtask['title']) ?></li> + <li><?= t('Status:') ?> <?= $this->text->e($subtask['status_name']) ?></li> + <li><?= t('Assignee:') ?> <?= $this->text->e($subtask['name'] ?: $subtask['username'] ?: '?') ?></li> <li> <?= t('Time tracking:') ?> <?php if (! empty($subtask['time_estimated'])): ?> - <strong><?= $this->e($subtask['time_estimated']).'h' ?></strong> <?= t('estimated') ?> + <strong><?= $this->text->e($subtask['time_estimated']).'h' ?></strong> <?= t('estimated') ?> <?php endif ?> </li> </ul> diff --git a/app/Template/notification/subtask_update.php b/app/Template/notification/subtask_update.php index cfde9db6..e6785f2c 100644 --- a/app/Template/notification/subtask_update.php +++ b/app/Template/notification/subtask_update.php @@ -1,19 +1,19 @@ -<h2><?= $this->e($task['title']) ?> (#<?= $task['id'] ?>)</h2> +<h2><?= $this->text->e($task['title']) ?> (#<?= $task['id'] ?>)</h2> <h3><?= t('Sub-task updated') ?></h3> <ul> - <li><?= t('Title:') ?> <?= $this->e($subtask['title']) ?></li> - <li><?= t('Status:') ?> <?= $this->e($subtask['status_name']) ?></li> - <li><?= t('Assignee:') ?> <?= $this->e($subtask['name'] ?: $subtask['username'] ?: '?') ?></li> + <li><?= t('Title:') ?> <?= $this->text->e($subtask['title']) ?></li> + <li><?= t('Status:') ?> <?= $this->text->e($subtask['status_name']) ?></li> + <li><?= t('Assignee:') ?> <?= $this->text->e($subtask['name'] ?: $subtask['username'] ?: '?') ?></li> <li> <?= t('Time tracking:') ?> <?php if (! empty($subtask['time_spent'])): ?> - <strong><?= $this->e($subtask['time_spent']).'h' ?></strong> <?= t('spent') ?> + <strong><?= $this->text->e($subtask['time_spent']).'h' ?></strong> <?= t('spent') ?> <?php endif ?> <?php if (! empty($subtask['time_estimated'])): ?> - <strong><?= $this->e($subtask['time_estimated']).'h' ?></strong> <?= t('estimated') ?> + <strong><?= $this->text->e($subtask['time_estimated']).'h' ?></strong> <?= t('estimated') ?> <?php endif ?> </li> </ul> diff --git a/app/Template/notification/task_assignee_change.php b/app/Template/notification/task_assignee_change.php index c9729ac9..53f7c5c1 100644 --- a/app/Template/notification/task_assignee_change.php +++ b/app/Template/notification/task_assignee_change.php @@ -1,4 +1,4 @@ -<h2><?= $this->e($task['title']) ?> (#<?= $task['id'] ?>)</h2> +<h2><?= $this->text->e($task['title']) ?> (#<?= $task['id'] ?>)</h2> <ul> <li> diff --git a/app/Template/notification/task_close.php b/app/Template/notification/task_close.php index 463223a0..4202e092 100644 --- a/app/Template/notification/task_close.php +++ b/app/Template/notification/task_close.php @@ -1,4 +1,4 @@ -<h2><?= $this->e($task['title']) ?> (#<?= $task['id'] ?>)</h2> +<h2><?= $this->text->e($task['title']) ?> (#<?= $task['id'] ?>)</h2> <p><?= t('The task #%d have been closed.', $task['id']) ?></p> diff --git a/app/Template/notification/task_create.php b/app/Template/notification/task_create.php index fb7898fc..3cd68ac0 100644 --- a/app/Template/notification/task_create.php +++ b/app/Template/notification/task_create.php @@ -1,4 +1,4 @@ -<h2><?= $this->e($task['title']) ?> (#<?= $task['id'] ?>)</h2> +<h2><?= $this->text->e($task['title']) ?> (#<?= $task['id'] ?>)</h2> <ul> <li> @@ -25,12 +25,12 @@ </li> <li> <?= t('Column on the board:') ?> - <strong><?= $this->e($task['column_title']) ?></strong> + <strong><?= $this->text->e($task['column_title']) ?></strong> </li> - <li><?= t('Task position:').' '.$this->e($task['position']) ?></li> + <li><?= t('Task position:').' '.$this->text->e($task['position']) ?></li> <?php if (! empty($task['category_name'])): ?> <li> - <?= t('Category:') ?> <strong><?= $this->e($task['category_name']) ?></strong> + <?= t('Category:') ?> <strong><?= $this->text->e($task['category_name']) ?></strong> </li> <?php endif ?> </ul> diff --git a/app/Template/notification/task_file_create.php b/app/Template/notification/task_file_create.php index 63f7d1b8..feab8dd2 100644 --- a/app/Template/notification/task_file_create.php +++ b/app/Template/notification/task_file_create.php @@ -1,4 +1,4 @@ -<h2><?= $this->e($task['title']) ?> (#<?= $task['id'] ?>)</h2> +<h2><?= $this->text->e($task['title']) ?> (#<?= $task['id'] ?>)</h2> <p><?= t('New attachment added "%s"', $file['name']) ?></p> diff --git a/app/Template/notification/task_move_column.php b/app/Template/notification/task_move_column.php index 88ab8ab5..263adebf 100644 --- a/app/Template/notification/task_move_column.php +++ b/app/Template/notification/task_move_column.php @@ -1,11 +1,11 @@ -<h2><?= $this->e($task['title']) ?> (#<?= $task['id'] ?>)</h2> +<h2><?= $this->text->e($task['title']) ?> (#<?= $task['id'] ?>)</h2> <ul> <li> <?= t('Column on the board:') ?> - <strong><?= $this->e($task['column_title']) ?></strong> + <strong><?= $this->text->e($task['column_title']) ?></strong> </li> - <li><?= t('Task position:').' '.$this->e($task['position']) ?></li> + <li><?= t('Task position:').' '.$this->text->e($task['position']) ?></li> </ul> <?= $this->render('notification/footer', array('task' => $task, 'application_url' => $application_url)) ?>
\ No newline at end of file diff --git a/app/Template/notification/task_move_position.php b/app/Template/notification/task_move_position.php index 88ab8ab5..263adebf 100644 --- a/app/Template/notification/task_move_position.php +++ b/app/Template/notification/task_move_position.php @@ -1,11 +1,11 @@ -<h2><?= $this->e($task['title']) ?> (#<?= $task['id'] ?>)</h2> +<h2><?= $this->text->e($task['title']) ?> (#<?= $task['id'] ?>)</h2> <ul> <li> <?= t('Column on the board:') ?> - <strong><?= $this->e($task['column_title']) ?></strong> + <strong><?= $this->text->e($task['column_title']) ?></strong> </li> - <li><?= t('Task position:').' '.$this->e($task['position']) ?></li> + <li><?= t('Task position:').' '.$this->text->e($task['position']) ?></li> </ul> <?= $this->render('notification/footer', array('task' => $task, 'application_url' => $application_url)) ?>
\ No newline at end of file diff --git a/app/Template/notification/task_move_swimlane.php b/app/Template/notification/task_move_swimlane.php index 04de7cc6..cbbd620d 100644 --- a/app/Template/notification/task_move_swimlane.php +++ b/app/Template/notification/task_move_swimlane.php @@ -1,4 +1,4 @@ -<h2><?= $this->e($task['title']) ?> (#<?= $task['id'] ?>)</h2> +<h2><?= $this->text->e($task['title']) ?> (#<?= $task['id'] ?>)</h2> <ul> <li> @@ -6,14 +6,14 @@ <?= t('The task have been moved to the first swimlane') ?> <?php else: ?> <?= t('The task have been moved to another swimlane:') ?> - <strong><?= $this->e($task['swimlane_name']) ?></strong> + <strong><?= $this->text->e($task['swimlane_name']) ?></strong> <?php endif ?> </li> <li> <?= t('Column on the board:') ?> - <strong><?= $this->e($task['column_title']) ?></strong> + <strong><?= $this->text->e($task['column_title']) ?></strong> </li> - <li><?= t('Task position:').' '.$this->e($task['position']) ?></li> + <li><?= t('Task position:').' '.$this->text->e($task['position']) ?></li> </ul> <?= $this->render('notification/footer', array('task' => $task, 'application_url' => $application_url)) ?>
\ No newline at end of file diff --git a/app/Template/notification/task_open.php b/app/Template/notification/task_open.php index cb02a79c..6eb4ec08 100644 --- a/app/Template/notification/task_open.php +++ b/app/Template/notification/task_open.php @@ -1,4 +1,4 @@ -<h2><?= $this->e($task['title']) ?> (#<?= $task['id'] ?>)</h2> +<h2><?= $this->text->e($task['title']) ?> (#<?= $task['id'] ?>)</h2> <p><?= t('The task #%d have been opened.', $task['id']) ?></p> diff --git a/app/Template/notification/task_overdue.php b/app/Template/notification/task_overdue.php index d7e6ff5a..ac0665a2 100644 --- a/app/Template/notification/task_overdue.php +++ b/app/Template/notification/task_overdue.php @@ -5,9 +5,9 @@ <li> (<strong>#<?= $task['id'] ?></strong>) <?php if ($application_url): ?> - <a href="<?= $this->url->href('task', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id']), false, '', true) ?>"><?= $this->e($task['title']) ?></a> + <a href="<?= $this->url->href('task', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id']), false, '', true) ?>"><?= $this->text->e($task['title']) ?></a> <?php else: ?> - <?= $this->e($task['title']) ?> + <?= $this->text->e($task['title']) ?> <?php endif ?> (<?= $this->dt->date($task['date_due']) ?>) <?php if ($task['assignee_username']): ?> diff --git a/app/Template/notification/task_update.php b/app/Template/notification/task_update.php index 54f5c6d1..8adb2553 100644 --- a/app/Template/notification/task_update.php +++ b/app/Template/notification/task_update.php @@ -1,4 +1,4 @@ -<h2><?= $this->e($task['title']) ?> (#<?= $task['id'] ?>)</h2> +<h2><?= $this->text->e($task['title']) ?> (#<?= $task['id'] ?>)</h2> <?= $this->render('task/changes', array('changes' => $changes, 'task' => $task)) ?> <?= $this->render('notification/footer', array('task' => $task, 'application_url' => $application_url)) ?>
\ No newline at end of file diff --git a/app/Template/notification/task_user_mention.php b/app/Template/notification/task_user_mention.php index 40ddddca..3d8c8e95 100644 --- a/app/Template/notification/task_user_mention.php +++ b/app/Template/notification/task_user_mention.php @@ -1,5 +1,5 @@ <h2><?= t('You were mentioned in the task #%d', $task['id']) ?></h2> -<p><?= $this->e($task['title']) ?></p> +<p><?= $this->text->e($task['title']) ?></p> <h2><?= t('Description') ?></h2> <?= $this->text->markdown($task['description']) ?> diff --git a/app/Template/project/index.php b/app/Template/project/index.php index 8d384e58..10d4aaa2 100644 --- a/app/Template/project/index.php +++ b/app/Template/project/index.php @@ -49,12 +49,12 @@ <?php endif ?> <?php if (! empty($project['description'])): ?> - <span class="tooltip" title='<?= $this->e($this->text->markdown($project['description'])) ?>'> + <span class="tooltip" title='<?= $this->text->e($this->text->markdown($project['description'])) ?>'> <i class="fa fa-info-circle"></i> </span> <?php endif ?> - <?= $this->url->link($this->e($project['name']), 'project', 'show', array('project_id' => $project['id'])) ?> + <?= $this->url->link($this->text->e($project['name']), 'project', 'show', array('project_id' => $project['id'])) ?> </td> <td> <?= $this->dt->date($project['start_date']) ?> @@ -64,7 +64,7 @@ </td> <td> <?php if ($project['owner_id'] > 0): ?> - <?= $this->e($project['owner_name'] ?: $project['owner_username']) ?> + <?= $this->text->e($project['owner_name'] ?: $project['owner_username']) ?> <?php endif ?> </td> <?php if ($this->user->hasAccess('projectuser', 'managers')): ?> @@ -76,7 +76,7 @@ <td class="dashboard-project-stats"> <?php foreach ($project['columns'] as $column): ?> <strong title="<?= t('Task count') ?>"><?= $column['nb_tasks'] ?></strong> - <span><?= $this->e($column['title']) ?></span> + <span><?= $this->text->e($column['title']) ?></span> <?php endforeach ?> </td> </tr> diff --git a/app/Template/project/show.php b/app/Template/project/show.php index 166b8902..42eeec4d 100644 --- a/app/Template/project/show.php +++ b/app/Template/project/show.php @@ -5,7 +5,7 @@ <li><strong><?= $project['is_active'] ? t('Active') : t('Inactive') ?></strong></li> <?php if ($project['owner_id'] > 0): ?> - <li><?= t('Project owner: ') ?><strong><?= $this->e($project['owner_name'] ?: $project['owner_username']) ?></strong></li> + <li><?= t('Project owner: ') ?><strong><?= $this->text->e($project['owner_name'] ?: $project['owner_username']) ?></strong></li> <?php endif ?> <?php if ($project['is_private']): ?> @@ -61,9 +61,9 @@ <?php foreach ($stats['columns'] as $column): ?> <tr> <td> - <?= $this->e($column['title']) ?> + <?= $this->text->e($column['title']) ?> <?php if (! empty($column['description'])): ?> - <span class="tooltip" title='<?= $this->e($this->text->markdown($column['description'])) ?>'> + <span class="tooltip" title='<?= $this->text->e($this->text->markdown($column['description'])) ?>'> <i class="fa fa-info-circle"></i> </span> <?php endif ?> diff --git a/app/Template/project_file/remove.php b/app/Template/project_file/remove.php index 4f0ba465..ba834288 100644 --- a/app/Template/project_file/remove.php +++ b/app/Template/project_file/remove.php @@ -4,7 +4,7 @@ <div class="confirm"> <p class="alert alert-info"> - <?= t('Do you really want to remove this file: "%s"?', $this->e($file['name'])) ?> + <?= t('Do you really want to remove this file: "%s"?', $this->text->e($file['name'])) ?> </p> <div class="form-actions"> diff --git a/app/Template/project_header/search.php b/app/Template/project_header/search.php index 2b2a2c39..42216352 100644 --- a/app/Template/project_header/search.php +++ b/app/Template/project_header/search.php @@ -12,7 +12,7 @@ <a href="#" class="dropdown-menu dropdown-menu-link-icon" title="<?= t('Custom filters') ?>"><i class="fa fa-bookmark fa-fw"></i><i class="fa fa-caret-down"></i></a> <ul> <?php foreach ($custom_filters_list as $filter): ?> - <li><a href="#" class="filter-helper" data-<?php if ($filter['append']): ?><?= 'append-' ?><?php endif ?>filter='<?= $this->e($filter['filter']) ?>'><?= $this->e($filter['name']) ?></a></li> + <li><a href="#" class="filter-helper" data-<?php if ($filter['append']): ?><?= 'append-' ?><?php endif ?>filter='<?= $this->text->e($filter['filter']) ?>'><?= $this->text->e($filter['name']) ?></a></li> <?php endforeach ?> </ul> </div> @@ -24,7 +24,7 @@ <ul> <li><a href="#" class="filter-helper" data-append-filter="assignee:nobody"><?= t('Not assigned') ?></a></li> <?php foreach ($users_list as $user): ?> - <li><a href="#" class="filter-helper" data-append-filter='assignee:"<?= $this->e($user) ?>"'><?= $this->e($user) ?></a></li> + <li><a href="#" class="filter-helper" data-append-filter='assignee:"<?= $this->text->e($user) ?>"'><?= $this->text->e($user) ?></a></li> <?php endforeach ?> </ul> </div> @@ -36,7 +36,7 @@ <ul> <li><a href="#" class="filter-helper" data-append-filter="category:none"><?= t('No category') ?></a></li> <?php foreach ($categories_list as $category): ?> - <li><a href="#" class="filter-helper" data-append-filter='category:"<?= $this->e($category) ?>"'><?= $this->e($category) ?></a></li> + <li><a href="#" class="filter-helper" data-append-filter='category:"<?= $this->text->e($category) ?>"'><?= $this->text->e($category) ?></a></li> <?php endforeach ?> </ul> </div> diff --git a/app/Template/project_overview/columns.php b/app/Template/project_overview/columns.php index 870d753f..cc5782bd 100644 --- a/app/Template/project_overview/columns.php +++ b/app/Template/project_overview/columns.php @@ -2,7 +2,7 @@ <?php foreach ($project['columns'] as $column): ?> <div class="project-overview-column"> <strong title="<?= t('Task count') ?>"><?= $column['nb_tasks'] ?></strong><br> - <span><?= $this->e($column['title']) ?></span> + <span><?= $this->text->e($column['title']) ?></span> </div> <?php endforeach ?> </div> diff --git a/app/Template/project_overview/description.php b/app/Template/project_overview/description.php index 4137bf9f..cd6e2450 100644 --- a/app/Template/project_overview/description.php +++ b/app/Template/project_overview/description.php @@ -1,6 +1,6 @@ <?php if (! empty($project['description'])): ?> <div class="page-header"> - <h2><?= $this->e($project['name']) ?></h2> + <h2><?= $this->text->e($project['name']) ?></h2> </div> <article class="markdown"> <?= $this->text->markdown($project['description']) ?> diff --git a/app/Template/project_overview/files.php b/app/Template/project_overview/files.php index 7eb8c762..605431ed 100644 --- a/app/Template/project_overview/files.php +++ b/app/Template/project_overview/files.php @@ -18,11 +18,11 @@ <div class="file-thumbnails"> <?php foreach ($images as $file): ?> <div class="file-thumbnail"> - <a href="<?= $this->url->href('FileViewer', 'show', array('project_id' => $project['id'], 'file_id' => $file['id'])) ?>" class="popover"><img src="<?= $this->url->href('FileViewer', 'thumbnail', array('file_id' => $file['id'], 'project_id' => $project['id'])) ?>" title="<?= $this->e($file['name']) ?>" alt="<?= $this->e($file['name']) ?>"></a> + <a href="<?= $this->url->href('FileViewer', 'show', array('project_id' => $project['id'], 'file_id' => $file['id'])) ?>" class="popover"><img src="<?= $this->url->href('FileViewer', 'thumbnail', array('file_id' => $file['id'], 'project_id' => $project['id'])) ?>" title="<?= $this->text->e($file['name']) ?>" alt="<?= $this->text->e($file['name']) ?>"></a> <div class="file-thumbnail-content"> <div class="file-thumbnail-title"> <div class="dropdown"> - <a href="#" class="dropdown-menu dropdown-menu-link-text"><?= $this->e($file['name']) ?> <i class="fa fa-caret-down"></i></a> + <a href="#" class="dropdown-menu dropdown-menu-link-text"><?= $this->text->e($file['name']) ?> <i class="fa fa-caret-down"></i></a> <ul> <li> <i class="fa fa-download fa-fw"></i> @@ -62,7 +62,7 @@ <td> <i class="fa <?= $this->file->icon($file['name']) ?> fa-fw"></i> <div class="dropdown"> - <a href="#" class="dropdown-menu dropdown-menu-link-text"><?= $this->e($file['name']) ?> <i class="fa fa-caret-down"></i></a> + <a href="#" class="dropdown-menu dropdown-menu-link-text"><?= $this->text->e($file['name']) ?> <i class="fa fa-caret-down"></i></a> <ul> <?php if ($this->file->getPreviewType($file['name']) !== null): ?> <li> @@ -84,7 +84,7 @@ </div> </td> <td> - <?= $this->e($file['user_name'] ?: $file['username']) ?> + <?= $this->text->e($file['user_name'] ?: $file['username']) ?> </td> <td> <?= $this->dt->date($file['date']) ?> diff --git a/app/Template/project_overview/information.php b/app/Template/project_overview/information.php index 12a1317d..95508d98 100644 --- a/app/Template/project_overview/information.php +++ b/app/Template/project_overview/information.php @@ -4,7 +4,7 @@ <div class="listing"> <ul> <?php if ($project['owner_id'] > 0): ?> - <li><?= t('Project owner: ') ?><strong><?= $this->e($project['owner_name'] ?: $project['owner_username']) ?></strong></li> + <li><?= t('Project owner: ') ?><strong><?= $this->text->e($project['owner_name'] ?: $project['owner_username']) ?></strong></li> <?php endif ?> <?php if (! empty($users)): ?> diff --git a/app/Template/project_permission/index.php b/app/Template/project_permission/index.php index 5f0edc2b..6135ad9d 100644 --- a/app/Template/project_permission/index.php +++ b/app/Template/project_permission/index.php @@ -19,7 +19,7 @@ </tr> <?php foreach ($users as $user): ?> <tr> - <td><?= $this->e($user['name'] ?: $user['username']) ?></td> + <td><?= $this->text->e($user['name'] ?: $user['username']) ?></td> <td> <?= $this->form->select( 'role-'.$user['id'], @@ -79,7 +79,7 @@ </tr> <?php foreach ($groups as $group): ?> <tr> - <td><?= $this->e($group['name']) ?></td> + <td><?= $this->text->e($group['name']) ?></td> <td> <?= $this->form->select( 'role-'.$group['id'], diff --git a/app/Template/project_user/layout.php b/app/Template/project_user/layout.php index 3ced5590..1103e9bc 100644 --- a/app/Template/project_user/layout.php +++ b/app/Template/project_user/layout.php @@ -19,7 +19,7 @@ <div class="sidebar-content"> <div class="page-header"> - <h2><?= $this->e($title) ?></h2> + <h2><?= $this->text->e($title) ?></h2> </div> <?= $content_for_sublayout ?> </div> diff --git a/app/Template/project_user/roles.php b/app/Template/project_user/roles.php index 35d16241..17fb709b 100644 --- a/app/Template/project_user/roles.php +++ b/app/Template/project_user/roles.php @@ -10,19 +10,19 @@ <?php foreach ($paginator->getCollection() as $project): ?> <tr> <td> - <?= $this->e($this->user->getFullname($project)) ?> + <?= $this->text->e($this->user->getFullname($project)) ?> </td> <td> <?= $this->url->link('<i class="fa fa-th"></i>', 'board', 'show', array('project_id' => $project['id']), false, 'dashboard-table-link', t('Board')) ?> <?= $this->url->link('<i class="fa fa-sliders fa-fw"></i>', 'gantt', 'project', array('project_id' => $project['id']), false, 'dashboard-table-link', t('Gantt chart')) ?> <?= $this->url->link('<i class="fa fa-cog fa-fw"></i>', 'project', 'show', array('project_id' => $project['id']), false, 'dashboard-table-link', t('Project settings')) ?> - <?= $this->e($project['project_name']) ?> + <?= $this->text->e($project['project_name']) ?> </td> <td class="dashboard-project-stats"> <?php foreach ($project['columns'] as $column): ?> <strong title="<?= t('Task count') ?>"><?= $column['nb_tasks'] ?></strong> - <span><?= $this->e($column['title']) ?></span> + <span><?= $this->text->e($column['title']) ?></span> <?php endforeach ?> </td> </tr> diff --git a/app/Template/project_user/tasks.php b/app/Template/project_user/tasks.php index 8d1cbd96..108d3b33 100644 --- a/app/Template/project_user/tasks.php +++ b/app/Template/project_user/tasks.php @@ -14,20 +14,20 @@ <?php foreach ($paginator->getCollection() as $task): ?> <tr> <td class="task-table color-<?= $task['color_id'] ?>"> - <?= $this->url->link('#'.$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->text->e($task['id']), 'task', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id']), false, '', t('View this task')) ?> </td> <td> - <?= $this->url->link($this->e($task['project_name']), 'board', 'show', array('project_id' => $task['project_id'])) ?> + <?= $this->url->link($this->text->e($task['project_name']), 'board', 'show', array('project_id' => $task['project_id'])) ?> </td> <td> - <?= $this->e($task['column_name']) ?> + <?= $this->text->e($task['column_name']) ?> </td> <td> - <?= $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')) ?> </td> <td> <?php if ($task['assignee_username']): ?> - <?= $this->e($task['assignee_name'] ?: $task['assignee_username']) ?> + <?= $this->text->e($task['assignee_name'] ?: $task['assignee_username']) ?> <?php else: ?> <?= t('Unassigned') ?> <?php endif ?> diff --git a/app/Template/project_user/tooltip_users.php b/app/Template/project_user/tooltip_users.php index 7a07caad..f75d964b 100644 --- a/app/Template/project_user/tooltip_users.php +++ b/app/Template/project_user/tooltip_users.php @@ -6,7 +6,7 @@ <strong><?= $role_name ?></strong> <ul> <?php foreach ($users[$role] as $user_id => $user): ?> - <li><?= $this->url->link($this->e($user), 'Projectuser', 'opens', array('user_id' => $user_id)) ?></li> + <li><?= $this->url->link($this->text->e($user), 'Projectuser', 'opens', array('user_id' => $user_id)) ?></li> <?php endforeach ?> </ul> <?php endif ?> diff --git a/app/Template/search/results.php b/app/Template/search/results.php index 3bb0e603..79df3544 100644 --- a/app/Template/search/results.php +++ b/app/Template/search/results.php @@ -13,26 +13,26 @@ <?php foreach ($paginator->getCollection() as $task): ?> <tr> <td> - <?= $this->url->link($this->e($task['project_name']), 'board', 'show', array('project_id' => $task['project_id'])) ?> + <?= $this->url->link($this->text->e($task['project_name']), 'board', 'show', array('project_id' => $task['project_id'])) ?> </td> <td class="task-table color-<?= $task['color_id'] ?>"> - <?= $this->url->link('#'.$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->text->e($task['id']), 'task', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id']), false, '', t('View this task')) ?> </td> <td> - <?= $this->e($task['swimlane_name'] ?: $task['default_swimlane']) ?> + <?= $this->text->e($task['swimlane_name'] ?: $task['default_swimlane']) ?> </td> <td> - <?= $this->e($task['column_name']) ?> + <?= $this->text->e($task['column_name']) ?> </td> <td> - <?= $this->e($task['category_name']) ?> + <?= $this->text->e($task['category_name']) ?> </td> <td> - <?= $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')) ?> </td> <td> <?php if ($task['assignee_username']): ?> - <?= $this->e($task['assignee_name'] ?: $task['assignee_username']) ?> + <?= $this->text->e($task['assignee_name'] ?: $task['assignee_username']) ?> <?php else: ?> <?= t('Unassigned') ?> <?php endif ?> diff --git a/app/Template/subtask/remove.php b/app/Template/subtask/remove.php index 9aef6842..374256fd 100644 --- a/app/Template/subtask/remove.php +++ b/app/Template/subtask/remove.php @@ -7,7 +7,7 @@ <?= t('Do you really want to remove this sub-task?') ?> </p> - <p><strong><?= $this->e($subtask['title']) ?></strong></p> + <p><strong><?= $this->text->e($subtask['title']) ?></strong></p> <div class="form-actions"> <?= $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') ?> diff --git a/app/Template/subtask/table.php b/app/Template/subtask/table.php index 13d2c7cc..0af02dcf 100644 --- a/app/Template/subtask/table.php +++ b/app/Template/subtask/table.php @@ -26,18 +26,18 @@ </td> <td> <?php if (! empty($subtask['username'])): ?> - <?= $this->e($subtask['name'] ?: $subtask['username']) ?> + <?= $this->text->e($subtask['name'] ?: $subtask['username']) ?> <?php endif ?> </td> <td> <ul class="no-bullet"> <li> <?php if (! empty($subtask['time_spent'])): ?> - <strong><?= $this->e($subtask['time_spent']).'h' ?></strong> <?= t('spent') ?> + <strong><?= $this->text->e($subtask['time_spent']).'h' ?></strong> <?= t('spent') ?> <?php endif ?> <?php if (! empty($subtask['time_estimated'])): ?> - <strong><?= $this->e($subtask['time_estimated']).'h' ?></strong> <?= t('estimated') ?> + <strong><?= $this->text->e($subtask['time_estimated']).'h' ?></strong> <?= t('estimated') ?> <?php endif ?> </li> <?php if ($editable && $subtask['user_id'] == $this->user->getId()): ?> diff --git a/app/Template/swimlane/table.php b/app/Template/swimlane/table.php index 1e6a86bc..17be6924 100644 --- a/app/Template/swimlane/table.php +++ b/app/Template/swimlane/table.php @@ -10,7 +10,7 @@ <?php if (! empty($default_swimlane)): ?> <tr> <td> - <?= $this->e($default_swimlane['default_swimlane']) ?> + <?= $this->text->e($default_swimlane['default_swimlane']) ?> <?php if ($default_swimlane['default_swimlane'] !== t('Default swimlane')): ?> (<?= t('Default swimlane') ?>) <?php endif ?> @@ -42,10 +42,10 @@ <i class="fa fa-arrows-alt draggable-row-handle" title="<?= t('Change column position') ?>"></i> <?php endif ?> - <?= $this->e($swimlane['name']) ?> + <?= $this->text->e($swimlane['name']) ?> <?php if (! empty($swimlane['description'])): ?> - <span class="tooltip" title='<?= $this->e($this->text->markdown($swimlane['description'])) ?>'> + <span class="tooltip" title='<?= $this->text->e($this->text->markdown($swimlane['description'])) ?>'> <i class="fa fa-info-circle"></i> </span> <?php endif ?> diff --git a/app/Template/task/analytics.php b/app/Template/task/analytics.php index 306dd021..2f2c23a1 100644 --- a/app/Template/task/analytics.php +++ b/app/Template/task/analytics.php @@ -18,7 +18,7 @@ </tr> <?php foreach ($time_spent_columns as $column): ?> <tr> - <td><?= $this->e($column['title']) ?></td> + <td><?= $this->text->e($column['title']) ?></td> <td><?= $this->dt->duration($column['time_spent']) ?></td> </tr> <?php endforeach ?> diff --git a/app/Template/task/color_picker.php b/app/Template/task/color_picker.php index a849b9ce..0c62fa70 100644 --- a/app/Template/task/color_picker.php +++ b/app/Template/task/color_picker.php @@ -3,7 +3,7 @@ <div data-color-id="<?= $color_id ?>" class="color-square color-<?= $color_id ?> <?= isset($values['color_id']) && $values['color_id'] === $color_id ? 'color-square-selected' : '' ?>" - title="<?= $this->e($color_name) ?>"> + title="<?= $this->text->e($color_name) ?>"> </div> <?php endforeach ?> </div> diff --git a/app/Template/task/details.php b/app/Template/task/details.php index 5c2e3cff..61f6c848 100644 --- a/app/Template/task/details.php +++ b/app/Template/task/details.php @@ -1,5 +1,5 @@ <section id="task-summary"> - <h2><?= $this->e($task['title']) ?></h2> + <h2><?= $this->text->e($task['title']) ?></h2> <div class="task-summary-container color-<?= $task['color_id'] ?>"> <div class="task-summary-column"> <ul class="no-bullet"> @@ -18,12 +18,12 @@ </li> <?php if (! empty($task['reference'])): ?> <li> - <strong><?= t('Reference:') ?></strong> <span><?= $this->e($task['reference']) ?></span> + <strong><?= t('Reference:') ?></strong> <span><?= $this->text->e($task['reference']) ?></span> </li> <?php endif ?> <?php if (! empty($task['score'])): ?> <li> - <strong><?= t('Complexity:') ?></strong> <span><?= $this->e($task['score']) ?></span> + <strong><?= t('Complexity:') ?></strong> <span><?= $this->text->e($task['score']) ?></span> </li> <?php endif ?> <?php if ($project['is_public']): ?> @@ -39,18 +39,18 @@ <?php if (! empty($task['category_name'])): ?> <li> <strong><?= t('Category:') ?></strong> - <span><?= $this->e($task['category_name']) ?></span> + <span><?= $this->text->e($task['category_name']) ?></span> </li> <?php endif ?> <?php if (! empty($task['swimlane_name'])): ?> <li> <strong><?= t('Swimlane:') ?></strong> - <span><?= $this->e($task['swimlane_name']) ?></span> + <span><?= $this->text->e($task['swimlane_name']) ?></span> </li> <?php endif ?> <li> <strong><?= t('Column:') ?></strong> - <span><?= $this->e($task['column_title']) ?></span> + <span><?= $this->text->e($task['column_title']) ?></span> </li> <li> <strong><?= t('Position:') ?></strong> @@ -64,7 +64,7 @@ <strong><?= t('Assignee:') ?></strong> <span> <?php if ($task['assignee_username']): ?> - <?= $this->e($task['assignee_name'] ?: $task['assignee_username']) ?> + <?= $this->text->e($task['assignee_name'] ?: $task['assignee_username']) ?> <?php else: ?> <?= t('not assigned') ?> <?php endif ?> @@ -73,7 +73,7 @@ <?php if ($task['creator_username']): ?> <li> <strong><?= t('Creator:') ?></strong> - <span><?= $this->e($task['creator_name'] ?: $task['creator_username']) ?></span> + <span><?= $this->text->e($task['creator_name'] ?: $task['creator_username']) ?></span> </li> <?php endif ?> <?php if ($task['date_due']): ?> diff --git a/app/Template/task/remove.php b/app/Template/task/remove.php index e0d655fe..eb0809b1 100644 --- a/app/Template/task/remove.php +++ b/app/Template/task/remove.php @@ -4,7 +4,7 @@ <div class="confirm"> <p class="alert alert-info"> - <?= t('Do you really want to remove this task: "%s"?', $this->e($task['title'])) ?> + <?= t('Do you really want to remove this task: "%s"?', $this->text->e($task['title'])) ?> </p> <div class="form-actions"> diff --git a/app/Template/task/time_tracking_details.php b/app/Template/task/time_tracking_details.php index 147c5109..e2b599a5 100644 --- a/app/Template/task/time_tracking_details.php +++ b/app/Template/task/time_tracking_details.php @@ -14,7 +14,7 @@ </tr> <?php foreach ($subtask_paginator->getCollection() as $record): ?> <tr> - <td><?= $this->url->link($this->e($record['user_fullname'] ?: $record['username']), 'user', 'show', array('user_id' => $record['user_id'])) ?></td> + <td><?= $this->url->link($this->text->e($record['user_fullname'] ?: $record['username']), 'user', 'show', array('user_id' => $record['user_id'])) ?></td> <td><?= t($record['subtask_title']) ?></td> <td><?= $this->dt->datetime($record['start']) ?></td> <td><?= $this->dt->datetime($record['end']) ?></td> diff --git a/app/Template/task/time_tracking_summary.php b/app/Template/task/time_tracking_summary.php index 0210be7e..9886ccfa 100644 --- a/app/Template/task/time_tracking_summary.php +++ b/app/Template/task/time_tracking_summary.php @@ -5,9 +5,9 @@ </div> <ul class="listing"> - <li><?= t('Estimate:') ?> <strong><?= $this->e($task['time_estimated']) ?></strong> <?= t('hours') ?></li> - <li><?= t('Spent:') ?> <strong><?= $this->e($task['time_spent']) ?></strong> <?= t('hours') ?></li> - <li><?= t('Remaining:') ?> <strong><?= $this->e($task['time_estimated'] - $task['time_spent']) ?></strong> <?= t('hours') ?></li> + <li><?= t('Estimate:') ?> <strong><?= $this->text->e($task['time_estimated']) ?></strong> <?= t('hours') ?></li> + <li><?= t('Spent:') ?> <strong><?= $this->text->e($task['time_spent']) ?></strong> <?= t('hours') ?></li> + <li><?= t('Remaining:') ?> <strong><?= $this->text->e($task['time_estimated'] - $task['time_spent']) ?></strong> <?= t('hours') ?></li> </ul> <?php endif ?>
\ No newline at end of file diff --git a/app/Template/task/transitions.php b/app/Template/task/transitions.php index d79c2fd9..57f1e0ff 100644 --- a/app/Template/task/transitions.php +++ b/app/Template/task/transitions.php @@ -16,9 +16,9 @@ <?php foreach ($transitions as $transition): ?> <tr> <td><?= $this->dt->datetime($transition['date']) ?></td> - <td><?= $this->e($transition['src_column']) ?></td> - <td><?= $this->e($transition['dst_column']) ?></td> - <td><?= $this->url->link($this->e($transition['name'] ?: $transition['username']), 'user', 'show', array('user_id' => $transition['user_id'])) ?></td> + <td><?= $this->text->e($transition['src_column']) ?></td> + <td><?= $this->text->e($transition['dst_column']) ?></td> + <td><?= $this->url->link($this->text->e($transition['name'] ?: $transition['username']), 'user', 'show', array('user_id' => $transition['user_id'])) ?></td> <td><?= $this->dt->duration($transition['time_spent']) ?></td> </tr> <?php endforeach ?> diff --git a/app/Template/task_external_link/show.php b/app/Template/task_external_link/show.php index 12d8e4f6..7dce107e 100644 --- a/app/Template/task_external_link/show.php +++ b/app/Template/task_external_link/show.php @@ -22,13 +22,13 @@ <?= $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> <td> - <?= $this->e($link['creator_name'] ?: $link['creator_username']) ?> + <?= $this->text->e($link['creator_name'] ?: $link['creator_username']) ?> </td> <td> <?= $this->dt->date($link['date_creation']) ?> diff --git a/app/Template/task_file/remove.php b/app/Template/task_file/remove.php index 5e6c83f2..fe601f6f 100644 --- a/app/Template/task_file/remove.php +++ b/app/Template/task_file/remove.php @@ -4,7 +4,7 @@ <div class="confirm"> <p class="alert alert-info"> - <?= t('Do you really want to remove this file: "%s"?', $this->e($file['name'])) ?> + <?= t('Do you really want to remove this file: "%s"?', $this->text->e($file['name'])) ?> </p> <div class="form-actions"> diff --git a/app/Template/task_file/show.php b/app/Template/task_file/show.php index c3f2bb98..21bf79ef 100644 --- a/app/Template/task_file/show.php +++ b/app/Template/task_file/show.php @@ -8,11 +8,11 @@ <div class="file-thumbnails"> <?php foreach ($images as $file): ?> <div class="file-thumbnail"> - <a href="<?= $this->url->href('FileViewer', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id'], 'file_id' => $file['id'])) ?>" class="popover"><img src="<?= $this->url->href('FileViewer', 'thumbnail', array('file_id' => $file['id'], 'project_id' => $task['project_id'], 'task_id' => $file['task_id'])) ?>" title="<?= $this->e($file['name']) ?>" alt="<?= $this->e($file['name']) ?>"></a> + <a href="<?= $this->url->href('FileViewer', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id'], 'file_id' => $file['id'])) ?>" class="popover"><img src="<?= $this->url->href('FileViewer', 'thumbnail', array('file_id' => $file['id'], 'project_id' => $task['project_id'], 'task_id' => $file['task_id'])) ?>" title="<?= $this->text->e($file['name']) ?>" alt="<?= $this->text->e($file['name']) ?>"></a> <div class="file-thumbnail-content"> <div class="file-thumbnail-title"> <div class="dropdown"> - <a href="#" class="dropdown-menu dropdown-menu-link-text"><?= $this->e($file['name']) ?> <i class="fa fa-caret-down"></i></a> + <a href="#" class="dropdown-menu dropdown-menu-link-text"><?= $this->text->e($file['name']) ?> <i class="fa fa-caret-down"></i></a> <ul> <li> <i class="fa fa-download fa-fw"></i> @@ -52,7 +52,7 @@ <td> <i class="fa <?= $this->file->icon($file['name']) ?> fa-fw"></i> <div class="dropdown"> - <a href="#" class="dropdown-menu dropdown-menu-link-text"><?= $this->e($file['name']) ?> <i class="fa fa-caret-down"></i></a> + <a href="#" class="dropdown-menu dropdown-menu-link-text"><?= $this->text->e($file['name']) ?> <i class="fa fa-caret-down"></i></a> <ul> <?php if ($this->file->getPreviewType($file['name']) !== null): ?> <li> @@ -74,7 +74,7 @@ </div> </td> <td> - <?= $this->e($file['user_name'] ?: $file['username']) ?> + <?= $this->text->e($file['user_name'] ?: $file['username']) ?> </td> <td> <?= $this->dt->date($file['date']) ?> diff --git a/app/Template/task_recurrence/info.php b/app/Template/task_recurrence/info.php index 83ca0960..1a6574df 100644 --- a/app/Template/task_recurrence/info.php +++ b/app/Template/task_recurrence/info.php @@ -5,16 +5,16 @@ <li><?= t('Recurrent task has been generated:') ?> <ul> <li> - <?= t('Trigger to generate recurrent task: ') ?><strong><?= $this->e($recurrence_trigger_list[$task['recurrence_trigger']]) ?></strong> + <?= t('Trigger to generate recurrent task: ') ?><strong><?= $this->text->e($recurrence_trigger_list[$task['recurrence_trigger']]) ?></strong> </li> <li> - <?= t('Factor to calculate new due date: ') ?><strong><?= $this->e($task['recurrence_factor']) ?></strong> + <?= t('Factor to calculate new due date: ') ?><strong><?= $this->text->e($task['recurrence_factor']) ?></strong> </li> <li> - <?= t('Timeframe to calculate new due date: ') ?><strong><?= $this->e($recurrence_timeframe_list[$task['recurrence_timeframe']]) ?></strong> + <?= t('Timeframe to calculate new due date: ') ?><strong><?= $this->text->e($recurrence_timeframe_list[$task['recurrence_timeframe']]) ?></strong> </li> <li> - <?= t('Base date to calculate new due date: ') ?><strong><?= $this->e($recurrence_basedate_list[$task['recurrence_basedate']]) ?></strong> + <?= t('Base date to calculate new due date: ') ?><strong><?= $this->text->e($recurrence_basedate_list[$task['recurrence_basedate']]) ?></strong> </li> </ul> </li> diff --git a/app/Template/tasklink/show.php b/app/Template/tasklink/show.php index fd8b37a6..82c3d6c9 100644 --- a/app/Template/tasklink/show.php +++ b/app/Template/tasklink/show.php @@ -27,7 +27,7 @@ <td> <?php if ($is_public): ?> <?= $this->url->link( - $this->e('#'.$link['task_id'].' '.$link['title']), + $this->text->e('#'.$link['task_id'].' '.$link['title']), 'task', 'readonly', array('task_id' => $link['task_id'], 'token' => $project['token']), @@ -36,7 +36,7 @@ ) ?> <?php else: ?> <?= $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']), @@ -48,21 +48,21 @@ <br> <?php if (! empty($link['task_time_spent'])): ?> - <strong><?= $this->e($link['task_time_spent']).'h' ?></strong> <?= t('spent') ?> + <strong><?= $this->text->e($link['task_time_spent']).'h' ?></strong> <?= t('spent') ?> <?php endif ?> <?php if (! empty($link['task_time_estimated'])): ?> - <strong><?= $this->e($link['task_time_estimated']).'h' ?></strong> <?= t('estimated') ?> + <strong><?= $this->text->e($link['task_time_estimated']).'h' ?></strong> <?= t('estimated') ?> <?php endif ?> </td> - <td><?= $this->e($link['project_name']) ?></td> - <td><?= $this->e($link['column_title']) ?></td> + <td><?= $this->text->e($link['project_name']) ?></td> + <td><?= $this->text->e($link['column_title']) ?></td> <td> <?php if (! empty($link['task_assignee_username'])): ?> <?php if ($editable): ?> - <?= $this->url->link($this->e($link['task_assignee_name'] ?: $link['task_assignee_username']), 'user', 'show', array('user_id' => $link['task_assignee_id'])) ?> + <?= $this->url->link($this->text->e($link['task_assignee_name'] ?: $link['task_assignee_username']), 'user', 'show', array('user_id' => $link['task_assignee_id'])) ?> <?php else: ?> - <?= $this->e($link['task_assignee_name'] ?: $link['task_assignee_username']) ?> + <?= $this->text->e($link['task_assignee_name'] ?: $link['task_assignee_username']) ?> <?php endif ?> <?php endif ?> </td> diff --git a/app/Template/twofactor/index.php b/app/Template/twofactor/index.php index b9ee4b49..6e701273 100644 --- a/app/Template/twofactor/index.php +++ b/app/Template/twofactor/index.php @@ -4,7 +4,7 @@ <form method="post" action="<?= $this->url->href('twofactor', $user['twofactor_activated'] == 1 ? 'deactivate' : 'show', array('user_id' => $user['id'])) ?>" autocomplete="off"> <?= $this->form->csrf() ?> - <p><?= t('Two-Factor Provider: ') ?><strong><?= $this->e($provider) ?></strong></p> + <p><?= t('Two-Factor Provider: ') ?><strong><?= $this->text->e($provider) ?></strong></p> <div class="form-actions"> <?php if ($user['twofactor_activated'] == 1): ?> <input type="submit" value="<?= t('Disable two-factor authentication') ?>" class="btn btn-red"/> diff --git a/app/Template/twofactor/show.php b/app/Template/twofactor/show.php index d6d8f405..df408035 100644 --- a/app/Template/twofactor/show.php +++ b/app/Template/twofactor/show.php @@ -5,7 +5,7 @@ <?php if (! empty($secret) || ! empty($qrcode_url) || ! empty($key_url)): ?> <div class="listing"> <?php if (! empty($secret)): ?> - <p><?= t('Secret key: ') ?><strong><?= $this->e($secret) ?></strong></p> + <p><?= t('Secret key: ') ?><strong><?= $this->text->e($secret) ?></strong></p> <?php endif ?> <?php if (! empty($qrcode_url)): ?> @@ -13,7 +13,7 @@ <?php endif ?> <?php if (! empty($key_url)): ?> - <p><?= t('This QR code contains the key URI: ') ?><a href="<?= $this->e($key_url) ?>"><?= $this->e($key_url) ?></a></p> + <p><?= t('This QR code contains the key URI: ') ?><a href="<?= $this->text->e($key_url) ?>"><?= $this->text->e($key_url) ?></a></p> <?php endif ?> </div> <?php endif ?> diff --git a/app/Template/user/index.php b/app/Template/user/index.php index 494c1465..364fd965 100644 --- a/app/Template/user/index.php +++ b/app/Template/user/index.php @@ -27,13 +27,13 @@ <tr> <td> <?= '#'.$user['id'] ?> - <?= $this->url->link($this->e($user['username']), 'user', 'show', array('user_id' => $user['id'])) ?> + <?= $this->url->link($this->text->e($user['username']), 'user', 'show', array('user_id' => $user['id'])) ?> </td> <td> - <?= $this->e($user['name']) ?> + <?= $this->text->e($user['name']) ?> </td> <td> - <a href="mailto:<?= $this->e($user['email']) ?>"><?= $this->e($user['email']) ?></a> + <a href="mailto:<?= $this->text->e($user['email']) ?>"><?= $this->text->e($user['email']) ?></a> </td> <td> <?= $this->user->getRoleName($user['role']) ?> diff --git a/app/Template/user/last.php b/app/Template/user/last.php index d6c86391..3de4d5e2 100644 --- a/app/Template/user/last.php +++ b/app/Template/user/last.php @@ -15,9 +15,9 @@ <?php foreach ($last_logins as $login): ?> <tr> <td><?= $this->dt->datetime($login['date_creation']) ?></td> - <td><?= $this->e($login['auth_type']) ?></td> - <td><?= $this->e($login['ip']) ?></td> - <td><?= $this->e($login['user_agent']) ?></td> + <td><?= $this->text->e($login['auth_type']) ?></td> + <td><?= $this->text->e($login['ip']) ?></td> + <td><?= $this->text->e($login['user_agent']) ?></td> </tr> <?php endforeach ?> </table> diff --git a/app/Template/user/password_reset.php b/app/Template/user/password_reset.php index 4e9063ef..1371ce11 100644 --- a/app/Template/user/password_reset.php +++ b/app/Template/user/password_reset.php @@ -18,8 +18,8 @@ <td><?= $this->dt->datetime($token['date_creation']) ?></td> <td><?= $this->dt->datetime($token['date_expiration']) ?></td> <td><?= $token['is_active'] == 0 ? t('No') : t('Yes') ?></td> - <td><?= $this->e($token['ip']) ?></td> - <td><?= $this->e($token['user_agent']) ?></td> + <td><?= $this->text->e($token['ip']) ?></td> + <td><?= $this->text->e($token['user_agent']) ?></td> </tr> <?php endforeach ?> </table> diff --git a/app/Template/user/profile.php b/app/Template/user/profile.php index 176a1491..80a633e3 100644 --- a/app/Template/user/profile.php +++ b/app/Template/user/profile.php @@ -1,8 +1,8 @@ <section id="main"> <br> <ul class="listing"> - <li><?= t('Username:') ?> <strong><?= $this->e($user['username']) ?></strong></li> - <li><?= t('Name:') ?> <strong><?= $this->e($user['name']) ?: t('None') ?></strong></li> - <li><?= t('Email:') ?> <strong><?= $this->e($user['email']) ?: t('None') ?></strong></li> + <li><?= t('Username:') ?> <strong><?= $this->text->e($user['username']) ?></strong></li> + <li><?= t('Name:') ?> <strong><?= $this->text->e($user['name']) ?: t('None') ?></strong></li> + <li><?= t('Email:') ?> <strong><?= $this->text->e($user['email']) ?: t('None') ?></strong></li> </ul> </section>
\ No newline at end of file diff --git a/app/Template/user/sessions.php b/app/Template/user/sessions.php index 8db02430..d7fe895d 100644 --- a/app/Template/user/sessions.php +++ b/app/Template/user/sessions.php @@ -17,8 +17,8 @@ <tr> <td><?= $this->dt->datetime($session['date_creation']) ?></td> <td><?= $this->dt->datetime($session['expiration']) ?></td> - <td><?= $this->e($session['ip']) ?></td> - <td><?= $this->e($session['user_agent']) ?></td> + <td><?= $this->text->e($session['ip']) ?></td> + <td><?= $this->text->e($session['user_agent']) ?></td> <td><?= $this->url->link(t('Remove'), 'User', 'removeSession', array('user_id' => $user['id'], 'id' => $session['id']), true) ?></td> </tr> <?php endforeach ?> diff --git a/app/Template/user/show.php b/app/Template/user/show.php index 9da56666..df0affb8 100644 --- a/app/Template/user/show.php +++ b/app/Template/user/show.php @@ -2,9 +2,9 @@ <h2><?= t('Summary') ?></h2> </div> <ul class="listing"> - <li><?= t('Username:') ?> <strong><?= $this->e($user['username']) ?></strong></li> - <li><?= t('Name:') ?> <strong><?= $this->e($user['name']) ?: t('None') ?></strong></li> - <li><?= t('Email:') ?> <strong><?= $this->e($user['email']) ?: t('None') ?></strong></li> + <li><?= t('Username:') ?> <strong><?= $this->text->e($user['username']) ?></strong></li> + <li><?= t('Name:') ?> <strong><?= $this->text->e($user['name']) ?: t('None') ?></strong></li> + <li><?= t('Email:') ?> <strong><?= $this->text->e($user['email']) ?: t('None') ?></strong></li> <li><?= t('Status:') ?> <strong><?= $user['is_active'] ? t('Active') : t('Inactive') ?></strong></li> </ul> diff --git a/app/Template/user/timesheet.php b/app/Template/user/timesheet.php index 4a6e42c5..92ebafb5 100644 --- a/app/Template/user/timesheet.php +++ b/app/Template/user/timesheet.php @@ -16,8 +16,8 @@ </tr> <?php foreach ($subtask_paginator->getCollection() as $record): ?> <tr> - <td><?= $this->url->link($this->e($record['task_title']), 'task', 'show', array('project_id' => $record['project_id'], 'task_id' => $record['task_id'])) ?></td> - <td><?= $this->url->link($this->e($record['subtask_title']), 'task', 'show', array('project_id' => $record['project_id'], 'task_id' => $record['task_id'])) ?></td> + <td><?= $this->url->link($this->text->e($record['task_title']), 'task', 'show', array('project_id' => $record['project_id'], 'task_id' => $record['task_id'])) ?></td> + <td><?= $this->url->link($this->text->e($record['subtask_title']), 'task', 'show', array('project_id' => $record['project_id'], 'task_id' => $record['task_id'])) ?></td> <td><?= $this->dt->datetime($record['start']) ?></td> <td><?= $this->dt->datetime($record['end']) ?></td> <td><?= n($record['time_spent']).' '.t('hours') ?></td> diff --git a/app/common.php b/app/common.php index e2fe6aff..71f80c75 100644 --- a/app/common.php +++ b/app/common.php @@ -26,6 +26,7 @@ require __DIR__.'/constants.php'; require __DIR__.'/check_setup.php'; $container = new Pimple\Container; +$container->register(new Kanboard\ServiceProvider\HelperProvider); $container->register(new Kanboard\ServiceProvider\SessionProvider); $container->register(new Kanboard\ServiceProvider\LoggingProvider); $container->register(new Kanboard\ServiceProvider\DatabaseProvider); diff --git a/composer.lock b/composer.lock index 238d6c7c..81375dd0 100644 --- a/composer.lock +++ b/composer.lock @@ -397,16 +397,16 @@ }, { "name": "paragonie/random_compat", - "version": "v1.2.0", + "version": "v1.2.1", "source": { "type": "git", "url": "https://github.com/paragonie/random_compat.git", - "reference": "b0e69d10852716b2ccbdff69c75c477637220790" + "reference": "f078eba3bcf140fd69b5fcc3ea5ac809abf729dc" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/paragonie/random_compat/zipball/b0e69d10852716b2ccbdff69c75c477637220790", - "reference": "b0e69d10852716b2ccbdff69c75c477637220790", + "url": "https://api.github.com/repos/paragonie/random_compat/zipball/f078eba3bcf140fd69b5fcc3ea5ac809abf729dc", + "reference": "f078eba3bcf140fd69b5fcc3ea5ac809abf729dc", "shasum": "" }, "require": { @@ -441,7 +441,7 @@ "pseudorandom", "random" ], - "time": "2016-02-06 03:52:05" + "time": "2016-02-29 17:25:04" }, { "name": "pimple/pimple", @@ -627,16 +627,16 @@ }, { "name": "symfony/console", - "version": "v2.8.2", + "version": "v2.8.3", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "d0239fb42f98dd02e7d342f793c5d2cdee0c478d" + "reference": "56cc5caf051189720b8de974e4746090aaa10d44" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/d0239fb42f98dd02e7d342f793c5d2cdee0c478d", - "reference": "d0239fb42f98dd02e7d342f793c5d2cdee0c478d", + "url": "https://api.github.com/repos/symfony/console/zipball/56cc5caf051189720b8de974e4746090aaa10d44", + "reference": "56cc5caf051189720b8de974e4746090aaa10d44", "shasum": "" }, "require": { @@ -683,20 +683,20 @@ ], "description": "Symfony Console Component", "homepage": "https://symfony.com", - "time": "2016-01-14 08:33:16" + "time": "2016-02-28 16:20:50" }, { "name": "symfony/event-dispatcher", - "version": "v2.8.2", + "version": "v2.8.3", "source": { "type": "git", "url": "https://github.com/symfony/event-dispatcher.git", - "reference": "ee278f7c851533e58ca307f66305ccb9188aceda" + "reference": "78c468665c9568c3faaa9c416a7134308f2d85c3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/ee278f7c851533e58ca307f66305ccb9188aceda", - "reference": "ee278f7c851533e58ca307f66305ccb9188aceda", + "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/78c468665c9568c3faaa9c416a7134308f2d85c3", + "reference": "78c468665c9568c3faaa9c416a7134308f2d85c3", "shasum": "" }, "require": { @@ -743,7 +743,7 @@ ], "description": "Symfony EventDispatcher Component", "homepage": "https://symfony.com", - "time": "2016-01-13 10:28:07" + "time": "2016-01-27 05:14:19" }, { "name": "symfony/polyfill-mbstring", @@ -808,7 +808,7 @@ "packages-dev": [ { "name": "symfony/stopwatch", - "version": "v2.8.2", + "version": "v2.8.3", "source": { "type": "git", "url": "https://github.com/symfony/stopwatch.git", diff --git a/doc/plugin-helpers.markdown b/doc/plugin-helpers.markdown new file mode 100644 index 00000000..8cc6b42a --- /dev/null +++ b/doc/plugin-helpers.markdown @@ -0,0 +1,40 @@ +Registering new helpers +======================= + +Helper skeleton: + +```php +<?php + +namespace Kanboard\Plugin\MyPlugin\Helper\MyHelper; + +use Kanboard\Core\Base; + +class MyHelper extends Base +{ + public function doSomething() + { + return 'foobar'; + } +} +``` + +Register your helper class: + +```php +$this->helper->register('myHelper', '\Kanboard\Plugin\MyPlugin\Helper\MyHelper'); +``` + +Using your helper from a template: + +```php +<p> + <?= $this->myHelper->doSomething() ?> +</p> +``` + +Using your helper from another class: + +```php +$this->helper->myHelper->doSomething(); +``` diff --git a/doc/plugins.markdown b/doc/plugins.markdown index 55575612..e38c887f 100644 --- a/doc/plugins.markdown +++ b/doc/plugins.markdown @@ -13,6 +13,7 @@ Plugin creators should specify explicitly the compatible versions of Kanboard. I - [Override default application behaviors](plugin-overrides.markdown) - [Add schema migrations for plugins](plugin-schema-migrations.markdown) - [Custom routes](plugin-routes.markdown) +- [Add helpers](plugin-helpers.markdown) - [Add mail transports](plugin-mail-transports.markdown) - [Add notification types](plugin-notifications.markdown) - [Add automatic actions](plugin-automatic-actions.markdown) diff --git a/tests/units/Base.php b/tests/units/Base.php index eb9fc68b..6af14ba5 100644 --- a/tests/units/Base.php +++ b/tests/units/Base.php @@ -33,6 +33,7 @@ abstract class Base extends PHPUnit_Framework_TestCase } $this->container = new Pimple\Container; + $this->container->register(new Kanboard\ServiceProvider\HelperProvider); $this->container->register(new Kanboard\ServiceProvider\AuthenticationProvider); $this->container->register(new Kanboard\ServiceProvider\DatabaseProvider); $this->container->register(new Kanboard\ServiceProvider\ClassProvider); diff --git a/tests/units/Core/HelperTest.php b/tests/units/Core/HelperTest.php new file mode 100644 index 00000000..b766dd96 --- /dev/null +++ b/tests/units/Core/HelperTest.php @@ -0,0 +1,17 @@ +<?php + +require_once __DIR__.'/../Base.php'; + +use Kanboard\Core\Helper; + +class HelperTest extends Base +{ + public function testRegister() + { + $helper = new Helper($this->container); + $helper->register('foobar', '\Stdclass'); + + $this->assertInstanceOf('Stdclass', $helper->foobar); + $this->assertInstanceOf('Stdclass', $helper->getHelper('foobar')); + } +} diff --git a/tests/units/Core/Http/RouterTest.php b/tests/units/Core/Http/RouterTest.php index 0b200ab5..75a3ba4f 100644 --- a/tests/units/Core/Http/RouterTest.php +++ b/tests/units/Core/Http/RouterTest.php @@ -40,21 +40,25 @@ namespace { $this->assertEquals('userImport', $dispatcher->sanitize('userImport', 'default')); } - public function testGetPath() + public function testGetPathWithFolder() { - $dispatcher = new Router($this->container); - - $this->container['helper'] = new Helper($this->container); + $router = new Router($this->container); $this->container['request'] = new Request($this->container, array('PHP_SELF' => '/index.php', 'REQUEST_URI' => '/a/b/c', 'REQUEST_METHOD' => 'GET')); - $this->assertEquals('a/b/c', $dispatcher->getPath()); + $this->assertEquals('a/b/c', $router->getPath()); + } - $this->container['helper'] = new Helper($this->container); + public function testGetPathWithQueryString() + { + $router = new Router($this->container); $this->container['request'] = new Request($this->container, array('PHP_SELF' => '/index.php', 'REQUEST_URI' => '/a/b/something?test=a', 'QUERY_STRING' => 'test=a', 'REQUEST_METHOD' => 'GET')); - $this->assertEquals('a/b/something', $dispatcher->getPath()); + $this->assertEquals('a/b/something', $router->getPath()); + } - $this->container['helper'] = new Helper($this->container); + public function testGetPathWithSubFolderAndQueryString() + { + $router = new Router($this->container); $this->container['request'] = new Request($this->container, array('PHP_SELF' => '/a/index.php', 'REQUEST_URI' => '/a/b/something?test=a', 'QUERY_STRING' => 'test=a', 'REQUEST_METHOD' => 'GET')); - $this->assertEquals('b/something', $dispatcher->getPath()); + $this->assertEquals('b/something', $router->getPath()); } public function testDispatcherWithControllerNotFound() diff --git a/tests/units/Core/TemplateTest.php b/tests/units/Core/TemplateTest.php index 6e5ae00d..bd476c51 100644 --- a/tests/units/Core/TemplateTest.php +++ b/tests/units/Core/TemplateTest.php @@ -8,7 +8,7 @@ class TemplateTest extends Base { public function testGetTemplateFile() { - $t = new Template($this->container); + $t = new Template($this->container['helper']); $this->assertStringEndsWith( 'app'.DIRECTORY_SEPARATOR.'Core'.DIRECTORY_SEPARATOR.'..'.DIRECTORY_SEPARATOR.'Template'.DIRECTORY_SEPARATOR.'a'.DIRECTORY_SEPARATOR.'b.php', $t->getTemplateFile('a'.DIRECTORY_SEPARATOR.'b') @@ -17,7 +17,7 @@ class TemplateTest extends Base public function testGetPluginTemplateFile() { - $t = new Template($this->container); + $t = new Template($this->container['helper']); $this->assertStringEndsWith( 'app'.DIRECTORY_SEPARATOR.'Core'.DIRECTORY_SEPARATOR.'..'.DIRECTORY_SEPARATOR.'..'.DIRECTORY_SEPARATOR.'plugins'.DIRECTORY_SEPARATOR.'Myplugin'.DIRECTORY_SEPARATOR.'Template'.DIRECTORY_SEPARATOR.'a'.DIRECTORY_SEPARATOR.'b.php', $t->getTemplateFile('myplugin:a'.DIRECTORY_SEPARATOR.'b') @@ -26,7 +26,7 @@ class TemplateTest extends Base public function testGetOverridedTemplateFile() { - $t = new Template($this->container); + $t = new Template($this->container['helper']); $t->setTemplateOverride('a'.DIRECTORY_SEPARATOR.'b', 'myplugin:c'); $this->assertStringEndsWith( diff --git a/tests/units/Helper/AppHelperTest.php b/tests/units/Helper/AppHelperTest.php index 4fd486f0..dee0750e 100644 --- a/tests/units/Helper/AppHelperTest.php +++ b/tests/units/Helper/AppHelperTest.php @@ -3,25 +3,25 @@ require_once __DIR__.'/../Base.php'; use Kanboard\Core\Session\FlashMessage; -use Kanboard\Helper\App; +use Kanboard\Helper\AppHelper; class AppHelperTest extends Base { public function testJsLang() { - $h = new App($this->container); + $h = new AppHelper($this->container); $this->assertEquals('en', $h->jsLang()); } public function testTimezone() { - $h = new App($this->container); + $h = new AppHelper($this->container); $this->assertEquals('UTC', $h->getTimezone()); } public function testFlashMessage() { - $h = new App($this->container); + $h = new AppHelper($this->container); $f = new FlashMessage($this->container); $this->assertEmpty($h->flashMessage()); diff --git a/tests/units/Helper/AssetHelperTest.php b/tests/units/Helper/AssetHelperTest.php index 64fcd569..6ef5accd 100644 --- a/tests/units/Helper/AssetHelperTest.php +++ b/tests/units/Helper/AssetHelperTest.php @@ -2,14 +2,14 @@ require_once __DIR__.'/../Base.php'; -use Kanboard\Helper\Asset; +use Kanboard\Helper\AssetHelper; use Kanboard\Model\Config; class AssetHelperTest extends Base { public function testCustomCss() { - $h = new Asset($this->container); + $h = new AssetHelper($this->container); $c = new Config($this->container); $this->assertEmpty($h->customCss()); diff --git a/tests/units/Helper/DatetimeHelperTest.php b/tests/units/Helper/DatetimeHelperTest.php index f27a2eb9..19b1b704 100644 --- a/tests/units/Helper/DatetimeHelperTest.php +++ b/tests/units/Helper/DatetimeHelperTest.php @@ -2,19 +2,19 @@ require_once __DIR__.'/../Base.php'; -use Kanboard\Helper\Dt; +use Kanboard\Helper\DateHelper; class DatetimeHelperTest extends Base { public function testGetTime() { - $helper = new Dt($this->container); + $helper = new DateHelper($this->container); $this->assertEquals('17:25', $helper->time(1422206700)); } public function testGetDate() { - $helper = new Dt($this->container); + $helper = new DateHelper($this->container); $this->assertEquals('01/25/2015', $helper->date(1422206700)); $this->assertEquals('01/25/2015', $helper->date('2015-01-25')); $this->assertEquals('', $helper->date('0')); @@ -24,13 +24,13 @@ class DatetimeHelperTest extends Base public function testGetDatetime() { - $helper = new Dt($this->container); + $helper = new DateHelper($this->container); $this->assertEquals('01/25/2015 17:25', $helper->datetime(1422206700)); } public function testAge() { - $helper = new Dt($this->container); + $helper = new DateHelper($this->container); $this->assertEquals('<15m', $helper->age(0, 30)); $this->assertEquals('<30m', $helper->age(0, 1000)); @@ -42,7 +42,7 @@ class DatetimeHelperTest extends Base public function testGetDayHours() { - $helper = new Dt($this->container); + $helper = new DateHelper($this->container); $slots = $helper->getDayHours(); @@ -58,7 +58,7 @@ class DatetimeHelperTest extends Base public function testGetWeekDays() { - $helper = new Dt($this->container); + $helper = new DateHelper($this->container); $slots = $helper->getWeekDays(); @@ -70,7 +70,7 @@ class DatetimeHelperTest extends Base public function testGetWeekDay() { - $helper = new Dt($this->container); + $helper = new DateHelper($this->container); $this->assertEquals('Monday', $helper->getWeekDay(1)); $this->assertEquals('Sunday', $helper->getWeekDay(7)); diff --git a/tests/units/Helper/FileHelperText.php b/tests/units/Helper/FileHelperText.php index 6a1b78a4..215b024b 100644 --- a/tests/units/Helper/FileHelperText.php +++ b/tests/units/Helper/FileHelperText.php @@ -2,20 +2,20 @@ require_once __DIR__.'/../Base.php'; -use Kanboard\Helper\File; +use Kanboard\Helper\FileHelper; class FileHelperTest extends Base { public function testIcon() { - $helper = new File($this->container); + $helper = new FileHelper($this->container); $this->assertEquals('fa-file-image-o', $helper->icon('test.png')); $this->assertEquals('fa-file-o', $helper->icon('test')); } public function testGetMimeType() { - $helper = new File($this->container); + $helper = new FileHelper($this->container); $this->assertEquals('image/jpeg', $helper->getImageMimeType('My File.JPG')); $this->assertEquals('image/jpeg', $helper->getImageMimeType('My File.jpeg')); @@ -27,7 +27,7 @@ class FileHelperTest extends Base public function testGetPreviewType() { - $helper = new File($this->container); + $helper = new FileHelper($this->container); $this->assertEquals('text', $helper->getPreviewType('test.txt')); $this->assertEquals('markdown', $helper->getPreviewType('test.markdown')); $this->assertEquals('md', $helper->getPreviewType('test.md')); diff --git a/tests/units/Helper/HookHelperTest.php b/tests/units/Helper/HookHelperTest.php index aec4a771..6e03acd1 100644 --- a/tests/units/Helper/HookHelperTest.php +++ b/tests/units/Helper/HookHelperTest.php @@ -2,7 +2,7 @@ require_once __DIR__.'/../Base.php'; -use Kanboard\Helper\Hook; +use Kanboard\Helper\HookHelper; class HookHelperTest extends Base { @@ -10,7 +10,7 @@ class HookHelperTest extends Base { $this->container['template'] = $this ->getMockBuilder('\Kanboard\Core\Template') - ->setConstructorArgs(array($this->container)) + ->setConstructorArgs(array($this->container['helper'])) ->setMethods(array('render')) ->getMock(); @@ -32,7 +32,7 @@ class HookHelperTest extends Base ) ->will($this->returnValue('tpl2_content')); - $h = new Hook($this->container); + $h = new HookHelper($this->container); $h->attach('test', 'tpl1'); $h->attach('test', 'tpl2'); $this->assertEquals('tpl1_contenttpl2_content', $h->render('test')); @@ -41,7 +41,7 @@ class HookHelperTest extends Base public function testAssetHooks() { $this->container['helper']->asset = $this - ->getMockBuilder('\Kanboard\Helper\Asset') + ->getMockBuilder('\Kanboard\Helper\AssetHelper') ->setConstructorArgs(array($this->container)) ->setMethods(array('css', 'js')) ->getMock(); @@ -64,7 +64,7 @@ class HookHelperTest extends Base ) ->will($this->returnValue('<script src="skin.js"></script>')); - $h = new Hook($this->container); + $h = new HookHelper($this->container); $h->attach('test1', 'skin.css'); $h->attach('test2', 'skin.js'); diff --git a/tests/units/Helper/TaskHelperTest.php b/tests/units/Helper/TaskHelperTest.php index 726188e4..454da553 100644 --- a/tests/units/Helper/TaskHelperTest.php +++ b/tests/units/Helper/TaskHelperTest.php @@ -2,20 +2,20 @@ require_once __DIR__.'/../Base.php'; -use Kanboard\Helper\Task; +use Kanboard\Helper\TaskHelper; class TaskHelperTest extends Base { public function testSelectPriority() { - $helper = new Task($this->container); + $helper = new TaskHelper($this->container); $this->assertNotEmpty($helper->selectPriority(array('priority_end' => '3', 'priority_start' => '1', 'priority_default' => '2'), array())); $this->assertEmpty($helper->selectPriority(array('priority_end' => '3', 'priority_start' => '3', 'priority_default' => '2'), array())); } public function testFormatPriority() { - $helper = new Task($this->container); + $helper = new TaskHelper($this->container); $this->assertEquals( '<span class="task-board-priority" title="Task priority">P2</span>', diff --git a/tests/units/Helper/TextHelperTest.php b/tests/units/Helper/TextHelperTest.php index a4bdfa91..d7324dfd 100644 --- a/tests/units/Helper/TextHelperTest.php +++ b/tests/units/Helper/TextHelperTest.php @@ -2,13 +2,13 @@ require_once __DIR__.'/../Base.php'; -use Kanboard\Helper\Text; +use Kanboard\Helper\TextHelper; class TextHelperTest extends Base { public function testMarkdownTaskLink() { - $h = new Text($this->container); + $h = new TextHelper($this->container); $this->assertEquals('<p>Test</p>', $h->markdown('Test')); @@ -33,13 +33,13 @@ class TextHelperTest extends Base public function testMarkdownUserLink() { - $h = new Text($this->container); + $h = new TextHelper($this->container); $this->assertEquals('<p>Text <a href="?controller=user&action=profile&user_id=1" class="user-mention-link">@admin</a> @notfound</p>', $h->markdown('Text @admin @notfound')); } public function testFormatBytes() { - $h = new Text($this->container); + $h = new TextHelper($this->container); $this->assertEquals('1k', $h->bytes(1024)); $this->assertEquals('33.71k', $h->bytes(34520)); @@ -47,7 +47,7 @@ class TextHelperTest extends Base public function testContains() { - $h = new Text($this->container); + $h = new TextHelper($this->container); $this->assertTrue($h->contains('abc', 'b')); $this->assertFalse($h->contains('abc', 'd')); @@ -55,7 +55,7 @@ class TextHelperTest extends Base public function testInList() { - $h = new Text($this->container); + $h = new TextHelper($this->container); $this->assertEquals('?', $h->in('a', array('b' => 'c'))); $this->assertEquals('c', $h->in('b', array('b' => 'c'))); } diff --git a/tests/units/Helper/UrlHelperTest.php b/tests/units/Helper/UrlHelperTest.php index 15e01237..34ab7604 100644 --- a/tests/units/Helper/UrlHelperTest.php +++ b/tests/units/Helper/UrlHelperTest.php @@ -2,7 +2,7 @@ require_once __DIR__.'/../Base.php'; -use Kanboard\Helper\Url; +use Kanboard\Helper\UrlHelper; use Kanboard\Model\Config; use Kanboard\Core\Http\Request; @@ -10,7 +10,7 @@ class UrlHelperTest extends Base { public function testPluginLink() { - $h = new Url($this->container); + $h = new UrlHelper($this->container); $this->assertEquals( '<a href="?controller=a&action=b&d=e&plugin=something" class="f" title=\'g\' target="_blank">label</a>', $h->link('label', 'a', 'b', array('d' => 'e', 'plugin' => 'something'), false, 'f', 'g', true) @@ -22,7 +22,7 @@ class UrlHelperTest extends Base $this->container['route']->enable(); $this->container['route']->addRoute('/myplugin/something/:d', 'a', 'b', 'something'); - $h = new Url($this->container); + $h = new UrlHelper($this->container); $this->assertEquals( '<a href="myplugin/something/e" class="f" title=\'g\' target="_blank">label</a>', $h->link('label', 'a', 'b', array('d' => 'e', 'plugin' => 'something'), false, 'f', 'g', true) @@ -31,7 +31,7 @@ class UrlHelperTest extends Base public function testAppLink() { - $h = new Url($this->container); + $h = new UrlHelper($this->container); $this->assertEquals( '<a href="?controller=a&action=b&d=e" class="f" title=\'g\' target="_blank">label</a>', $h->link('label', 'a', 'b', array('d' => 'e'), false, 'f', 'g', true) @@ -40,7 +40,7 @@ class UrlHelperTest extends Base public function testHref() { - $h = new Url($this->container); + $h = new UrlHelper($this->container); $this->assertEquals( '?controller=a&action=b&d=e', $h->href('a', 'b', array('d' => 'e')) @@ -49,7 +49,7 @@ class UrlHelperTest extends Base public function testTo() { - $h = new Url($this->container); + $h = new UrlHelper($this->container); $this->assertEquals( '?controller=a&action=b&d=e', $h->to('a', 'b', array('d' => 'e')) @@ -64,7 +64,7 @@ class UrlHelperTest extends Base ) ); - $h = new Url($this->container); + $h = new UrlHelper($this->container); $this->assertEquals('/kanboard/', $h->dir()); $this->container['request'] = new Request($this->container, array( @@ -73,7 +73,7 @@ class UrlHelperTest extends Base ) ); - $h = new Url($this->container); + $h = new UrlHelper($this->container); $this->assertEquals('/', $h->dir()); } @@ -87,7 +87,7 @@ class UrlHelperTest extends Base ) ); - $h = new Url($this->container); + $h = new UrlHelper($this->container); $this->assertEquals('http://localhost/', $h->server()); $this->container['request'] = new Request($this->container, array( @@ -98,7 +98,7 @@ class UrlHelperTest extends Base ) ); - $h = new Url($this->container); + $h = new UrlHelper($this->container); $this->assertEquals('http://kb:1234/', $h->server()); } @@ -112,14 +112,14 @@ class UrlHelperTest extends Base ) ); - $h = new Url($this->container); + $h = new UrlHelper($this->container); $this->assertEquals('http://kb:1234/', $h->base()); $c = new Config($this->container); $c->save(array('application_url' => 'https://mykanboard/')); $this->container['memoryCache']->flush(); - $h = new Url($this->container); + $h = new UrlHelper($this->container); $this->assertEquals('https://mykanboard/', $c->get('application_url')); $this->assertEquals('https://mykanboard/', $h->base()); } diff --git a/tests/units/Helper/UserHelperTest.php b/tests/units/Helper/UserHelperTest.php index f1099faa..7ee6e8bb 100644 --- a/tests/units/Helper/UserHelperTest.php +++ b/tests/units/Helper/UserHelperTest.php @@ -2,7 +2,7 @@ require_once __DIR__.'/../Base.php'; -use Kanboard\Helper\User; +use Kanboard\Helper\UserHelper; use Kanboard\Model\Project; use Kanboard\Model\ProjectUserRole; use Kanboard\Model\User as UserModel; @@ -12,7 +12,7 @@ class UserHelperTest extends Base { public function testInitials() { - $helper = new User($this->container); + $helper = new UserHelper($this->container); $this->assertEquals('CN', $helper->getInitials('chuck norris')); $this->assertEquals('A', $helper->getInitials('admin')); @@ -20,7 +20,7 @@ class UserHelperTest extends Base public function testGetRoleName() { - $helper = new User($this->container); + $helper = new UserHelper($this->container); $this->assertEquals('Administrator', $helper->getRoleName(Role::APP_ADMIN)); $this->assertEquals('Manager', $helper->getRoleName(Role::APP_MANAGER)); $this->assertEquals('Project Viewer', $helper->getRoleName(Role::PROJECT_VIEWER)); @@ -28,7 +28,7 @@ class UserHelperTest extends Base public function testHasAccessForAdmins() { - $helper = new User($this->container); + $helper = new UserHelper($this->container); $this->container['sessionStorage']->user = array( 'id' => 2, @@ -42,7 +42,7 @@ class UserHelperTest extends Base public function testHasAccessForManagers() { - $helper = new User($this->container); + $helper = new UserHelper($this->container); $this->container['sessionStorage']->user = array( 'id' => 2, @@ -56,7 +56,7 @@ class UserHelperTest extends Base public function testHasAccessForUsers() { - $helper = new User($this->container); + $helper = new UserHelper($this->container); $this->container['sessionStorage']->user = array( 'id' => 2, @@ -70,7 +70,7 @@ class UserHelperTest extends Base public function testHasProjectAccessForAdmins() { - $helper = new User($this->container); + $helper = new UserHelper($this->container); $project = new Project($this->container); $this->container['sessionStorage']->user = array( @@ -86,7 +86,7 @@ class UserHelperTest extends Base public function testHasProjectAccessForManagers() { - $helper = new User($this->container); + $helper = new UserHelper($this->container); $project = new Project($this->container); $this->container['sessionStorage']->user = array( @@ -102,7 +102,7 @@ class UserHelperTest extends Base public function testHasProjectAccessForUsers() { - $helper = new User($this->container); + $helper = new UserHelper($this->container); $project = new Project($this->container); $this->container['sessionStorage']->user = array( @@ -118,7 +118,7 @@ class UserHelperTest extends Base public function testHasProjectAccessForAppManagerAndProjectManagers() { - $helper = new User($this->container); + $helper = new UserHelper($this->container); $user = new UserModel($this->container); $project = new Project($this->container); $projectUserRole = new ProjectUserRole($this->container); @@ -146,7 +146,7 @@ class UserHelperTest extends Base public function testHasProjectAccessForProjectManagers() { - $helper = new User($this->container); + $helper = new UserHelper($this->container); $user = new UserModel($this->container); $project = new Project($this->container); $projectUserRole = new ProjectUserRole($this->container); @@ -174,7 +174,7 @@ class UserHelperTest extends Base public function testHasProjectAccessForProjectMembers() { - $helper = new User($this->container); + $helper = new UserHelper($this->container); $user = new UserModel($this->container); $project = new Project($this->container); $projectUserRole = new ProjectUserRole($this->container); @@ -202,7 +202,7 @@ class UserHelperTest extends Base public function testHasProjectAccessForProjectViewers() { - $helper = new User($this->container); + $helper = new UserHelper($this->container); $user = new UserModel($this->container); $project = new Project($this->container); $projectUserRole = new ProjectUserRole($this->container); |