diff --git a/app/Action/Base.php b/app/Action/Base.php index 0d8bd565f..f29e9323d 100644 --- a/app/Action/Base.php +++ b/app/Action/Base.php @@ -10,17 +10,8 @@ use Pimple\Container; * * @package action * @author Frederic Guillot - * - * @property \Model\UserSession $userSession - * @property \Model\Comment $comment - * @property \Model\Task $task - * @property \Model\TaskCreation $taskCreation - * @property \Model\TaskModification $taskModification - * @property \Model\TaskDuplication $taskDuplication - * @property \Model\TaskFinder $taskFinder - * @property \Model\TaskStatus $taskStatus */ -abstract class Base +abstract class Base extends \Core\Base { /** * Flag for called listener @@ -135,18 +126,6 @@ abstract class Base return get_called_class(); } - /** - * Load automatically models - * - * @access public - * @param string $name Model name - * @return mixed - */ - public function __get($name) - { - return $this->container[$name]; - } - /** * Set an user defined parameter * diff --git a/app/Api/Base.php b/app/Api/Base.php index e9494b586..1b2258afe 100644 --- a/app/Api/Base.php +++ b/app/Api/Base.php @@ -2,7 +2,6 @@ namespace Api; -use Pimple\Container; use JsonRPC\AuthenticationFailure; use Symfony\Component\EventDispatcher\Event; @@ -11,56 +10,9 @@ use Symfony\Component\EventDispatcher\Event; * * @package api * @author Frederic Guillot - * - * @property \Model\Board $board - * @property \Model\Config $config - * @property \Model\Comment $comment - * @property \Model\LastLogin $lastLogin - * @property \Model\Notification $notification - * @property \Model\Project $project - * @property \Model\ProjectPermission $projectPermission - * @property \Model\ProjectActivity $projectActivity - * @property \Model\ProjectAnalytic $projectAnalytic - * @property \Model\ProjectDailySummary $projectDailySummary - * @property \Model\Subtask $subtask - * @property \Model\Task $task - * @property \Model\TaskDuplication $taskDuplication - * @property \Model\TaskExport $taskExport - * @property \Model\TaskFinder $taskFinder */ -abstract class Base +abstract class Base extends \Core\Base { - /** - * Container instance - * - * @access protected - * @var \Pimple\Container - */ - protected $container; - - /** - * Constructor - * - * @access public - * @param \Pimple\Container $container - */ - public function __construct(Container $container) - { - $this->container = $container; - } - - /** - * Load automatically models - * - * @access public - * @param string $name Model name - * @return mixed - */ - public function __get($name) - { - return $this->container[$name]; - } - /** * Check api credentials * diff --git a/app/Auth/Base.php b/app/Auth/Base.php index e2209e1ff..ebf6681bd 100644 --- a/app/Auth/Base.php +++ b/app/Auth/Base.php @@ -9,14 +9,8 @@ use Pimple\Container; * * @package auth * @author Frederic Guillot - * - * @property \Core\Session $session - * @property \Model\Acl $acl - * @property \Model\LastLogin $lastLogin - * @property \Model\User $user - * @property \Model\UserSession $userSession */ -abstract class Base +abstract class Base extends \Core\Base { /** * Database instance @@ -26,14 +20,6 @@ abstract class Base */ protected $db; - /** - * Container instance - * - * @access protected - * @var \Pimple\Container - */ - protected $container; - /** * Constructor * @@ -45,16 +31,4 @@ abstract class Base $this->container = $container; $this->db = $this->container['db']; } - - /** - * Load automatically models - * - * @access public - * @param string $name Model name - * @return mixed - */ - public function __get($name) - { - return $this->container[$name]; - } } diff --git a/app/Controller/App.php b/app/Controller/App.php index e4a97f8e0..8a97e8c74 100644 --- a/app/Controller/App.php +++ b/app/Controller/App.php @@ -90,7 +90,7 @@ class App extends Base $this->response->html('

'.t('Nothing to preview...').'

'); } - $this->response->html($this->template->markdown($payload['text'])); + $this->response->html($this->helper->text->markdown($payload['text'])); } /** diff --git a/app/Controller/Auth.php b/app/Controller/Auth.php index c1859304d..24e6e2428 100644 --- a/app/Controller/Auth.php +++ b/app/Controller/Auth.php @@ -18,7 +18,7 @@ class Auth extends Base public function login(array $values = array(), array $errors = array()) { if ($this->userSession->isLogged()) { - $this->response->redirect($this->helper->url('app', 'index')); + $this->response->redirect($this->helper->url->to('app', 'index')); } $this->response->html($this->template->layout('auth/index', array( @@ -47,7 +47,7 @@ class Auth extends Base $this->response->redirect('?'.urldecode($redirect_query)); } - $this->response->redirect($this->helper->url('app', 'index')); + $this->response->redirect($this->helper->url->to('app', 'index')); } $this->login($values, $errors); @@ -62,6 +62,6 @@ class Auth extends Base { $this->authentication->backend('rememberMe')->destroy($this->userSession->getId()); $this->session->close(); - $this->response->redirect($this->helper->url('auth', 'login')); + $this->response->redirect($this->helper->url->to('auth', 'login')); } } diff --git a/app/Controller/Base.php b/app/Controller/Base.php index 30d0b4e48..19de6a935 100644 --- a/app/Controller/Base.php +++ b/app/Controller/Base.php @@ -16,67 +16,8 @@ use Symfony\Component\EventDispatcher\Event; * * @package controller * @author Frederic Guillot - * - * @property \Core\Helper $helper - * @property \Core\Session $session - * @property \Core\Template $template - * @property \Core\Paginator $paginator - * @property \Integration\GithubWebhook $githubWebhook - * @property \Integration\GitlabWebhook $gitlabWebhook - * @property \Integration\BitbucketWebhook $bitbucketWebhook - * @property \Integration\PostmarkWebhook $postmarkWebhook - * @property \Integration\SendgridWebhook $sendgridWebhook - * @property \Integration\MailgunWebhook $mailgunWebhook - * @property \Model\Acl $acl - * @property \Model\Authentication $authentication - * @property \Model\Action $action - * @property \Model\Board $board - * @property \Model\Category $category - * @property \Model\Color $color - * @property \Model\Comment $comment - * @property \Model\Config $config - * @property \Model\DateParser $dateParser - * @property \Model\File $file - * @property \Model\HourlyRate $hourlyRate - * @property \Model\LastLogin $lastLogin - * @property \Model\Notification $notification - * @property \Model\Project $project - * @property \Model\ProjectPermission $projectPermission - * @property \Model\ProjectDuplication $projectDuplication - * @property \Model\ProjectAnalytic $projectAnalytic - * @property \Model\ProjectActivity $projectActivity - * @property \Model\ProjectDailySummary $projectDailySummary - * @property \Model\ProjectIntegration $projectIntegration - * @property \Model\Subtask $subtask - * @property \Model\SubtaskForecast $subtaskForecast - * @property \Model\Swimlane $swimlane - * @property \Model\Task $task - * @property \Model\Link $link - * @property \Model\TaskCreation $taskCreation - * @property \Model\TaskModification $taskModification - * @property \Model\TaskDuplication $taskDuplication - * @property \Model\TaskHistory $taskHistory - * @property \Model\TaskExport $taskExport - * @property \Model\TaskFinder $taskFinder - * @property \Model\TaskFilter $taskFilter - * @property \Model\TaskPosition $taskPosition - * @property \Model\TaskPermission $taskPermission - * @property \Model\TaskStatus $taskStatus - * @property \Model\Timetable $timetable - * @property \Model\TimetableDay $timetableDay - * @property \Model\TimetableWeek $timetableWeek - * @property \Model\TimetableExtra $timetableExtra - * @property \Model\TimetableOff $timetableOff - * @property \Model\TaskValidator $taskValidator - * @property \Model\TaskLink $taskLink - * @property \Model\CommentHistory $commentHistory - * @property \Model\SubtaskHistory $subtaskHistory - * @property \Model\SubtaskTimeTracking $subtaskTimeTracking - * @property \Model\User $user - * @property \Model\UserSession $userSession - * @property \Model\Webhook $webhook */ -abstract class Base +abstract class Base extends \Core\Base { /** * Request instance @@ -94,14 +35,6 @@ abstract class Base */ protected $response; - /** - * Container instance - * - * @access private - * @var \Pimple\Container - */ - private $container; - /** * Constructor * @@ -133,18 +66,6 @@ abstract class Base } } - /** - * Load automatically models - * - * @access public - * @param string $name Model name - * @return mixed - */ - public function __get($name) - { - return $this->container[$name]; - } - /** * Send HTTP headers * @@ -201,7 +122,7 @@ abstract class Base $this->response->text('Not Authorized', 401); } - $this->response->redirect($this->helper->url('auth', 'login', array('redirect_query' => urlencode($this->request->getQueryString())))); + $this->response->redirect($this->helper->url->to('auth', 'login', array('redirect_query' => urlencode($this->request->getQueryString())))); } } @@ -220,7 +141,7 @@ abstract class Base $this->response->text('Not Authorized', 401); } - $this->response->redirect($this->helper->url('twofactor', 'code')); + $this->response->redirect($this->helper->url->to('twofactor', 'code')); } } diff --git a/app/Controller/Board.php b/app/Controller/Board.php index 07c99a969..2b633d825 100644 --- a/app/Controller/Board.php +++ b/app/Controller/Board.php @@ -295,7 +295,7 @@ class Board extends Base $this->session->flashError(t('Unable to update your task.')); } - $this->response->redirect($this->helper->url('board', 'show', array('project_id' => $values['project_id']))); + $this->response->redirect($this->helper->url->to('board', 'show', array('project_id' => $values['project_id']))); } /** @@ -333,7 +333,7 @@ class Board extends Base $this->session->flashError(t('Unable to update your task.')); } - $this->response->redirect($this->helper->url('board', 'show', array('project_id' => $values['project_id']))); + $this->response->redirect($this->helper->url->to('board', 'show', array('project_id' => $values['project_id']))); } /** diff --git a/app/Controller/Budget.php b/app/Controller/Budget.php index 2c56c79df..45dad7fbb 100644 --- a/app/Controller/Budget.php +++ b/app/Controller/Budget.php @@ -88,7 +88,7 @@ class Budget extends Base if ($this->budget->create($values['project_id'], $values['amount'], $values['comment'], $values['date'])) { $this->session->flash(t('The budget line have been created successfully.')); - $this->response->redirect($this->helper->url('budget', 'create', array('project_id' => $project['id']))); + $this->response->redirect($this->helper->url->to('budget', 'create', array('project_id' => $project['id']))); } else { $this->session->flashError(t('Unable to create the budget line.')); @@ -130,6 +130,6 @@ class Budget extends Base $this->session->flashError(t('Unable to remove this budget line.')); } - $this->response->redirect($this->helper->url('budget', 'create', array('project_id' => $project['id']))); + $this->response->redirect($this->helper->url->to('budget', 'create', array('project_id' => $project['id']))); } } diff --git a/app/Controller/Column.php b/app/Controller/Column.php index 69ca5dd20..89c495a6e 100644 --- a/app/Controller/Column.php +++ b/app/Controller/Column.php @@ -57,7 +57,7 @@ class Column extends Base if ($this->board->addColumn($project['id'], $data['title'], $data['task_limit'], $data['description'])) { $this->session->flash(t('Board updated successfully.')); - $this->response->redirect($this->helper->url('column', 'index', array('project_id' => $project['id']))); + $this->response->redirect($this->helper->url->to('column', 'index', array('project_id' => $project['id']))); } else { $this->session->flashError(t('Unable to update this board.')); @@ -102,7 +102,7 @@ class Column extends Base if ($this->board->updateColumn($values['id'], $values['title'], $values['task_limit'], $values['description'])) { $this->session->flash(t('Board updated successfully.')); - $this->response->redirect($this->helper->url('column', 'index', array('project_id' => $project['id']))); + $this->response->redirect($this->helper->url->to('column', 'index', array('project_id' => $project['id']))); } else { $this->session->flashError(t('Unable to update this board.')); @@ -128,7 +128,7 @@ class Column extends Base $this->board->{'move'.$direction}($project['id'], $column_id); } - $this->response->redirect($this->helper->url('column', 'index', array('project_id' => $project['id']))); + $this->response->redirect($this->helper->url->to('column', 'index', array('project_id' => $project['id']))); } /** @@ -165,6 +165,6 @@ class Column extends Base $this->session->flashError(t('Unable to remove this column.')); } - $this->response->redirect($this->helper->url('column', 'index', array('project_id' => $project['id']))); + $this->response->redirect($this->helper->url->to('column', 'index', array('project_id' => $project['id']))); } } diff --git a/app/Controller/Currency.php b/app/Controller/Currency.php index fac34a301..10fb90da6 100644 --- a/app/Controller/Currency.php +++ b/app/Controller/Currency.php @@ -57,7 +57,7 @@ class Currency extends Base if ($this->currency->create($values['currency'], $values['rate'])) { $this->session->flash(t('The currency rate have been added successfully.')); - $this->response->redirect($this->helper->url('currency', 'index')); + $this->response->redirect($this->helper->url->to('currency', 'index')); } else { $this->session->flashError(t('Unable to add this currency rate.')); @@ -84,6 +84,6 @@ class Currency extends Base $this->session->flashError(t('Unable to save your settings.')); } - $this->response->redirect($this->helper->url('currency', 'index')); + $this->response->redirect($this->helper->url->to('currency', 'index')); } } diff --git a/app/Controller/File.php b/app/Controller/File.php index 39032abcc..f03675373 100644 --- a/app/Controller/File.php +++ b/app/Controller/File.php @@ -24,10 +24,10 @@ class File extends Base $this->session->flash(t('Screenshot uploaded successfully.')); if ($this->request->getStringParam('redirect') === 'board') { - $this->response->redirect($this->helper->url('board', 'show', array('project_id' => $task['project_id']))); + $this->response->redirect($this->helper->url->to('board', 'show', array('project_id' => $task['project_id']))); } - $this->response->redirect($this->helper->url('task', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id']))); + $this->response->redirect($this->helper->url->to('task', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id']))); } $this->response->html($this->taskLayout('file/screenshot', array( @@ -64,7 +64,7 @@ class File extends Base $this->session->flashError(t('Unable to upload the file.')); } - $this->response->redirect($this->helper->url('task', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id']))); + $this->response->redirect($this->helper->url->to('task', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id']))); } /** @@ -83,7 +83,7 @@ class File extends Base $this->response->binary(file_get_contents($filename)); } - $this->response->redirect($this->helper->url('task', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id']))); + $this->response->redirect($this->helper->url->to('task', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id']))); } /** @@ -164,7 +164,7 @@ class File extends Base $this->session->flashError(t('Unable to remove this file.')); } - $this->response->redirect($this->helper->url('task', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id']))); + $this->response->redirect($this->helper->url->to('task', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id']))); } /** diff --git a/app/Controller/Hourlyrate.php b/app/Controller/Hourlyrate.php index 8d96e5ca0..19650ede4 100644 --- a/app/Controller/Hourlyrate.php +++ b/app/Controller/Hourlyrate.php @@ -42,7 +42,7 @@ class Hourlyrate extends User if ($this->hourlyRate->create($values['user_id'], $values['rate'], $values['currency'], $values['date_effective'])) { $this->session->flash(t('Hourly rate created successfully.')); - $this->response->redirect($this->helper->url('hourlyrate', 'index', array('user_id' => $values['user_id']))); + $this->response->redirect($this->helper->url->to('hourlyrate', 'index', array('user_id' => $values['user_id']))); } else { $this->session->flashError(t('Unable to save the hourly rate.')); @@ -84,6 +84,6 @@ class Hourlyrate extends User $this->session->flash(t('Unable to remove this rate.')); } - $this->response->redirect($this->helper->url('hourlyrate', 'index', array('user_id' => $user['id']))); + $this->response->redirect($this->helper->url->to('hourlyrate', 'index', array('user_id' => $user['id']))); } } diff --git a/app/Controller/Link.php b/app/Controller/Link.php index 4a29a3e2c..8eac84941 100644 --- a/app/Controller/Link.php +++ b/app/Controller/Link.php @@ -73,7 +73,7 @@ class Link extends Base if ($this->link->create($values['label'], $values['opposite_label'])) { $this->session->flash(t('Link added successfully.')); - $this->response->redirect($this->helper->url('link', 'index')); + $this->response->redirect($this->helper->url->to('link', 'index')); } else { $this->session->flashError(t('Unable to create your link.')); @@ -115,7 +115,7 @@ class Link extends Base if ($valid) { if ($this->link->update($values)) { $this->session->flash(t('Link updated successfully.')); - $this->response->redirect($this->helper->url('link', 'index')); + $this->response->redirect($this->helper->url->to('link', 'index')); } else { $this->session->flashError(t('Unable to update your link.')); @@ -157,6 +157,6 @@ class Link extends Base $this->session->flashError(t('Unable to remove this link.')); } - $this->response->redirect($this->helper->url('link', 'index')); + $this->response->redirect($this->helper->url->to('link', 'index')); } } diff --git a/app/Controller/Subtask.php b/app/Controller/Subtask.php index 5eff1575b..5baa6004c 100644 --- a/app/Controller/Subtask.php +++ b/app/Controller/Subtask.php @@ -252,11 +252,11 @@ class Subtask extends Base { switch ($redirect) { case 'board': - $this->response->redirect($this->helper->url('board', 'show', array('project_id' => $task['project_id']))); + $this->response->redirect($this->helper->url->to('board', 'show', array('project_id' => $task['project_id']))); case 'dashboard': - $this->response->redirect($this->helper->url('app', 'index')); + $this->response->redirect($this->helper->url->to('app', 'index')); default: - $this->response->redirect($this->helper->url('task', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id']))); + $this->response->redirect($this->helper->url->to('task', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id']))); } } @@ -275,6 +275,6 @@ class Subtask extends Base $method = $direction === 'up' ? 'moveUp' : 'moveDown'; $this->subtask->$method($task_id, $subtask_id); - $this->response->redirect($this->helper->url('task', 'show', array('project_id' => $project_id, 'task_id' => $task_id)).'#subtasks'); + $this->response->redirect($this->helper->url->to('task', 'show', array('project_id' => $project_id, 'task_id' => $task_id)).'#subtasks'); } } diff --git a/app/Controller/Task.php b/app/Controller/Task.php index c2e66245b..dc83f7b16 100644 --- a/app/Controller/Task.php +++ b/app/Controller/Task.php @@ -288,10 +288,10 @@ class Task extends Base } if ($redirect === 'board') { - $this->response->redirect($this->helper->url('board', 'show', array('project_id' => $task['project_id']))); + $this->response->redirect($this->helper->url->to('board', 'show', array('project_id' => $task['project_id']))); } - $this->response->redirect($this->helper->url('task', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id']))); + $this->response->redirect($this->helper->url->to('task', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id']))); } if ($this->request->isAjax()) { diff --git a/app/Controller/Tasklink.php b/app/Controller/Tasklink.php index eccf149f5..dd076802b 100644 --- a/app/Controller/Tasklink.php +++ b/app/Controller/Tasklink.php @@ -77,10 +77,10 @@ class Tasklink extends Base $this->session->flash(t('Link added successfully.')); if ($ajax) { - $this->response->redirect($this->helper->url('board', 'show', array('project_id' => $task['project_id']))); + $this->response->redirect($this->helper->url->to('board', 'show', array('project_id' => $task['project_id']))); } - $this->response->redirect($this->helper->url('task', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id'])).'#links'); + $this->response->redirect($this->helper->url->to('task', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id'])).'#links'); } $errors = array('title' => array(t('The exact same link already exists'))); @@ -132,7 +132,7 @@ class Tasklink extends Base if ($this->taskLink->update($values['id'], $values['task_id'], $values['opposite_task_id'], $values['link_id'])) { $this->session->flash(t('Link updated successfully.')); - $this->response->redirect($this->helper->url('task', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id'])).'#links'); + $this->response->redirect($this->helper->url->to('task', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id'])).'#links'); } $this->session->flashError(t('Unable to update your link.')); @@ -174,6 +174,6 @@ class Tasklink extends Base $this->session->flashError(t('Unable to remove this link.')); } - $this->response->redirect($this->helper->url('task', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id'])).'#links'); + $this->response->redirect($this->helper->url->to('task', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id'])).'#links'); } } diff --git a/app/Controller/Timetableday.php b/app/Controller/Timetableday.php index eea44ae1b..c8f7ac8aa 100644 --- a/app/Controller/Timetableday.php +++ b/app/Controller/Timetableday.php @@ -41,7 +41,7 @@ class Timetableday extends User if ($this->timetableDay->create($values['user_id'], $values['start'], $values['end'])) { $this->session->flash(t('Time slot created successfully.')); - $this->response->redirect($this->helper->url('timetableday', 'index', array('user_id' => $values['user_id']))); + $this->response->redirect($this->helper->url->to('timetableday', 'index', array('user_id' => $values['user_id']))); } else { $this->session->flashError(t('Unable to save this time slot.')); @@ -83,6 +83,6 @@ class Timetableday extends User $this->session->flash(t('Unable to remove this time slot.')); } - $this->response->redirect($this->helper->url('timetableday', 'index', array('user_id' => $user['id']))); + $this->response->redirect($this->helper->url->to('timetableday', 'index', array('user_id' => $user['id']))); } } diff --git a/app/Controller/Timetableoff.php b/app/Controller/Timetableoff.php index 19a6fab10..585014a30 100644 --- a/app/Controller/Timetableoff.php +++ b/app/Controller/Timetableoff.php @@ -60,7 +60,7 @@ class Timetableoff extends User $values['comment'])) { $this->session->flash(t('Time slot created successfully.')); - $this->response->redirect($this->helper->url($this->controller_url, 'index', array('user_id' => $values['user_id']))); + $this->response->redirect($this->helper->url->to($this->controller_url, 'index', array('user_id' => $values['user_id']))); } else { $this->session->flashError(t('Unable to save this time slot.')); @@ -102,6 +102,6 @@ class Timetableoff extends User $this->session->flash(t('Unable to remove this time slot.')); } - $this->response->redirect($this->helper->url($this->controller_url, 'index', array('user_id' => $user['id']))); + $this->response->redirect($this->helper->url->to($this->controller_url, 'index', array('user_id' => $user['id']))); } } diff --git a/app/Controller/Timetableweek.php b/app/Controller/Timetableweek.php index 829f44028..b8ce00e77 100644 --- a/app/Controller/Timetableweek.php +++ b/app/Controller/Timetableweek.php @@ -52,7 +52,7 @@ class Timetableweek extends User if ($this->timetableWeek->create($values['user_id'], $values['day'], $values['start'], $values['end'])) { $this->session->flash(t('Time slot created successfully.')); - $this->response->redirect($this->helper->url('timetableweek', 'index', array('user_id' => $values['user_id']))); + $this->response->redirect($this->helper->url->to('timetableweek', 'index', array('user_id' => $values['user_id']))); } else { $this->session->flashError(t('Unable to save this time slot.')); @@ -94,6 +94,6 @@ class Timetableweek extends User $this->session->flash(t('Unable to remove this time slot.')); } - $this->response->redirect($this->helper->url('timetableweek', 'index', array('user_id' => $user['id']))); + $this->response->redirect($this->helper->url->to('timetableweek', 'index', array('user_id' => $user['id']))); } } diff --git a/app/Controller/Twofactor.php b/app/Controller/Twofactor.php index c21729bae..a8b0351f0 100644 --- a/app/Controller/Twofactor.php +++ b/app/Controller/Twofactor.php @@ -76,7 +76,7 @@ class Twofactor extends User $_SESSION['user']['twofactor_activated'] = false; $this->session->flash(t('User updated successfully.')); - $this->response->redirect($this->helper->url('twofactor', 'index', array('user_id' => $user['id']))); + $this->response->redirect($this->helper->url->to('twofactor', 'index', array('user_id' => $user['id']))); } /** @@ -99,7 +99,7 @@ class Twofactor extends User $this->session->flashError(t('The two factor authentication code is not valid.')); } - $this->response->redirect($this->helper->url('twofactor', 'index', array('user_id' => $user['id']))); + $this->response->redirect($this->helper->url->to('twofactor', 'index', array('user_id' => $user['id']))); } /** @@ -118,11 +118,11 @@ class Twofactor extends User if (! empty($values['code']) && $otp->checkTotp(Base32::decode($user['twofactor_secret']), $values['code'])) { $this->session['2fa_validated'] = true; $this->session->flash(t('The two factor authentication code is valid.')); - $this->response->redirect($this->helper->url('app', 'index')); + $this->response->redirect($this->helper->url->to('app', 'index')); } else { $this->session->flashError(t('The two factor authentication code is not valid.')); - $this->response->redirect($this->helper->url('twofactor', 'code')); + $this->response->redirect($this->helper->url->to('twofactor', 'code')); } } @@ -157,7 +157,7 @@ class Twofactor extends User 'twofactor_secret' => '', )); - $this->response->redirect($this->helper->url('user', 'show', array('user_id' => $user['id']))); + $this->response->redirect($this->helper->url->to('user', 'show', array('user_id' => $user['id']))); } $this->response->html($this->layout('twofactor/disable', array( diff --git a/app/Controller/User.php b/app/Controller/User.php index c8496418d..b049c9264 100644 --- a/app/Controller/User.php +++ b/app/Controller/User.php @@ -268,7 +268,7 @@ class User extends Base $this->session->flashError(t('Unable to update this user.')); } - $this->response->redirect($this->helper->url('user', 'share', array('user_id' => $user['id']))); + $this->response->redirect($this->helper->url->to('user', 'share', array('user_id' => $user['id']))); } $this->response->html($this->layout('user/share', array( diff --git a/app/Controller/Webhook.php b/app/Controller/Webhook.php index 667c50879..c79b4ed68 100644 --- a/app/Controller/Webhook.php +++ b/app/Controller/Webhook.php @@ -96,7 +96,7 @@ class Webhook extends Base $this->bitbucketWebhook->setProjectId($this->request->getIntegerParam('project_id')); - $result = $this->bitbucketWebhook->parsePayload(json_decode(@$_POST['payload'], true)); + $result = $this->bitbucketWebhook->parsePayload(json_decode(@$_POST['payload'], true) ?: array()); echo $result ? 'PARSED' : 'IGNORED'; } diff --git a/app/Core/Base.php b/app/Core/Base.php new file mode 100644 index 000000000..cb8e44871 --- /dev/null +++ b/app/Core/Base.php @@ -0,0 +1,110 @@ +container = $container; + } + + /** + * Load automatically models + * + * @access public + * @param string $name Model name + * @return mixed + */ + public function __get($name) + { + return $this->container[$name]; + } +} diff --git a/app/Core/FileCache.php b/app/Core/FileCache.php deleted file mode 100644 index 2037f2717..000000000 --- a/app/Core/FileCache.php +++ /dev/null @@ -1,41 +0,0 @@ -container = $container; - } - - /** - * Load automatically models - * - * @access public - * @param string $name Model name + * @param string $name Helper name * @return mixed */ public function __get($name) { - return $this->container[$name]; - } - - /** - * Get the age of an item in quasi human readable format. - * It's in this format: <1h , NNh, NNd - * - * @access public - * @param integer $timestamp Unix timestamp of the artifact for which age will be calculated - * @param integer $now Compare with this timestamp (Default value is the current unix timestamp) - * @return string - */ - public function getTaskAge($timestamp, $now = null) - { - if ($now === null) { - $now = time(); + if (! isset(self::$helpers[$name])) { + $class = '\Helper\\'.ucfirst($name); + self::$helpers[$name] = new $class($this->container); } - $diff = $now - $timestamp; - - if ($diff < 3600) { - return t('<1h'); - } - else if ($diff < 86400) { - return t('%dh', $diff / 3600); - } - - return t('%dd', ($now - $timestamp) / 86400); - } - - /** - * Proxy cache helper for acl::isManagerActionAllowed() - * - * @access public - * @param integer $project_id - * @return boolean - */ - public function isManager($project_id) - { - if ($this->userSession->isAdmin()) { - return true; - } - - return $this->container['memoryCache']->proxy('acl', 'isManagerActionAllowed', $project_id); - } - - /** - * Return the user full name - * - * @param array $user User properties - * @return string - */ - public function getFullname(array $user = array()) - { - return $this->user->getFullname(empty($user) ? $_SESSION['user'] : $user); + return self::$helpers[$name]; } /** @@ -113,688 +57,4 @@ class Helper { return htmlspecialchars($value, ENT_QUOTES, 'UTF-8', false); } - - /** - * Add a Javascript asset - * - * @param string $filename Filename - * @return string - */ - public function js($filename) - { - return ''; - } - - /** - * Add a stylesheet asset - * - * @param string $filename Filename - * @param boolean $is_file Add file timestamp - * @param string $media Media - * @return string - */ - public function css($filename, $is_file = true, $media = 'screen') - { - return ''; - } - - /** - * Display the form error class - * - * @param array $errors Error list - * @param string $name Field name - * @return string - */ - public function errorClass(array $errors, $name) - { - return ! isset($errors[$name]) ? '' : ' form-error'; - } - - /** - * Display a list of form errors - * - * @param array $errors List of errors - * @param string $name Field name - * @return string - */ - public function errorList(array $errors, $name) - { - $html = ''; - - if (isset($errors[$name])) { - - $html .= ''; - } - - return $html; - } - - /** - * Get an escaped form value - * - * @param mixed $values Values - * @param string $name Field name - * @return string - */ - public function formValue($values, $name) - { - if (isset($values->$name)) { - return 'value="'.$this->e($values->$name).'"'; - } - - return isset($values[$name]) ? 'value="'.$this->e($values[$name]).'"' : ''; - } - - /** - * Hidden CSRF token field - * - * @return string - */ - public function formCsrf() - { - return ''; - } - - /** - * Display a hidden form field - * - * @param string $name Field name - * @param array $values Form values - * @return string - */ - public function formHidden($name, array $values = array()) - { - return 'formValue($values, $name).'/>'; - } - - /** - * Display a select field - * - * @param string $name Field name - * @param array $options Options - * @param array $values Form values - * @param array $errors Form errors - * @param string $class CSS class - * @return string - */ - public function formSelect($name, array $options, array $values = array(), array $errors = array(), array $attributes = array(), $class = '') - { - $html = ''; - $html .= $this->errorList($errors, $name); - - return $html; - } - - /** - * Display a radio field group - * - * @param string $name Field name - * @param array $options Options - * @param array $values Form values - * @return string - */ - public function formRadios($name, array $options, array $values = array()) - { - $html = ''; - - foreach ($options as $value => $label) { - $html .= $this->formRadio($name, $label, $value, isset($values[$name]) && $values[$name] == $value); - } - - return $html; - } - - /** - * Display a radio field - * - * @param string $name Field name - * @param string $label Form label - * @param string $value Form value - * @param boolean $selected Field selected or not - * @param string $class CSS class - * @return string - */ - public function formRadio($name, $label, $value, $selected = false, $class = '') - { - return ''; - } - - /** - * Display a checkbox field - * - * @param string $name Field name - * @param string $label Form label - * @param string $value Form value - * @param boolean $checked Field selected or not - * @param string $class CSS class - * @return string - */ - public function formCheckbox($name, $label, $value, $checked = false, $class = '') - { - return ''; - } - - /** - * Display a form label - * - * @param string $name Field name - * @param string $label Form label - * @param array $attributes HTML attributes - * @return string - */ - public function formLabel($label, $name, array $attributes = array()) - { - return ''; - } - - /** - * Display a textarea - * - * @param string $name Field name - * @param array $values Form values - * @param array $errors Form errors - * @param array $attributes HTML attributes - * @param string $class CSS class - * @return string - */ - public function formTextarea($name, $values = array(), array $errors = array(), array $attributes = array(), $class = '') - { - $class .= $this->errorClass($errors, $name); - - $html = ''; - $html .= $this->errorList($errors, $name); - - return $html; - } - - /** - * Display a input field - * - * @param string $type HMTL input tag type - * @param string $name Field name - * @param array $values Form values - * @param array $errors Form errors - * @param array $attributes HTML attributes - * @param string $class CSS class - * @return string - */ - public function formInput($type, $name, $values = array(), array $errors = array(), array $attributes = array(), $class = '') - { - $class .= $this->errorClass($errors, $name); - - $html = 'formValue($values, $name).' class="'.$class.'" '; - $html .= implode(' ', $attributes).'/>'; - if (in_array('required', $attributes)) $html .= '*'; - $html .= $this->errorList($errors, $name); - - return $html; - } - - /** - * Display a text field - * - * @param string $name Field name - * @param array $values Form values - * @param array $errors Form errors - * @param array $attributes HTML attributes - * @param string $class CSS class - * @return string - */ - public function formText($name, $values = array(), array $errors = array(), array $attributes = array(), $class = '') - { - return $this->formInput('text', $name, $values, $errors, $attributes, $class); - } - - /** - * Display a password field - * - * @param string $name Field name - * @param array $values Form values - * @param array $errors Form errors - * @param array $attributes HTML attributes - * @param string $class CSS class - * @return string - */ - public function formPassword($name, $values = array(), array $errors = array(), array $attributes = array(), $class = '') - { - return $this->formInput('password', $name, $values, $errors, $attributes, $class); - } - - /** - * Display an email field - * - * @param string $name Field name - * @param array $values Form values - * @param array $errors Form errors - * @param array $attributes HTML attributes - * @param string $class CSS class - * @return string - */ - public function formEmail($name, $values = array(), array $errors = array(), array $attributes = array(), $class = '') - { - return $this->formInput('email', $name, $values, $errors, $attributes, $class); - } - - /** - * Display a number field - * - * @param string $name Field name - * @param array $values Form values - * @param array $errors Form errors - * @param array $attributes HTML attributes - * @param string $class CSS class - * @return string - */ - public function formNumber($name, $values = array(), array $errors = array(), array $attributes = array(), $class = '') - { - return $this->formInput('number', $name, $values, $errors, $attributes, $class); - } - - /** - * Display a numeric field (allow decimal number) - * - * @param string $name Field name - * @param array $values Form values - * @param array $errors Form errors - * @param array $attributes HTML attributes - * @param string $class CSS class - * @return string - */ - public function formNumeric($name, $values = array(), array $errors = array(), array $attributes = array(), $class = '') - { - return $this->formInput('text', $name, $values, $errors, $attributes, $class.' form-numeric'); - } - - /** - * Link - * - * a('link', 'task', 'show', array('task_id' => $task_id)) - * - * @param string $label Link label - * @param string $controller Controller name - * @param string $action Action name - * @param array $params Url parameters - * @param boolean $csrf Add a CSRF token - * @param string $class CSS class attribute - * @param boolean $new_tab Open the link in a new tab - * @return string - */ - public function a($label, $controller, $action, array $params = array(), $csrf = false, $class = '', $title = '', $new_tab = false) - { - return ''.$label.''; - } - - /** - * Generate controller/action url for templates - * - * u('task', 'show', array('task_id' => $task_id)) - * - * @param string $controller Controller name - * @param string $action Action name - * @param array $params Url parameters - * @param boolean $csrf Add a CSRF token - * @return string - */ - public function u($controller, $action, array $params = array(), $csrf = false) - { - $values = array( - 'controller' => $controller, - 'action' => $action, - ); - - if ($csrf) { - $params['csrf_token'] = Security::getCSRFToken(); - } - - $values += $params; - - return '?'.http_build_query($values, '', '&'); - } - - /** - * Generate controller/action url - * - * l('task', 'show', array('task_id' => $task_id)) - * - * @param string $controller Controller name - * @param string $action Action name - * @param array $params Url parameters - * @return string - */ - public function url($controller, $action, array $params = array()) - { - $values = array( - 'controller' => $controller, - 'action' => $action, - ); - - $values += $params; - - return '?'.http_build_query($values); - } - - /** - * Markdown transformation - * - * @param string $text Markdown content - * @param array $link Link parameters for replacement - * @return string - */ - public function markdown($text, array $link = array()) - { - $parser = new Markdown($link, $this); - $parser->setMarkupEscaped(MARKDOWN_ESCAPE_HTML); - return $parser->text($text); - } - - /** - * Get the current URL without the querystring - * - * @return string - */ - public function getCurrentBaseUrl() - { - $application_url = $this->config->get('application_url'); - - if (! empty($application_url)) { - return $application_url; - } - - $self = str_replace('\\', '/', dirname($_SERVER['PHP_SELF'])); - - $url = Request::isHTTPS() ? 'https://' : 'http://'; - $url .= $_SERVER['SERVER_NAME']; - $url .= $_SERVER['SERVER_PORT'] == 80 || $_SERVER['SERVER_PORT'] == 443 ? '' : ':'.$_SERVER['SERVER_PORT']; - $url .= $self !== '/' ? $self.'/' : '/'; - - return $url; - } - - /** - * Dispplay the flash session message - * - * @param string $html HTML wrapper - * @return string - */ - public function flash($html) - { - return $this->flashMessage('flash_message', $html); - } - - /** - * Display the flash session error message - * - * @param string $html HTML wrapper - * @return string - */ - public function flashError($html) - { - return $this->flashMessage('flash_error_message', $html); - } - - /** - * Fetch and remove a flash session message - * - * @access private - * @param string $name Message name - * @param string $html HTML wrapper - * @return string - */ - private function flashMessage($name, $html) - { - $data = ''; - - if (isset($this->session[$name])) { - $data = sprintf($html, $this->e($this->session[$name])); - unset($this->session[$name]); - } - - return $data; - } - - /** - * Format a file size - * - * @param integer $size Size in bytes - * @param integer $precision Precision - * @return string - */ - public function formatBytes($size, $precision = 2) - { - $base = log($size) / log(1024); - $suffixes = array('', 'k', 'M', 'G', 'T'); - - return round(pow(1024, $base - floor($base)), $precision).$suffixes[(int)floor($base)]; - } - - /** - * Truncate a long text - * - * @param string $value Text - * @param integer $max_length Max Length - * @param string $end Text end - * @return string - */ - public function summary($value, $max_length = 85, $end = '[...]') - { - $length = strlen($value); - - if ($length > $max_length) { - return substr($value, 0, $max_length).' '.$end; - } - - return $value; - } - - /** - * Return true if needle is contained in the haystack - * - * @param string $haystack Haystack - * @param string $needle Needle - * @return boolean - */ - public function contains($haystack, $needle) - { - return strpos($haystack, $needle) !== false; - } - - /** - * Return a value from a dictionary - * - * @param mixed $id Key - * @param array $listing Dictionary - * @param string $default_value Value displayed when the key doesn't exists - * @return string - */ - public function inList($id, array $listing, $default_value = '?') - { - if (isset($listing[$id])) { - return $this->e($listing[$id]); - } - - return $default_value; - } - - /** - * Get javascript language code - * - * @access public - * @return string - */ - public function jsLang() - { - return $this->config->getJsLanguageCode(); - } - - /** - * Get current timezone - * - * @access public - * @return string - */ - public function getTimezone() - { - return $this->config->getCurrentTimezone(); - } - - /** - * Get the link to toggle subtask status - * - * @access public - * @param array $subtask - * @param string $redirect - * @return string - */ - public function toggleSubtaskStatus(array $subtask, $redirect) - { - if ($subtask['status'] == 0 && isset($this->session['has_subtask_inprogress']) && $this->session['has_subtask_inprogress'] === true) { - - return $this->a( - trim($this->render('subtask/icons', array('subtask' => $subtask))) . $this->e($subtask['title']), - 'subtask', - 'subtaskRestriction', - array('task_id' => $subtask['task_id'], 'subtask_id' => $subtask['id'], 'redirect' => $redirect), - false, - 'popover task-board-popover' - ); - } - - return $this->a( - trim($this->render('subtask/icons', array('subtask' => $subtask))) . $this->e($subtask['title']), - 'subtask', - 'toggleStatus', - array('task_id' => $subtask['task_id'], 'subtask_id' => $subtask['id'], 'redirect' => $redirect) - ); - } - - /** - * Get all hours for day - * - * @access public - * @return array - */ - public function getDayHours() - { - $values = array(); - - foreach (range(0, 23) as $hour) { - foreach (array(0, 30) as $minute) { - $time = sprintf('%02d:%02d', $hour, $minute); - $values[$time] = $time; - } - } - - return $values; - } - - /** - * Get all days of a week - * - * @access public - * @return array - */ - public function getWeekDays() - { - $values = array(); - - foreach (range(1, 7) as $day) { - $values[$day] = $this->getWeekDay($day); - } - - return $values; - } - - /** - * Get the localized day name from the day number - * - * @access public - * @param integer $day Day number - * @return string - */ - public function getWeekDay($day) - { - return dt('%A', strtotime('next Monday +'.($day - 1).' days')); - } - - /** - * Get file icon - * - * @access public - * @param string $filename Filename - * @return string Font-Awesome-Icon-Name - */ - public function getFileIcon($filename){ - - $extension = strtolower(pathinfo($filename, PATHINFO_EXTENSION)); - - switch ($extension) { - case 'jpeg': - case 'jpg': - case 'png': - case 'gif': - return 'fa-file-image-o'; - case 'xls': - case 'xlsx': - return 'fa-file-excel-o'; - case 'doc': - case 'docx': - return 'fa-file-word-o'; - case 'ppt': - case 'pptx': - return 'fa-file-powerpoint-o'; - case 'zip': - case 'rar': - return 'fa-file-archive-o'; - case 'mp3': - return 'fa-audio-o'; - case 'avi': - return 'fa-video-o'; - case 'php': - case 'html': - case 'css': - return 'fa-code-o'; - case 'pdf': - return 'fa-file-pdf-o'; - } - - return 'fa-file-o'; - } - - /** - * Display gravatar image - * - * @access public - * @param string $email - * @param string $alt - * @return string - */ - public function avatar($email, $alt = '') - { - if (! empty($email) && $this->config->get('integration_gravatar') == 1) { - return ''.$this->e($alt).''; - } - - return ''; - } } diff --git a/app/Core/Markdown.php b/app/Core/Markdown.php index 3dd986178..fa4e8080a 100644 --- a/app/Core/Markdown.php +++ b/app/Core/Markdown.php @@ -3,6 +3,7 @@ namespace Core; use Parsedown; +use Helper\Url; /** * Specific Markdown rules for Kanboard @@ -15,8 +16,8 @@ class Markdown extends Parsedown { private $link; private $helper; - - public function __construct($link, Helper $helper) + + public function __construct($link, Url $helper) { $this->link = $link; $this->helper = $helper; @@ -29,9 +30,12 @@ class Markdown extends Parsedown // Replace task #123 by a link to the task if (! empty($this->link) && preg_match('!#(\d+)!i', $Excerpt['text'], $matches)) { - $url = $this->helper->u($this->link['controller'], - $this->link['action'], - $this->link['params'] + array('task_id' => $matches[1])); + $url = $this->helper->href( + $this->link['controller'], + $this->link['action'], + $this->link['params'] + array('task_id' => $matches[1]) + ); + return array( 'extent' => strlen($matches[0]), 'element' => array( diff --git a/app/Core/Paginator.php b/app/Core/Paginator.php index 4d4364ddb..12cc05a13 100644 --- a/app/Core/Paginator.php +++ b/app/Core/Paginator.php @@ -349,7 +349,7 @@ class Paginator $html = ''; if ($this->offset > 0) { - $html .= $this->container['helper']->a( + $html .= $this->container['helper']->url->link( '← '.t('Previous'), $this->controller, $this->action, @@ -376,7 +376,7 @@ class Paginator $html = ''; if (($this->total - $this->offset) > $this->limit) { - $html .= $this->container['helper']->a( + $html .= $this->container['helper']->url->link( t('Next').' →', $this->controller, $this->action, @@ -451,7 +451,7 @@ class Paginator $direction = $this->direction === 'DESC' ? 'ASC' : 'DESC'; } - return $prefix.$this->container['helper']->a( + return $prefix.$this->container['helper']->url->link( $label, $this->controller, $this->action, diff --git a/app/Helper/App.php b/app/Helper/App.php new file mode 100644 index 000000000..8f5911439 --- /dev/null +++ b/app/Helper/App.php @@ -0,0 +1,56 @@ +config->getJsLanguageCode(); + } + + /** + * Get current timezone + * + * @access public + * @return string + */ + public function getTimezone() + { + return $this->config->getCurrentTimezone(); + } + + /** + * Get session flash message + * + * @access public + * @return string + */ + public function flashMessage() + { + $html = ''; + + if (isset($this->session['flash_message'])) { + $html = '
'.$this->helper->e($this->session['flash_message']).'
'; + unset($this->session['flash_message']); + } + else if (isset($this->session['flash_error_message'])) { + $html = '
'.$this->helper->e($this->session['flash_error_message']).'
'; + unset($this->session['flash_error_message']); + } + + return $html; + } +} diff --git a/app/Helper/Asset.php b/app/Helper/Asset.php new file mode 100644 index 000000000..fe2850810 --- /dev/null +++ b/app/Helper/Asset.php @@ -0,0 +1,51 @@ +'; + } + + /** + * Add a stylesheet asset + * + * @param string $filename Filename + * @param boolean $is_file Add file timestamp + * @param string $media Media + * @return string + */ + public function css($filename, $is_file = true, $media = 'screen') + { + return ''; + } + + /** + * Get custom css + * + * @access public + * @return string + */ + public function customCss() + { + if ($this->config->get('application_stylesheet')) { + return ''; + } + + return ''; + } +} diff --git a/app/Helper/Datetime.php b/app/Helper/Datetime.php new file mode 100644 index 000000000..3a9c4c485 --- /dev/null +++ b/app/Helper/Datetime.php @@ -0,0 +1,61 @@ +getWeekDay($day); + } + + return $values; + } + + /** + * Get the localized day name from the day number + * + * @access public + * @param integer $day Day number + * @return string + */ + public function getWeekDay($day) + { + return dt('%A', strtotime('next Monday +'.($day - 1).' days')); + } +} diff --git a/app/Helper/File.php b/app/Helper/File.php new file mode 100644 index 000000000..a35e42834 --- /dev/null +++ b/app/Helper/File.php @@ -0,0 +1,56 @@ +'; + } + + /** + * Display a hidden form field + * + * @access public + * @param string $name Field name + * @param array $values Form values + * @return string + */ + public function hidden($name, array $values = array()) + { + return 'formValue($values, $name).'/>'; + } + + /** + * Display a select field + * + * @access public + * @param string $name Field name + * @param array $options Options + * @param array $values Form values + * @param array $errors Form errors + * @param string $class CSS class + * @return string + */ + public function select($name, array $options, array $values = array(), array $errors = array(), array $attributes = array(), $class = '') + { + $html = ''; + $html .= $this->errorList($errors, $name); + + return $html; + } + + /** + * Display a radio field group + * + * @access public + * @param string $name Field name + * @param array $options Options + * @param array $values Form values + * @return string + */ + public function radios($name, array $options, array $values = array()) + { + $html = ''; + + foreach ($options as $value => $label) { + $html .= $this->radio($name, $label, $value, isset($values[$name]) && $values[$name] == $value); + } + + return $html; + } + + /** + * Display a radio field + * + * @access public + * @param string $name Field name + * @param string $label Form label + * @param string $value Form value + * @param boolean $selected Field selected or not + * @param string $class CSS class + * @return string + */ + public function radio($name, $label, $value, $selected = false, $class = '') + { + return ''; + } + + /** + * Display a checkbox field + * + * @access public + * @param string $name Field name + * @param string $label Form label + * @param string $value Form value + * @param boolean $checked Field selected or not + * @param string $class CSS class + * @return string + */ + public function checkbox($name, $label, $value, $checked = false, $class = '') + { + return ''; + } + + /** + * Display a form label + * + * @access public + * @param string $name Field name + * @param string $label Form label + * @param array $attributes HTML attributes + * @return string + */ + public function label($label, $name, array $attributes = array()) + { + return ''; + } + + /** + * Display a textarea + * + * @access public + * @param string $name Field name + * @param array $values Form values + * @param array $errors Form errors + * @param array $attributes HTML attributes + * @param string $class CSS class + * @return string + */ + public function textarea($name, $values = array(), array $errors = array(), array $attributes = array(), $class = '') + { + $class .= $this->errorClass($errors, $name); + + $html = ''; + $html .= $this->errorList($errors, $name); + + return $html; + } + + /** + * Display a input field + * + * @access public + * @param string $type HMTL input tag type + * @param string $name Field name + * @param array $values Form values + * @param array $errors Form errors + * @param array $attributes HTML attributes + * @param string $class CSS class + * @return string + */ + public function input($type, $name, $values = array(), array $errors = array(), array $attributes = array(), $class = '') + { + $class .= $this->errorClass($errors, $name); + + $html = 'formValue($values, $name).' class="'.$class.'" '; + $html .= implode(' ', $attributes).'>'; + + if (in_array('required', $attributes)) { + $html .= '*'; + } + + $html .= $this->errorList($errors, $name); + + return $html; + } + + /** + * Display a text field + * + * @access public + * @param string $name Field name + * @param array $values Form values + * @param array $errors Form errors + * @param array $attributes HTML attributes + * @param string $class CSS class + * @return string + */ + public function text($name, $values = array(), array $errors = array(), array $attributes = array(), $class = '') + { + return $this->input('text', $name, $values, $errors, $attributes, $class); + } + + /** + * Display a password field + * + * @access public + * @param string $name Field name + * @param array $values Form values + * @param array $errors Form errors + * @param array $attributes HTML attributes + * @param string $class CSS class + * @return string + */ + public function password($name, $values = array(), array $errors = array(), array $attributes = array(), $class = '') + { + return $this->input('password', $name, $values, $errors, $attributes, $class); + } + + /** + * Display an email field + * + * @access public + * @param string $name Field name + * @param array $values Form values + * @param array $errors Form errors + * @param array $attributes HTML attributes + * @param string $class CSS class + * @return string + */ + public function email($name, $values = array(), array $errors = array(), array $attributes = array(), $class = '') + { + return $this->input('email', $name, $values, $errors, $attributes, $class); + } + + /** + * Display a number field + * + * @access public + * @param string $name Field name + * @param array $values Form values + * @param array $errors Form errors + * @param array $attributes HTML attributes + * @param string $class CSS class + * @return string + */ + public function number($name, $values = array(), array $errors = array(), array $attributes = array(), $class = '') + { + return $this->input('number', $name, $values, $errors, $attributes, $class); + } + + /** + * Display a numeric field (allow decimal number) + * + * @access public + * @param string $name Field name + * @param array $values Form values + * @param array $errors Form errors + * @param array $attributes HTML attributes + * @param string $class CSS class + * @return string + */ + public function numeric($name, $values = array(), array $errors = array(), array $attributes = array(), $class = '') + { + return $this->input('text', $name, $values, $errors, $attributes, $class.' form-numeric'); + } + + /** + * Display the form error class + * + * @access private + * @param array $errors Error list + * @param string $name Field name + * @return string + */ + private function errorClass(array $errors, $name) + { + return ! isset($errors[$name]) ? '' : ' form-error'; + } + + /** + * Display a list of form errors + * + * @access private + * @param array $errors List of errors + * @param string $name Field name + * @return string + */ + private function errorList(array $errors, $name) + { + $html = ''; + + if (isset($errors[$name])) { + + $html .= ''; + } + + return $html; + } + + /** + * Get an escaped form value + * + * @access private + * @param mixed $values Values + * @param string $name Field name + * @return string + */ + private function formValue($values, $name) + { + if (isset($values->$name)) { + return 'value="'.$this->helper->e($values->$name).'"'; + } + + return isset($values[$name]) ? 'value="'.$this->helper->e($values[$name]).'"' : ''; + } +} diff --git a/app/Helper/Subtask.php b/app/Helper/Subtask.php new file mode 100644 index 000000000..6348ebd12 --- /dev/null +++ b/app/Helper/Subtask.php @@ -0,0 +1,42 @@ +session['has_subtask_inprogress']) && $this->session['has_subtask_inprogress'] === true) { + + return $this->helper->url->link( + trim($this->template->render('subtask/icons', array('subtask' => $subtask))) . $this->helper->e($subtask['title']), + 'subtask', + 'subtaskRestriction', + array('task_id' => $subtask['task_id'], 'subtask_id' => $subtask['id'], 'redirect' => $redirect), + false, + 'popover task-board-popover' + ); + } + + return $this->helper->url->link( + trim($this->template->render('subtask/icons', array('subtask' => $subtask))) . $this->helper->e($subtask['title']), + 'subtask', + 'toggleStatus', + array('task_id' => $subtask['task_id'], 'subtask_id' => $subtask['id'], 'redirect' => $redirect) + ); + } +} diff --git a/app/Helper/Task.php b/app/Helper/Task.php new file mode 100644 index 000000000..b3931cdbd --- /dev/null +++ b/app/Helper/Task.php @@ -0,0 +1,59 @@ +task->getRecurrenceTriggerList(); + } + + public function recurrenceTimeframes() + { + return $this->task->getRecurrenceTimeframeList(); + } + + public function recurrenceBasedates() + { + return $this->task->getRecurrenceBasedateList(); + } + + public function canRemove(array $task) + { + return $this->taskPermission->canRemoveTask($task); + } +} diff --git a/app/Helper/Text.php b/app/Helper/Text.php new file mode 100644 index 000000000..cfb557b1b --- /dev/null +++ b/app/Helper/Text.php @@ -0,0 +1,91 @@ +helper->url); + $parser->setMarkupEscaped(MARKDOWN_ESCAPE_HTML); + return $parser->text($text); + } + + /** + * Format a file size + * + * @param integer $size Size in bytes + * @param integer $precision Precision + * @return string + */ + public function bytes($size, $precision = 2) + { + $base = log($size) / log(1024); + $suffixes = array('', 'k', 'M', 'G', 'T'); + + return round(pow(1024, $base - floor($base)), $precision).$suffixes[(int)floor($base)]; + } + + /** + * Truncate a long text + * + * @param string $value Text + * @param integer $max_length Max Length + * @param string $end Text end + * @return string + */ + public function truncate($value, $max_length = 85, $end = '[...]') + { + $length = strlen($value); + + if ($length > $max_length) { + return substr($value, 0, $max_length).' '.$end; + } + + return $value; + } + + /** + * Return true if needle is contained in the haystack + * + * @param string $haystack Haystack + * @param string $needle Needle + * @return boolean + */ + public function contains($haystack, $needle) + { + return strpos($haystack, $needle) !== false; + } + + /** + * Return a value from a dictionary + * + * @param mixed $id Key + * @param array $listing Dictionary + * @param string $default_value Value displayed when the key doesn't exists + * @return string + */ + public function in($id, array $listing, $default_value = '?') + { + if (isset($listing[$id])) { + return $this->helper->e($listing[$id]); + } + + return $default_value; + } +} diff --git a/app/Helper/Url.php b/app/Helper/Url.php new file mode 100644 index 000000000..9bb38e591 --- /dev/null +++ b/app/Helper/Url.php @@ -0,0 +1,115 @@ +href($controller, $action, $params, $csrf).'" class="'.$class.'" title="'.$title.'" '.($new_tab ? 'target="_blank"' : '').'>'.$label.''; + } + + /** + * Hyperlink + * + * @access public + * @param string $controller Controller name + * @param string $action Action name + * @param array $params Url parameters + * @param boolean $csrf Add a CSRF token + * @return string + */ + public function href($controller, $action, array $params = array(), $csrf = false) + { + $values = array( + 'controller' => $controller, + 'action' => $action, + ); + + if ($csrf) { + $params['csrf_token'] = Security::getCSRFToken(); + } + + $values += $params; + + return '?'.http_build_query($values, '', '&'); + } + + /** + * Generate controller/action url + * + * @access public + * @param string $controller Controller name + * @param string $action Action name + * @param array $params Url parameters + * @return string + */ + public function to($controller, $action, array $params = array()) + { + $values = array( + 'controller' => $controller, + 'action' => $action, + ); + + $values += $params; + + return '?'.http_build_query($values, '', '&'); + } + + /** + * Get application base url + * + * @access public + * @return string + */ + public function base() + { + $application_url = $this->config->get('application_url'); + + if (! empty($application_url)) { + return $application_url; + } + + return $this->server(); + } + + /** + * Get current server base url + * + * @access public + * @return string + */ + public function server() + { + $self = str_replace('\\', '/', dirname($_SERVER['PHP_SELF'])); + + $url = Request::isHTTPS() ? 'https://' : 'http://'; + $url .= $_SERVER['SERVER_NAME']; + $url .= $_SERVER['SERVER_PORT'] == 80 || $_SERVER['SERVER_PORT'] == 443 ? '' : ':'.$_SERVER['SERVER_PORT']; + $url .= $self !== '/' ? $self.'/' : '/'; + + return $url; + } +} diff --git a/app/Helper/User.php b/app/Helper/User.php new file mode 100644 index 000000000..000188575 --- /dev/null +++ b/app/Helper/User.php @@ -0,0 +1,93 @@ +helper->url->link( + $this->helper->e($this->getFullname()), + 'user', + 'show', + array('user_id' => $this->userSession->getId()) + ); + } + /** + * Check if the given user_id is the connected user + * + * @param integer $user_id User id + * @return boolean + */ + public function isCurrentUser($user_id) + { + return $this->userSession->getId() == $user_id; + } + + /** + * Return if the logged user is admin + * + * @access public + * @return boolean + */ + public function isAdmin() + { + return $this->userSession->isAdmin(); + } + + /** + * Proxy cache helper for acl::isManagerActionAllowed() + * + * @access public + * @param integer $project_id + * @return boolean + */ + public function isManager($project_id) + { + if ($this->userSession->isAdmin()) { + return true; + } + + return $this->memoryCache->proxy('acl', 'isManagerActionAllowed', $project_id); + } + + /** + * Return the user full name + * + * @param array $user User properties + * @return string + */ + public function getFullname(array $user = array()) + { + return $this->user->getFullname(empty($user) ? $_SESSION['user'] : $user); + } + + /** + * Display gravatar image + * + * @access public + * @param string $email + * @param string $alt + * @return string + */ + public function avatar($email, $alt = '') + { + if (! empty($email) && $this->config->get('integration_gravatar') == 1) { + return ''.$this->helper->e($alt).''; + } + + return ''; + } +} diff --git a/app/Integration/Base.php b/app/Integration/Base.php deleted file mode 100644 index dbb0349aa..000000000 --- a/app/Integration/Base.php +++ /dev/null @@ -1,53 +0,0 @@ -container = $container; - } - - /** - * Load automatically class from the container - * - * @access public - * @param string $name - * @return mixed - */ - public function __get($name) - { - return $this->container[$name]; - } -} diff --git a/app/Integration/BitbucketWebhook.php b/app/Integration/BitbucketWebhook.php index 7ff8087e6..75fc1c814 100644 --- a/app/Integration/BitbucketWebhook.php +++ b/app/Integration/BitbucketWebhook.php @@ -11,7 +11,7 @@ use Model\Task; * @package integration * @author Frederic Guillot */ -class BitbucketWebhook extends Base +class BitbucketWebhook extends \Core\Base { /** * Events diff --git a/app/Integration/GithubWebhook.php b/app/Integration/GithubWebhook.php index 0070c3093..d95eba782 100644 --- a/app/Integration/GithubWebhook.php +++ b/app/Integration/GithubWebhook.php @@ -11,7 +11,7 @@ use Model\Task; * @package integration * @author Frederic Guillot */ -class GithubWebhook extends Base +class GithubWebhook extends \Core\Base { /** * Events diff --git a/app/Integration/GitlabWebhook.php b/app/Integration/GitlabWebhook.php index e30a0b508..8a11f5c6c 100644 --- a/app/Integration/GitlabWebhook.php +++ b/app/Integration/GitlabWebhook.php @@ -12,7 +12,7 @@ use Model\Task; * @package integration * @author Frederic Guillot */ -class GitlabWebhook extends Base +class GitlabWebhook extends \Core\Base { /** * Events diff --git a/app/Integration/HipchatWebhook.php b/app/Integration/HipchatWebhook.php index 03b85232a..591909590 100644 --- a/app/Integration/HipchatWebhook.php +++ b/app/Integration/HipchatWebhook.php @@ -8,7 +8,7 @@ namespace Integration; * @package integration * @author Frederic Guillot */ -class HipchatWebhook extends Base +class HipchatWebhook extends \Core\Base { /** * Return true if Hipchat is enabled for this project or globally diff --git a/app/Integration/Jabber.php b/app/Integration/Jabber.php index d6917186e..c956cc47b 100644 --- a/app/Integration/Jabber.php +++ b/app/Integration/Jabber.php @@ -14,7 +14,7 @@ use Fabiang\Xmpp\Protocol\Presence; * @package integration * @author Frederic Guillot */ -class Jabber extends Base +class Jabber extends \Core\Base { /** * Return true if Jabber is enabled for this project or globally @@ -82,7 +82,7 @@ class Jabber extends Base if ($this->config->get('application_url')) { $payload .= ' '.$this->config->get('application_url'); - $payload .= $this->helper->url('task', 'show', array('task_id' => $task_id, 'project_id' => $project_id)); + $payload .= $this->helper->url->to('task', 'show', array('task_id' => $task_id, 'project_id' => $project_id)); } $this->sendMessage($project_id, $payload); diff --git a/app/Integration/MailgunWebhook.php b/app/Integration/MailgunWebhook.php index 8e5425134..50d96a4a1 100644 --- a/app/Integration/MailgunWebhook.php +++ b/app/Integration/MailgunWebhook.php @@ -11,7 +11,7 @@ use Core\Tool; * @package integration * @author Frederic Guillot */ -class MailgunWebhook extends Base +class MailgunWebhook extends \Core\Base { /** * Parse incoming email diff --git a/app/Integration/PostmarkWebhook.php b/app/Integration/PostmarkWebhook.php index 642955df7..9051e5f7a 100644 --- a/app/Integration/PostmarkWebhook.php +++ b/app/Integration/PostmarkWebhook.php @@ -10,7 +10,7 @@ use HTML_To_Markdown; * @package integration * @author Frederic Guillot */ -class PostmarkWebhook extends Base +class PostmarkWebhook extends \Core\Base { /** * Parse incoming email diff --git a/app/Integration/SendgridWebhook.php b/app/Integration/SendgridWebhook.php index 142ed49f1..9125f00b2 100644 --- a/app/Integration/SendgridWebhook.php +++ b/app/Integration/SendgridWebhook.php @@ -11,7 +11,7 @@ use Core\Tool; * @package integration * @author Frederic Guillot */ -class SendgridWebhook extends Base +class SendgridWebhook extends \Core\Base { /** * Parse incoming email diff --git a/app/Integration/SlackWebhook.php b/app/Integration/SlackWebhook.php index b64096fb9..4d2ae3a34 100644 --- a/app/Integration/SlackWebhook.php +++ b/app/Integration/SlackWebhook.php @@ -8,7 +8,7 @@ namespace Integration; * @package integration * @author Frederic Guillot */ -class SlackWebhook extends Base +class SlackWebhook extends \Core\Base { /** * Return true if Slack is enabled for this project or globally diff --git a/app/Model/Base.php b/app/Model/Base.php index dd902bb34..03d0f8f0e 100644 --- a/app/Model/Base.php +++ b/app/Model/Base.php @@ -9,51 +9,8 @@ use Pimple\Container; * * @package model * @author Frederic Guillot - * - * @property \Core\Session $session - * @property \Core\Template $template - * @property \Model\Acl $acl - * @property \Model\Action $action - * @property \Model\Authentication $authentication - * @property \Model\Board $board - * @property \Model\Budget $budget - * @property \Model\Category $category - * @property \Model\Comment $comment - * @property \Model\CommentHistory $commentHistory - * @property \Model\Color $color - * @property \Model\Config $config - * @property \Model\DateParser $dateParser - * @property \Model\File $file - * @property \Model\Helper $helper - * @property \Model\LastLogin $lastLogin - * @property \Model\Link $link - * @property \Model\Notification $notification - * @property \Model\Project $project - * @property \Model\ProjectDuplication $projectDuplication - * @property \Model\ProjectPermission $projectPermission - * @property \Model\Subtask $subtask - * @property \Model\SubtaskHistory $subtaskHistory - * @property \Model\Swimlane $swimlane - * @property \Model\Task $task - * @property \Model\TaskCreation $taskCreation - * @property \Model\TaskDuplication $taskDuplication - * @property \Model\TaskExport $taskExport - * @property \Model\TaskFinder $taskFinder - * @property \Model\TaskHistory $taskHistory - * @property \Model\TaskLink $taskLink - * @property \Model\TaskPosition $taskPosition - * @property \Model\TaskValidator $taskValidator - * @property \Model\Timetable $timetable - * @property \Model\TimetableDay $timetableDay - * @property \Model\TimetableExtra $timetableExtra - * @property \Model\TimetableOff $timetableOff - * @property \Model\TimetableWeek $timetableWeek - * @property \Model\SubtaskTimeTracking $subtaskTimeTracking - * @property \Model\User $user - * @property \Model\UserSession $userSession - * @property \Model\Webhook $webhook */ -abstract class Base +abstract class Base extends \Core\Base { /** * Database instance @@ -63,14 +20,6 @@ abstract class Base */ protected $db; - /** - * Container instance - * - * @access protected - * @var \Pimple\Container - */ - protected $container; - /** * Constructor * @@ -83,18 +32,6 @@ abstract class Base $this->db = $this->container['db']; } - /** - * Load automatically models - * - * @access public - * @param string $name Model name - * @return mixed - */ - public function __get($name) - { - return $this->container[$name]; - } - /** * Save a record in the database * @@ -203,7 +140,7 @@ abstract class Base 'backgroundColor' => $this->color->getBackgroundColor($task['color_id']), 'borderColor' => $this->color->getBorderColor($task['color_id']), 'textColor' => 'black', - 'url' => $this->helper->url('task', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id'])), + 'url' => $this->helper->url->to('task', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id'])), ); } } diff --git a/app/Model/SubtaskForecast.php b/app/Model/SubtaskForecast.php index 0cb3175de..263aa27a3 100644 --- a/app/Model/SubtaskForecast.php +++ b/app/Model/SubtaskForecast.php @@ -96,7 +96,7 @@ class SubtaskForecast extends Base 'id' => $subtasks[$offset]['id'].'-'.$subtasks[$offset]['task_id'].'-'.$offset, 'subtask_id' => $subtasks[$offset]['id'], 'title' => t('#%d', $subtasks[$offset]['task_id']).' '.$subtasks[$offset]['title'], - 'url' => $this->helper->url('task', 'show', array('task_id' => $subtasks[$offset]['task_id'], 'project_id' => $subtasks[$offset]['project_id'])), + 'url' => $this->helper->url->to('task', 'show', array('task_id' => $subtasks[$offset]['task_id'], 'project_id' => $subtasks[$offset]['project_id'])), 'editable' => false, 'start' => date('Y-m-d\TH:i:s', $start), ); diff --git a/app/Model/SubtaskTimeTracking.php b/app/Model/SubtaskTimeTracking.php index 6d4a3467c..d4edf6602 100644 --- a/app/Model/SubtaskTimeTracking.php +++ b/app/Model/SubtaskTimeTracking.php @@ -196,7 +196,7 @@ class SubtaskTimeTracking extends Base 'backgroundColor' => $this->color->getBackgroundColor($row['color_id']), 'borderColor' => $this->color->getBorderColor($row['color_id']), 'textColor' => 'black', - 'url' => $this->helper->url('task', 'show', array('task_id' => $row['task_id'], 'project_id' => $row['project_id'])), + 'url' => $this->helper->url->to('task', 'show', array('task_id' => $row['task_id'], 'project_id' => $row['project_id'])), 'editable' => false, ); } diff --git a/app/Model/TaskFilter.php b/app/Model/TaskFilter.php index c4c568003..1fdf0a507 100644 --- a/app/Model/TaskFilter.php +++ b/app/Model/TaskFilter.php @@ -450,7 +450,7 @@ class TaskFilter extends Base $vEvent->setModified($dateModif); $vEvent->setUseTimezone(true); $vEvent->setSummary(t('#%d', $task['id']).' '.$task['title']); - $vEvent->setUrl($this->helper->getCurrentBaseUrl().$this->helper->url('task', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id']))); + $vEvent->setUrl($this->helper->url->base().$this->helper->url->to('task', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id']))); if (! empty($task['creator_id'])) { $vEvent->setOrganizer('MAILTO:'.($task['creator_email'] ?: $task['creator_username'].'@kanboard.local')); diff --git a/app/Model/UserSession.php b/app/Model/UserSession.php index efb027221..6703a1bc3 100644 --- a/app/Model/UserSession.php +++ b/app/Model/UserSession.php @@ -85,17 +85,6 @@ class UserSession extends Base return isset($this->session['user']['id']) ? (int) $this->session['user']['id'] : 0; } - /** - * Check if the given user_id is the connected user - * - * @param integer $user_id User id - * @return boolean - */ - public function isCurrentUser($user_id) - { - return $this->getId() == $user_id; - } - /** * Check is the user is connected * diff --git a/app/ServiceProvider/ClassProvider.php b/app/ServiceProvider/ClassProvider.php index c016b7ebf..ced7c7c6b 100644 --- a/app/ServiceProvider/ClassProvider.php +++ b/app/ServiceProvider/ClassProvider.php @@ -55,9 +55,9 @@ class ClassProvider implements ServiceProviderInterface 'TaskValidator', 'Timetable', 'TimetableDay', + 'TimetableExtra', 'TimetableWeek', 'TimetableOff', - 'TimetableExtra', 'Transition', 'User', 'UserSession', @@ -65,23 +65,22 @@ class ClassProvider implements ServiceProviderInterface ), 'Core' => array( 'Helper', - 'Template', - 'Session', - 'MemoryCache', - 'FileCache', - 'Request', 'HttpClient', + 'MemoryCache', + 'Request', + 'Session', + 'Template', ), 'Integration' => array( - 'GitlabWebhook', - 'GithubWebhook', 'BitbucketWebhook', + 'GithubWebhook', + 'GitlabWebhook', 'HipchatWebhook', + 'Jabber', 'MailgunWebhook', + 'PostmarkWebhook', 'SendgridWebhook', 'SlackWebhook', - 'PostmarkWebhook', - 'Jabber', ) ); diff --git a/app/Subscriber/AuthSubscriber.php b/app/Subscriber/AuthSubscriber.php index 161a7afd9..b814057fe 100644 --- a/app/Subscriber/AuthSubscriber.php +++ b/app/Subscriber/AuthSubscriber.php @@ -6,7 +6,7 @@ use Core\Request; use Event\AuthEvent; use Symfony\Component\EventDispatcher\EventSubscriberInterface; -class AuthSubscriber extends Base implements EventSubscriberInterface +class AuthSubscriber extends \Core\Base implements EventSubscriberInterface { public static function getSubscribedEvents() { diff --git a/app/Subscriber/Base.php b/app/Subscriber/Base.php deleted file mode 100644 index 100406262..000000000 --- a/app/Subscriber/Base.php +++ /dev/null @@ -1,66 +0,0 @@ -container = $container; - } - - /** - * Load automatically models - * - * @access public - * @param string $name Model name - * @return mixed - */ - public function __get($name) - { - return $this->container[$name]; - } -} diff --git a/app/Subscriber/BootstrapSubscriber.php b/app/Subscriber/BootstrapSubscriber.php index 35d0eff9e..793ba3e76 100644 --- a/app/Subscriber/BootstrapSubscriber.php +++ b/app/Subscriber/BootstrapSubscriber.php @@ -4,7 +4,7 @@ namespace Subscriber; use Symfony\Component\EventDispatcher\EventSubscriberInterface; -class BootstrapSubscriber extends Base implements EventSubscriberInterface +class BootstrapSubscriber extends \Core\Base implements EventSubscriberInterface { public static function getSubscribedEvents() { diff --git a/app/Subscriber/NotificationSubscriber.php b/app/Subscriber/NotificationSubscriber.php index 09ca76259..92d46754b 100644 --- a/app/Subscriber/NotificationSubscriber.php +++ b/app/Subscriber/NotificationSubscriber.php @@ -9,7 +9,7 @@ use Model\Subtask; use Model\File; use Symfony\Component\EventDispatcher\EventSubscriberInterface; -class NotificationSubscriber extends Base implements EventSubscriberInterface +class NotificationSubscriber extends \Core\Base implements EventSubscriberInterface { private $templates = array( Task::EVENT_CREATE => 'task_creation', diff --git a/app/Subscriber/ProjectActivitySubscriber.php b/app/Subscriber/ProjectActivitySubscriber.php index 8988d6c1a..31f771f84 100644 --- a/app/Subscriber/ProjectActivitySubscriber.php +++ b/app/Subscriber/ProjectActivitySubscriber.php @@ -8,7 +8,7 @@ use Model\Comment; use Model\Subtask; use Symfony\Component\EventDispatcher\EventSubscriberInterface; -class ProjectActivitySubscriber extends Base implements EventSubscriberInterface +class ProjectActivitySubscriber extends \Core\Base implements EventSubscriberInterface { public static function getSubscribedEvents() { diff --git a/app/Subscriber/ProjectDailySummarySubscriber.php b/app/Subscriber/ProjectDailySummarySubscriber.php index f865c0368..9e4f15b0b 100644 --- a/app/Subscriber/ProjectDailySummarySubscriber.php +++ b/app/Subscriber/ProjectDailySummarySubscriber.php @@ -6,7 +6,7 @@ use Event\TaskEvent; use Model\Task; use Symfony\Component\EventDispatcher\EventSubscriberInterface; -class ProjectDailySummarySubscriber extends Base implements EventSubscriberInterface +class ProjectDailySummarySubscriber extends \Core\Base implements EventSubscriberInterface { public static function getSubscribedEvents() { diff --git a/app/Subscriber/ProjectModificationDateSubscriber.php b/app/Subscriber/ProjectModificationDateSubscriber.php index 4c5380ff3..2c01173b9 100644 --- a/app/Subscriber/ProjectModificationDateSubscriber.php +++ b/app/Subscriber/ProjectModificationDateSubscriber.php @@ -6,7 +6,7 @@ use Event\GenericEvent; use Model\Task; use Symfony\Component\EventDispatcher\EventSubscriberInterface; -class ProjectModificationDateSubscriber extends Base implements EventSubscriberInterface +class ProjectModificationDateSubscriber extends \Core\Base implements EventSubscriberInterface { public static function getSubscribedEvents() { diff --git a/app/Subscriber/RecurringTaskSubscriber.php b/app/Subscriber/RecurringTaskSubscriber.php index 87418814b..68d704f09 100644 --- a/app/Subscriber/RecurringTaskSubscriber.php +++ b/app/Subscriber/RecurringTaskSubscriber.php @@ -6,7 +6,7 @@ use Event\TaskEvent; use Model\Task; use Symfony\Component\EventDispatcher\EventSubscriberInterface; -class RecurringTaskSubscriber extends Base implements EventSubscriberInterface +class RecurringTaskSubscriber extends \Core\Base implements EventSubscriberInterface { public static function getSubscribedEvents() { diff --git a/app/Subscriber/SubtaskTimesheetSubscriber.php b/app/Subscriber/SubtaskTimesheetSubscriber.php index acae9a4b8..fdaf442f7 100644 --- a/app/Subscriber/SubtaskTimesheetSubscriber.php +++ b/app/Subscriber/SubtaskTimesheetSubscriber.php @@ -6,7 +6,7 @@ use Symfony\Component\EventDispatcher\EventSubscriberInterface; use Model\Subtask; use Event\SubtaskEvent; -class SubtaskTimesheetSubscriber extends Base implements EventSubscriberInterface +class SubtaskTimesheetSubscriber extends \Core\Base implements EventSubscriberInterface { public static function getSubscribedEvents() { diff --git a/app/Subscriber/TaskMovedDateSubscriber.php b/app/Subscriber/TaskMovedDateSubscriber.php index 0e36acfa0..eb04d62cd 100644 --- a/app/Subscriber/TaskMovedDateSubscriber.php +++ b/app/Subscriber/TaskMovedDateSubscriber.php @@ -6,7 +6,7 @@ use Event\TaskEvent; use Model\Task; use Symfony\Component\EventDispatcher\EventSubscriberInterface; -class TaskMovedDateSubscriber extends Base implements EventSubscriberInterface +class TaskMovedDateSubscriber extends \Core\Base implements EventSubscriberInterface { public static function getSubscribedEvents() { diff --git a/app/Subscriber/TransitionSubscriber.php b/app/Subscriber/TransitionSubscriber.php index 347dd37d4..5804dab7a 100644 --- a/app/Subscriber/TransitionSubscriber.php +++ b/app/Subscriber/TransitionSubscriber.php @@ -6,7 +6,7 @@ use Event\TaskEvent; use Model\Task; use Symfony\Component\EventDispatcher\EventSubscriberInterface; -class TransitionSubscriber extends Base implements EventSubscriberInterface +class TransitionSubscriber extends \Core\Base implements EventSubscriberInterface { public static function getSubscribedEvents() { diff --git a/app/Subscriber/WebhookSubscriber.php b/app/Subscriber/WebhookSubscriber.php index e28675bd1..5176a7ff7 100644 --- a/app/Subscriber/WebhookSubscriber.php +++ b/app/Subscriber/WebhookSubscriber.php @@ -11,7 +11,7 @@ use Model\File; use Model\Subtask; use Symfony\Component\EventDispatcher\EventSubscriberInterface; -class WebhookSubscriber extends Base implements EventSubscriberInterface +class WebhookSubscriber extends \Core\Base implements EventSubscriberInterface { public static function getSubscribedEvents() { diff --git a/app/Template/action/event.php b/app/Template/action/event.php index 67a65c19a..7f968a971 100644 --- a/app/Template/action/event.php +++ b/app/Template/action/event.php @@ -3,15 +3,15 @@

-
+ - formCsrf() ?> + form->csrf() ?> - formHidden('project_id', $values) ?> - formHidden('action_name', $values) ?> + form->hidden('project_id', $values) ?> + form->hidden('action_name', $values) ?> - formLabel(t('Event'), 'event_name') ?> - formSelect('event_name', $events, $values) ?>
+ form->label(t('Event'), 'event_name') ?> + form->select('event_name', $events, $values) ?>
@@ -20,6 +20,6 @@
- a(t('cancel'), 'action', 'index', array('project_id' => $project['id'])) ?> + url->link(t('cancel'), 'action', 'index', array('project_id' => $project['id'])) ?>
\ No newline at end of file diff --git a/app/Template/action/index.php b/app/Template/action/index.php index e388fbc93..9e98554cf 100644 --- a/app/Template/action/index.php +++ b/app/Template/action/index.php @@ -15,25 +15,25 @@ - inList($action['event_name'], $available_events) ?> - inList($action['action_name'], $available_actions) ?> + text->in($action['event_name'], $available_events) ?> + text->in($action['action_name'], $available_actions) ?>
  • - inList($param['name'], $available_params) ?> = + text->in($param['name'], $available_params) ?> = - contains($param['name'], 'column_id')): ?> - inList($param['value'], $columns_list) ?> - contains($param['name'], 'user_id')): ?> - inList($param['value'], $users_list) ?> - contains($param['name'], 'project_id')): ?> - inList($param['value'], $projects_list) ?> - contains($param['name'], 'color_id')): ?> - inList($param['value'], $colors_list) ?> - contains($param['name'], 'category_id')): ?> - inList($param['value'], $categories_list) ?> - contains($param['name'], 'label')): ?> + text->contains($param['name'], 'column_id')): ?> + text->in($param['value'], $columns_list) ?> + text->contains($param['name'], 'user_id')): ?> + text->in($param['value'], $users_list) ?> + text->contains($param['name'], 'project_id')): ?> + text->in($param['value'], $projects_list) ?> + text->contains($param['name'], 'color_id')): ?> + text->in($param['value'], $colors_list) ?> + text->contains($param['name'], 'category_id')): ?> + text->in($param['value'], $categories_list) ?> + text->contains($param['name'], 'label')): ?> e($param['value']) ?> @@ -42,7 +42,7 @@
- a(t('Remove'), 'action', 'confirm', array('project_id' => $project['id'], 'action_id' => $action['id'])) ?> + url->link(t('Remove'), 'action', 'confirm', array('project_id' => $project['id'], 'action_id' => $action['id'])) ?> @@ -51,12 +51,12 @@

-
- formCsrf() ?> - formHidden('project_id', $values) ?> + + form->csrf() ?> + form->hidden('project_id', $values) ?> - formLabel(t('Action'), 'action_name') ?> - formSelect('action_name', $available_actions, $values) ?>
+ form->label(t('Action'), 'action_name') ?> + form->select('action_name', $available_actions, $values) ?>
diff --git a/app/Template/action/params.php b/app/Template/action/params.php index 3a5ecb860..685cbcc58 100644 --- a/app/Template/action/params.php +++ b/app/Template/action/params.php @@ -3,34 +3,34 @@

- + - formCsrf() ?> + form->csrf() ?> - formHidden('project_id', $values) ?> - formHidden('event_name', $values) ?> - formHidden('action_name', $values) ?> + form->hidden('project_id', $values) ?> + form->hidden('event_name', $values) ?> + form->hidden('action_name', $values) ?> $param_desc): ?> - contains($param_name, 'column_id')): ?> - formLabel($param_desc, $param_name) ?> - formSelect('params['.$param_name.']', $columns_list, $values) ?>
- contains($param_name, 'user_id')): ?> - formLabel($param_desc, $param_name) ?> - formSelect('params['.$param_name.']', $users_list, $values) ?>
- contains($param_name, 'project_id')): ?> - formLabel($param_desc, $param_name) ?> - formSelect('params['.$param_name.']', $projects_list, $values) ?>
- contains($param_name, 'color_id')): ?> - formLabel($param_desc, $param_name) ?> - formSelect('params['.$param_name.']', $colors_list, $values) ?>
- contains($param_name, 'category_id')): ?> - formLabel($param_desc, $param_name) ?> - formSelect('params['.$param_name.']', $categories_list, $values) ?>
- contains($param_name, 'label')): ?> - formLabel($param_desc, $param_name) ?> - formText('params['.$param_name.']', $values) ?> + text->contains($param_name, 'column_id')): ?> + form->label($param_desc, $param_name) ?> + form->select('params['.$param_name.']', $columns_list, $values) ?>
+ text->contains($param_name, 'user_id')): ?> + form->label($param_desc, $param_name) ?> + form->select('params['.$param_name.']', $users_list, $values) ?>
+ text->contains($param_name, 'project_id')): ?> + form->label($param_desc, $param_name) ?> + form->select('params['.$param_name.']', $projects_list, $values) ?>
+ text->contains($param_name, 'color_id')): ?> + form->label($param_desc, $param_name) ?> + form->select('params['.$param_name.']', $colors_list, $values) ?>
+ text->contains($param_name, 'category_id')): ?> + form->label($param_desc, $param_name) ?> + form->select('params['.$param_name.']', $categories_list, $values) ?>
+ text->contains($param_name, 'label')): ?> + form->label($param_desc, $param_name) ?> + form->text('params['.$param_name.']', $values) ?> @@ -38,6 +38,6 @@
- a(t('cancel'), 'action', 'index', array('project_id' => $project['id'])) ?> + url->link(t('cancel'), 'action', 'index', array('project_id' => $project['id'])) ?>
\ No newline at end of file diff --git a/app/Template/action/remove.php b/app/Template/action/remove.php index 672c08a72..c8d4dfe42 100644 --- a/app/Template/action/remove.php +++ b/app/Template/action/remove.php @@ -4,12 +4,12 @@

- inList($action['event_name'], $available_events).'/'.$this->inList($action['action_name'], $available_actions)) ?> + text->in($action['event_name'], $available_events).'/'.$this->text->in($action['action_name'], $available_actions)) ?>

- a(t('Yes'), 'action', 'remove', array('project_id' => $project['id'], 'action_id' => $action['id']), true, 'btn btn-red') ?> + url->link(t('Yes'), 'action', 'remove', array('project_id' => $project['id'], 'action_id' => $action['id']), true, 'btn btn-red') ?> - a(t('cancel'), 'action', 'index', array('project_id' => $project['id'])) ?> + url->link(t('cancel'), 'action', 'index', array('project_id' => $project['id'])) ?>
\ No newline at end of file diff --git a/app/Template/analytic/burndown.php b/app/Template/analytic/burndown.php index 5ebe1032b..839573bea 100644 --- a/app/Template/analytic/burndown.php +++ b/app/Template/analytic/burndown.php @@ -6,24 +6,24 @@

-
+

-
+ - formCsrf() ?> + form->csrf() ?>
- formLabel(t('Start Date'), 'from') ?> - formText('from', $values, array(), array('required', 'placeholder="'.$this->inList($date_format, $date_formats).'"'), 'form-date') ?> + form->label(t('Start Date'), 'from') ?> + form->text('from', $values, array(), array('required', 'placeholder="'.$this->text->in($date_format, $date_formats).'"'), 'form-date') ?>
- formLabel(t('End Date'), 'to') ?> - formText('to', $values, array(), array('required', 'placeholder="'.$this->inList($date_format, $date_formats).'"'), 'form-date') ?> + form->label(t('End Date'), 'to') ?> + form->text('to', $values, array(), array('required', 'placeholder="'.$this->text->in($date_format, $date_formats).'"'), 'form-date') ?>
diff --git a/app/Template/analytic/cfd.php b/app/Template/analytic/cfd.php index 58115e77b..26696b318 100644 --- a/app/Template/analytic/cfd.php +++ b/app/Template/analytic/cfd.php @@ -6,24 +6,24 @@

-
+

- + - formCsrf() ?> + form->csrf() ?>
- formLabel(t('Start Date'), 'from') ?> - formText('from', $values, array(), array('required', 'placeholder="'.$this->inList($date_format, $date_formats).'"'), 'form-date') ?> + form->label(t('Start Date'), 'from') ?> + form->text('from', $values, array(), array('required', 'placeholder="'.$this->text->in($date_format, $date_formats).'"'), 'form-date') ?>
- formLabel(t('End Date'), 'to') ?> - formText('to', $values, array(), array('required', 'placeholder="'.$this->inList($date_format, $date_formats).'"'), 'form-date') ?> + form->label(t('End Date'), 'to') ?> + form->text('to', $values, array(), array('required', 'placeholder="'.$this->text->in($date_format, $date_formats).'"'), 'form-date') ?>
diff --git a/app/Template/analytic/layout.php b/app/Template/analytic/layout.php index c6e3a962c..c3a36bdfa 100644 --- a/app/Template/analytic/layout.php +++ b/app/Template/analytic/layout.php @@ -1,10 +1,10 @@ -js('assets/js/vendor/d3.v3.4.8.min.js') ?> -js('assets/js/vendor/dimple.v2.1.2.min.js') ?> +asset->js('assets/js/vendor/d3.v3.4.8.min.js') ?> +asset->js('assets/js/vendor/dimple.v2.1.2.min.js') ?>
\ No newline at end of file diff --git a/app/Template/analytic/tasks.php b/app/Template/analytic/tasks.php index b1a08a231..faa4bacc9 100644 --- a/app/Template/analytic/tasks.php +++ b/app/Template/analytic/tasks.php @@ -7,7 +7,7 @@
-
+
diff --git a/app/Template/analytic/users.php b/app/Template/analytic/users.php index 97328c02b..982ef2063 100644 --- a/app/Template/analytic/users.php +++ b/app/Template/analytic/users.php @@ -7,7 +7,7 @@
-
+
diff --git a/app/Template/app/dashboard.php b/app/Template/app/dashboard.php index a832345b1..faf49ef52 100644 --- a/app/Template/app/dashboard.php +++ b/app/Template/app/dashboard.php @@ -1,14 +1,14 @@
@@ -18,11 +18,11 @@ diff --git a/app/Template/board/filters.php b/app/Template/board/filters.php index 147295b2d..0617fb47a 100644 --- a/app/Template/board/filters.php +++ b/app/Template/board/filters.php @@ -23,37 +23,37 @@
  • - a(t('Search'), 'project', 'search', array('project_id' => $project['id'])) ?> + url->link(t('Search'), 'project', 'search', array('project_id' => $project['id'])) ?>
  • - a(t('Completed tasks'), 'project', 'tasks', array('project_id' => $project['id'])) ?> + url->link(t('Completed tasks'), 'project', 'tasks', array('project_id' => $project['id'])) ?>
  • - a(t('Activity'), 'project', 'activity', array('project_id' => $project['id'])) ?> + url->link(t('Activity'), 'project', 'activity', array('project_id' => $project['id'])) ?>
  • - a(t('Calendar'), 'calendar', 'show', array('project_id' => $project['id'])) ?> + url->link(t('Calendar'), 'calendar', 'show', array('project_id' => $project['id'])) ?>
  • - a(t('Public link'), 'board', 'readonly', array('token' => $project['token']), false, '', '', true) ?> + url->link(t('Public link'), 'board', 'readonly', array('token' => $project['token']), false, '', '', true) ?>
  • - acl->isManagerActionAllowed($project['id'])): ?> + user->isManager($project['id'])): ?>
  • - a(t('Analytics'), 'analytic', 'tasks', array('project_id' => $project['id'])) ?> + url->link(t('Analytics'), 'analytic', 'tasks', array('project_id' => $project['id'])) ?>
  • - a(t('Budget'), 'budget', 'index', array('project_id' => $project['id'])) ?> + url->link(t('Budget'), 'budget', 'index', array('project_id' => $project['id'])) ?>
  • - a(t('Configure'), 'project', 'show', array('project_id' => $project['id'])) ?> + url->link(t('Configure'), 'project', 'show', array('project_id' => $project['id'])) ?>
  • @@ -61,10 +61,10 @@
  • - formSelect('user_id', $users, array(), array(), array('data-placeholder="'.t('Filter by user').'"', 'data-notfound="'.t('No results match:').'"'), 'apply-filters chosen-select') ?> + form->select('user_id', $users, array(), array(), array('data-placeholder="'.t('Filter by user').'"', 'data-notfound="'.t('No results match:').'"'), 'apply-filters chosen-select') ?>
  • - formSelect('category_id', $categories, array(), array(), array('data-placeholder="'.t('Filter by category').'"', 'data-notfound="'.t('No results match:').'"'), 'apply-filters chosen-select') ?> + form->select('category_id', $categories, array(), array(), array('data-placeholder="'.t('Filter by category').'"', 'data-notfound="'.t('No results match:').'"'), 'apply-filters chosen-select') ?>
  • getCollection() as $record): ?> - - - + + + diff --git a/app/Template/budget/create.php b/app/Template/budget/create.php index 5b2976f4e..d64bbc48c 100644 --- a/app/Template/budget/create.php +++ b/app/Template/budget/create.php @@ -1,8 +1,8 @@ @@ -20,7 +20,7 @@ @@ -29,21 +29,21 @@

    - + - formCsrf() ?> + form->csrf() ?> - formHidden('id', $values) ?> - formHidden('project_id', $values) ?> + form->hidden('id', $values) ?> + form->hidden('project_id', $values) ?> - formLabel(t('Amount'), 'amount') ?> - formText('amount', $values, $errors, array('required'), 'form-numeric') ?> + form->label(t('Amount'), 'amount') ?> + form->text('amount', $values, $errors, array('required'), 'form-numeric') ?> - formLabel(t('Date'), 'date') ?> - formText('date', $values, $errors, array('required'), 'form-date') ?> + form->label(t('Date'), 'date') ?> + form->text('date', $values, $errors, array('required'), 'form-date') ?> - formLabel(t('Comment'), 'comment') ?> - formText('comment', $values, $errors) ?> + form->label(t('Comment'), 'comment') ?> + form->text('comment', $values, $errors) ?>
    diff --git a/app/Template/budget/index.php b/app/Template/budget/index.php index 01525829b..d9fefc67d 100644 --- a/app/Template/budget/index.php +++ b/app/Template/budget/index.php @@ -1,11 +1,11 @@ -js('assets/js/vendor/d3.v3.4.8.min.js') ?> -js('assets/js/vendor/dimple.v2.1.2.min.js') ?> +asset->js('assets/js/vendor/d3.v3.4.8.min.js') ?> +asset->js('assets/js/vendor/dimple.v2.1.2.min.js') ?> diff --git a/app/Template/budget/remove.php b/app/Template/budget/remove.php index 97f9c3dc8..a5b906a1d 100644 --- a/app/Template/budget/remove.php +++ b/app/Template/budget/remove.php @@ -6,8 +6,8 @@

    - a(t('Yes'), 'budget', 'remove', array('project_id' => $project['id'], 'budget_id' => $budget_id), true, 'btn btn-red') ?> + url->link(t('Yes'), 'budget', 'remove', array('project_id' => $project['id'], 'budget_id' => $budget_id), true, 'btn btn-red') ?> - a(t('cancel'), 'budget', 'create', array('project_id' => $project['id'])) ?> + url->link(t('cancel'), 'budget', 'create', array('project_id' => $project['id'])) ?>
    \ No newline at end of file diff --git a/app/Template/calendar/show.php b/app/Template/calendar/show.php index 9e96d29e5..3fe97b651 100644 --- a/app/Template/calendar/show.php +++ b/app/Template/calendar/show.php @@ -3,19 +3,19 @@
    • - a(t('Back to the board'), 'board', 'show', array('project_id' => $project['id'])) ?> + url->link(t('Back to the board'), 'board', 'show', array('project_id' => $project['id'])) ?>
    • - a(t('Search'), 'project', 'search', array('project_id' => $project['id'])) ?> + url->link(t('Search'), 'project', 'search', array('project_id' => $project['id'])) ?>
    • - a(t('Completed tasks'), 'project', 'tasks', array('project_id' => $project['id'])) ?> + url->link(t('Completed tasks'), 'project', 'tasks', array('project_id' => $project['id'])) ?>
    • - a(t('Activity'), 'project', 'activity', array('project_id' => $project['id'])) ?> + url->link(t('Activity'), 'project', 'activity', array('project_id' => $project['id'])) ?>
    @@ -34,8 +34,8 @@ diff --git a/app/Template/category/edit.php b/app/Template/category/edit.php index 0d4b0f6fd..7d40fe653 100644 --- a/app/Template/category/edit.php +++ b/app/Template/category/edit.php @@ -2,21 +2,21 @@

    - + - formCsrf() ?> + form->csrf() ?> - formHidden('id', $values) ?> - formHidden('project_id', $values) ?> + form->hidden('id', $values) ?> + form->hidden('project_id', $values) ?> - formLabel(t('Category Name'), 'name') ?> - formText('name', $values, $errors, array('autofocus', 'required', 'maxlength="50"')) ?> + form->label(t('Category Name'), 'name') ?> + form->text('name', $values, $errors, array('autofocus', 'required', 'maxlength="50"')) ?> - formLabel(t('Description'), 'description') ?> + form->label(t('Description'), 'description') ?>
    - formTextarea('description', $values, $errors) ?> + form->textarea('description', $values, $errors) ?>
    diff --git a/app/Template/category/index.php b/app/Template/category/index.php index d5b50af48..dba537d06 100644 --- a/app/Template/category/index.php +++ b/app/Template/category/index.php @@ -13,10 +13,10 @@
    @@ -28,13 +28,13 @@ - + - formCsrf() ?> - formHidden('project_id', $values) ?> + form->csrf() ?> + form->hidden('project_id', $values) ?> - formLabel(t('Category Name'), 'name') ?> - formText('name', $values, $errors, array('autofocus', 'required', 'maxlength="50"')) ?> + form->label(t('Category Name'), 'name') ?> + form->text('name', $values, $errors, array('autofocus', 'required', 'maxlength="50"')) ?>
    diff --git a/app/Template/category/remove.php b/app/Template/category/remove.php index 8875b232f..ce5897851 100644 --- a/app/Template/category/remove.php +++ b/app/Template/category/remove.php @@ -9,9 +9,9 @@

    - a(t('Yes'), 'category', 'remove', array('project_id' => $project['id'], 'category_id' => $category['id']), true, 'btn btn-red') ?> + url->link(t('Yes'), 'category', 'remove', array('project_id' => $project['id'], 'category_id' => $category['id']), true, 'btn btn-red') ?> - a(t('cancel'), 'category', 'index', array('project_id' => $project['id'])) ?> + url->link(t('cancel'), 'category', 'index', array('project_id' => $project['id'])) ?>
    \ No newline at end of file diff --git a/app/Template/column/edit.php b/app/Template/column/edit.php index 7e16c326a..4d9848a9e 100644 --- a/app/Template/column/edit.php +++ b/app/Template/column/edit.php @@ -2,25 +2,25 @@

    - + - formCsrf() ?> + form->csrf() ?> - formHidden('id', $values) ?> - formHidden('project_id', $values) ?> + form->hidden('id', $values) ?> + form->hidden('project_id', $values) ?> - formLabel(t('Title'), 'title') ?> - formText('title', $values, $errors, array('autofocus', 'required', 'maxlength="50"')) ?> + form->label(t('Title'), 'title') ?> + form->text('title', $values, $errors, array('autofocus', 'required', 'maxlength="50"')) ?> - formLabel(t('Task limit'), 'task_limit') ?> - formNumber('task_limit', $values, $errors) ?> + form->label(t('Task limit'), 'task_limit') ?> + form->number('task_limit', $values, $errors) ?> - formLabel(t('Description'), 'description') ?> + form->label(t('Description'), 'description') ?>
    - formTextarea('description', $values, $errors) ?> + form->textarea('description', $values, $errors) ?>
    diff --git a/app/Template/column/index.php b/app/Template/column/index.php index e57729232..18e7f2841 100644 --- a/app/Template/column/index.php +++ b/app/Template/column/index.php @@ -18,7 +18,7 @@
    @@ -51,23 +51,23 @@

    - + - formCsrf() ?> + form->csrf() ?> - formHidden('project_id', $values) ?> + form->hidden('project_id', $values) ?> - formLabel(t('Title'), 'title') ?> - formText('title', $values, $errors, array('required', 'maxlength="50"')) ?> + form->label(t('Title'), 'title') ?> + form->text('title', $values, $errors, array('required', 'maxlength="50"')) ?> - formLabel(t('Task limit'), 'task_limit') ?> - formNumber('task_limit', $values, $errors) ?> + form->label(t('Task limit'), 'task_limit') ?> + form->number('task_limit', $values, $errors) ?> - formLabel(t('Description'), 'description') ?> + form->label(t('Description'), 'description') ?>
    - formTextarea('description', $values, $errors) ?> + form->textarea('description', $values, $errors) ?>
    diff --git a/app/Template/column/remove.php b/app/Template/column/remove.php index 3dcbd62f6..28d0928fe 100644 --- a/app/Template/column/remove.php +++ b/app/Template/column/remove.php @@ -9,7 +9,7 @@

    - a(t('Yes'), 'column', 'remove', array('project_id' => $project['id'], 'column_id' => $column['id'], 'remove' => 'yes'), true, 'btn btn-red') ?> - a(t('cancel'), 'column', 'index', array('project_id' => $project['id'])) ?> + url->link(t('Yes'), 'column', 'remove', array('project_id' => $project['id'], 'column_id' => $column['id'], 'remove' => 'yes'), true, 'btn btn-red') ?> + url->link(t('cancel'), 'column', 'index', array('project_id' => $project['id'])) ?>
    \ No newline at end of file diff --git a/app/Template/comment/create.php b/app/Template/comment/create.php index 5bd8debc8..8c66d9a46 100644 --- a/app/Template/comment/create.php +++ b/app/Template/comment/create.php @@ -2,10 +2,10 @@

    - - formCsrf() ?> - formHidden('task_id', $values) ?> - formHidden('user_id', $values) ?> + + form->csrf() ?> + form->hidden('task_id', $values) ?> + form->hidden('user_id', $values) ?>
      @@ -17,7 +17,7 @@
    - formTextarea('comment', $values, $errors, array(! isset($skip_cancel) ? 'autofocus' : '', 'required', 'placeholder="'.t('Leave a comment').'"'), 'comment-textarea') ?> + form->textarea('comment', $values, $errors, array(! isset($skip_cancel) ? 'autofocus' : '', 'required', 'placeholder="'.t('Leave a comment').'"'), 'comment-textarea') ?>
    @@ -31,9 +31,9 @@ - a(t('cancel'), 'board', 'show', array('project_id' => $task['project_id'])) ?> + url->link(t('cancel'), 'board', 'show', array('project_id' => $task['project_id'])) ?> - a(t('cancel'), 'task', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?> + url->link(t('cancel'), 'task', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?>
    diff --git a/app/Template/comment/edit.php b/app/Template/comment/edit.php index 2785fe629..d67aa3874 100644 --- a/app/Template/comment/edit.php +++ b/app/Template/comment/edit.php @@ -2,12 +2,12 @@

    - + - formCsrf() ?> - formHidden('id', $values) ?> - formHidden('task_id', $values) ?> - formHidden('user_id', $values) ?> + form->csrf() ?> + form->hidden('id', $values) ?> + form->hidden('task_id', $values) ?> + form->hidden('user_id', $values) ?>
      @@ -19,7 +19,7 @@
    - formTextarea('comment', $values, $errors, array('autofocus', 'required', 'placeholder="'.t('Leave a comment').'"'), 'comment-textarea') ?> + form->textarea('comment', $values, $errors, array('autofocus', 'required', 'placeholder="'.t('Leave a comment').'"'), 'comment-textarea') ?>
    @@ -31,6 +31,6 @@
    - a(t('cancel'), 'task', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?> + url->link(t('cancel'), 'task', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?>
    diff --git a/app/Template/comment/remove.php b/app/Template/comment/remove.php index 2338a03d6..afc3346f7 100644 --- a/app/Template/comment/remove.php +++ b/app/Template/comment/remove.php @@ -10,8 +10,8 @@ render('comment/show', array('comment' => $comment, 'task' => $task, 'preview' => true)) ?>
    - a(t('Yes'), 'comment', 'remove', array('task_id' => $task['id'], 'project_id' => $task['project_id'], 'comment_id' => $comment['id']), true, 'btn btn-red') ?> + url->link(t('Yes'), 'comment', 'remove', array('task_id' => $task['id'], 'project_id' => $task['project_id'], 'comment_id' => $comment['id']), true, 'btn btn-red') ?> - a(t('cancel'), 'task', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?> + url->link(t('cancel'), 'task', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?>
    \ No newline at end of file diff --git a/app/Template/comment/show.php b/app/Template/comment/show.php index 98c29441b..35394ccbd 100644 --- a/app/Template/comment/show.php +++ b/app/Template/comment/show.php @@ -2,7 +2,7 @@

    - avatar($comment['email'], $comment['name'] ?: $comment['username']) ?> + user->avatar($comment['email'], $comment['name'] ?: $comment['username']) ?> e($comment['name'] ?: $comment['username']) ?> @

    @@ -11,12 +11,12 @@
    • - userSession->isAdmin() || $this->userSession->isCurrentUser($comment['user_id']))): ?> + user->isAdmin() || $this->user->isCurrentUser($comment['user_id']))): ?>
    • - a(t('remove'), 'comment', 'confirm', array('task_id' => $task['id'], 'project_id' => $task['project_id'], 'comment_id' => $comment['id'])) ?> + url->link(t('remove'), 'comment', 'confirm', array('task_id' => $task['id'], 'project_id' => $task['project_id'], 'comment_id' => $comment['id'])) ?>
    • - a(t('edit'), 'comment', 'edit', array('task_id' => $task['id'], 'project_id' => $task['project_id'], 'comment_id' => $comment['id'])) ?> + url->link(t('edit'), 'comment', 'edit', array('task_id' => $task['id'], 'project_id' => $task['project_id'], 'comment_id' => $comment['id'])) ?>
    @@ -24,7 +24,7 @@
    - markdown( + text->markdown( $comment['comment'], array( 'controller' => 'task', @@ -35,7 +35,7 @@ ) ) ?> - markdown( + text->markdown( $comment['comment'], array( 'controller' => 'task', diff --git a/app/Template/config/about.php b/app/Template/config/about.php index b6ed43e56..a7098c1b0 100644 --- a/app/Template/config/about.php +++ b/app/Template/config/about.php @@ -25,14 +25,14 @@
  • - formatBytes($db_size) ?> + text->bytes($db_size) ?>
  • - a(t('Download the database'), 'config', 'downloadDb', array(), true) ?>  + url->link(t('Download the database'), 'config', 'downloadDb', array(), true) ?> 
  • - a(t('Optimize the database'), 'config', 'optimizeDb', array(), true) ?>  + url->link(t('Optimize the database'), 'config', 'optimizeDb', array(), true) ?> 
  • diff --git a/app/Template/config/api.php b/app/Template/config/api.php index 0df90835e..489f19687 100644 --- a/app/Template/config/api.php +++ b/app/Template/config/api.php @@ -9,10 +9,10 @@
  • - +
  • - a(t('Reset token'), 'config', 'token', array('type' => 'api'), true) ?> + url->link(t('Reset token'), 'config', 'token', array('type' => 'api'), true) ?>
  • \ No newline at end of file diff --git a/app/Template/config/application.php b/app/Template/config/application.php index f6c9db949..7d4c811d3 100644 --- a/app/Template/config/application.php +++ b/app/Template/config/application.php @@ -2,26 +2,26 @@

    -
    + - formCsrf() ?> + form->csrf() ?> - formLabel(t('Application URL'), 'application_url') ?> - formText('application_url', $values, $errors, array('placeholder="http://example.kanboard.net/"')) ?>
    + form->label(t('Application URL'), 'application_url') ?> + form->text('application_url', $values, $errors, array('placeholder="http://example.kanboard.net/"')) ?>

    - formLabel(t('Language'), 'application_language') ?> - formSelect('application_language', $languages, $values, $errors) ?>
    + form->label(t('Language'), 'application_language') ?> + form->select('application_language', $languages, $values, $errors) ?>
    - formLabel(t('Timezone'), 'application_timezone') ?> - formSelect('application_timezone', $timezones, $values, $errors) ?>
    + form->label(t('Timezone'), 'application_timezone') ?> + form->select('application_timezone', $timezones, $values, $errors) ?>
    - formLabel(t('Date format'), 'application_date_format') ?> - formSelect('application_date_format', $date_formats, $values, $errors) ?>
    + form->label(t('Date format'), 'application_date_format') ?> + form->select('application_date_format', $date_formats, $values, $errors) ?>

    - formLabel(t('Custom Stylesheet'), 'application_stylesheet') ?> - formTextarea('application_stylesheet', $values, $errors) ?>
    + form->label(t('Custom Stylesheet'), 'application_stylesheet') ?> + form->textarea('application_stylesheet', $values, $errors) ?>
    diff --git a/app/Template/config/board.php b/app/Template/config/board.php index c55003de2..19a4bcd7e 100644 --- a/app/Template/config/board.php +++ b/app/Template/config/board.php @@ -2,20 +2,20 @@

    - + - formCsrf() ?> + form->csrf() ?> - formLabel(t('Task highlight period'), 'board_highlight_period') ?> - formNumber('board_highlight_period', $values, $errors) ?>
    + form->label(t('Task highlight period'), 'board_highlight_period') ?> + form->number('board_highlight_period', $values, $errors) ?>

    - formLabel(t('Refresh interval for public board'), 'board_public_refresh_interval') ?> - formNumber('board_public_refresh_interval', $values, $errors) ?>
    + form->label(t('Refresh interval for public board'), 'board_public_refresh_interval') ?> + form->number('board_public_refresh_interval', $values, $errors) ?>

    - formLabel(t('Refresh interval for private board'), 'board_private_refresh_interval') ?> - formNumber('board_private_refresh_interval', $values, $errors) ?>
    + form->label(t('Refresh interval for private board'), 'board_private_refresh_interval') ?> + form->number('board_private_refresh_interval', $values, $errors) ?>

    diff --git a/app/Template/config/calendar.php b/app/Template/config/calendar.php index 300d34195..1cc985c8d 100644 --- a/app/Template/config/calendar.php +++ b/app/Template/config/calendar.php @@ -2,13 +2,13 @@

    - + - formCsrf() ?> + form->csrf() ?>

    - formRadios('calendar_project_tasks', array( + form->radios('calendar_project_tasks', array( 'date_creation' => t('Show tasks based on the creation date'), 'date_started' => t('Show tasks based on the start date'), ), $values) ?> @@ -16,14 +16,14 @@

    - formRadios('calendar_user_tasks', array( + form->radios('calendar_user_tasks', array( 'date_creation' => t('Show tasks based on the creation date'), 'date_started' => t('Show tasks based on the start date'), ), $values) ?>

    - formCheckbox('calendar_user_subtasks_time_tracking', t('Show subtasks based on the time tracking'), 1, $values['calendar_user_subtasks_time_tracking'] == 1) ?> - formCheckbox('calendar_user_subtasks_forecast', t('Show subtask estimates (forecast of future work)'), 1, $values['calendar_user_subtasks_forecast'] == 1) ?> + form->checkbox('calendar_user_subtasks_time_tracking', t('Show subtasks based on the time tracking'), 1, $values['calendar_user_subtasks_time_tracking'] == 1) ?> + form->checkbox('calendar_user_subtasks_forecast', t('Show subtask estimates (forecast of future work)'), 1, $values['calendar_user_subtasks_forecast'] == 1) ?>
    diff --git a/app/Template/config/integrations.php b/app/Template/config/integrations.php index f9e7f5378..a1299806f 100644 --- a/app/Template/config/integrations.php +++ b/app/Template/config/integrations.php @@ -2,81 +2,81 @@

    - + - formCsrf() ?> + form->csrf() ?>

     

    -
    +

     

    -
    +

     

    -
    +

     

    - formCheckbox('integration_gravatar', t('Enable Gravatar images'), 1, $values['integration_gravatar'] == 1) ?> + form->checkbox('integration_gravatar', t('Enable Gravatar images'), 1, $values['integration_gravatar'] == 1) ?>

    - formCheckbox('integration_jabber', t('Send notifications to Jabber'), 1, $values['integration_jabber'] == 1) ?> + form->checkbox('integration_jabber', t('Send notifications to Jabber'), 1, $values['integration_jabber'] == 1) ?> - formLabel(t('XMPP server address'), 'integration_jabber_server') ?> - formText('integration_jabber_server', $values, $errors, array('placeholder="tcp://myserver:5222"')) ?> + form->label(t('XMPP server address'), 'integration_jabber_server') ?> + form->text('integration_jabber_server', $values, $errors, array('placeholder="tcp://myserver:5222"')) ?>

    - formLabel(t('Jabber domain'), 'integration_jabber_domain') ?> - formText('integration_jabber_domain', $values, $errors, array('placeholder="example.com"')) ?> + form->label(t('Jabber domain'), 'integration_jabber_domain') ?> + form->text('integration_jabber_domain', $values, $errors, array('placeholder="example.com"')) ?> - formLabel(t('Username'), 'integration_jabber_username') ?> - formText('integration_jabber_username', $values, $errors) ?> + form->label(t('Username'), 'integration_jabber_username') ?> + form->text('integration_jabber_username', $values, $errors) ?> - formLabel(t('Password'), 'integration_jabber_password') ?> - formPassword('integration_jabber_password', $values, $errors) ?> + form->label(t('Password'), 'integration_jabber_password') ?> + form->password('integration_jabber_password', $values, $errors) ?> - formLabel(t('Jabber nickname'), 'integration_jabber_nickname') ?> - formText('integration_jabber_nickname', $values, $errors) ?> + form->label(t('Jabber nickname'), 'integration_jabber_nickname') ?> + form->text('integration_jabber_nickname', $values, $errors) ?> - formLabel(t('Multi-user chat room'), 'integration_jabber_room') ?> - formText('integration_jabber_room', $values, $errors, array('placeholder="myroom@conference.example.com"')) ?> + form->label(t('Multi-user chat room'), 'integration_jabber_room') ?> + form->text('integration_jabber_room', $values, $errors, array('placeholder="myroom@conference.example.com"')) ?>

    - formCheckbox('integration_hipchat', t('Send notifications to Hipchat'), 1, $values['integration_hipchat'] == 1) ?> + form->checkbox('integration_hipchat', t('Send notifications to Hipchat'), 1, $values['integration_hipchat'] == 1) ?> - formLabel(t('API URL'), 'integration_hipchat_api_url') ?> - formText('integration_hipchat_api_url', $values, $errors) ?> + form->label(t('API URL'), 'integration_hipchat_api_url') ?> + form->text('integration_hipchat_api_url', $values, $errors) ?> - formLabel(t('Room API ID or name'), 'integration_hipchat_room_id') ?> - formText('integration_hipchat_room_id', $values, $errors) ?> + form->label(t('Room API ID or name'), 'integration_hipchat_room_id') ?> + form->text('integration_hipchat_room_id', $values, $errors) ?> - formLabel(t('Room notification token'), 'integration_hipchat_room_token') ?> - formText('integration_hipchat_room_token', $values, $errors) ?> + form->label(t('Room notification token'), 'integration_hipchat_room_token') ?> + form->text('integration_hipchat_room_token', $values, $errors) ?>

     

    - formCheckbox('integration_slack_webhook', t('Send notifications to a Slack channel'), 1, $values['integration_slack_webhook'] == 1) ?> + form->checkbox('integration_slack_webhook', t('Send notifications to a Slack channel'), 1, $values['integration_slack_webhook'] == 1) ?> - formLabel(t('Webhook URL'), 'integration_slack_webhook_url') ?> - formText('integration_slack_webhook_url', $values, $errors) ?> + form->label(t('Webhook URL'), 'integration_slack_webhook_url') ?> + form->text('integration_slack_webhook_url', $values, $errors) ?>

    diff --git a/app/Template/config/project.php b/app/Template/config/project.php index b559d6327..90dd9c8ea 100644 --- a/app/Template/config/project.php +++ b/app/Template/config/project.php @@ -2,20 +2,20 @@

    - + - formCsrf() ?> + form->csrf() ?> - formLabel(t('Default columns for new projects (Comma-separated)'), 'board_columns') ?> - formText('board_columns', $values, $errors) ?>
    + form->label(t('Default columns for new projects (Comma-separated)'), 'board_columns') ?> + form->text('board_columns', $values, $errors) ?>

    - formLabel(t('Default categories for new projects (Comma-separated)'), 'project_categories') ?> - formText('project_categories', $values, $errors) ?>
    + form->label(t('Default categories for new projects (Comma-separated)'), 'project_categories') ?> + form->text('project_categories', $values, $errors) ?>

    - formCheckbox('subtask_restriction', t('Allow only one subtask in progress at the same time for a user'), 1, $values['subtask_restriction'] == 1) ?> - formCheckbox('subtask_time_tracking', t('Enable time tracking for subtasks'), 1, $values['subtask_time_tracking'] == 1) ?> + form->checkbox('subtask_restriction', t('Allow only one subtask in progress at the same time for a user'), 1, $values['subtask_restriction'] == 1) ?> + form->checkbox('subtask_time_tracking', t('Enable time tracking for subtasks'), 1, $values['subtask_time_tracking'] == 1) ?>
    diff --git a/app/Template/config/sidebar.php b/app/Template/config/sidebar.php index 4bae9e2e2..7f946dee6 100644 --- a/app/Template/config/sidebar.php +++ b/app/Template/config/sidebar.php @@ -2,34 +2,34 @@

    • - a(t('About'), 'config', 'index') ?> + url->link(t('About'), 'config', 'index') ?>
    • - a(t('Application settings'), 'config', 'application') ?> + url->link(t('Application settings'), 'config', 'application') ?>
    • - a(t('Project settings'), 'config', 'project') ?> + url->link(t('Project settings'), 'config', 'project') ?>
    • - a(t('Board settings'), 'config', 'board') ?> + url->link(t('Board settings'), 'config', 'board') ?>
    • - a(t('Calendar settings'), 'config', 'calendar') ?> + url->link(t('Calendar settings'), 'config', 'calendar') ?>
    • - a(t('Link settings'), 'link', 'index') ?> + url->link(t('Link settings'), 'link', 'index') ?>
    • - a(t('Currency rates'), 'currency', 'index') ?> + url->link(t('Currency rates'), 'currency', 'index') ?>
    • - a(t('Integrations'), 'config', 'integrations') ?> + url->link(t('Integrations'), 'config', 'integrations') ?>
    • - a(t('Webhooks'), 'config', 'webhook') ?> + url->link(t('Webhooks'), 'config', 'webhook') ?>
    • - a(t('API'), 'config', 'api') ?> + url->link(t('API'), 'config', 'api') ?>
    \ No newline at end of file diff --git a/app/Template/config/webhook.php b/app/Template/config/webhook.php index 06f7870b0..73ca35987 100644 --- a/app/Template/config/webhook.php +++ b/app/Template/config/webhook.php @@ -2,12 +2,12 @@

    - + - formCsrf() ?> + form->csrf() ?> - formLabel(t('Webhook URL'), 'webhook_url') ?> - formText('webhook_url', $values, $errors) ?> + form->label(t('Webhook URL'), 'webhook_url') ?> + form->text('webhook_url', $values, $errors) ?>
    @@ -26,10 +26,10 @@
  • - +
  • - a(t('Reset token'), 'config', 'token', array('type' => 'webhook'), true) ?> + url->link(t('Reset token'), 'config', 'token', array('type' => 'webhook'), true) ?>
  • \ No newline at end of file diff --git a/app/Template/currency/index.php b/app/Template/currency/index.php index 7839a1426..f72c57004 100644 --- a/app/Template/currency/index.php +++ b/app/Template/currency/index.php @@ -24,12 +24,12 @@

    - + - formCsrf() ?> + form->csrf() ?> - formLabel(t('Reference currency'), 'application_currency') ?> - formSelect('application_currency', $currencies, $config_values, $errors) ?>
    + form->label(t('Reference currency'), 'application_currency') ?> + form->select('application_currency', $currencies, $config_values, $errors) ?>
    @@ -38,15 +38,15 @@

    - + - formCsrf() ?> + form->csrf() ?> - formLabel(t('Currency'), 'currency') ?> - formSelect('currency', $currencies, $values, $errors) ?>
    + form->label(t('Currency'), 'currency') ?> + form->select('currency', $currencies, $values, $errors) ?>
    - formLabel(t('Rate'), 'rate') ?> - formText('rate', $values, $errors, array(), 'form-numeric') ?>
    + form->label(t('Rate'), 'rate') ?> + form->text('rate', $values, $errors, array(), 'form-numeric') ?>
    diff --git a/app/Template/event/comment_create.php b/app/Template/event/comment_create.php index 79238aba4..462f15ca8 100644 --- a/app/Template/event/comment_create.php +++ b/app/Template/event/comment_create.php @@ -1,12 +1,12 @@ -avatar($email, $author) ?> +user->avatar($email, $author) ?>

    e($author), - $this->a(t('#%d', $task['id']), 'task', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) + $this->url->link(t('#%d', $task['id']), 'task', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ) ?>

    e($task['title']) ?>
    -
    markdown($comment['comment']) ?>
    +
    text->markdown($comment['comment']) ?>
    \ No newline at end of file diff --git a/app/Template/event/comment_update.php b/app/Template/event/comment_update.php index 5d22a2ce3..0cb10bf60 100644 --- a/app/Template/event/comment_update.php +++ b/app/Template/event/comment_update.php @@ -1,9 +1,9 @@ -avatar($email, $author) ?> +user->avatar($email, $author) ?>

    e($author), - $this->a(t('#%d', $task['id']), 'task', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) + $this->url->link(t('#%d', $task['id']), 'task', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ) ?>

    diff --git a/app/Template/event/events.php b/app/Template/event/events.php index 93bc65842..2dc798711 100644 --- a/app/Template/event/events.php +++ b/app/Template/event/events.php @@ -5,11 +5,11 @@

    - contains($event['event_name'], 'subtask')): ?> + text->contains($event['event_name'], 'subtask')): ?> - contains($event['event_name'], 'task')): ?> + text->contains($event['event_name'], 'task')): ?> - contains($event['event_name'], 'comment')): ?> + text->contains($event['event_name'], 'comment')): ?>   diff --git a/app/Template/event/subtask_create.php b/app/Template/event/subtask_create.php index 4f33069a0..ca23aa9c4 100644 --- a/app/Template/event/subtask_create.php +++ b/app/Template/event/subtask_create.php @@ -1,9 +1,9 @@ -avatar($email, $author) ?> +user->avatar($email, $author) ?>

    e($author), - $this->a(t('#%d', $task['id']), 'task', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) + $this->url->link(t('#%d', $task['id']), 'task', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ) ?>

    diff --git a/app/Template/event/subtask_update.php b/app/Template/event/subtask_update.php index 19fe2e56f..11a778de7 100644 --- a/app/Template/event/subtask_update.php +++ b/app/Template/event/subtask_update.php @@ -1,9 +1,9 @@ -avatar($email, $author) ?> +user->avatar($email, $author) ?>

    e($author), - $this->a(t('#%d', $task['id']), 'task', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) + $this->url->link(t('#%d', $task['id']), 'task', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ) ?>

    diff --git a/app/Template/event/task_assignee_change.php b/app/Template/event/task_assignee_change.php index 38e2bca71..cdec8743a 100644 --- a/app/Template/event/task_assignee_change.php +++ b/app/Template/event/task_assignee_change.php @@ -1,4 +1,4 @@ -avatar($email, $author) ?> +user->avatar($email, $author) ?>

    @@ -6,11 +6,11 @@ e($author), - $this->a(t('#%d', $task['id']), 'task', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id'])), + $this->url->link(t('#%d', $task['id']), 'task', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id'])), $this->e($assignee) ) ?> - e($author), $this->a(t('#%d', $task['id']), 'task', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id']))) ?> + e($author), $this->url->link(t('#%d', $task['id']), 'task', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id']))) ?>

    diff --git a/app/Template/event/task_close.php b/app/Template/event/task_close.php index afedbef36..3d8670a60 100644 --- a/app/Template/event/task_close.php +++ b/app/Template/event/task_close.php @@ -1,9 +1,9 @@ -avatar($email, $author) ?> +user->avatar($email, $author) ?>

    e($author), - $this->a(t('#%d', $task['id']), 'task', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) + $this->url->link(t('#%d', $task['id']), 'task', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ) ?>

    diff --git a/app/Template/event/task_create.php b/app/Template/event/task_create.php index 4b9202347..773f401cd 100644 --- a/app/Template/event/task_create.php +++ b/app/Template/event/task_create.php @@ -1,9 +1,9 @@ -avatar($email, $author) ?> +user->avatar($email, $author) ?>

    e($author), - $this->a(t('#%d', $task['id']), 'task', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) + $this->url->link(t('#%d', $task['id']), 'task', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ) ?>

    diff --git a/app/Template/event/task_move_column.php b/app/Template/event/task_move_column.php index e97a3ab72..ca482e465 100644 --- a/app/Template/event/task_move_column.php +++ b/app/Template/event/task_move_column.php @@ -1,9 +1,9 @@ -avatar($email, $author) ?> +user->avatar($email, $author) ?>

    e($author), - $this->a(t('#%d', $task['id']), 'task', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id'])), + $this->url->link(t('#%d', $task['id']), 'task', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id'])), $this->e($task['column_title']) ) ?>

    diff --git a/app/Template/event/task_move_position.php b/app/Template/event/task_move_position.php index 2ed4ffe80..dcdd3e1bc 100644 --- a/app/Template/event/task_move_position.php +++ b/app/Template/event/task_move_position.php @@ -1,9 +1,9 @@ -avatar($email, $author) ?> +user->avatar($email, $author) ?>

    e($author), - $this->a(t('#%d', $task['id']), 'task', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id'])), + $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']) ) ?> diff --git a/app/Template/event/task_open.php b/app/Template/event/task_open.php index 9a4084499..11fec64b5 100644 --- a/app/Template/event/task_open.php +++ b/app/Template/event/task_open.php @@ -1,9 +1,9 @@ -avatar($email, $author) ?> +user->avatar($email, $author) ?>

    e($author), - $this->a(t('#%d', $task['id']), 'task', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) + $this->url->link(t('#%d', $task['id']), 'task', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ) ?>

    diff --git a/app/Template/event/task_update.php b/app/Template/event/task_update.php index 0f81870b2..7d036d438 100644 --- a/app/Template/event/task_update.php +++ b/app/Template/event/task_update.php @@ -1,9 +1,9 @@ -avatar($email, $author) ?> +user->avatar($email, $author) ?>

    e($author), - $this->a(t('#%d', $task['id']), 'task', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) + $this->url->link(t('#%d', $task['id']), 'task', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ) ?>

    diff --git a/app/Template/export/subtasks.php b/app/Template/export/subtasks.php index aa999a561..d22b96a4f 100644 --- a/app/Template/export/subtasks.php +++ b/app/Template/export/subtasks.php @@ -6,15 +6,15 @@ - formHidden('controller', $values) ?> - formHidden('action', $values) ?> - formHidden('project_id', $values) ?> + form->hidden('controller', $values) ?> + form->hidden('action', $values) ?> + form->hidden('project_id', $values) ?> - formLabel(t('Start Date'), 'from') ?> - formText('from', $values, $errors, array('required', 'placeholder="'.$this->inList($date_format, $date_formats).'"'), 'form-date') ?>
    + form->label(t('Start Date'), 'from') ?> + form->text('from', $values, $errors, array('required', 'placeholder="'.$this->text->in($date_format, $date_formats).'"'), 'form-date') ?>
    - formLabel(t('End Date'), 'to') ?> - formText('to', $values, $errors, array('required', 'placeholder="'.$this->inList($date_format, $date_formats).'"'), 'form-date') ?> + form->label(t('End Date'), 'to') ?> + form->text('to', $values, $errors, array('required', 'placeholder="'.$this->text->in($date_format, $date_formats).'"'), 'form-date') ?>

    diff --git a/app/Template/export/summary.php b/app/Template/export/summary.php index 191d36b6a..ffbd6ac20 100644 --- a/app/Template/export/summary.php +++ b/app/Template/export/summary.php @@ -8,15 +8,15 @@ - formHidden('controller', $values) ?> - formHidden('action', $values) ?> - formHidden('project_id', $values) ?> + form->hidden('controller', $values) ?> + form->hidden('action', $values) ?> + form->hidden('project_id', $values) ?> - formLabel(t('Start Date'), 'from') ?> - formText('from', $values, $errors, array('required', 'placeholder="'.$this->inList($date_format, $date_formats).'"'), 'form-date') ?>
    + form->label(t('Start Date'), 'from') ?> + form->text('from', $values, $errors, array('required', 'placeholder="'.$this->text->in($date_format, $date_formats).'"'), 'form-date') ?>
    - formLabel(t('End Date'), 'to') ?> - formText('to', $values, $errors, array('required', 'placeholder="'.$this->inList($date_format, $date_formats).'"'), 'form-date') ?> + form->label(t('End Date'), 'to') ?> + form->text('to', $values, $errors, array('required', 'placeholder="'.$this->text->in($date_format, $date_formats).'"'), 'form-date') ?>
    diff --git a/app/Template/export/tasks.php b/app/Template/export/tasks.php index e502085cb..5c5e21723 100644 --- a/app/Template/export/tasks.php +++ b/app/Template/export/tasks.php @@ -6,15 +6,15 @@ - formHidden('controller', $values) ?> - formHidden('action', $values) ?> - formHidden('project_id', $values) ?> + form->hidden('controller', $values) ?> + form->hidden('action', $values) ?> + form->hidden('project_id', $values) ?> - formLabel(t('Start Date'), 'from') ?> - formText('from', $values, $errors, array('required', 'placeholder="'.$this->inList($date_format, $date_formats).'"'), 'form-date') ?>
    + form->label(t('Start Date'), 'from') ?> + form->text('from', $values, $errors, array('required', 'placeholder="'.$this->text->in($date_format, $date_formats).'"'), 'form-date') ?>
    - formLabel(t('End Date'), 'to') ?> - formText('to', $values, $errors, array('required', 'placeholder="'.$this->inList($date_format, $date_formats).'"'), 'form-date') ?> + form->label(t('End Date'), 'to') ?> + form->text('to', $values, $errors, array('required', 'placeholder="'.$this->text->in($date_format, $date_formats).'"'), 'form-date') ?>
    diff --git a/app/Template/export/transitions.php b/app/Template/export/transitions.php index 7cd190e03..bf6ef2491 100644 --- a/app/Template/export/transitions.php +++ b/app/Template/export/transitions.php @@ -8,15 +8,15 @@ - formHidden('controller', $values) ?> - formHidden('action', $values) ?> - formHidden('project_id', $values) ?> + form->hidden('controller', $values) ?> + form->hidden('action', $values) ?> + form->hidden('project_id', $values) ?> - formLabel(t('Start Date'), 'from') ?> - formText('from', $values, $errors, array('required', 'placeholder="'.$this->inList($date_format, $date_formats).'"'), 'form-date') ?>
    + form->label(t('Start Date'), 'from') ?> + form->text('from', $values, $errors, array('required', 'placeholder="'.$this->text->in($date_format, $date_formats).'"'), 'form-date') ?>
    - formLabel(t('End Date'), 'to') ?> - formText('to', $values, $errors, array('required', 'placeholder="'.$this->inList($date_format, $date_formats).'"'), 'form-date') ?> + form->label(t('End Date'), 'to') ?> + form->text('to', $values, $errors, array('required', 'placeholder="'.$this->text->in($date_format, $date_formats).'"'), 'form-date') ?>
    diff --git a/app/Template/file/new.php b/app/Template/file/new.php index 4f0c233bf..a1a59eaef 100644 --- a/app/Template/file/new.php +++ b/app/Template/file/new.php @@ -2,13 +2,13 @@

    - - formCsrf() ?> + + form->csrf() ?> -
    formatBytes($max_size) : $max_size ?>
    +
    text->bytes($max_size) : $max_size ?>
    - a(t('cancel'), 'task', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?> + url->link(t('cancel'), 'task', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?>
    \ No newline at end of file diff --git a/app/Template/file/open.php b/app/Template/file/open.php index 70e0f8aa5..3df012b6f 100644 --- a/app/Template/file/open.php +++ b/app/Template/file/open.php @@ -1,6 +1,6 @@ \ No newline at end of file diff --git a/app/Template/file/remove.php b/app/Template/file/remove.php index 04ec30d5a..37f648eb4 100644 --- a/app/Template/file/remove.php +++ b/app/Template/file/remove.php @@ -8,8 +8,8 @@

    - a(t('Yes'), 'file', 'remove', array('task_id' => $task['id'], 'project_id' => $task['project_id'], 'file_id' => $file['id']), true, 'btn btn-red') ?> + url->link(t('Yes'), 'file', 'remove', array('task_id' => $task['id'], 'project_id' => $task['project_id'], 'file_id' => $file['id']), true, 'btn btn-red') ?> - a(t('cancel'), 'task', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?> + url->link(t('cancel'), 'task', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?>
    \ No newline at end of file diff --git a/app/Template/file/screenshot.php b/app/Template/file/screenshot.php index 299bf6157..89d9324cc 100644 --- a/app/Template/file/screenshot.php +++ b/app/Template/file/screenshot.php @@ -6,12 +6,12 @@

    -
    + - formCsrf() ?> + form->csrf() ?>
    - a(t('cancel'), 'task', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id']), false, 'close-popover') ?> + url->link(t('cancel'), 'task', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id']), false, 'close-popover') ?>
    diff --git a/app/Template/file/show.php b/app/Template/file/show.php index 3ce7f9f44..7d5dc96fb 100644 --- a/app/Template/file/show.php +++ b/app/Template/file/show.php @@ -11,19 +11,19 @@
  • - <?= $this->e($file['name']) ?> + <?= $this->e($file['name']) ?>

    e($file['name']) ?> - '.t('uploaded on: %s', dt('%B %e, %Y at %k:%M %p', $file['date'])).'
    '.t('size: %s', $this->formatBytes($file['size'])) ?>'> + '.t('uploaded on: %s', dt('%B %e, %Y at %k:%M %p', $file['date'])).'
    '.t('size: %s', $this->text->bytes($file['size'])) ?>'>

    - a(t('open'), 'file', 'open', array('task_id' => $task['id'], 'project_id' => $task['project_id'], 'file_id' => $file['id']), false, 'popover') ?> - a(t('remove'), 'file', 'confirm', array('task_id' => $task['id'], 'project_id' => $task['project_id'], 'file_id' => $file['id'])) ?> - a(t('download'), 'file', 'download', array('task_id' => $task['id'], 'project_id' => $task['project_id'], 'file_id' => $file['id'])) ?> + url->link(t('open'), 'file', 'open', array('task_id' => $task['id'], 'project_id' => $task['project_id'], 'file_id' => $file['id']), false, 'popover') ?> + url->link(t('remove'), 'file', 'confirm', array('task_id' => $task['id'], 'project_id' => $task['project_id'], 'file_id' => $file['id'])) ?> + url->link(t('download'), 'file', 'download', array('task_id' => $task['id'], 'project_id' => $task['project_id'], 'file_id' => $file['id'])) ?>
  • @@ -35,17 +35,17 @@
    - a('#'.$project['id'], 'board', 'show', array('project_id' => $project['id']), false, 'dashboard-table-link') ?> + url->link('#'.$project['id'], 'board', 'show', array('project_id' => $project['id']), false, 'dashboard-table-link') ?> - isManager($project['id'])): ?> - a('', 'project', 'show', array('project_id' => $project['id']), false, 'dashboard-table-link', t('Settings')) ?>  + user->isManager($project['id'])): ?> + url->link('', 'project', 'show', array('project_id' => $project['id']), false, 'dashboard-table-link', t('Settings')) ?>  - a('', 'calendar', 'show', array('project_id' => $project['id']), false, 'dashboard-table-link', t('Calendar')) ?>  + url->link('', 'calendar', 'show', array('project_id' => $project['id']), false, 'dashboard-table-link', t('Calendar')) ?>  - a($this->e($project['name']), 'board', 'show', array('project_id' => $project['id'])) ?> + url->link($this->e($project['name']), 'board', 'show', array('project_id' => $project['id'])) ?> - '> + '> diff --git a/app/Template/app/subtasks.php b/app/Template/app/subtasks.php index 487b66fce..5afb71b01 100644 --- a/app/Template/app/subtasks.php +++ b/app/Template/app/subtasks.php @@ -13,16 +13,16 @@ getCollection() as $subtask): ?>
    - a('#'.$subtask['task_id'], 'task', 'show', array('task_id' => $subtask['task_id'], 'project_id' => $subtask['project_id'])) ?> + url->link('#'.$subtask['task_id'], 'task', 'show', array('task_id' => $subtask['task_id'], 'project_id' => $subtask['project_id'])) ?> - a($this->e($subtask['project_name']), 'board', 'show', array('project_id' => $subtask['project_id'])) ?> + url->link($this->e($subtask['project_name']), 'board', 'show', array('project_id' => $subtask['project_id'])) ?> - a($this->e($subtask['task_name']), 'task', 'show', array('task_id' => $subtask['task_id'], 'project_id' => $subtask['project_id'])) ?> + url->link($this->e($subtask['task_name']), 'task', 'show', array('task_id' => $subtask['task_id'], 'project_id' => $subtask['project_id'])) ?> - toggleSubtaskStatus($subtask, 'dashboard') ?> + subtask->toggleStatus($subtask, 'dashboard') ?> diff --git a/app/Template/app/tasks.php b/app/Template/app/tasks.php index 9987ff480..f05c63ef8 100644 --- a/app/Template/app/tasks.php +++ b/app/Template/app/tasks.php @@ -13,13 +13,13 @@ getCollection() as $task): ?>
    - a('#'.$task['id'], 'task', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?> + url->link('#'.$task['id'], 'task', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?> - a($this->e($task['project_name']), 'board', 'show', array('project_id' => $task['project_id'])) ?> + url->link($this->e($task['project_name']), 'board', 'show', array('project_id' => $task['project_id'])) ?> - a($this->e($task['title']), 'task', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?> + url->link($this->e($task['title']), 'task', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?> diff --git a/app/Template/auth/index.php b/app/Template/auth/index.php index b35b12538..8801a512f 100644 --- a/app/Template/auth/index.php +++ b/app/Template/auth/index.php @@ -4,24 +4,24 @@

    e($errors['login']) ?>

    - + - formCsrf() ?> + form->csrf() ?> - formLabel(t('Username'), 'username') ?> - formText('username', $values, $errors, array('autofocus', 'required')) ?>
    + form->label(t('Username'), 'username') ?> + form->text('username', $values, $errors, array('autofocus', 'required')) ?>
    - formLabel(t('Password'), 'password') ?> - formPassword('password', $values, $errors, array('required')) ?> + form->label(t('Password'), 'password') ?> + form->password('password', $values, $errors, array('required')) ?> - formCheckbox('remember_me', t('Remember Me'), 1) ?>
    + form->checkbox('remember_me', t('Remember Me'), 1) ?>
    - a(t('Login with my Google Account'), 'user', 'google') ?> + url->link(t('Login with my Google Account'), 'user', 'google') ?> - a(t('Login with my GitHub Account'), 'user', 'gitHub') ?> + url->link(t('Login with my GitHub Account'), 'user', 'gitHub') ?>
    diff --git a/app/Template/board/assignee.php b/app/Template/board/assignee.php index 453b3f2d6..4af19cf7c 100644 --- a/app/Template/board/assignee.php +++ b/app/Template/board/assignee.php @@ -1,20 +1,20 @@

    - + - formCsrf() ?> + form->csrf() ?> - formHidden('id', $values) ?> - formHidden('project_id', $values) ?> + form->hidden('id', $values) ?> + form->hidden('project_id', $values) ?> - formLabel(t('Assignee'), 'owner_id') ?> - formSelect('owner_id', $users_list, $values, array(), array('autofocus')) ?>
    + form->label(t('Assignee'), 'owner_id') ?> + form->select('owner_id', $users_list, $values, array(), array('autofocus')) ?>
    - a(t('cancel'), 'board', 'show', array('project_id' => $project['id']), false, 'close-popover') ?> + url->link(t('cancel'), 'board', 'show', array('project_id' => $project['id']), false, 'close-popover') ?>
    diff --git a/app/Template/board/category.php b/app/Template/board/category.php index ee01ec5fd..b38758d36 100644 --- a/app/Template/board/category.php +++ b/app/Template/board/category.php @@ -1,20 +1,20 @@

    -
    + - formCsrf() ?> + form->csrf() ?> - formHidden('id', $values) ?> - formHidden('project_id', $values) ?> + form->hidden('id', $values) ?> + form->hidden('project_id', $values) ?> - formLabel(t('Category'), 'category_id') ?> - formSelect('category_id', $categories_list, $values) ?>
    + form->label(t('Category'), 'category_id') ?> + form->select('category_id', $categories_list, $values) ?>
    - a(t('cancel'), 'board', 'show', array('project_id' => $project['id']), false, 'close-popover') ?> + url->link(t('cancel'), 'board', 'show', array('project_id' => $project['id']), false, 'close-popover') ?>
    diff --git a/app/Template/board/comments.php b/app/Template/board/comments.php index 5424df78e..75816af6d 100644 --- a/app/Template/board/comments.php +++ b/app/Template/board/comments.php @@ -6,7 +6,7 @@
    - markdown($comment['comment']) ?> + text->markdown($comment['comment']) ?>
    diff --git a/app/Template/board/description.php b/app/Template/board/description.php index b38f5bf41..7e0e34301 100644 --- a/app/Template/board/description.php +++ b/app/Template/board/description.php @@ -1,5 +1,5 @@
    - markdown($task['description']) ?> + text->markdown($task['description']) ?>
    \ No newline at end of file diff --git a/app/Template/board/files.php b/app/Template/board/files.php index 851a118d4..811366599 100644 --- a/app/Template/board/files.php +++ b/app/Template/board/files.php @@ -8,8 +8,8 @@ e($file['name']) ?>
    - a(t('download'), 'file', 'download', array('task_id' => $task['id'], 'project_id' => $task['project_id'], 'file_id' => $file['id'])) ?> - a(t('open'), 'file', 'open', array('task_id' => $task['id'], 'project_id' => $task['project_id'], 'file_id' => $file['id']), false, 'popover') ?> + url->link(t('download'), 'file', 'download', array('task_id' => $task['id'], 'project_id' => $task['project_id'], 'file_id' => $file['id'])) ?> + url->link(t('open'), 'file', 'open', array('task_id' => $task['id'], 'project_id' => $task['project_id'], 'file_id' => $file['id']), false, 'popover') ?>
    - + e($file['name']) ?> - a(t('download'), 'file', 'download', array('task_id' => $task['id'], 'project_id' => $task['project_id'], 'file_id' => $file['id'])) ?> + url->link(t('download'), 'file', 'download', array('task_id' => $task['id'], 'project_id' => $task['project_id'], 'file_id' => $file['id'])) ?>
    - a('+', 'task', 'create', array('project_id' => $column['project_id'], 'column_id' => $column['id'], 'swimlane_id' => $swimlane['id']), false, 'task-board-popover', t('Add a new task')) ?> + url->link('+', 'task', 'create', array('project_id' => $column['project_id'], 'column_id' => $column['id'], 'swimlane_id' => $swimlane['id']), false, 'task-board-popover', t('Add a new task')) ?>
    e($column['title']) ?> - '> + '> diff --git a/app/Template/board/task_footer.php b/app/Template/board/task_footer.php index 0ea0f5fae..5945d5af0 100644 --- a/app/Template/board/task_footer.php +++ b/app/Template/board/task_footer.php @@ -2,16 +2,16 @@
    - inList($task['category_id'], $categories_listing) ?> + text->in($task['category_id'], $categories_listing) ?> - a( - $this->inList($task['category_id'], $categories_listing), + url->link( + $this->text->in($task['category_id'], $categories_listing), 'board', 'changeCategory', array('task_id' => $task['id'], 'project_id' => $task['project_id']), false, 'task-board-popover' . (isset($categories_description[$task['category_id']]) ? ' column-tooltip' : ''), - isset($categories_description[$task['category_id']]) ? $this->markdown($categories_description[$task['category_id']]) : t('Change category') + isset($categories_description[$task['category_id']]) ? $this->text->markdown($categories_description[$task['category_id']]) : t('Change category') ) ?> @@ -26,31 +26,31 @@ - + - + -   +   -   +   -   +   -   +   - + diff --git a/app/Template/board/task_menu.php b/app/Template/board/task_menu.php index 04b033858..97c0f8dc9 100644 --- a/app/Template/board/task_menu.php +++ b/app/Template/board/task_menu.php @@ -2,15 +2,15 @@
      -
    • a(t('Change assignee'), 'board', 'changeAssignee', array('task_id' => $task['id'], 'project_id' => $task['project_id']), false, 'task-board-popover') ?>
    • -
    • a(t('Change category'), 'board', 'changeCategory', array('task_id' => $task['id'], 'project_id' => $task['project_id']), false, 'task-board-popover') ?>
    • -
    • a(t('Change description'), 'task', 'description', array('task_id' => $task['id'], 'project_id' => $task['project_id']), false, 'task-board-popover') ?>
    • -
    • a(t('Edit this task'), 'task', 'edit', array('task_id' => $task['id'], 'project_id' => $task['project_id']), false, 'task-board-popover') ?>
    • -
    • a(t('Add a comment'), 'comment', 'create', array('task_id' => $task['id'], 'project_id' => $task['project_id']), false, 'task-board-popover') ?>
    • -
    • a(t('Add a link'), 'tasklink', 'create', array('task_id' => $task['id'], 'project_id' => $task['project_id']), false, 'task-board-popover') ?>
    • -
    • a(t('Add a screenshot'), 'board', 'screenshot', array('task_id' => $task['id'], 'project_id' => $task['project_id']), false, 'task-board-popover') ?>
    • -
    • a(t('Edit recurrence'), 'task', 'recurrence', array('task_id' => $task['id'], 'project_id' => $task['project_id']), false, 'task-board-popover') ?>
    • -
    • a(t('Close this task'), 'task', 'close', array('task_id' => $task['id'], 'project_id' => $task['project_id'], 'redirect' => 'board'), false, 'task-board-popover') ?>
    • +
    • url->link(t('Change assignee'), 'board', 'changeAssignee', array('task_id' => $task['id'], 'project_id' => $task['project_id']), false, 'task-board-popover') ?>
    • +
    • url->link(t('Change category'), 'board', 'changeCategory', array('task_id' => $task['id'], 'project_id' => $task['project_id']), false, 'task-board-popover') ?>
    • +
    • url->link(t('Change description'), 'task', 'description', array('task_id' => $task['id'], 'project_id' => $task['project_id']), false, 'task-board-popover') ?>
    • +
    • url->link(t('Edit this task'), 'task', 'edit', array('task_id' => $task['id'], 'project_id' => $task['project_id']), false, 'task-board-popover') ?>
    • +
    • url->link(t('Add a comment'), 'comment', 'create', array('task_id' => $task['id'], 'project_id' => $task['project_id']), false, 'task-board-popover') ?>
    • +
    • url->link(t('Add a link'), 'tasklink', 'create', array('task_id' => $task['id'], 'project_id' => $task['project_id']), false, 'task-board-popover') ?>
    • +
    • url->link(t('Add a screenshot'), 'board', 'screenshot', array('task_id' => $task['id'], 'project_id' => $task['project_id']), false, 'task-board-popover') ?>
    • +
    • url->link(t('Edit recurrence'), 'task', 'recurrence', array('task_id' => $task['id'], 'project_id' => $task['project_id']), false, 'task-board-popover') ?>
    • +
    • url->link(t('Close this task'), 'task', 'close', array('task_id' => $task['id'], 'project_id' => $task['project_id'], 'redirect' => 'board'), false, 'task-board-popover') ?>
    diff --git a/app/Template/board/task_private.php b/app/Template/board/task_private.php index d82b96e84..088f47bcb 100644 --- a/app/Template/board/task_private.php +++ b/app/Template/board/task_private.php @@ -3,12 +3,12 @@ data-owner-id="" data-category-id="" data-due-date="" - data-task-url="u('task', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?>"> + data-task-url="url->href('task', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?>"> render('board/task_menu', array('task' => $task)) ?>
    @@ -19,8 +19,8 @@ - - a( + + url->link( (! empty($task['owner_id']) ? ($task['assignee_name'] ?: $task['assignee_username']) : t('Nobody assigned')), 'board', 'changeAssignee', @@ -32,12 +32,12 @@
    - getTaskAge($task['date_creation']) ?> - getTaskAge($task['date_moved']) ?> + task->age($task['date_creation']) ?> + task->age($task['date_moved']) ?>
    - a($this->e($task['title']), 'task', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id']), false, '', t('View this task')) ?> + url->link($this->e($task['title']), 'task', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id']), false, '', t('View this task')) ?>
    render('board/task_footer', array( diff --git a/app/Template/board/task_public.php b/app/Template/board/task_public.php index 1ab2b3aa8..9ac6e5702 100644 --- a/app/Template/board/task_public.php +++ b/app/Template/board/task_public.php @@ -1,6 +1,6 @@
    - a('#'.$task['id'], 'task', 'readonly', array('task_id' => $task['id'], 'token' => $project['token'])) ?> + url->link('#'.$task['id'], 'task', 'readonly', array('task_id' => $task['id'], 'token' => $project['token'])) ?> @@ -19,7 +19,7 @@
    - a($this->e($task['title']), 'task', 'readonly', array('task_id' => $task['id'], 'token' => $project['token'])) ?> + url->link($this->e($task['title']), 'task', 'readonly', array('task_id' => $task['id'], 'token' => $project['token'])) ?>
    render('board/task_footer', array( diff --git a/app/Template/board/tasklinks.php b/app/Template/board/tasklinks.php index f934cff97..25aa91aaf 100644 --- a/app/Template/board/tasklinks.php +++ b/app/Template/board/tasklinks.php @@ -3,7 +3,7 @@
  • - a( + url->link( $this->e('#'.$link['task_id'].' - '.$link['title']), 'task', 'show', array('task_id' => $link['task_id'], 'project_id' => $link['project_id']), false, diff --git a/app/Template/budget/breakdown.php b/app/Template/budget/breakdown.php index 51044c460..3275a66a2 100644 --- a/app/Template/budget/breakdown.php +++ b/app/Template/budget/breakdown.php @@ -1,8 +1,8 @@ @@ -20,9 +20,9 @@
  • a($this->e($record['task_title']), 'task', 'show', array('project_id' => $project['id'], 'task_id' => $record['task_id'])) ?>a($this->e($record['subtask_title']), 'task', 'show', array('project_id' => $project['id'], 'task_id' => $record['task_id'])) ?>a($this->e($record['name'] ?: $record['username']), 'user', 'show', array('user_id' => $record['user_id'])) ?>url->link($this->e($record['task_title']), 'task', 'show', array('project_id' => $project['id'], 'task_id' => $record['task_id'])) ?>url->link($this->e($record['subtask_title']), 'task', 'show', array('project_id' => $project['id'], 'task_id' => $record['task_id'])) ?>url->link($this->e($record['name'] ?: $record['username']), 'user', 'show', array('user_id' => $record['user_id'])) ?> e($line['comment']) ?> - a(t('Remove'), 'budget', 'confirm', array('project_id' => $project['id'], 'budget_id' => $line['id'])) ?> + url->link(t('Remove'), 'budget', 'confirm', array('project_id' => $project['id'], 'budget_id' => $line['id'])) ?>
    • - a(t('Edit'), 'category', 'edit', array('project_id' => $project['id'], 'category_id' => $category_id)) ?> + url->link(t('Edit'), 'category', 'edit', array('project_id' => $project['id'], 'category_id' => $category_id)) ?>
    • - a(t('Remove'), 'category', 'confirm', array('project_id' => $project['id'], 'category_id' => $category_id)) ?> + url->link(t('Remove'), 'category', 'confirm', array('project_id' => $project['id'], 'category_id' => $category_id)) ?>
    e($column['title']) ?> - '> + '> @@ -27,20 +27,20 @@
    • - a(t('Edit'), 'column', 'edit', array('project_id' => $project['id'], 'column_id' => $column['id'])) ?> + url->link(t('Edit'), 'column', 'edit', array('project_id' => $project['id'], 'column_id' => $column['id'])) ?>
    • - a(t('Move Up'), 'column', 'move', array('project_id' => $project['id'], 'column_id' => $column['id'], 'direction' => 'up'), true) ?> + url->link(t('Move Up'), 'column', 'move', array('project_id' => $project['id'], 'column_id' => $column['id'], 'direction' => 'up'), true) ?>
    • - a(t('Move Down'), 'column', 'move', array('project_id' => $project['id'], 'column_id' => $column['id'], 'direction' => 'down'), true) ?> + url->link(t('Move Down'), 'column', 'move', array('project_id' => $project['id'], 'column_id' => $column['id'], 'direction' => 'down'), true) ?>
    • - a(t('Remove'), 'column', 'confirm', array('project_id' => $project['id'], 'column_id' => $column['id'])) ?> + url->link(t('Remove'), 'column', 'confirm', array('project_id' => $project['id'], 'column_id' => $column['id'])) ?>
    - + diff --git a/app/Template/hourlyrate/index.php b/app/Template/hourlyrate/index.php index 9d0b77c8e..af305d07f 100644 --- a/app/Template/hourlyrate/index.php +++ b/app/Template/hourlyrate/index.php @@ -17,7 +17,7 @@ @@ -26,19 +26,19 @@

    - + - formHidden('user_id', $values) ?> - formCsrf() ?> + form->hidden('user_id', $values) ?> + form->csrf() ?> - formLabel(t('Hourly rate'), 'rate') ?> - formText('rate', $values, $errors, array('required'), 'form-numeric') ?> + form->label(t('Hourly rate'), 'rate') ?> + form->text('rate', $values, $errors, array('required'), 'form-numeric') ?> - formLabel(t('Currency'), 'currency') ?> - formSelect('currency', $currencies_list, $values, $errors, array('required')) ?> + form->label(t('Currency'), 'currency') ?> + form->select('currency', $currencies_list, $values, $errors, array('required')) ?> - formLabel(t('Effective date'), 'date_effective') ?> - formText('date_effective', $values, $errors, array('required'), 'form-date') ?> + form->label(t('Effective date'), 'date_effective') ?> + form->text('date_effective', $values, $errors, array('required'), 'form-date') ?>
    diff --git a/app/Template/hourlyrate/remove.php b/app/Template/hourlyrate/remove.php index 7f22728e6..121436e4b 100644 --- a/app/Template/hourlyrate/remove.php +++ b/app/Template/hourlyrate/remove.php @@ -6,8 +6,8 @@

    - a(t('Yes'), 'hourlyrate', 'remove', array('user_id' => $user['id'], 'rate_id' => $rate_id), true, 'btn btn-red') ?> + url->link(t('Yes'), 'hourlyrate', 'remove', array('user_id' => $user['id'], 'rate_id' => $rate_id), true, 'btn btn-red') ?> - a(t('cancel'), 'hourlyrate', 'index', array('user_id' => $user['id'])) ?> + url->link(t('cancel'), 'hourlyrate', 'index', array('user_id' => $user['id'])) ?>
    \ No newline at end of file diff --git a/app/Template/layout.php b/app/Template/layout.php index 7baecde93..cf74c8ab3 100644 --- a/app/Template/layout.php +++ b/app/Template/layout.php @@ -11,16 +11,13 @@ - js('assets/js/app.js') ?> + asset->js('assets/js/app.js') ?> - css($this->u('app', 'colors'), false, 'all') ?> - css('assets/css/app.css') ?> - css('assets/css/print.css', true, 'print') ?> - - config->get('application_stylesheet')): ?> - - + asset->css($this->url->href('app', 'colors'), false, 'all') ?> + asset->css('assets/css/app.css') ?> + asset->css('assets/css/print.css', true, 'print') ?> + asset->customCss() ?> @@ -30,19 +27,19 @@ <?= isset($title) ? $this->e($title) : 'Kanboard' ?> - +
    - flash('
    %s
    ') ?> - flashError('
    %s
    ') ?> + app->flashMessage() ?>
    diff --git a/app/Template/link/create.php b/app/Template/link/create.php index 125895748..2b4ac62c7 100644 --- a/app/Template/link/create.php +++ b/app/Template/link/create.php @@ -2,15 +2,15 @@

    - + - formCsrf() ?> + form->csrf() ?> - formLabel(t('Label'), 'label') ?> - formText('label', $values, $errors, array('required')) ?> + form->label(t('Label'), 'label') ?> + form->text('label', $values, $errors, array('required')) ?> - formLabel(t('Opposite label'), 'opposite_label') ?> - formText('opposite_label', $values, $errors) ?> + form->label(t('Opposite label'), 'opposite_label') ?> + form->text('opposite_label', $values, $errors) ?>
    diff --git a/app/Template/link/edit.php b/app/Template/link/edit.php index d9ce280c7..516de4640 100644 --- a/app/Template/link/edit.php +++ b/app/Template/link/edit.php @@ -2,20 +2,20 @@

    - + - formCsrf() ?> - formHidden('id', $values) ?> + form->csrf() ?> + form->hidden('id', $values) ?> - formLabel(t('Label'), 'label') ?> - formText('label', $values, $errors, array('required')) ?> + form->label(t('Label'), 'label') ?> + form->text('label', $values, $errors, array('required')) ?> - formLabel(t('Opposite label'), 'opposite_id') ?> - formSelect('opposite_id', $labels, $values, $errors) ?> + form->label(t('Opposite label'), 'opposite_id') ?> + form->select('opposite_id', $labels, $values, $errors) ?>
    - a(t('cancel'), 'link', 'index') ?> + url->link(t('cancel'), 'link', 'index') ?>
    \ No newline at end of file diff --git a/app/Template/link/index.php b/app/Template/link/index.php index 90d1c3572..1475bd509 100644 --- a/app/Template/link/index.php +++ b/app/Template/link/index.php @@ -18,9 +18,9 @@ diff --git a/app/Template/link/remove.php b/app/Template/link/remove.php index a802feb03..12ca14bbf 100644 --- a/app/Template/link/remove.php +++ b/app/Template/link/remove.php @@ -8,8 +8,8 @@

    - a(t('Yes'), 'link', 'remove', array('link_id' => $link['id']), true, 'btn btn-red') ?> + url->link(t('Yes'), 'link', 'remove', array('link_id' => $link['id']), true, 'btn btn-red') ?> - a(t('cancel'), 'link', 'index') ?> + url->link(t('cancel'), 'link', 'index') ?>
    \ No newline at end of file diff --git a/app/Template/notification/comment_creation.php b/app/Template/notification/comment_creation.php index b28e261a8..747c4f438 100644 --- a/app/Template/notification/comment_creation.php +++ b/app/Template/notification/comment_creation.php @@ -2,6 +2,6 @@

    -markdown($comment['comment']) ?> +text->markdown($comment['comment']) ?> render('notification/footer', array('task' => $task, 'application_url' => $application_url)) ?> \ No newline at end of file diff --git a/app/Template/notification/comment_update.php b/app/Template/notification/comment_update.php index 88154f0b0..a15e5d6d5 100644 --- a/app/Template/notification/comment_update.php +++ b/app/Template/notification/comment_update.php @@ -2,6 +2,6 @@

    -markdown($comment['comment']) ?> +text->markdown($comment['comment']) ?> render('notification/footer', array('task' => $task, 'application_url' => $application_url)) ?> \ No newline at end of file diff --git a/app/Template/notification/footer.php b/app/Template/notification/footer.php index 4de1487e4..7041c43b9 100644 --- a/app/Template/notification/footer.php +++ b/app/Template/notification/footer.php @@ -2,5 +2,5 @@ Kanboard - - . + - . diff --git a/app/Template/notification/task_assignee_change.php b/app/Template/notification/task_assignee_change.php index faab92f39..c9729ac9c 100644 --- a/app/Template/notification/task_assignee_change.php +++ b/app/Template/notification/task_assignee_change.php @@ -14,7 +14,7 @@

    - markdown($task['description']) ?: t('There is no description.') ?> + text->markdown($task['description']) ?: t('There is no description.') ?> render('notification/footer', array('task' => $task, 'application_url' => $application_url)) ?> \ No newline at end of file diff --git a/app/Template/notification/task_creation.php b/app/Template/notification/task_creation.php index dfd3e5915..0905d3f54 100644 --- a/app/Template/notification/task_creation.php +++ b/app/Template/notification/task_creation.php @@ -37,7 +37,7 @@

    - markdown($task['description']) ?> + text->markdown($task['description']) ?> render('notification/footer', array('task' => $task, 'application_url' => $application_url)) ?> \ No newline at end of file diff --git a/app/Template/notification/task_due.php b/app/Template/notification/task_due.php index 72c8de1bc..7482424aa 100644 --- a/app/Template/notification/task_due.php +++ b/app/Template/notification/task_due.php @@ -5,7 +5,7 @@
  • (#) - e($task['title']) ?> + e($task['title']) ?> e($task['title']) ?> diff --git a/app/Template/notification/task_update.php b/app/Template/notification/task_update.php index 71e949dde..ffea49cd8 100644 --- a/app/Template/notification/task_update.php +++ b/app/Template/notification/task_update.php @@ -37,7 +37,7 @@

    - markdown($task['description']) ?: t('There is no description.') ?> + text->markdown($task['description']) ?: t('There is no description.') ?> render('notification/footer', array('task' => $task, 'application_url' => $application_url)) ?> \ No newline at end of file diff --git a/app/Template/project/activity.php b/app/Template/project/activity.php index 7da6be5cd..1c5dcb759 100644 --- a/app/Template/project/activity.php +++ b/app/Template/project/activity.php @@ -3,22 +3,22 @@
    • - a(t('Back to the board'), 'board', 'show', array('project_id' => $project['id'])) ?> + url->link(t('Back to the board'), 'board', 'show', array('project_id' => $project['id'])) ?>
    • - a(t('Calendar'), 'calendar', 'show', array('project_id' => $project['id'])) ?> + url->link(t('Calendar'), 'calendar', 'show', array('project_id' => $project['id'])) ?>
    • - a(t('Search'), 'project', 'search', array('project_id' => $project['id'])) ?> + url->link(t('Search'), 'project', 'search', array('project_id' => $project['id'])) ?>
    • - a(t('Completed tasks'), 'project', 'tasks', array('project_id' => $project['id'])) ?> + url->link(t('Completed tasks'), 'project', 'tasks', array('project_id' => $project['id'])) ?>
    • -
    • a(t('RSS feed'), 'project', 'feed', array('token' => $project['token']), false, '', '', true) ?>
    • +
    • url->link(t('RSS feed'), 'project', 'feed', array('token' => $project['token']), false, '', '', true) ?>
    diff --git a/app/Template/project/disable.php b/app/Template/project/disable.php index 48a09a97b..ddfcdca20 100644 --- a/app/Template/project/disable.php +++ b/app/Template/project/disable.php @@ -8,7 +8,7 @@

    - a(t('Yes'), 'project', 'disable', array('project_id' => $project['id'], 'disable' => 'yes'), true, 'btn btn-red') ?> - a(t('cancel'), 'project', 'show', array('project_id' => $project['id'])) ?> + url->link(t('Yes'), 'project', 'disable', array('project_id' => $project['id'], 'disable' => 'yes'), true, 'btn btn-red') ?> + url->link(t('cancel'), 'project', 'show', array('project_id' => $project['id'])) ?>
    \ No newline at end of file diff --git a/app/Template/project/duplicate.php b/app/Template/project/duplicate.php index 7e7fd85e0..8967c306e 100644 --- a/app/Template/project/duplicate.php +++ b/app/Template/project/duplicate.php @@ -6,18 +6,18 @@

    -
    + - formCsrf() ?> + form->csrf() ?> - formCheckbox('category', t('Categories'), 1, true) ?> - formCheckbox('action', t('Actions'), 1, true) ?> - formCheckbox('swimlane', t('Swimlanes'), 1, false) ?> - formCheckbox('task', t('Tasks'), 1, false) ?> + form->checkbox('category', t('Categories'), 1, true) ?> + form->checkbox('action', t('Actions'), 1, true) ?> + form->checkbox('swimlane', t('Swimlanes'), 1, false) ?> + form->checkbox('task', t('Tasks'), 1, false) ?>
    - a(t('cancel'), 'project', 'show', array('project_id' => $project['id'])) ?> + url->link(t('cancel'), 'project', 'show', array('project_id' => $project['id'])) ?>
    \ No newline at end of file diff --git a/app/Template/project/edit.php b/app/Template/project/edit.php index 8b94e3785..794267f48 100644 --- a/app/Template/project/edit.php +++ b/app/Template/project/edit.php @@ -1,28 +1,28 @@ -
    + - formCsrf() ?> - formHidden('id', $values) ?> + form->csrf() ?> + form->hidden('id', $values) ?> - formLabel(t('Name'), 'name') ?> - formText('name', $values, $errors, array('required', 'maxlength="50"')) ?> + form->label(t('Name'), 'name') ?> + form->text('name', $values, $errors, array('required', 'maxlength="50"')) ?> - formLabel(t('Identifier'), 'identifier') ?> - formText('identifier', $values, $errors, array('maxlength="50"')) ?> + form->label(t('Identifier'), 'identifier') ?> + form->text('identifier', $values, $errors, array('maxlength="50"')) ?>

    - userSession->isAdmin()): ?> - formCheckbox('is_private', t('Private project'), 1, $project['is_private'] == 1) ?> + user->isAdmin()): ?> + form->checkbox('is_private', t('Private project'), 1, $project['is_private'] == 1) ?> - formLabel(t('Description'), 'description') ?> + form->label(t('Description'), 'description') ?>
    - formTextarea('description', $values, $errors) ?> + form->textarea('description', $values, $errors) ?>
    diff --git a/app/Template/project/enable.php b/app/Template/project/enable.php index b683ea7c4..c10d2f12c 100644 --- a/app/Template/project/enable.php +++ b/app/Template/project/enable.php @@ -8,7 +8,7 @@

    - a(t('Yes'), 'project', 'enable', array('project_id' => $project['id'], 'enable' => 'yes'), true, 'btn btn-red') ?> - a(t('cancel'), 'project', 'show', array('project_id' => $project['id'])) ?> + url->link(t('Yes'), 'project', 'enable', array('project_id' => $project['id'], 'enable' => 'yes'), true, 'btn btn-red') ?> + url->link(t('cancel'), 'project', 'show', array('project_id' => $project['id'])) ?>
    \ No newline at end of file diff --git a/app/Template/project/feed.php b/app/Template/project/feed.php index 14427af9e..2062e8012 100644 --- a/app/Template/project/feed.php +++ b/app/Template/project/feed.php @@ -1,16 +1,16 @@ ' ?> <?= t('%s\'s activity', $project['name']) ?> - - + + - getCurrentBaseUrl() ?> - getCurrentBaseUrl() ?>assets/img/favicon.png + url->base() ?> + url->base() ?>assets/img/favicon.png <?= $e['event_title'] ?> - + diff --git a/app/Template/project/index.php b/app/Template/project/index.php index 8d2bc30b4..1080968e7 100644 --- a/app/Template/project/index.php +++ b/app/Template/project/index.php @@ -1,10 +1,10 @@
    @@ -22,7 +22,7 @@ getCollection() as $project): ?>
  • @@ -68,10 +68,10 @@
    e($file['name']) ?> - '.t('uploaded on: %s', dt('%B %e, %Y at %k:%M %p', $file['date'])).'
    '.t('size: %s', $this->formatBytes($file['size'])) ?>'> + '.t('uploaded on: %s', dt('%B %e, %Y at %k:%M %p', $file['date'])).'
    '.t('size: %s', $this->text->bytes($file['size'])) ?>'>
    - a(t('remove'), 'file', 'confirm', array('task_id' => $task['id'], 'project_id' => $task['project_id'], 'file_id' => $file['id'])) ?> - a(t('download'), 'file', 'download', array('task_id' => $task['id'], 'project_id' => $task['project_id'], 'file_id' => $file['id'])) ?> + url->link(t('remove'), 'file', 'confirm', array('task_id' => $task['id'], 'project_id' => $task['project_id'], 'file_id' => $file['id'])) ?> + url->link(t('download'), 'file', 'download', array('task_id' => $task['id'], 'project_id' => $task['project_id'], 'file_id' => $file['id'])) ?>
    - a(t('Remove'), 'hourlyrate', 'confirm', array('user_id' => $user['id'], 'rate_id' => $rate['id'])) ?> + url->link(t('Remove'), 'hourlyrate', 'confirm', array('user_id' => $user['id'], 'rate_id' => $rate['id'])) ?>
      - a(t('Edit'), 'link', 'edit', array('link_id' => $link['id'])) ?> + url->link(t('Edit'), 'link', 'edit', array('link_id' => $link['id'])) ?> - a(t('Remove'), 'link', 'confirm', array('link_id' => $link['id'])) ?> + url->link(t('Remove'), 'link', 'confirm', array('link_id' => $link['id'])) ?>
    - a('#'.$project['id'], 'board', 'show', array('project_id' => $project['id']), false, 'dashboard-table-link') ?> + url->link('#'.$project['id'], 'board', 'show', array('project_id' => $project['id']), false, 'dashboard-table-link') ?> @@ -35,7 +35,7 @@ e($project['identifier']) ?> - a('', 'board', 'show', array('project_id' => $project['id']), false, 'dashboard-table-link', t('Board')) ?>  + url->link('', 'board', 'show', array('project_id' => $project['id']), false, 'dashboard-table-link', t('Board')) ?>  @@ -44,9 +44,9 @@ - a($this->e($project['name']), 'project', 'show', array('project_id' => $project['id'])) ?> + url->link($this->e($project['name']), 'project', 'show', array('project_id' => $project['id'])) ?> - '> + '> diff --git a/app/Template/project/integrations.php b/app/Template/project/integrations.php index d4fab23b5..698e438ce 100644 --- a/app/Template/project/integrations.php +++ b/app/Template/project/integrations.php @@ -2,53 +2,53 @@

    - - formCsrf() ?> + + form->csrf() ?>

     

    -
    +

     

    -
    +

     

    -
    +

    - formCheckbox('jabber', t('Send notifications to Jabber'), 1, isset($values['jabber']) && $values['jabber'] == 1) ?> + form->checkbox('jabber', t('Send notifications to Jabber'), 1, isset($values['jabber']) && $values['jabber'] == 1) ?> - formLabel(t('XMPP server address'), 'jabber_server') ?> - formText('jabber_server', $values, $errors, array('placeholder="tcp://myserver:5222"')) ?> + form->label(t('XMPP server address'), 'jabber_server') ?> + form->text('jabber_server', $values, $errors, array('placeholder="tcp://myserver:5222"')) ?>

    - formLabel(t('Jabber domain'), 'jabber_domain') ?> - formText('jabber_domain', $values, $errors, array('placeholder="example.com"')) ?> + form->label(t('Jabber domain'), 'jabber_domain') ?> + form->text('jabber_domain', $values, $errors, array('placeholder="example.com"')) ?> - formLabel(t('Username'), 'jabber_username') ?> - formText('jabber_username', $values, $errors) ?> + form->label(t('Username'), 'jabber_username') ?> + form->text('jabber_username', $values, $errors) ?> - formLabel(t('Password'), 'jabber_password') ?> - formPassword('jabber_password', $values, $errors) ?> + form->label(t('Password'), 'jabber_password') ?> + form->password('jabber_password', $values, $errors) ?> - formLabel(t('Jabber nickname'), 'jabber_nickname') ?> - formText('jabber_nickname', $values, $errors) ?> + form->label(t('Jabber nickname'), 'jabber_nickname') ?> + form->text('jabber_nickname', $values, $errors) ?> - formLabel(t('Multi-user chat room'), 'jabber_room') ?> - formText('jabber_room', $values, $errors, array('placeholder="myroom@conference.example.com"')) ?> + form->label(t('Multi-user chat room'), 'jabber_room') ?> + form->text('jabber_room', $values, $errors, array('placeholder="myroom@conference.example.com"')) ?>

    @@ -60,16 +60,16 @@

    - formCheckbox('hipchat', t('Send notifications to Hipchat'), 1, isset($values['hipchat']) && $values['hipchat'] == 1) ?> + form->checkbox('hipchat', t('Send notifications to Hipchat'), 1, isset($values['hipchat']) && $values['hipchat'] == 1) ?> - formLabel(t('API URL'), 'hipchat_api_url') ?> - formText('hipchat_api_url', $values, $errors) ?> + form->label(t('API URL'), 'hipchat_api_url') ?> + form->text('hipchat_api_url', $values, $errors) ?> - formLabel(t('Room API ID or name'), 'hipchat_room_id') ?> - formText('hipchat_room_id', $values, $errors) ?> + form->label(t('Room API ID or name'), 'hipchat_room_id') ?> + form->text('hipchat_room_id', $values, $errors) ?> - formLabel(t('Room notification token'), 'hipchat_room_token') ?> - formText('hipchat_room_token', $values, $errors) ?> + form->label(t('Room notification token'), 'hipchat_room_token') ?> + form->text('hipchat_room_token', $values, $errors) ?>

    @@ -81,10 +81,10 @@

     

    - formCheckbox('slack', t('Send notifications to a Slack channel'), 1, isset($values['slack']) && $values['slack'] == 1) ?> + form->checkbox('slack', t('Send notifications to a Slack channel'), 1, isset($values['slack']) && $values['slack'] == 1) ?> - formLabel(t('Webhook URL'), 'slack_webhook_url') ?> - formText('slack_webhook_url', $values, $errors) ?> + form->label(t('Webhook URL'), 'slack_webhook_url') ?> + form->text('slack_webhook_url', $values, $errors) ?>

    diff --git a/app/Template/project/layout.php b/app/Template/project/layout.php index 8cd1fd3cf..f54095005 100644 --- a/app/Template/project/layout.php +++ b/app/Template/project/layout.php @@ -3,11 +3,11 @@
    • - a(t('Back to the board'), 'board', 'show', array('project_id' => $project['id'])) ?> + url->link(t('Back to the board'), 'board', 'show', array('project_id' => $project['id'])) ?>
    • - a(t('All projects'), 'project', 'index') ?> + url->link(t('All projects'), 'project', 'index') ?>
    diff --git a/app/Template/project/new.php b/app/Template/project/new.php index b68258b42..25b70ac29 100644 --- a/app/Template/project/new.php +++ b/app/Template/project/new.php @@ -1,20 +1,20 @@
    - + - formCsrf() ?> - formHidden('is_private', $values) ?> - formLabel(t('Name'), 'name') ?> - formText('name', $values, $errors, array('autofocus', 'required', 'maxlength="50"')) ?> + form->csrf() ?> + form->hidden('is_private', $values) ?> + form->label(t('Name'), 'name') ?> + form->text('name', $values, $errors, array('autofocus', 'required', 'maxlength="50"')) ?>
    - a(t('cancel'), 'project', 'index') ?> + url->link(t('cancel'), 'project', 'index') ?>
    diff --git a/app/Template/project/remove.php b/app/Template/project/remove.php index 0f6fec785..fa43fc786 100644 --- a/app/Template/project/remove.php +++ b/app/Template/project/remove.php @@ -8,7 +8,7 @@

    - a(t('Yes'), 'project', 'remove', array('project_id' => $project['id'], 'remove' => 'yes'), true, 'btn btn-red') ?> - a(t('cancel'), 'project', 'show', array('project_id' => $project['id'])) ?> + url->link(t('Yes'), 'project', 'remove', array('project_id' => $project['id'], 'remove' => 'yes'), true, 'btn btn-red') ?> + url->link(t('cancel'), 'project', 'show', array('project_id' => $project['id'])) ?>
    \ No newline at end of file diff --git a/app/Template/project/search.php b/app/Template/project/search.php index 47ba0f77e..a8e387c63 100644 --- a/app/Template/project/search.php +++ b/app/Template/project/search.php @@ -3,28 +3,28 @@
    • - a(t('Back to the board'), 'board', 'show', array('project_id' => $project['id'])) ?> + url->link(t('Back to the board'), 'board', 'show', array('project_id' => $project['id'])) ?>
    • - a(t('Calendar'), 'calendar', 'show', array('project_id' => $project['id'])) ?> + url->link(t('Calendar'), 'calendar', 'show', array('project_id' => $project['id'])) ?>
    • - a(t('Completed tasks'), 'project', 'tasks', array('project_id' => $project['id'])) ?> + url->link(t('Completed tasks'), 'project', 'tasks', array('project_id' => $project['id'])) ?>
    • - a(t('Activity'), 'project', 'activity', array('project_id' => $project['id'])) ?> + url->link(t('Activity'), 'project', 'activity', array('project_id' => $project['id'])) ?>
    - formHidden('controller', $values) ?> - formHidden('action', $values) ?> - formHidden('project_id', $values) ?> - formText('search', $values, array(), array('autofocus', 'required', 'placeholder="'.t('Search').'"'), 'form-input-large') ?> + form->hidden('controller', $values) ?> + form->hidden('action', $values) ?> + form->hidden('project_id', $values) ?> + form->text('search', $values, array(), array('autofocus', 'required', 'placeholder="'.t('Search').'"'), 'form-input-large') ?>
    diff --git a/app/Template/project/share.php b/app/Template/project/share.php index 07f29fdcd..a91465995 100644 --- a/app/Template/project/share.php +++ b/app/Template/project/share.php @@ -6,14 +6,14 @@
      -
    • a(t('Public link'), 'board', 'readonly', array('token' => $project['token']), false, '', '', true) ?>
    • -
    • a(t('RSS feed'), 'project', 'feed', array('token' => $project['token']), false, '', '', true) ?>
    • -
    • a(t('iCal feed'), 'ical', 'project', array('token' => $project['token']), false, '', '', true) ?>
    • +
    • url->link(t('Public link'), 'board', 'readonly', array('token' => $project['token']), false, '', '', true) ?>
    • +
    • url->link(t('RSS feed'), 'project', 'feed', array('token' => $project['token']), false, '', '', true) ?>
    • +
    • url->link(t('iCal feed'), 'ical', 'project', array('token' => $project['token']), false, '', '', true) ?>
    - a(t('Disable public access'), 'project', 'share', array('project_id' => $project['id'], 'switch' => 'disable'), true, 'btn btn-red') ?> + url->link(t('Disable public access'), 'project', 'share', array('project_id' => $project['id'], 'switch' => 'disable'), true, 'btn btn-red') ?> - a(t('Enable public access'), 'project', 'share', array('project_id' => $project['id'], 'switch' => 'enable'), true, 'btn btn-blue') ?> + url->link(t('Enable public access'), 'project', 'share', array('project_id' => $project['id'], 'switch' => 'enable'), true, 'btn btn-blue') ?> diff --git a/app/Template/project/show.php b/app/Template/project/show.php index 9c6cd1a87..9ffbd5bc2 100644 --- a/app/Template/project/show.php +++ b/app/Template/project/show.php @@ -9,8 +9,8 @@ -
  • a(t('Public link'), 'board', 'readonly', array('token' => $project['token']), false, '', '', true) ?>
  • -
  • a(t('RSS feed'), 'project', 'feed', array('token' => $project['token']), false, '', '', true) ?>
  • +
  • url->link(t('Public link'), 'board', 'readonly', array('token' => $project['token']), false, '', '', true) ?>
  • +
  • url->link(t('RSS feed'), 'project', 'feed', array('token' => $project['token']), false, '', '', true) ?>
  • @@ -22,11 +22,11 @@ 0): ?> 0): ?> -
  • a(t('%d tasks on the board', $stats['nb_active_tasks']), 'board', 'show', array('project_id' => $project['id'])) ?>
  • +
  • url->link(t('%d tasks on the board', $stats['nb_active_tasks']), 'board', 'show', array('project_id' => $project['id'])) ?>
  • 0): ?> -
  • a(t('%d closed tasks', $stats['nb_inactive_tasks']), 'project', 'tasks', array('project_id' => $project['id'])) ?>
  • +
  • url->link(t('%d closed tasks', $stats['nb_inactive_tasks']), 'project', 'tasks', array('project_id' => $project['id'])) ?>
  • @@ -50,7 +50,7 @@
    e($column['title']) ?> - '> + '> @@ -67,6 +67,6 @@
    - markdown($project['description']) ?> + text->markdown($project['description']) ?>
    diff --git a/app/Template/project/sidebar.php b/app/Template/project/sidebar.php index 31e3ff04c..5c7ea7159 100644 --- a/app/Template/project/sidebar.php +++ b/app/Template/project/sidebar.php @@ -2,71 +2,71 @@

    • - a(t('Summary'), 'project', 'show', array('project_id' => $project['id'])) ?> + url->link(t('Summary'), 'project', 'show', array('project_id' => $project['id'])) ?>
    • - isManager($project['id'])): ?> + user->isManager($project['id'])): ?>
    • - a(t('Public access'), 'project', 'share', array('project_id' => $project['id'])) ?> + url->link(t('Public access'), 'project', 'share', array('project_id' => $project['id'])) ?>
    • - a(t('Integrations'), 'project', 'integration', array('project_id' => $project['id'])) ?> + url->link(t('Integrations'), 'project', 'integration', array('project_id' => $project['id'])) ?>
    • - a(t('Edit project'), 'project', 'edit', array('project_id' => $project['id'])) ?> + url->link(t('Edit project'), 'project', 'edit', array('project_id' => $project['id'])) ?>
    • - a(t('Edit board'), 'column', 'index', array('project_id' => $project['id'])) ?> + url->link(t('Edit board'), 'column', 'index', array('project_id' => $project['id'])) ?>
    • - a(t('Category management'), 'category', 'index', array('project_id' => $project['id'])) ?> + url->link(t('Category management'), 'category', 'index', array('project_id' => $project['id'])) ?>
    • - a(t('Swimlanes'), 'swimlane', 'index', array('project_id' => $project['id'])) ?> + url->link(t('Swimlanes'), 'swimlane', 'index', array('project_id' => $project['id'])) ?>
    • - userSession->isAdmin() || $project['is_private'] == 0): ?> + user->isAdmin() || $project['is_private'] == 0): ?>
    • - a(t('User management'), 'project', 'users', array('project_id' => $project['id'])) ?> + url->link(t('User management'), 'project', 'users', array('project_id' => $project['id'])) ?>
    • - a(t('Automatic actions'), 'action', 'index', array('project_id' => $project['id'])) ?> + url->link(t('Automatic actions'), 'action', 'index', array('project_id' => $project['id'])) ?>
    • - a(t('Duplicate'), 'project', 'duplicate', array('project_id' => $project['id'])) ?> + url->link(t('Duplicate'), 'project', 'duplicate', array('project_id' => $project['id'])) ?>
    • - a(t('Budget'), 'budget', 'index', array('project_id' => $project['id'])) ?> + url->link(t('Budget'), 'budget', 'index', array('project_id' => $project['id'])) ?>
    • - a(t('Disable'), 'project', 'disable', array('project_id' => $project['id']), true) ?> + url->link(t('Disable'), 'project', 'disable', array('project_id' => $project['id']), true) ?> - a(t('Enable'), 'project', 'enable', array('project_id' => $project['id']), true) ?> + url->link(t('Enable'), 'project', 'enable', array('project_id' => $project['id']), true) ?>
    • - userSession->isAdmin()): ?> + user->isAdmin()): ?>
    • - a(t('Remove'), 'project', 'remove', array('project_id' => $project['id'])) ?> + url->link(t('Remove'), 'project', 'remove', array('project_id' => $project['id'])) ?>
    - acl->isManagerActionAllowed($project['id'])): ?> + user->isManager($project['id'])): ?>

    • - a(t('Tasks'), 'export', 'tasks', array('project_id' => $project['id'])) ?> + url->link(t('Tasks'), 'export', 'tasks', array('project_id' => $project['id'])) ?>
    • - a(t('Subtasks'), 'export', 'subtasks', array('project_id' => $project['id'])) ?> + url->link(t('Subtasks'), 'export', 'subtasks', array('project_id' => $project['id'])) ?>
    • - a(t('Task transitions'), 'export', 'transitions', array('project_id' => $project['id'])) ?> + url->link(t('Task transitions'), 'export', 'transitions', array('project_id' => $project['id'])) ?>
    • - a(t('Daily project summary'), 'export', 'summary', array('project_id' => $project['id'])) ?> + url->link(t('Daily project summary'), 'export', 'summary', array('project_id' => $project['id'])) ?>
    diff --git a/app/Template/project/tasks.php b/app/Template/project/tasks.php index b22746f99..06f28061c 100644 --- a/app/Template/project/tasks.php +++ b/app/Template/project/tasks.php @@ -3,19 +3,19 @@
    • - a(t('Back to the board'), 'board', 'show', array('project_id' => $project['id'])) ?> + url->link(t('Back to the board'), 'board', 'show', array('project_id' => $project['id'])) ?>
    • - a(t('Calendar'), 'calendar', 'show', array('project_id' => $project['id'])) ?> + url->link(t('Calendar'), 'calendar', 'show', array('project_id' => $project['id'])) ?>
    • - a(t('Search'), 'project', 'search', array('project_id' => $project['id'])) ?> + url->link(t('Search'), 'project', 'search', array('project_id' => $project['id'])) ?>
    • - a(t('Activity'), 'project', 'activity', array('project_id' => $project['id'])) ?> + url->link(t('Activity'), 'project', 'activity', array('project_id' => $project['id'])) ?>
    diff --git a/app/Template/project/users.php b/app/Template/project/users.php index 181473406..d725a9e82 100644 --- a/app/Template/project/users.php +++ b/app/Template/project/users.php @@ -24,12 +24,12 @@
      -
    • a(t('Revoke'), 'project', 'revoke', array('project_id' => $project['id'], 'user_id' => $user_id), true) ?>
    • +
    • url->link(t('Revoke'), 'project', 'revoke', array('project_id' => $project['id'], 'user_id' => $user_id), true) ?>
    • - a(t('Set project member'), 'project', 'role', array('project_id' => $project['id'], 'user_id' => $user_id, 'is_owner' => 0), true) ?> + url->link(t('Set project member'), 'project', 'role', array('project_id' => $project['id'], 'user_id' => $user_id, 'is_owner' => 0), true) ?> - a(t('Set project manager'), 'project', 'role', array('project_id' => $project['id'], 'user_id' => $user_id, 'is_owner' => 1), true) ?> + url->link(t('Set project manager'), 'project', 'role', array('project_id' => $project['id'], 'user_id' => $user_id, 'is_owner' => 1), true) ?>
    @@ -42,14 +42,14 @@
    -
    + - formCsrf() ?> + form->csrf() ?> - formHidden('project_id', array('project_id' => $project['id'])) ?> + form->hidden('project_id', array('project_id' => $project['id'])) ?> - formLabel(t('User'), 'user_id') ?> - formSelect('user_id', $users['not_allowed'], array(), array(), array('data-notfound="'.t('No results match:').'"'), 'chosen-select') ?>
    + form->label(t('User'), 'user_id') ?> + form->select('user_id', $users['not_allowed'], array(), array(), array('data-notfound="'.t('No results match:').'"'), 'chosen-select') ?>
    @@ -61,11 +61,11 @@
    - - formCsrf() ?> + + form->csrf() ?> - formHidden('id', array('id' => $project['id'])) ?> - formCheckbox('is_everybody_allowed', t('Allow everybody to access to this project'), 1, $project['is_everybody_allowed']) ?> + form->hidden('id', array('id' => $project['id'])) ?> + form->checkbox('is_everybody_allowed', t('Allow everybody to access to this project'), 1, $project['is_everybody_allowed']) ?>
    diff --git a/app/Template/subtask/create.php b/app/Template/subtask/create.php index 8c5aae113..82e378f54 100644 --- a/app/Template/subtask/create.php +++ b/app/Template/subtask/create.php @@ -2,26 +2,26 @@

    - + - formCsrf() ?> + form->csrf() ?> - formHidden('task_id', $values) ?> + form->hidden('task_id', $values) ?> - formLabel(t('Title'), 'title') ?> - formText('title', $values, $errors, array('required', 'autofocus', 'maxlength="255"')) ?>
    + form->label(t('Title'), 'title') ?> + form->text('title', $values, $errors, array('required', 'autofocus', 'maxlength="255"')) ?>
    - formLabel(t('Assignee'), 'user_id') ?> - formSelect('user_id', $users_list, $values, $errors) ?>
    + form->label(t('Assignee'), 'user_id') ?> + form->select('user_id', $users_list, $values, $errors) ?>
    - formLabel(t('Original estimate'), 'time_estimated') ?> - formNumeric('time_estimated', $values, $errors) ?>
    + form->label(t('Original estimate'), 'time_estimated') ?> + form->numeric('time_estimated', $values, $errors) ?>
    - formCheckbox('another_subtask', t('Create another sub-task'), 1, isset($values['another_subtask']) && $values['another_subtask'] == 1) ?> + form->checkbox('another_subtask', t('Create another sub-task'), 1, isset($values['another_subtask']) && $values['another_subtask'] == 1) ?>
    - a(t('cancel'), 'task', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?> + url->link(t('cancel'), 'task', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?>
    diff --git a/app/Template/subtask/edit.php b/app/Template/subtask/edit.php index 3058ff44f..2e5830690 100644 --- a/app/Template/subtask/edit.php +++ b/app/Template/subtask/edit.php @@ -2,28 +2,28 @@

    -
    + - formCsrf() ?> + form->csrf() ?> - formHidden('id', $values) ?> - formHidden('task_id', $values) ?> + form->hidden('id', $values) ?> + form->hidden('task_id', $values) ?> - formLabel(t('Title'), 'title') ?> - formText('title', $values, $errors, array('required', 'autofocus', 'maxlength="255"')) ?>
    + form->label(t('Title'), 'title') ?> + form->text('title', $values, $errors, array('required', 'autofocus', 'maxlength="255"')) ?>
    - formLabel(t('Assignee'), 'user_id') ?> - formSelect('user_id', $users_list, $values, $errors) ?>
    + form->label(t('Assignee'), 'user_id') ?> + form->select('user_id', $users_list, $values, $errors) ?>
    - formLabel(t('Original estimate'), 'time_estimated') ?> - formNumeric('time_estimated', $values, $errors) ?>
    + form->label(t('Original estimate'), 'time_estimated') ?> + form->numeric('time_estimated', $values, $errors) ?>
    - formLabel(t('Time spent'), 'time_spent') ?> - formNumeric('time_spent', $values, $errors) ?>
    + form->label(t('Time spent'), 'time_spent') ?> + form->numeric('time_spent', $values, $errors) ?>
    - a(t('cancel'), 'task', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?> + url->link(t('cancel'), 'task', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?>
    diff --git a/app/Template/subtask/remove.php b/app/Template/subtask/remove.php index c623791d0..65ade31d0 100644 --- a/app/Template/subtask/remove.php +++ b/app/Template/subtask/remove.php @@ -10,8 +10,8 @@

    e($subtask['title']) ?>

    - a(t('Yes'), 'subtask', 'remove', array('task_id' => $task['id'], 'project_id' => $task['project_id'], 'subtask_id' => $subtask['id']), true, 'btn btn-red') ?> + url->link(t('Yes'), 'subtask', 'remove', array('task_id' => $task['id'], 'project_id' => $task['project_id'], 'subtask_id' => $subtask['id']), true, 'btn btn-red') ?> - a(t('cancel'), 'task', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?> + url->link(t('cancel'), 'task', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?>
    \ No newline at end of file diff --git a/app/Template/subtask/restriction_change_status.php b/app/Template/subtask/restriction_change_status.php index 99e022f84..88e91d82d 100644 --- a/app/Template/subtask/restriction_change_status.php +++ b/app/Template/subtask/restriction_change_status.php @@ -2,14 +2,14 @@

    -
    + - formCsrf() ?> - formHidden('redirect', array('redirect' => $redirect)) ?> + form->csrf() ?> + form->hidden('redirect', array('redirect' => $redirect)) ?>

    - formRadios('status', $status_list) ?> - formHidden('id', $subtask_inprogress) ?> + form->radios('status', $status_list) ?> + form->hidden('id', $subtask_inprogress) ?>
    diff --git a/app/Template/subtask/show.php b/app/Template/subtask/show.php index e53682651..c9690f08e 100644 --- a/app/Template/subtask/show.php +++ b/app/Template/subtask/show.php @@ -22,14 +22,14 @@
    - toggleSubtaskStatus($subtask, 'task') ?> + subtask->toggleStatus($subtask, 'task') ?> render('subtask/icons', array('subtask' => $subtask)) . $this->e($subtask['title']) ?> - a($this->e($subtask['name'] ?: $subtask['username']), 'user', 'show', array('user_id' => $subtask['user_id'])) ?> + url->link($this->e($subtask['name'] ?: $subtask['username']), 'user', 'show', array('user_id' => $subtask['user_id'])) ?> @@ -46,19 +46,19 @@
    • - a(t('Move Up'), 'subtask', 'movePosition', array('project_id' => $project['id'], 'task_id' => $subtask['task_id'], 'subtask_id' => $subtask['id'], 'direction' => 'up'), true) ?> + url->link(t('Move Up'), 'subtask', 'movePosition', array('project_id' => $project['id'], 'task_id' => $subtask['task_id'], 'subtask_id' => $subtask['id'], 'direction' => 'up'), true) ?>
    • - a(t('Move Down'), 'subtask', 'movePosition', array('project_id' => $project['id'], 'task_id' => $subtask['task_id'], 'subtask_id' => $subtask['id'], 'direction' => 'down'), true) ?> + url->link(t('Move Down'), 'subtask', 'movePosition', array('project_id' => $project['id'], 'task_id' => $subtask['task_id'], 'subtask_id' => $subtask['id'], 'direction' => 'down'), true) ?>
    • - a(t('Edit'), 'subtask', 'edit', array('task_id' => $task['id'], 'project_id' => $task['project_id'], 'subtask_id' => $subtask['id'])) ?> + url->link(t('Edit'), 'subtask', 'edit', array('task_id' => $task['id'], 'project_id' => $task['project_id'], 'subtask_id' => $subtask['id'])) ?>
    • - a(t('Remove'), 'subtask', 'confirm', array('task_id' => $task['id'], 'project_id' => $task['project_id'], 'subtask_id' => $subtask['id'])) ?> + url->link(t('Remove'), 'subtask', 'confirm', array('task_id' => $task['id'], 'project_id' => $task['project_id'], 'subtask_id' => $subtask['id'])) ?>
    - - formCsrf() ?> - formHidden('task_id', array('task_id' => $task['id'])) ?> - formText('title', array(), array(), array('required', 'placeholder="'.t('Type here to create a new sub-task').'"')) ?> + + form->csrf() ?> + form->hidden('task_id', array('task_id' => $task['id'])) ?> + form->text('title', array(), array(), array('required', 'placeholder="'.t('Type here to create a new sub-task').'"')) ?> diff --git a/app/Template/swimlane/edit.php b/app/Template/swimlane/edit.php index f39b6fde8..cc98b584c 100644 --- a/app/Template/swimlane/edit.php +++ b/app/Template/swimlane/edit.php @@ -2,15 +2,15 @@

    -
    + - formCsrf() ?> + form->csrf() ?> - formHidden('id', $values) ?> - formHidden('project_id', $values) ?> + form->hidden('id', $values) ?> + form->hidden('project_id', $values) ?> - formLabel(t('Name'), 'name') ?> - formText('name', $values, $errors, array('autofocus', 'required', 'maxlength="50"')) ?> + form->label(t('Name'), 'name') ?> + form->text('name', $values, $errors, array('autofocus', 'required', 'maxlength="50"')) ?>
    diff --git a/app/Template/swimlane/index.php b/app/Template/swimlane/index.php index 3482a56c3..daee6af50 100644 --- a/app/Template/swimlane/index.php +++ b/app/Template/swimlane/index.php @@ -8,13 +8,13 @@ - + - formCsrf() ?> - formHidden('project_id', $values) ?> + form->csrf() ?> + form->hidden('project_id', $values) ?> - formLabel(t('Name'), 'name') ?> - formText('name', $values, $errors, array('autofocus', 'required', 'maxlength="50"')) ?> + form->label(t('Name'), 'name') ?> + form->text('name', $values, $errors, array('autofocus', 'required', 'maxlength="50"')) ?>
    @@ -24,15 +24,15 @@ - + - formCsrf() ?> - formHidden('id', $default_swimlane) ?> + form->csrf() ?> + form->hidden('id', $default_swimlane) ?> - formLabel(t('Rename'), 'default_swimlane') ?> - formText('default_swimlane', $default_swimlane, array(), array('autofocus', 'required', 'maxlength="50"')) ?>
    + form->label(t('Rename'), 'default_swimlane') ?> + form->text('default_swimlane', $default_swimlane, array(), array('autofocus', 'required', 'maxlength="50"')) ?>
    - formCheckbox('show_default_swimlane', t('Show default swimlane'), 1, isset($default_swimlane['show_default_swimlane']) && $default_swimlane['show_default_swimlane'] == 1) ?> + form->checkbox('show_default_swimlane', t('Show default swimlane'), 1, isset($default_swimlane['show_default_swimlane']) && $default_swimlane['show_default_swimlane'] == 1) ?>
    diff --git a/app/Template/swimlane/remove.php b/app/Template/swimlane/remove.php index 3268f51fe..1d7c2b7ab 100644 --- a/app/Template/swimlane/remove.php +++ b/app/Template/swimlane/remove.php @@ -9,9 +9,9 @@

    - a(t('Yes'), 'swimlane', 'remove', array('project_id' => $project['id'], 'swimlane_id' => $swimlane['id']), true, 'btn btn-red') ?> + url->link(t('Yes'), 'swimlane', 'remove', array('project_id' => $project['id'], 'swimlane_id' => $swimlane['id']), true, 'btn btn-red') ?> - a(t('cancel'), 'swimlane', 'index', array('project_id' => $project['id'])) ?> + url->link(t('cancel'), 'swimlane', 'index', array('project_id' => $project['id'])) ?>
    \ No newline at end of file diff --git a/app/Template/swimlane/table.php b/app/Template/swimlane/table.php index cf22e31b1..f38572a3b 100644 --- a/app/Template/swimlane/table.php +++ b/app/Template/swimlane/table.php @@ -16,26 +16,26 @@
    • - a(t('Move Up'), 'swimlane', 'moveup', array('project_id' => $project['id'], 'swimlane_id' => $swimlane['id']), true) ?> + url->link(t('Move Up'), 'swimlane', 'moveup', array('project_id' => $project['id'], 'swimlane_id' => $swimlane['id']), true) ?>
    • - a(t('Move Down'), 'swimlane', 'movedown', array('project_id' => $project['id'], 'swimlane_id' => $swimlane['id']), true) ?> + url->link(t('Move Down'), 'swimlane', 'movedown', array('project_id' => $project['id'], 'swimlane_id' => $swimlane['id']), true) ?>
    • - a(t('Rename'), 'swimlane', 'edit', array('project_id' => $project['id'], 'swimlane_id' => $swimlane['id'])) ?> + url->link(t('Rename'), 'swimlane', 'edit', array('project_id' => $project['id'], 'swimlane_id' => $swimlane['id'])) ?>
    • - a(t('Disable'), 'swimlane', 'disable', array('project_id' => $project['id'], 'swimlane_id' => $swimlane['id']), true) ?> + url->link(t('Disable'), 'swimlane', 'disable', array('project_id' => $project['id'], 'swimlane_id' => $swimlane['id']), true) ?> - a(t('Enable'), 'swimlane', 'enable', array('project_id' => $project['id'], 'swimlane_id' => $swimlane['id']), true) ?> + url->link(t('Enable'), 'swimlane', 'enable', array('project_id' => $project['id'], 'swimlane_id' => $swimlane['id']), true) ?>
    • - a(t('Remove'), 'swimlane', 'confirm', array('project_id' => $project['id'], 'swimlane_id' => $swimlane['id'])) ?> + url->link(t('Remove'), 'swimlane', 'confirm', array('project_id' => $project['id'], 'swimlane_id' => $swimlane['id'])) ?>
    diff --git a/app/Template/task/close.php b/app/Template/task/close.php index a0a95787d..79150333e 100644 --- a/app/Template/task/close.php +++ b/app/Template/task/close.php @@ -8,8 +8,8 @@

    - a(t('Yes'), 'task', 'close', array('task_id' => $task['id'], 'project_id' => $task['project_id'], 'confirmation' => 'yes', 'redirect' => $redirect), true, 'btn btn-red') ?> + url->link(t('Yes'), 'task', 'close', array('task_id' => $task['id'], 'project_id' => $task['project_id'], 'confirmation' => 'yes', 'redirect' => $redirect), true, 'btn btn-red') ?> - a(t('cancel'), 'task', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id']), false, 'close-popover') ?> + url->link(t('cancel'), 'task', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id']), false, 'close-popover') ?>
    \ No newline at end of file diff --git a/app/Template/task/details.php b/app/Template/task/details.php index c70945bc4..f688585a6 100644 --- a/app/Template/task/details.php +++ b/app/Template/task/details.php @@ -77,7 +77,7 @@
  • - a(t('Public link'), 'task', 'readonly', array('task_id' => $task['id'], 'token' => $project['token']), false, '', '', true) ?> + url->link(t('Public link'), 'task', 'readonly', array('task_id' => $task['id'], 'token' => $project['token']), false, '', '', true) ?>
  • diff --git a/app/Template/task/duplicate.php b/app/Template/task/duplicate.php index cc7e0870e..e74d29060 100644 --- a/app/Template/task/duplicate.php +++ b/app/Template/task/duplicate.php @@ -8,8 +8,8 @@

    - a(t('Yes'), 'task', 'duplicate', array('task_id' => $task['id'], 'project_id' => $task['project_id'], 'confirmation' => 'yes'), true, 'btn btn-red') ?> + url->link(t('Yes'), 'task', 'duplicate', array('task_id' => $task['id'], 'project_id' => $task['project_id'], 'confirmation' => 'yes'), true, 'btn btn-red') ?> - a(t('cancel'), 'task', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?> + url->link(t('cancel'), 'task', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?>
    \ No newline at end of file diff --git a/app/Template/task/duplicate_project.php b/app/Template/task/duplicate_project.php index e227e0465..9a8e3c4a1 100644 --- a/app/Template/task/duplicate_project.php +++ b/app/Template/task/duplicate_project.php @@ -6,18 +6,18 @@

    - + - formCsrf() ?> + form->csrf() ?> - formHidden('id', $values) ?> - formLabel(t('Project'), 'project_id') ?> - formSelect('project_id', $projects_list, $values, $errors) ?>
    + form->hidden('id', $values) ?> + form->label(t('Project'), 'project_id') ?> + form->select('project_id', $projects_list, $values, $errors) ?>
    - a(t('cancel'), 'task', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?> + url->link(t('cancel'), 'task', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?>
    diff --git a/app/Template/task/edit.php b/app/Template/task/edit.php index f9ac2b20e..2900b739e 100644 --- a/app/Template/task/edit.php +++ b/app/Template/task/edit.php @@ -2,16 +2,16 @@

    -
    + - formCsrf() ?> + form->csrf() ?>
    - formLabel(t('Title'), 'title') ?> - formText('title', $values, $errors, array('required', 'maxlength="200"')) ?>
    + form->label(t('Title'), 'title') ?> + form->text('title', $values, $errors, array('required', 'maxlength="200"')) ?>
    - formLabel(t('Description'), 'description') ?> + form->label(t('Description'), 'description') ?>
      @@ -23,7 +23,7 @@
    - formTextarea('description', $values, $errors, array('placeholder="'.t('Leave a description').'"')) ?> + form->textarea('description', $values, $errors, array('placeholder="'.t('Leave a description').'"')) ?>
    @@ -35,23 +35,23 @@
    - formHidden('id', $values) ?> - formHidden('project_id', $values) ?> + form->hidden('id', $values) ?> + form->hidden('project_id', $values) ?> - formLabel(t('Assignee'), 'owner_id') ?> - formSelect('owner_id', $users_list, $values, $errors) ?>
    + form->label(t('Assignee'), 'owner_id') ?> + form->select('owner_id', $users_list, $values, $errors) ?>
    - formLabel(t('Category'), 'category_id') ?> - formSelect('category_id', $categories_list, $values, $errors) ?>
    + form->label(t('Category'), 'category_id') ?> + form->select('category_id', $categories_list, $values, $errors) ?>
    - formLabel(t('Color'), 'color_id') ?> - formSelect('color_id', $colors_list, $values, $errors) ?>
    + form->label(t('Color'), 'color_id') ?> + form->select('color_id', $colors_list, $values, $errors) ?>
    - formLabel(t('Complexity'), 'score') ?> - formNumber('score', $values, $errors) ?>
    + form->label(t('Complexity'), 'score') ?> + form->number('score', $values, $errors) ?>
    - formLabel(t('Due Date'), 'date_due') ?> - formText('date_due', $values, $errors, array('placeholder="'.$this->inList($date_format, $date_formats).'"'), 'form-date') ?>
    + form->label(t('Due Date'), 'date_due') ?> + form->text('date_due', $values, $errors, array('placeholder="'.$this->text->in($date_format, $date_formats).'"'), 'form-date') ?>
    @@ -59,9 +59,9 @@ - a(t('cancel'), 'board', 'show', array('project_id' => $task['project_id']), false, 'close-popover') ?> + url->link(t('cancel'), 'board', 'show', array('project_id' => $task['project_id']), false, 'close-popover') ?> - a(t('cancel'), 'task', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?> + url->link(t('cancel'), 'task', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?>
    diff --git a/app/Template/task/edit_description.php b/app/Template/task/edit_description.php index 2af26ef4a..84f0cebd6 100644 --- a/app/Template/task/edit_description.php +++ b/app/Template/task/edit_description.php @@ -2,10 +2,10 @@

    -
    + - formCsrf() ?> - formHidden('id', $values) ?> + form->csrf() ?> + form->hidden('id', $values) ?>
      @@ -17,7 +17,7 @@
    - formTextarea('description', $values, $errors, array('autofocus', 'placeholder="'.t('Leave a description').'"'), 'description-textarea') ?> + form->textarea('description', $values, $errors, array('autofocus', 'placeholder="'.t('Leave a description').'"'), 'description-textarea') ?>
    @@ -30,9 +30,9 @@ - a(t('cancel'), 'board', 'show', array('project_id' => $task['project_id'])) ?> + url->link(t('cancel'), 'board', 'show', array('project_id' => $task['project_id'])) ?> - a(t('cancel'), 'task', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?> + url->link(t('cancel'), 'task', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?>
    diff --git a/app/Template/task/edit_recurrence.php b/app/Template/task/edit_recurrence.php index 76894bd40..c261e3681 100644 --- a/app/Template/task/edit_recurrence.php +++ b/app/Template/task/edit_recurrence.php @@ -15,36 +15,36 @@ -
    + - formCsrf() ?> + form->csrf() ?> - formHidden('id', $values) ?> - formHidden('project_id', $values) ?> + form->hidden('id', $values) ?> + form->hidden('project_id', $values) ?> - formLabel(t('Generate recurrent task'), 'recurrence_status') ?> - formSelect('recurrence_status', $recurrence_status_list, $values, $errors) ?> + form->label(t('Generate recurrent task'), 'recurrence_status') ?> + form->select('recurrence_status', $recurrence_status_list, $values, $errors) ?> - formLabel(t('Trigger to generate recurrent task'), 'recurrence_trigger') ?> - formSelect('recurrence_trigger', $recurrence_trigger_list, $values, $errors) ?> + form->label(t('Trigger to generate recurrent task'), 'recurrence_trigger') ?> + form->select('recurrence_trigger', $recurrence_trigger_list, $values, $errors) ?> - formLabel(t('Factor to calculate new due date'), 'recurrence_factor') ?> - formNumber('recurrence_factor', $values, $errors) ?> + form->label(t('Factor to calculate new due date'), 'recurrence_factor') ?> + form->number('recurrence_factor', $values, $errors) ?> - formLabel(t('Timeframe to calculate new due date'), 'recurrence_timeframe') ?> - formSelect('recurrence_timeframe', $recurrence_timeframe_list, $values, $errors) ?> + form->label(t('Timeframe to calculate new due date'), 'recurrence_timeframe') ?> + form->select('recurrence_timeframe', $recurrence_timeframe_list, $values, $errors) ?> - formLabel(t('Base date to calculate new due date'), 'recurrence_basedate') ?> - formSelect('recurrence_basedate', $recurrence_basedate_list, $values, $errors) ?> + form->label(t('Base date to calculate new due date'), 'recurrence_basedate') ?> + form->select('recurrence_basedate', $recurrence_basedate_list, $values, $errors) ?>
    - a(t('cancel'), 'board', 'show', array('project_id' => $task['project_id'])) ?> + url->link(t('cancel'), 'board', 'show', array('project_id' => $task['project_id'])) ?> - a(t('cancel'), 'task', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?> + url->link(t('cancel'), 'task', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?>
    diff --git a/app/Template/task/layout.php b/app/Template/task/layout.php index dd59a9fc9..18ddea36a 100644 --- a/app/Template/task/layout.php +++ b/app/Template/task/layout.php @@ -3,11 +3,11 @@
    • - a(t('Back to the board'), 'board', 'show', array('project_id' => $task['project_id'])) ?> + url->link(t('Back to the board'), 'board', 'show', array('project_id' => $task['project_id'])) ?>
    • - a(t('Calendar'), 'calendar', 'show', array('project_id' => $task['project_id'])) ?> + url->link(t('Calendar'), 'calendar', 'show', array('project_id' => $task['project_id'])) ?>
    diff --git a/app/Template/task/move_project.php b/app/Template/task/move_project.php index ccc67851d..b0b33f817 100644 --- a/app/Template/task/move_project.php +++ b/app/Template/task/move_project.php @@ -6,18 +6,18 @@

    -
    + - formCsrf() ?> + form->csrf() ?> - formHidden('id', $values) ?> - formLabel(t('Project'), 'project_id') ?> - formSelect('project_id', $projects_list, $values, $errors) ?>
    + form->hidden('id', $values) ?> + form->label(t('Project'), 'project_id') ?> + form->select('project_id', $projects_list, $values, $errors) ?>
    - a(t('cancel'), 'task', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?> + url->link(t('cancel'), 'task', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?>
    diff --git a/app/Template/task/new.php b/app/Template/task/new.php index 37294c898..bd00d3472 100644 --- a/app/Template/task/new.php +++ b/app/Template/task/new.php @@ -1,7 +1,7 @@ @@ -11,15 +11,15 @@
    -
    + - formCsrf() ?> + form->csrf() ?>
    - formLabel(t('Title'), 'title') ?> - formText('title', $values, $errors, array('autofocus', 'required', 'maxlength="200"'), 'form-input-large') ?>
    + form->label(t('Title'), 'title') ?> + form->text('title', $values, $errors, array('autofocus', 'required', 'maxlength="200"'), 'form-input-large') ?>
    - formLabel(t('Description'), 'description') ?> + form->label(t('Description'), 'description') ?>
      @@ -31,7 +31,7 @@
    - formTextarea('description', $values, $errors, array('placeholder="'.t('Leave a description').'"')) ?> + form->textarea('description', $values, $errors, array('placeholder="'.t('Leave a description').'"')) ?>
    @@ -41,44 +41,44 @@
    - formCheckbox('another_task', t('Create another task'), 1, isset($values['another_task']) && $values['another_task'] == 1) ?> + form->checkbox('another_task', t('Create another task'), 1, isset($values['another_task']) && $values['another_task'] == 1) ?>
    - formHidden('project_id', $values) ?> + form->hidden('project_id', $values) ?> - formLabel(t('Assignee'), 'owner_id') ?> - formSelect('owner_id', $users_list, $values, $errors) ?>
    + form->label(t('Assignee'), 'owner_id') ?> + form->select('owner_id', $users_list, $values, $errors) ?>
    - formLabel(t('Category'), 'category_id') ?> - formSelect('category_id', $categories_list, $values, $errors) ?>
    + form->label(t('Category'), 'category_id') ?> + form->select('category_id', $categories_list, $values, $errors) ?>
    - formLabel(t('Swimlane'), 'swimlane_id') ?> - formSelect('swimlane_id', $swimlanes_list, $values, $errors) ?>
    + form->label(t('Swimlane'), 'swimlane_id') ?> + form->select('swimlane_id', $swimlanes_list, $values, $errors) ?>
    - formLabel(t('Column'), 'column_id') ?> - formSelect('column_id', $columns_list, $values, $errors) ?>
    + form->label(t('Column'), 'column_id') ?> + form->select('column_id', $columns_list, $values, $errors) ?>
    - formLabel(t('Color'), 'color_id') ?> - formSelect('color_id', $colors_list, $values, $errors) ?>
    + form->label(t('Color'), 'color_id') ?> + form->select('color_id', $colors_list, $values, $errors) ?>
    - formLabel(t('Complexity'), 'score') ?> - formNumber('score', $values, $errors) ?>
    + form->label(t('Complexity'), 'score') ?> + form->number('score', $values, $errors) ?>
    - formLabel(t('Original estimate'), 'time_estimated') ?> - formNumeric('time_estimated', $values, $errors) ?>
    + form->label(t('Original estimate'), 'time_estimated') ?> + form->numeric('time_estimated', $values, $errors) ?>
    - formLabel(t('Due Date'), 'date_due') ?> - formText('date_due', $values, $errors, array('placeholder="'.$this->inList($date_format, $date_formats).'"'), 'form-date') ?>
    + form->label(t('Due Date'), 'date_due') ?> + form->text('date_due', $values, $errors, array('placeholder="'.$this->text->in($date_format, $date_formats).'"'), 'form-date') ?>
    - a(t('cancel'), 'board', 'show', array('project_id' => $values['project_id']), false, 'close-popover') ?> + url->link(t('cancel'), 'board', 'show', array('project_id' => $values['project_id']), false, 'close-popover') ?>
    diff --git a/app/Template/task/open.php b/app/Template/task/open.php index 1fcdcd800..fbcc11113 100644 --- a/app/Template/task/open.php +++ b/app/Template/task/open.php @@ -8,8 +8,8 @@

    - a(t('Yes'), 'task', 'open', array('task_id' => $task['id'], 'project_id' => $task['project_id'], 'confirmation' => 'yes'), true, 'btn btn-red') ?> + url->link(t('Yes'), 'task', 'open', array('task_id' => $task['id'], 'project_id' => $task['project_id'], 'confirmation' => 'yes'), true, 'btn btn-red') ?> - a(t('cancel'), 'task', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?> + url->link(t('cancel'), 'task', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?>
    \ No newline at end of file diff --git a/app/Template/task/public.php b/app/Template/task/public.php index 9f32f669c..73116de95 100644 --- a/app/Template/task/public.php +++ b/app/Template/task/public.php @@ -2,7 +2,7 @@ render('task/details', array('task' => $task, 'project' => $project, 'not_editable' => true)) ?> -

    a(t('Back to the board'), 'board', 'readonly', array('token' => $project['token'])) ?>

    +

    url->link(t('Back to the board'), 'board', 'readonly', array('token' => $project['token'])) ?>

    render('task/show_description', array( 'task' => $task, diff --git a/app/Template/task/recurring_info.php b/app/Template/task/recurring_info.php index 897f6207d..ad64ae19e 100644 --- a/app/Template/task/recurring_info.php +++ b/app/Template/task/recurring_info.php @@ -24,13 +24,13 @@
  • - a('#'.$task['recurrence_parent'], 'task', 'show', array('task_id' => $task['recurrence_parent'], 'project_id' => $task['project_id'])) ?> + url->link('#'.$task['recurrence_parent'], 'task', 'show', array('task_id' => $task['recurrence_parent'], 'project_id' => $task['project_id'])) ?>
  • - a('#'.$task['recurrence_child'], 'task', 'show', array('task_id' => $task['recurrence_child'], 'project_id' => $task['project_id'])) ?> + url->link('#'.$task['recurrence_child'], 'task', 'show', array('task_id' => $task['recurrence_child'], 'project_id' => $task['project_id'])) ?>
  • diff --git a/app/Template/task/remove.php b/app/Template/task/remove.php index c1eea5a0d..2f6edc224 100644 --- a/app/Template/task/remove.php +++ b/app/Template/task/remove.php @@ -8,8 +8,8 @@

    - a(t('Yes'), 'task', 'remove', array('task_id' => $task['id'], 'project_id' => $task['project_id'], 'confirmation' => 'yes'), true, 'btn btn-red') ?> + url->link(t('Yes'), 'task', 'remove', array('task_id' => $task['id'], 'project_id' => $task['project_id'], 'confirmation' => 'yes'), true, 'btn btn-red') ?> - a(t('cancel'), 'task', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?> + url->link(t('cancel'), 'task', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?>
    \ No newline at end of file diff --git a/app/Template/task/show.php b/app/Template/task/show.php index 5aa352a63..54c124f66 100644 --- a/app/Template/task/show.php +++ b/app/Template/task/show.php @@ -1,9 +1,9 @@ render('task/details', array( 'task' => $task, 'project' => $project, - 'recurrence_trigger_list' => $this->task->getRecurrenceTriggerList(), - 'recurrence_timeframe_list' => $this->task->getRecurrenceTimeframeList(), - 'recurrence_basedate_list' => $this->task->getRecurrenceBasedateList(), + 'recurrence_trigger_list' => $this->task->recurrenceTriggers(), + 'recurrence_timeframe_list' => $this->task->recurrenceTimeframes(), + 'recurrence_basedate_list' => $this->task->recurrenceBasedates(), )) ?> render('task/time', array('task' => $task, 'values' => $values, 'date_format' => $date_format, 'date_formats' => $date_formats)) ?> diff --git a/app/Template/task/show_description.php b/app/Template/task/show_description.php index 3807ddd2a..f823e7d64 100644 --- a/app/Template/task/show_description.php +++ b/app/Template/task/show_description.php @@ -6,7 +6,7 @@
    - markdown( + text->markdown( $task['description'], array( 'controller' => 'task', @@ -17,7 +17,7 @@ ) ) ?> - markdown( + text->markdown( $task['description'], array( 'controller' => 'task', diff --git a/app/Template/task/sidebar.php b/app/Template/task/sidebar.php index 7c82700a3..bb137ac91 100644 --- a/app/Template/task/sidebar.php +++ b/app/Template/task/sidebar.php @@ -2,65 +2,65 @@

    • - a(t('Summary'), 'task', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?> + url->link(t('Summary'), 'task', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?>
    • - a(t('Activity stream'), 'task', 'activites', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?> + url->link(t('Activity stream'), 'task', 'activites', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?>
    • - a(t('Transitions'), 'task', 'transitions', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?> + url->link(t('Transitions'), 'task', 'transitions', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?>
    • 0 || $task['time_spent'] > 0): ?>
    • - a(t('Time tracking'), 'task', 'timesheet', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?> + url->link(t('Time tracking'), 'task', 'timesheet', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?>

    • - a(t('Edit the task'), 'task', 'edit', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?> + url->link(t('Edit the task'), 'task', 'edit', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?>
    • - a(t('Edit the description'), 'task', 'description', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?> + url->link(t('Edit the description'), 'task', 'description', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?>
    • - a(t('Edit recurrence'), 'task', 'recurrence', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?> + url->link(t('Edit recurrence'), 'task', 'recurrence', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?>
    • - a(t('Add a sub-task'), 'subtask', 'create', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?> + url->link(t('Add a sub-task'), 'subtask', 'create', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?>
    • - a(t('Add a link'), 'tasklink', 'create', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?> + url->link(t('Add a link'), 'tasklink', 'create', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?>
    • - a(t('Add a comment'), 'comment', 'create', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?> + url->link(t('Add a comment'), 'comment', 'create', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?>
    • - a(t('Attach a document'), 'file', 'create', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?> + url->link(t('Attach a document'), 'file', 'create', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?>
    • - a(t('Add a screenshot'), 'file', 'screenshot', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?> + url->link(t('Add a screenshot'), 'file', 'screenshot', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?>
    • - a(t('Duplicate'), 'task', 'duplicate', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?> + url->link(t('Duplicate'), 'task', 'duplicate', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?>
    • - a(t('Duplicate to another project'), 'task', 'copy', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?> + url->link(t('Duplicate to another project'), 'task', 'copy', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?>
    • - a(t('Move to another project'), 'task', 'move', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?> + url->link(t('Move to another project'), 'task', 'move', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?>
    • - a(t('Close this task'), 'task', 'close', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?> + url->link(t('Close this task'), 'task', 'close', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?> - a(t('Open this task'), 'task', 'open', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?> + url->link(t('Open this task'), 'task', 'open', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?>
    • - taskPermission->canRemoveTask($task)): ?> + task->canRemove($task)): ?>
    • - a(t('Remove'), 'task', 'remove', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?> + url->link(t('Remove'), 'task', 'remove', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?>
    diff --git a/app/Template/task/table.php b/app/Template/task/table.php index 4ccf83b95..d06bc7b76 100644 --- a/app/Template/task/table.php +++ b/app/Template/task/table.php @@ -13,16 +13,16 @@ getCollection() as $task): ?> - a('#'.$this->e($task['id']), 'task', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id']), false, '', t('View this task')) ?> + url->link('#'.$this->e($task['id']), 'task', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id']), false, '', t('View this task')) ?> - inList($task['column_id'], $columns) ?> + text->in($task['column_id'], $columns) ?> - inList($task['category_id'], $categories, '') ?> + text->in($task['category_id'], $categories, '') ?> - a($this->e($task['title']), 'task', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id']), false, '', t('View this task')) ?> + url->link($this->e($task['title']), 'task', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id']), false, '', t('View this task')) ?> diff --git a/app/Template/task/time.php b/app/Template/task/time.php index 4aeddc703..6682a08d9 100644 --- a/app/Template/task/time.php +++ b/app/Template/task/time.php @@ -1,15 +1,15 @@ -
    - formCsrf() ?> - formHidden('id', $values) ?> + + form->csrf() ?> + form->hidden('id', $values) ?> - formLabel(t('Start date'), 'date_started') ?> - formText('date_started', $values, array(), array('placeholder="'.$this->inList($date_format, $date_formats).'"'), 'form-date') ?> + form->label(t('Start date'), 'date_started') ?> + form->text('date_started', $values, array(), array('placeholder="'.$this->text->in($date_format, $date_formats).'"'), 'form-date') ?> - formLabel(t('Time estimated'), 'time_estimated') ?> - formNumeric('time_estimated', $values, array(), array('placeholder="'.t('hours').'"')) ?> + form->label(t('Time estimated'), 'time_estimated') ?> + form->numeric('time_estimated', $values, array(), array('placeholder="'.t('hours').'"')) ?> - formLabel(t('Time spent'), 'time_spent') ?> - formNumeric('time_spent', $values, array(), array('placeholder="'.t('hours').'"')) ?> + form->label(t('Time spent'), 'time_spent') ?> + form->numeric('time_spent', $values, array(), array('placeholder="'.t('hours').'"')) ?>
    \ No newline at end of file diff --git a/app/Template/task/time_tracking.php b/app/Template/task/time_tracking.php index 55d33e5ec..441cb585f 100644 --- a/app/Template/task/time_tracking.php +++ b/app/Template/task/time_tracking.php @@ -14,7 +14,7 @@ getCollection() as $record): ?> - a($this->e($record['user_fullname'] ?: $record['username']), 'user', 'show', array('user_id' => $record['user_id'])) ?> + url->link($this->e($record['user_fullname'] ?: $record['username']), 'user', 'show', array('user_id' => $record['user_id'])) ?> diff --git a/app/Template/task/transitions.php b/app/Template/task/transitions.php index 2f45eb399..6455fd667 100644 --- a/app/Template/task/transitions.php +++ b/app/Template/task/transitions.php @@ -18,7 +18,7 @@ e($transition['src_column']) ?> e($transition['dst_column']) ?> - a($this->e($transition['name'] ?: $transition['username']), 'user', 'show', array('user_id' => $transition['user_id'])) ?> + url->link($this->e($transition['name'] ?: $transition['username']), 'user', 'show', array('user_id' => $transition['user_id'])) ?> diff --git a/app/Template/tasklink/create.php b/app/Template/tasklink/create.php index 3394271a3..749f2968d 100644 --- a/app/Template/tasklink/create.php +++ b/app/Template/tasklink/create.php @@ -2,17 +2,17 @@

    -
    + - formCsrf() ?> - formHidden('task_id', array('task_id' => $task['id'])) ?> - formHidden('opposite_task_id', $values) ?> + form->csrf() ?> + form->hidden('task_id', array('task_id' => $task['id'])) ?> + form->hidden('opposite_task_id', $values) ?> - formLabel(t('Label'), 'link_id') ?> - formSelect('link_id', $labels, $values, $errors) ?> + form->label(t('Label'), 'link_id') ?> + form->select('link_id', $labels, $values, $errors) ?> - formLabel(t('Task'), 'title') ?> - formText( + form->label(t('Task'), 'title') ?> + form->text( 'title', $values, $errors, @@ -21,7 +21,7 @@ 'placeholder="'.t('Start to type task title...').'"', 'title="'.t('Start to type task title...').'"', 'data-dst-field="opposite_task_id"', - 'data-search-url="'.$this->u('app', 'autocomplete', array('exclude_task_id' => $task['id'])).'"', + 'data-search-url="'.$this->url->href('app', 'autocomplete', array('exclude_task_id' => $task['id'])).'"', ), 'task-autocomplete') ?> @@ -29,9 +29,9 @@ - a(t('cancel'), 'board', 'show', array('project_id' => $task['project_id']), false, 'close-popover') ?> + url->link(t('cancel'), 'board', 'show', array('project_id' => $task['project_id']), false, 'close-popover') ?> - a(t('cancel'), 'task', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?> + url->link(t('cancel'), 'task', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?>
    \ No newline at end of file diff --git a/app/Template/tasklink/edit.php b/app/Template/tasklink/edit.php index 37c3cb146..73b432775 100644 --- a/app/Template/tasklink/edit.php +++ b/app/Template/tasklink/edit.php @@ -2,18 +2,18 @@

    -
    + - formCsrf() ?> - formHidden('id', $values) ?> - formHidden('task_id', $values) ?> - formHidden('opposite_task_id', $values) ?> + form->csrf() ?> + form->hidden('id', $values) ?> + form->hidden('task_id', $values) ?> + form->hidden('opposite_task_id', $values) ?> - formLabel(t('Label'), 'link_id') ?> - formSelect('link_id', $labels, $values, $errors) ?> + form->label(t('Label'), 'link_id') ?> + form->select('link_id', $labels, $values, $errors) ?> - formLabel(t('Task'), 'title') ?> - formText( + form->label(t('Task'), 'title') ?> + form->text( 'title', $values, $errors, @@ -22,13 +22,13 @@ 'placeholder="'.t('Start to type task title...').'"', 'title="'.t('Start to type task title...').'"', 'data-dst-field="opposite_task_id"', - 'data-search-url="'.$this->u('app', 'autocomplete', array('exclude_task_id' => $task['id'])).'"', + 'data-search-url="'.$this->url->href('app', 'autocomplete', array('exclude_task_id' => $task['id'])).'"', ), 'task-autocomplete') ?>
    - a(t('cancel'), 'task', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?> + url->link(t('cancel'), 'task', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?>
    \ No newline at end of file diff --git a/app/Template/tasklink/remove.php b/app/Template/tasklink/remove.php index 9322ec24e..262fb4882 100644 --- a/app/Template/tasklink/remove.php +++ b/app/Template/tasklink/remove.php @@ -8,8 +8,8 @@

    - a(t('Yes'), 'tasklink', 'remove', array('link_id' => $link['id'], 'task_id' => $task['id'], 'project_id' => $task['project_id']), true, 'btn btn-red') ?> + url->link(t('Yes'), 'tasklink', 'remove', array('link_id' => $link['id'], 'task_id' => $task['id'], 'project_id' => $task['project_id']), true, 'btn btn-red') ?> - a(t('cancel'), 'task', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?> + url->link(t('cancel'), 'task', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?>
    \ No newline at end of file diff --git a/app/Template/tasklink/show.php b/app/Template/tasklink/show.php index d4a3939bb..7125b11dc 100644 --- a/app/Template/tasklink/show.php +++ b/app/Template/tasklink/show.php @@ -23,7 +23,7 @@ - a( + url->link( $this->e('#'.$link['task_id'].' '.$link['title']), 'task', 'show', @@ -32,7 +32,7 @@ $link['is_active'] ? '' : 'task-link-closed' ) ?> - a( + url->link( $this->e('#'.$link['task_id'].' '.$link['title']), 'task', 'readonly', @@ -56,7 +56,7 @@ - a($this->e($link['task_assignee_name'] ?: $link['task_assignee_username']), 'user', 'show', array('user_id' => $link['task_assignee_id'])) ?> + url->link($this->e($link['task_assignee_name'] ?: $link['task_assignee_username']), 'user', 'show', array('user_id' => $link['task_assignee_id'])) ?> e($link['task_assignee_name'] ?: $link['task_assignee_username']) ?> @@ -65,8 +65,8 @@
      -
    • a(t('Edit'), 'tasklink', 'edit', array('link_id' => $link['id'], 'task_id' => $task['id'], 'project_id' => $task['project_id'])) ?>
    • -
    • a(t('Remove'), 'tasklink', 'confirm', array('link_id' => $link['id'], 'task_id' => $task['id'], 'project_id' => $task['project_id'])) ?>
    • +
    • url->link(t('Edit'), 'tasklink', 'edit', array('link_id' => $link['id'], 'task_id' => $task['id'], 'project_id' => $task['project_id'])) ?>
    • +
    • url->link(t('Remove'), 'tasklink', 'confirm', array('link_id' => $link['id'], 'task_id' => $task['id'], 'project_id' => $task['project_id'])) ?>
    @@ -76,15 +76,15 @@ -
    + - formCsrf() ?> - formHidden('task_id', array('task_id' => $task['id'])) ?> - formHidden('opposite_task_id', array()) ?> + form->csrf() ?> + form->hidden('task_id', array('task_id' => $task['id'])) ?> + form->hidden('opposite_task_id', array()) ?> - formSelect('link_id', $link_label_list, array(), array()) ?> + form->select('link_id', $link_label_list, array(), array()) ?> - formText( + form->text( 'title', array(), array(), @@ -93,7 +93,7 @@ 'placeholder="'.t('Start to type task title...').'"', 'title="'.t('Start to type task title...').'"', 'data-dst-field="opposite_task_id"', - 'data-search-url="'.$this->u('app', 'autocomplete', array('exclude_task_id' => $task['id'])).'"', + 'data-search-url="'.$this->url->href('app', 'autocomplete', array('exclude_task_id' => $task['id'])).'"', ), 'task-autocomplete') ?> diff --git a/app/Template/timetable/index.php b/app/Template/timetable/index.php index 27cbe39c2..7a63a2ec8 100644 --- a/app/Template/timetable/index.php +++ b/app/Template/timetable/index.php @@ -1,24 +1,24 @@ - formHidden('controller', $values) ?> - formHidden('action', $values) ?> - formHidden('user_id', $values) ?> + form->hidden('controller', $values) ?> + form->hidden('action', $values) ?> + form->hidden('user_id', $values) ?> - formLabel(t('From'), 'from') ?> - formText('from', $values, array(), array(), 'form-date') ?> + form->label(t('From'), 'from') ?> + form->text('from', $values, array(), array(), 'form-date') ?> - formLabel(t('To'), 'to') ?> - formText('to', $values, array(), array(), 'form-date') ?> + form->label(t('To'), 'to') ?> + form->text('to', $values, array(), array(), 'form-date') ?>
    diff --git a/app/Template/timetable_day/index.php b/app/Template/timetable_day/index.php index 50aca6027..d2877816c 100644 --- a/app/Template/timetable_day/index.php +++ b/app/Template/timetable_day/index.php @@ -15,7 +15,7 @@ - a(t('Remove'), 'timetableday', 'confirm', array('user_id' => $user['id'], 'slot_id' => $slot['id'])) ?> + url->link(t('Remove'), 'timetableday', 'confirm', array('user_id' => $user['id'], 'slot_id' => $slot['id'])) ?> @@ -24,16 +24,16 @@

    -
    + - formHidden('user_id', $values) ?> - formCsrf() ?> + form->hidden('user_id', $values) ?> + form->csrf() ?> - formLabel(t('Start time'), 'start') ?> - formSelect('start', $this->getDayHours(), $values, $errors) ?> + form->label(t('Start time'), 'start') ?> + form->select('start', $this->datetime->getDayHours(), $values, $errors) ?> - formLabel(t('End time'), 'end') ?> - formSelect('end', $this->getDayHours(), $values, $errors) ?> + form->label(t('End time'), 'end') ?> + form->select('end', $this->datetime->getDayHours(), $values, $errors) ?>
    diff --git a/app/Template/timetable_day/remove.php b/app/Template/timetable_day/remove.php index b3ee87758..1b33b2665 100644 --- a/app/Template/timetable_day/remove.php +++ b/app/Template/timetable_day/remove.php @@ -6,8 +6,8 @@

    - a(t('Yes'), 'timetableday', 'remove', array('user_id' => $user['id'], 'slot_id' => $slot_id), true, 'btn btn-red') ?> + url->link(t('Yes'), 'timetableday', 'remove', array('user_id' => $user['id'], 'slot_id' => $slot_id), true, 'btn btn-red') ?> - a(t('cancel'), 'timetableday', 'index', array('user_id' => $user['id'])) ?> + url->link(t('cancel'), 'timetableday', 'index', array('user_id' => $user['id'])) ?>
    \ No newline at end of file diff --git a/app/Template/timetable_extra/index.php b/app/Template/timetable_extra/index.php index a0a55becb..d3224ae68 100644 --- a/app/Template/timetable_extra/index.php +++ b/app/Template/timetable_extra/index.php @@ -21,7 +21,7 @@ e($slot['comment']) ?> - a(t('Remove'), 'timetableextra', 'confirm', array('user_id' => $user['id'], 'slot_id' => $slot['id'])) ?> + url->link(t('Remove'), 'timetableextra', 'confirm', array('user_id' => $user['id'], 'slot_id' => $slot['id'])) ?> @@ -31,24 +31,24 @@ - + - formHidden('user_id', $values) ?> - formCsrf() ?> + form->hidden('user_id', $values) ?> + form->csrf() ?> - formLabel(t('Day'), 'date') ?> - formText('date', $values, $errors, array('required'), 'form-date') ?> + form->label(t('Day'), 'date') ?> + form->text('date', $values, $errors, array('required'), 'form-date') ?> - formCheckbox('all_day', t('All day'), 1) ?> + form->checkbox('all_day', t('All day'), 1) ?> - formLabel(t('Start time'), 'start') ?> - formSelect('start', $this->getDayHours(), $values, $errors) ?> + form->label(t('Start time'), 'start') ?> + form->select('start', $this->datetime->getDayHours(), $values, $errors) ?> - formLabel(t('End time'), 'end') ?> - formSelect('end', $this->getDayHours(), $values, $errors) ?> + form->label(t('End time'), 'end') ?> + form->select('end', $this->datetime->getDayHours(), $values, $errors) ?> - formLabel(t('Comment'), 'comment') ?> - formText('comment', $values, $errors) ?> + form->label(t('Comment'), 'comment') ?> + form->text('comment', $values, $errors) ?>
    diff --git a/app/Template/timetable_extra/remove.php b/app/Template/timetable_extra/remove.php index d8dc5b3b3..fc907438e 100644 --- a/app/Template/timetable_extra/remove.php +++ b/app/Template/timetable_extra/remove.php @@ -6,8 +6,8 @@

    - a(t('Yes'), 'timetableextra', 'remove', array('user_id' => $user['id'], 'slot_id' => $slot_id), true, 'btn btn-red') ?> + url->link(t('Yes'), 'timetableextra', 'remove', array('user_id' => $user['id'], 'slot_id' => $slot_id), true, 'btn btn-red') ?> - a(t('cancel'), 'timetableextra', 'index', array('user_id' => $user['id'])) ?> + url->link(t('cancel'), 'timetableextra', 'index', array('user_id' => $user['id'])) ?>
    \ No newline at end of file diff --git a/app/Template/timetable_off/index.php b/app/Template/timetable_off/index.php index f35d331ea..75e02dbd7 100644 --- a/app/Template/timetable_off/index.php +++ b/app/Template/timetable_off/index.php @@ -21,7 +21,7 @@ e($slot['comment']) ?> - a(t('Remove'), 'timetableoff', 'confirm', array('user_id' => $user['id'], 'slot_id' => $slot['id'])) ?> + url->link(t('Remove'), 'timetableoff', 'confirm', array('user_id' => $user['id'], 'slot_id' => $slot['id'])) ?> @@ -31,24 +31,24 @@ - + - formHidden('user_id', $values) ?> - formCsrf() ?> + form->hidden('user_id', $values) ?> + form->csrf() ?> - formLabel(t('Day'), 'date') ?> - formText('date', $values, $errors, array('required'), 'form-date') ?> + form->label(t('Day'), 'date') ?> + form->text('date', $values, $errors, array('required'), 'form-date') ?> - formCheckbox('all_day', t('All day'), 1) ?> + form->checkbox('all_day', t('All day'), 1) ?> - formLabel(t('Start time'), 'start') ?> - formSelect('start', $this->getDayHours(), $values, $errors) ?> + form->label(t('Start time'), 'start') ?> + form->select('start', $this->datetime->getDayHours(), $values, $errors) ?> - formLabel(t('End time'), 'end') ?> - formSelect('end', $this->getDayHours(), $values, $errors) ?> + form->label(t('End time'), 'end') ?> + form->select('end', $this->datetime->getDayHours(), $values, $errors) ?> - formLabel(t('Comment'), 'comment') ?> - formText('comment', $values, $errors) ?> + form->label(t('Comment'), 'comment') ?> + form->text('comment', $values, $errors) ?>
    diff --git a/app/Template/timetable_off/remove.php b/app/Template/timetable_off/remove.php index 648637812..621e191cb 100644 --- a/app/Template/timetable_off/remove.php +++ b/app/Template/timetable_off/remove.php @@ -6,8 +6,8 @@

    - a(t('Yes'), 'timetableoff', 'remove', array('user_id' => $user['id'], 'slot_id' => $slot_id), true, 'btn btn-red') ?> + url->link(t('Yes'), 'timetableoff', 'remove', array('user_id' => $user['id'], 'slot_id' => $slot_id), true, 'btn btn-red') ?> - a(t('cancel'), 'timetableoff', 'index', array('user_id' => $user['id'])) ?> + url->link(t('cancel'), 'timetableoff', 'index', array('user_id' => $user['id'])) ?>
    \ No newline at end of file diff --git a/app/Template/timetable_week/index.php b/app/Template/timetable_week/index.php index 8fb51909e..552e93023 100644 --- a/app/Template/timetable_week/index.php +++ b/app/Template/timetable_week/index.php @@ -13,11 +13,11 @@ - getWeekDay($slot['day']) ?> + datetime->getWeekDay($slot['day']) ?> - a(t('Remove'), 'timetableweek', 'confirm', array('user_id' => $user['id'], 'slot_id' => $slot['id'])) ?> + url->link(t('Remove'), 'timetableweek', 'confirm', array('user_id' => $user['id'], 'slot_id' => $slot['id'])) ?> @@ -26,19 +26,19 @@

    - + - formHidden('user_id', $values) ?> - formCsrf() ?> + form->hidden('user_id', $values) ?> + form->csrf() ?> - formLabel(t('Day'), 'day') ?> - formSelect('day', $this->getWeekDays(), $values, $errors) ?> + form->label(t('Day'), 'day') ?> + form->select('day', $this->datetime->getWeekDays(), $values, $errors) ?> - formLabel(t('Start time'), 'start') ?> - formSelect('start', $this->getDayHours(), $values, $errors) ?> + form->label(t('Start time'), 'start') ?> + form->select('start', $this->datetime->getDayHours(), $values, $errors) ?> - formLabel(t('End time'), 'end') ?> - formSelect('end', $this->getDayHours(), $values, $errors) ?> + form->label(t('End time'), 'end') ?> + form->select('end', $this->datetime->getDayHours(), $values, $errors) ?>
    diff --git a/app/Template/timetable_week/remove.php b/app/Template/timetable_week/remove.php index f8eb2bbeb..f5a101993 100644 --- a/app/Template/timetable_week/remove.php +++ b/app/Template/timetable_week/remove.php @@ -6,8 +6,8 @@

    - a(t('Yes'), 'timetableweek', 'remove', array('user_id' => $user['id'], 'slot_id' => $slot_id), true, 'btn btn-red') ?> + url->link(t('Yes'), 'timetableweek', 'remove', array('user_id' => $user['id'], 'slot_id' => $slot_id), true, 'btn btn-red') ?> - a(t('cancel'), 'timetableweek', 'index', array('user_id' => $user['id'])) ?> + url->link(t('cancel'), 'timetableweek', 'index', array('user_id' => $user['id'])) ?>
    \ No newline at end of file diff --git a/app/Template/twofactor/check.php b/app/Template/twofactor/check.php index c29c01296..0e29d526d 100644 --- a/app/Template/twofactor/check.php +++ b/app/Template/twofactor/check.php @@ -1,8 +1,8 @@ - + - formCsrf() ?> - formLabel(t('Code'), 'code') ?> - formText('code', array(), array(), array('placeholder="123456"', 'autofocus'), 'form-numeric') ?> + form->csrf() ?> + form->label(t('Code'), 'code') ?> + form->text('code', array(), array(), array('placeholder="123456"', 'autofocus'), 'form-numeric') ?>
    diff --git a/app/Template/twofactor/disable.php b/app/Template/twofactor/disable.php index 6909b4468..36be4ef93 100644 --- a/app/Template/twofactor/disable.php +++ b/app/Template/twofactor/disable.php @@ -8,7 +8,7 @@

    - a(t('Yes'), 'twofactor', 'disable', array('user_id' => $user['id'], 'disable' => 'yes'), true, 'btn btn-red') ?> - a(t('cancel'), 'user', 'show', array('user_id' => $user['id'])) ?> + url->link(t('Yes'), 'twofactor', 'disable', array('user_id' => $user['id'], 'disable' => 'yes'), true, 'btn btn-red') ?> + url->link(t('cancel'), 'user', 'show', array('user_id' => $user['id'])) ?>
    \ No newline at end of file diff --git a/app/Template/twofactor/index.php b/app/Template/twofactor/index.php index 28e93f144..36b926537 100644 --- a/app/Template/twofactor/index.php +++ b/app/Template/twofactor/index.php @@ -2,10 +2,10 @@

    - + - formCsrf() ?> - formCheckbox('twofactor_activated', t('Enable/disable two factor authentication'), 1, isset($user['twofactor_activated']) && $user['twofactor_activated'] == 1) ?> + form->csrf() ?> + form->checkbox('twofactor_activated', t('Enable/disable two factor authentication'), 1, isset($user['twofactor_activated']) && $user['twofactor_activated'] == 1) ?>
    @@ -24,11 +24,11 @@

    - + - formCsrf() ?> - formLabel(t('Code'), 'code') ?> - formText('code', array(), array(), array('placeholder="123456"'), 'form-numeric') ?> + form->csrf() ?> + form->label(t('Code'), 'code') ?> + form->text('code', array(), array(), array('placeholder="123456"'), 'form-numeric') ?>
    diff --git a/app/Template/user/calendar.php b/app/Template/user/calendar.php index 6708c5c3c..7ec124966 100644 --- a/app/Template/user/calendar.php +++ b/app/Template/user/calendar.php @@ -1,6 +1,6 @@
    \ No newline at end of file diff --git a/app/Template/user/edit.php b/app/Template/user/edit.php index bd1c4889d..e29dcfca6 100644 --- a/app/Template/user/edit.php +++ b/app/Template/user/edit.php @@ -1,42 +1,42 @@ - + - formCsrf() ?> + form->csrf() ?> - formHidden('id', $values) ?> - formHidden('is_ldap_user', $values) ?> + form->hidden('id', $values) ?> + form->hidden('is_ldap_user', $values) ?> - formLabel(t('Username'), 'username') ?> - formText('username', $values, $errors, array('required', $values['is_ldap_user'] == 1 ? 'readonly' : '', 'maxlength="50"')) ?>
    + form->label(t('Username'), 'username') ?> + form->text('username', $values, $errors, array('required', $values['is_ldap_user'] == 1 ? 'readonly' : '', 'maxlength="50"')) ?>
    - formLabel(t('Name'), 'name') ?> - formText('name', $values, $errors) ?>
    + form->label(t('Name'), 'name') ?> + form->text('name', $values, $errors) ?>
    - formLabel(t('Email'), 'email') ?> - formEmail('email', $values, $errors) ?>
    + form->label(t('Email'), 'email') ?> + form->email('email', $values, $errors) ?>
    - formLabel(t('Default project'), 'default_project_id') ?> - formSelect('default_project_id', $projects, $values, $errors) ?>
    + form->label(t('Default project'), 'default_project_id') ?> + form->select('default_project_id', $projects, $values, $errors) ?>
    - formLabel(t('Timezone'), 'timezone') ?> - formSelect('timezone', $timezones, $values, $errors) ?>
    + form->label(t('Timezone'), 'timezone') ?> + form->select('timezone', $timezones, $values, $errors) ?>
    - formLabel(t('Language'), 'language') ?> - formSelect('language', $languages, $values, $errors) ?>
    + form->label(t('Language'), 'language') ?> + form->select('language', $languages, $values, $errors) ?>
    - formCheckbox('disable_login_form', t('Disable login form'), 1, isset($values['disable_login_form']) && $values['disable_login_form'] == 1) ?>
    + form->checkbox('disable_login_form', t('Disable login form'), 1, isset($values['disable_login_form']) && $values['disable_login_form'] == 1) ?>
    - userSession->isAdmin()): ?> - formCheckbox('is_admin', t('Administrator'), 1, isset($values['is_admin']) && $values['is_admin'] == 1) ?>
    + user->isAdmin()): ?> + form->checkbox('is_admin', t('Administrator'), 1, isset($values['is_admin']) && $values['is_admin'] == 1) ?>
    - a(t('cancel'), 'user', 'show', array('user_id' => $user['id'])) ?> + url->link(t('cancel'), 'user', 'show', array('user_id' => $user['id'])) ?>
    \ No newline at end of file diff --git a/app/Template/user/external.php b/app/Template/user/external.php index b4cea1566..df85ace7e 100644 --- a/app/Template/user/external.php +++ b/app/Template/user/external.php @@ -6,11 +6,11 @@

    - userSession->isCurrentUser($user['id'])): ?> + user->isCurrentUser($user['id'])): ?> - a(t('Link my Google Account'), 'user', 'google', array(), true) ?> + url->link(t('Link my Google Account'), 'user', 'google', array(), true) ?> - a(t('Unlink my Google Account'), 'user', 'unlinkGoogle', array(), true) ?> + url->link(t('Unlink my Google Account'), 'user', 'unlinkGoogle', array(), true) ?> @@ -22,11 +22,11 @@

    - userSession->isCurrentUser($user['id'])): ?> + user->isCurrentUser($user['id'])): ?> - a(t('Link my GitHub Account'), 'user', 'github', array(), true) ?> + url->link(t('Link my GitHub Account'), 'user', 'github', array(), true) ?> - a(t('Unlink my GitHub Account'), 'user', 'unlinkGitHub', array(), true) ?> + url->link(t('Unlink my GitHub Account'), 'user', 'unlinkGitHub', array(), true) ?> diff --git a/app/Template/user/index.php b/app/Template/user/index.php index d6b0fecf5..6b4396b24 100644 --- a/app/Template/user/index.php +++ b/app/Template/user/index.php @@ -1,8 +1,8 @@

    @@ -26,10 +26,10 @@ getCollection() as $user): ?> - a('#'.$user['id'], 'user', 'show', array('user_id' => $user['id'])) ?> + url->link('#'.$user['id'], 'user', 'show', array('user_id' => $user['id'])) ?> - a($this->e($user['username']), 'user', 'show', array('user_id' => $user['id'])) ?> + url->link($this->e($user['username']), 'user', 'show', array('user_id' => $user['id'])) ?> e($user['name']) ?> diff --git a/app/Template/user/last.php b/app/Template/user/last.php index 317334b81..ab25f79b9 100644 --- a/app/Template/user/last.php +++ b/app/Template/user/last.php @@ -17,7 +17,7 @@ e($login['auth_type']) ?> e($login['ip']) ?> - e($this->summary($login['user_agent'])) ?> + e($this->text->truncate($login['user_agent'])) ?> diff --git a/app/Template/user/layout.php b/app/Template/user/layout.php index a5a78a3fb..e60ab77d0 100644 --- a/app/Template/user/layout.php +++ b/app/Template/user/layout.php @@ -1,9 +1,9 @@
    diff --git a/app/Template/user/new.php b/app/Template/user/new.php index e56f38b16..ba7a38810 100644 --- a/app/Template/user/new.php +++ b/app/Template/user/new.php @@ -1,44 +1,44 @@
    -
    + - formCsrf() ?> + form->csrf() ?> - formLabel(t('Username'), 'username') ?> - formText('username', $values, $errors, array('autofocus', 'required', 'maxlength="50"')) ?>
    + form->label(t('Username'), 'username') ?> + form->text('username', $values, $errors, array('autofocus', 'required', 'maxlength="50"')) ?>
    - formLabel(t('Name'), 'name') ?> - formText('name', $values, $errors) ?>
    + form->label(t('Name'), 'name') ?> + form->text('name', $values, $errors) ?>
    - formLabel(t('Email'), 'email') ?> - formEmail('email', $values, $errors) ?>
    + form->label(t('Email'), 'email') ?> + form->email('email', $values, $errors) ?>
    - formLabel(t('Password'), 'password') ?> - formPassword('password', $values, $errors, array('required')) ?>
    + form->label(t('Password'), 'password') ?> + form->password('password', $values, $errors, array('required')) ?>
    - formLabel(t('Confirmation'), 'confirmation') ?> - formPassword('confirmation', $values, $errors, array('required')) ?>
    + form->label(t('Confirmation'), 'confirmation') ?> + form->password('confirmation', $values, $errors, array('required')) ?>
    - formLabel(t('Default project'), 'default_project_id') ?> - formSelect('default_project_id', $projects, $values, $errors) ?>
    + form->label(t('Default project'), 'default_project_id') ?> + form->select('default_project_id', $projects, $values, $errors) ?>
    - formLabel(t('Timezone'), 'timezone') ?> - formSelect('timezone', $timezones, $values, $errors) ?>
    + form->label(t('Timezone'), 'timezone') ?> + form->select('timezone', $timezones, $values, $errors) ?>
    - formLabel(t('Language'), 'language') ?> - formSelect('language', $languages, $values, $errors) ?>
    + form->label(t('Language'), 'language') ?> + form->select('language', $languages, $values, $errors) ?>
    - formCheckbox('is_admin', t('Administrator'), 1, isset($values['is_admin']) && $values['is_admin'] == 1 ? true : false) ?> + form->checkbox('is_admin', t('Administrator'), 1, isset($values['is_admin']) && $values['is_admin'] == 1 ? true : false) ?>
    - a(t('cancel'), 'user', 'index') ?> + url->link(t('cancel'), 'user', 'index') ?>
    diff --git a/app/Template/user/notifications.php b/app/Template/user/notifications.php index 56c48f8f5..df5cbb9bd 100644 --- a/app/Template/user/notifications.php +++ b/app/Template/user/notifications.php @@ -2,18 +2,18 @@

    -
    + - formCsrf() ?> + form->csrf() ?> - formCheckbox('notifications_enabled', t('Enable email notifications'), '1', $notifications['notifications_enabled'] == 1) ?>
    + form->checkbox('notifications_enabled', t('Enable email notifications'), '1', $notifications['notifications_enabled'] == 1) ?>



    $project_name): ?> - formCheckbox('projects['.$project_id.']', $project_name, '1', isset($notifications['project_'.$project_id])) ?>
    + form->checkbox('projects['.$project_id.']', $project_name, '1', isset($notifications['project_'.$project_id])) ?>
    @@ -21,6 +21,6 @@
    - a(t('cancel'), 'user', 'show', array('user_id' => $user['id'])) ?> + url->link(t('cancel'), 'user', 'show', array('user_id' => $user['id'])) ?>
    \ No newline at end of file diff --git a/app/Template/user/password.php b/app/Template/user/password.php index 14de0d42b..3ef28d337 100644 --- a/app/Template/user/password.php +++ b/app/Template/user/password.php @@ -2,25 +2,25 @@

    -
    + - formHidden('id', $values) ?> - formCsrf() ?> + form->hidden('id', $values) ?> + form->csrf() ?>
    - formLabel(t('Current password for the user "%s"', $this->getFullname()), 'current_password') ?> - formPassword('current_password', $values, $errors) ?>
    + form->label(t('Current password for the user "%s"', $this->user->getFullname()), 'current_password') ?> + form->password('current_password', $values, $errors) ?>
    - formLabel(t('New password for the user "%s"', $this->getFullname($user)), 'password') ?> - formPassword('password', $values, $errors) ?>
    + form->label(t('New password for the user "%s"', $this->user->getFullname($user)), 'password') ?> + form->password('password', $values, $errors) ?>
    - formLabel(t('Confirmation'), 'confirmation') ?> - formPassword('confirmation', $values, $errors) ?>
    + form->label(t('Confirmation'), 'confirmation') ?> + form->password('confirmation', $values, $errors) ?>
    - a(t('cancel'), 'user', 'show', array('user_id' => $user['id'])) ?> + url->link(t('cancel'), 'user', 'show', array('user_id' => $user['id'])) ?>
    diff --git a/app/Template/user/remove.php b/app/Template/user/remove.php index e4b09cfa8..810a3a3ff 100644 --- a/app/Template/user/remove.php +++ b/app/Template/user/remove.php @@ -6,8 +6,8 @@

    - a(t('Yes'), 'user', 'remove', array('user_id' => $user['id'], 'confirmation' => 'yes'), true, 'btn btn-red') ?> + url->link(t('Yes'), 'user', 'remove', array('user_id' => $user['id'], 'confirmation' => 'yes'), true, 'btn btn-red') ?> - a(t('cancel'), 'user', 'show', array('user_id' => $user['id'])) ?> + url->link(t('cancel'), 'user', 'show', array('user_id' => $user['id'])) ?>
    \ No newline at end of file diff --git a/app/Template/user/sessions.php b/app/Template/user/sessions.php index 5a06057cd..a7504a7a8 100644 --- a/app/Template/user/sessions.php +++ b/app/Template/user/sessions.php @@ -18,8 +18,8 @@ e($session['ip']) ?> - e($this->summary($session['user_agent'])) ?> - a(t('Remove'), 'user', 'removeSession', array('user_id' => $user['id'], 'id' => $session['id']), true) ?> + e($this->text->truncate($session['user_agent'])) ?> + url->link(t('Remove'), 'user', 'removeSession', array('user_id' => $user['id'], 'id' => $session['id']), true) ?> diff --git a/app/Template/user/share.php b/app/Template/user/share.php index 55d06897b..8f333a6be 100644 --- a/app/Template/user/share.php +++ b/app/Template/user/share.php @@ -6,12 +6,12 @@
      -
    • a(t('iCal feed'), 'ical', 'user', array('token' => $user['token']), false, '', '', true) ?>
    • +
    • url->link(t('iCal feed'), 'ical', 'user', array('token' => $user['token']), false, '', '', true) ?>
    - a(t('Disable public access'), 'user', 'share', array('user_id' => $user['id'], 'switch' => 'disable'), true, 'btn btn-red') ?> + url->link(t('Disable public access'), 'user', 'share', array('user_id' => $user['id'], 'switch' => 'disable'), true, 'btn btn-red') ?> - a(t('Enable public access'), 'user', 'share', array('user_id' => $user['id'], 'switch' => 'enable'), true, 'btn btn-blue') ?> + url->link(t('Enable public access'), 'user', 'share', array('user_id' => $user['id'], 'switch' => 'enable'), true, 'btn btn-blue') ?> diff --git a/app/Template/user/show.php b/app/Template/user/show.php index 1be39cc35..5442e2e73 100644 --- a/app/Template/user/show.php +++ b/app/Template/user/show.php @@ -21,8 +21,8 @@
    • e($projects[$user['default_project_id']]) : t('None') ?>
    • -
    • inList($user['timezone'], $timezones) ?>
    • -
    • inList($user['language'], $languages) ?>
    • +
    • text->in($user['timezone'], $timezones) ?>
    • +
    • text->in($user['language'], $languages) ?>
    @@ -33,7 +33,7 @@
      -
    • a(t('iCal feed'), 'ical', 'user', array('token' => $user['token']), false, '', '', true) ?>
    • +
    • url->link(t('iCal feed'), 'ical', 'user', array('token' => $user['token']), false, '', '', true) ?>
    diff --git a/app/Template/user/sidebar.php b/app/Template/user/sidebar.php index 8c7e3cf85..2c8e909a6 100644 --- a/app/Template/user/sidebar.php +++ b/app/Template/user/sidebar.php @@ -2,75 +2,75 @@

    • - a(t('Summary'), 'user', 'show', array('user_id' => $user['id'])) ?> + url->link(t('Summary'), 'user', 'show', array('user_id' => $user['id'])) ?>
    • - userSession->isAdmin()): ?> + user->isAdmin()): ?>
    • - a(t('User dashboard'), 'app', 'dashboard', array('user_id' => $user['id'])) ?> + url->link(t('User dashboard'), 'app', 'dashboard', array('user_id' => $user['id'])) ?>
    • - a(t('User calendar'), 'user', 'calendar', array('user_id' => $user['id'])) ?> + url->link(t('User calendar'), 'user', 'calendar', array('user_id' => $user['id'])) ?>
    • - userSession->isAdmin() || $this->userSession->isCurrentUser($user['id'])): ?> + user->isAdmin() || $this->user->isCurrentUser($user['id'])): ?>
    • - a(t('Time tracking'), 'user', 'timesheet', array('user_id' => $user['id'])) ?> + url->link(t('Time tracking'), 'user', 'timesheet', array('user_id' => $user['id'])) ?>
    • - a(t('Last logins'), 'user', 'last', array('user_id' => $user['id'])) ?> + url->link(t('Last logins'), 'user', 'last', array('user_id' => $user['id'])) ?>
    • - a(t('Persistent connections'), 'user', 'sessions', array('user_id' => $user['id'])) ?> + url->link(t('Persistent connections'), 'user', 'sessions', array('user_id' => $user['id'])) ?>

      - userSession->isAdmin() || $this->userSession->isCurrentUser($user['id'])): ?> + user->isAdmin() || $this->user->isCurrentUser($user['id'])): ?>
    • - a(t('Edit profile'), 'user', 'edit', array('user_id' => $user['id'])) ?> + url->link(t('Edit profile'), 'user', 'edit', array('user_id' => $user['id'])) ?>
    • - a(t('Change password'), 'user', 'password', array('user_id' => $user['id'])) ?> + url->link(t('Change password'), 'user', 'password', array('user_id' => $user['id'])) ?>
    • - userSession->isCurrentUser($user['id'])): ?> + user->isCurrentUser($user['id'])): ?>
    • - a(t('Two factor authentication'), 'twofactor', 'index', array('user_id' => $user['id'])) ?> + url->link(t('Two factor authentication'), 'twofactor', 'index', array('user_id' => $user['id'])) ?>
    • - userSession->isAdmin() && $user['twofactor_activated'] == 1): ?> + user->isAdmin() && $user['twofactor_activated'] == 1): ?>
    • - a(t('Two factor authentication'), 'twofactor', 'disable', array('user_id' => $user['id'])) ?> + url->link(t('Two factor authentication'), 'twofactor', 'disable', array('user_id' => $user['id'])) ?>
    • - a(t('Public access'), 'user', 'share', array('user_id' => $user['id'])) ?> + url->link(t('Public access'), 'user', 'share', array('user_id' => $user['id'])) ?>
    • - a(t('Email notifications'), 'user', 'notifications', array('user_id' => $user['id'])) ?> + url->link(t('Email notifications'), 'user', 'notifications', array('user_id' => $user['id'])) ?>
    • - a(t('External accounts'), 'user', 'external', array('user_id' => $user['id'])) ?> + url->link(t('External accounts'), 'user', 'external', array('user_id' => $user['id'])) ?>
    • - userSession->isAdmin()): ?> + user->isAdmin()): ?>
    • - a(t('Hourly rates'), 'hourlyrate', 'index', array('user_id' => $user['id'])) ?> + url->link(t('Hourly rates'), 'hourlyrate', 'index', array('user_id' => $user['id'])) ?>
    • - a(t('Manage timetable'), 'timetable', 'index', array('user_id' => $user['id'])) ?> + url->link(t('Manage timetable'), 'timetable', 'index', array('user_id' => $user['id'])) ?>
    • - userSession->isAdmin() && ! $this->userSession->isCurrentUser($user['id'])): ?> + user->isAdmin() && ! $this->user->isCurrentUser($user['id'])): ?>
    • - a(t('Remove'), 'user', 'remove', array('user_id' => $user['id'])) ?> + url->link(t('Remove'), 'user', 'remove', array('user_id' => $user['id'])) ?>
    diff --git a/app/Template/user/timesheet.php b/app/Template/user/timesheet.php index 3ae84df0f..5c0d3af87 100644 --- a/app/Template/user/timesheet.php +++ b/app/Template/user/timesheet.php @@ -16,8 +16,8 @@ getCollection() as $record): ?> - a($this->e($record['task_title']), 'task', 'show', array('project_id' => $record['project_id'], 'task_id' => $record['task_id'])) ?> - a($this->e($record['subtask_title']), 'task', 'show', array('project_id' => $record['project_id'], 'task_id' => $record['task_id'])) ?> + url->link($this->e($record['task_title']), 'task', 'show', array('project_id' => $record['project_id'], 'task_id' => $record['task_id'])) ?> + url->link($this->e($record['subtask_title']), 'task', 'show', array('project_id' => $record['project_id'], 'task_id' => $record['task_id'])) ?> diff --git a/tests/units/AppHelperTest.php b/tests/units/AppHelperTest.php new file mode 100644 index 000000000..ad4bc1519 --- /dev/null +++ b/tests/units/AppHelperTest.php @@ -0,0 +1,38 @@ +container); + $this->assertEquals('en', $h->jsLang()); + } + + public function testTimezone() + { + $h = new App($this->container); + $this->assertEquals('UTC', $h->getTimezone()); + } + + public function testFlashMessage() + { + $h = new App($this->container); + $s = new Session; + + $this->assertEmpty($h->flashMessage()); + $s->flash('test & test'); + $this->assertEquals('
    test & test
    ', $h->flashMessage()); + $this->assertEmpty($h->flashMessage()); + + $this->assertEmpty($h->flashMessage()); + $s->flashError('test & test'); + $this->assertEquals('
    test & test
    ', $h->flashMessage()); + $this->assertEmpty($h->flashMessage()); + } +} diff --git a/tests/units/AssetHelperTest.php b/tests/units/AssetHelperTest.php new file mode 100644 index 000000000..1143ce1f0 --- /dev/null +++ b/tests/units/AssetHelperTest.php @@ -0,0 +1,21 @@ +container); + $c = new Config($this->container); + + $this->assertEmpty($h->customCss()); + + $this->assertTrue($c->save(array('application_stylesheet' => 'p { color: red }'))); + + $this->assertEquals('', $h->customCss()); + } +} diff --git a/tests/units/DatetimeHelperTest.php b/tests/units/DatetimeHelperTest.php new file mode 100644 index 000000000..2746beed5 --- /dev/null +++ b/tests/units/DatetimeHelperTest.php @@ -0,0 +1,44 @@ +container); + + $slots = $h->getDayHours(); + + $this->assertNotEmpty($slots); + $this->assertCount(48, $slots); + $this->assertArrayHasKey('00:00', $slots); + $this->assertArrayHasKey('00:30', $slots); + $this->assertArrayHasKey('01:00', $slots); + $this->assertArrayHasKey('01:30', $slots); + $this->assertArrayHasKey('23:30', $slots); + $this->assertArrayNotHasKey('24:00', $slots); + } + + public function testGetWeekDays() + { + $h = new Datetime($this->container); + + $slots = $h->getWeekDays(); + + $this->assertNotEmpty($slots); + $this->assertCount(7, $slots); + $this->assertContains('Monday', $slots); + $this->assertContains('Sunday', $slots); + } + + public function testGetWeekDay() + { + $h = new Datetime($this->container); + + $this->assertEquals('Monday', $h->getWeekDay(1)); + $this->assertEquals('Sunday', $h->getWeekDay(7)); + } +} diff --git a/tests/units/FileHelperText.php b/tests/units/FileHelperText.php new file mode 100644 index 000000000..ce04fdbd1 --- /dev/null +++ b/tests/units/FileHelperText.php @@ -0,0 +1,15 @@ +container); + $this->assertEquals('fa-file-image-o', $h->icon('test.png')); + $this->assertEquals('fa-file-o', $h->icon('test')); + } +} diff --git a/tests/units/HelperTest.php b/tests/units/TextHelperTest.php similarity index 54% rename from tests/units/HelperTest.php rename to tests/units/TextHelperTest.php index 57d1940ad..20b89fa8b 100644 --- a/tests/units/HelperTest.php +++ b/tests/units/TextHelperTest.php @@ -2,14 +2,13 @@ require_once __DIR__.'/Base.php'; -use Core\Helper; -use Model\Config; +use Helper\Text; -class HelperTest extends Base +class TextHelperTest extends Base { public function testMarkdown() { - $h = new Helper($this->container); + $h = new Text($this->container); $this->assertEquals('

    Test

    ', $h->markdown('Test')); @@ -32,19 +31,34 @@ class HelperTest extends Base ); } - public function testGetCurrentBaseUrl() + public function testFormatBytes() { - $h = new Helper($this->container); + $h = new Text($this->container); - $_SERVER['PHP_SELF'] = '/'; - $_SERVER['SERVER_NAME'] = 'localhost'; - $_SERVER['SERVER_PORT'] = 1234; + $this->assertEquals('1k', $h->bytes(1024)); + $this->assertEquals('33.71k', $h->bytes(34520)); + } - $this->assertEquals('http://localhost:1234/', $h->getCurrentBaseUrl()); + public function testTruncate() + { + $h = new Text($this->container); - $c = new Config($this->container); - $c->save(array('application_url' => 'https://mykanboard/')); - $this->assertEquals('https://mykanboard/', $c->get('application_url')); - $this->assertEquals('https://mykanboard/', $h->getCurrentBaseUrl()); + $this->assertEquals('abc', $h->truncate('abc')); + $this->assertEquals(str_repeat('a', 85).' [...]', $h->truncate(str_repeat('a', 200))); + } + + public function testContains() + { + $h = new Text($this->container); + + $this->assertTrue($h->contains('abc', 'b')); + $this->assertFalse($h->contains('abc', 'd')); + } + + public function testInList() + { + $h = new Text($this->container); + $this->assertEquals('?', $h->in('a', array('b' => 'c'))); + $this->assertEquals('c', $h->in('b', array('b' => 'c'))); } } diff --git a/tests/units/UrlHelperTest.php b/tests/units/UrlHelperTest.php new file mode 100644 index 000000000..d70842aac --- /dev/null +++ b/tests/units/UrlHelperTest.php @@ -0,0 +1,64 @@ +container); + $this->assertEquals( + 'label', + $h->link('label', 'a', 'b', array('d' => 'e'), false, 'f', 'g', true) + ); + } + + public function testHref() + { + $h = new Url($this->container); + $this->assertEquals( + '?controller=a&action=b&d=e', + $h->href('a', 'b', array('d' => 'e')) + ); + } + + public function testTo() + { + $h = new Url($this->container); + $this->assertEquals( + '?controller=a&action=b&d=e', + $h->to('a', 'b', array('d' => 'e')) + ); + } + + public function testServer() + { + $h = new Url($this->container); + + $_SERVER['PHP_SELF'] = '/'; + $_SERVER['SERVER_NAME'] = 'localhost'; + $_SERVER['SERVER_PORT'] = 1234; + + $this->assertEquals('http://localhost:1234/', $h->server()); + } + + public function testBase() + { + $h = new Url($this->container); + + $_SERVER['PHP_SELF'] = '/'; + $_SERVER['SERVER_NAME'] = 'localhost'; + $_SERVER['SERVER_PORT'] = 1234; + + $this->assertEquals('http://localhost:1234/', $h->base()); + + $c = new Config($this->container); + $c->save(array('application_url' => 'https://mykanboard/')); + + $this->assertEquals('https://mykanboard/', $c->get('application_url')); + $this->assertEquals('https://mykanboard/', $h->base()); + } +}