Template helpers refactoring
This commit is contained in:
parent
88d84073ae
commit
34d7450d3c
|
|
@ -21,7 +21,7 @@ class Analytic extends Base
|
|||
private function layout($template, array $params)
|
||||
{
|
||||
$params['board_selector'] = $this->projectPermission->getAllowedProjects($this->acl->getUserId());
|
||||
$params['analytic_content_for_layout'] = $this->template->load($template, $params);
|
||||
$params['analytic_content_for_layout'] = $this->template->render($template, $params);
|
||||
|
||||
return $this->template->layout('analytic/layout', $params);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,7 +3,6 @@
|
|||
namespace Controller;
|
||||
|
||||
use Model\SubTask as SubTaskModel;
|
||||
use Helper;
|
||||
|
||||
/**
|
||||
* Application controller
|
||||
|
|
@ -192,7 +191,7 @@ class App extends Base
|
|||
$this->response->html('<p>'.t('Nothing to preview...').'</p>');
|
||||
}
|
||||
else {
|
||||
$this->response->html(Helper\markdown($payload['text']));
|
||||
$this->response->html($this->template->markdown($payload['text']));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -17,6 +17,8 @@ use Symfony\Component\EventDispatcher\Event;
|
|||
* @package controller
|
||||
* @author Frederic Guillot
|
||||
*
|
||||
* @property \Core\Session $session
|
||||
* @property \Core\Template $template
|
||||
* @property \Model\Acl $acl
|
||||
* @property \Model\Authentication $authentication
|
||||
* @property \Model\Action $action
|
||||
|
|
@ -69,22 +71,6 @@ abstract class Base
|
|||
*/
|
||||
protected $response;
|
||||
|
||||
/**
|
||||
* Template instance
|
||||
*
|
||||
* @accesss protected
|
||||
* @var \Core\Template
|
||||
*/
|
||||
protected $template;
|
||||
|
||||
/**
|
||||
* Session instance
|
||||
*
|
||||
* @accesss public
|
||||
* @var \Core\Session
|
||||
*/
|
||||
protected $session;
|
||||
|
||||
/**
|
||||
* Container instance
|
||||
*
|
||||
|
|
@ -104,8 +90,6 @@ abstract class Base
|
|||
$this->container = $container;
|
||||
$this->request = new Request;
|
||||
$this->response = new Response;
|
||||
$this->session = new Session;
|
||||
$this->template = new Template;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -265,7 +249,7 @@ abstract class Base
|
|||
$params['hide_remove_menu'] = true;
|
||||
}
|
||||
|
||||
$content = $this->template->load($template, $params);
|
||||
$content = $this->template->render($template, $params);
|
||||
$params['task_content_for_layout'] = $content;
|
||||
$params['title'] = $params['task']['project_name'].' > '.$params['task']['title'];
|
||||
$params['board_selector'] = $this->projectPermission->getAllowedProjects($this->acl->getUserId());
|
||||
|
|
@ -283,7 +267,7 @@ abstract class Base
|
|||
*/
|
||||
protected function projectLayout($template, array $params)
|
||||
{
|
||||
$content = $this->template->load($template, $params);
|
||||
$content = $this->template->render($template, $params);
|
||||
$params['project_content_for_layout'] = $content;
|
||||
$params['title'] = $params['project']['name'] === $params['title'] ? $params['title'] : $params['project']['name'].' > '.$params['title'];
|
||||
$params['board_selector'] = $this->projectPermission->getAllowedProjects($this->acl->getUserId());
|
||||
|
|
|
|||
|
|
@ -39,7 +39,7 @@ class Board extends Base
|
|||
$task = $this->getTask();
|
||||
$project = $this->project->getById($task['project_id']);
|
||||
|
||||
$this->response->html($this->template->load('board/assignee', array(
|
||||
$this->response->html($this->template->render('board/assignee', array(
|
||||
'values' => $task,
|
||||
'users_list' => $this->projectPermission->getMemberList($project['id']),
|
||||
'project' => $project,
|
||||
|
|
@ -78,7 +78,7 @@ class Board extends Base
|
|||
$task = $this->getTask();
|
||||
$project = $this->project->getById($task['project_id']);
|
||||
|
||||
$this->response->html($this->template->load('board/category', array(
|
||||
$this->response->html($this->template->render('board/category', array(
|
||||
'values' => $task,
|
||||
'categories_list' => $this->category->getList($project['id']),
|
||||
'project' => $project,
|
||||
|
|
@ -360,7 +360,7 @@ class Board extends Base
|
|||
}
|
||||
|
||||
$this->response->html(
|
||||
$this->template->load('board/show', array(
|
||||
$this->template->render('board/show', array(
|
||||
'project' => $this->project->getById($project_id),
|
||||
'swimlanes' => $this->board->getBoard($project_id),
|
||||
'categories' => $this->category->getList($project_id, false),
|
||||
|
|
@ -394,7 +394,7 @@ class Board extends Base
|
|||
}
|
||||
|
||||
$this->response->html(
|
||||
$this->template->load('board/show', array(
|
||||
$this->template->render('board/show', array(
|
||||
'project' => $this->project->getById($project_id),
|
||||
'swimlanes' => $this->board->getBoard($project_id),
|
||||
'categories' => $this->category->getList($project_id, false),
|
||||
|
|
@ -412,7 +412,7 @@ class Board extends Base
|
|||
public function subtasks()
|
||||
{
|
||||
$task = $this->getTask();
|
||||
$this->response->html($this->template->load('board/subtasks', array(
|
||||
$this->response->html($this->template->render('board/subtasks', array(
|
||||
'subtasks' => $this->subTask->getAll($task['id'])
|
||||
)));
|
||||
}
|
||||
|
|
@ -427,7 +427,7 @@ class Board extends Base
|
|||
$task = $this->getTask();
|
||||
$this->subTask->toggleStatus($this->request->getIntegerParam('subtask_id'));
|
||||
|
||||
$this->response->html($this->template->load('board/subtasks', array(
|
||||
$this->response->html($this->template->render('board/subtasks', array(
|
||||
'subtasks' => $this->subTask->getAll($task['id'])
|
||||
)));
|
||||
}
|
||||
|
|
@ -441,7 +441,7 @@ class Board extends Base
|
|||
{
|
||||
$task = $this->getTask();
|
||||
|
||||
$this->response->html($this->template->load('board/files', array(
|
||||
$this->response->html($this->template->render('board/files', array(
|
||||
'files' => $this->file->getAll($task['id'])
|
||||
)));
|
||||
}
|
||||
|
|
@ -455,7 +455,7 @@ class Board extends Base
|
|||
{
|
||||
$task = $this->getTask();
|
||||
|
||||
$this->response->html($this->template->load('board/comments', array(
|
||||
$this->response->html($this->template->render('board/comments', array(
|
||||
'comments' => $this->comment->getAll($task['id'])
|
||||
)));
|
||||
}
|
||||
|
|
@ -469,7 +469,7 @@ class Board extends Base
|
|||
{
|
||||
$task = $this->getTask();
|
||||
|
||||
$this->response->html($this->template->load('board/description', array(
|
||||
$this->response->html($this->template->render('board/description', array(
|
||||
'task' => $task
|
||||
)));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@ class Config extends Base
|
|||
$params['board_selector'] = $this->projectPermission->getAllowedProjects($this->acl->getUserId());
|
||||
$params['values'] = $this->config->getAll();
|
||||
$params['errors'] = array();
|
||||
$params['config_content_for_layout'] = $this->template->load($template, $params);
|
||||
$params['config_content_for_layout'] = $this->template->render($template, $params);
|
||||
|
||||
return $this->template->layout('config/layout', $params);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -75,7 +75,7 @@ class File extends Base
|
|||
$file = $this->file->getById($this->request->getIntegerParam('file_id'));
|
||||
|
||||
if ($file['task_id'] == $task['id']) {
|
||||
$this->response->html($this->template->load('file/open', array(
|
||||
$this->response->html($this->template->render('file/open', array(
|
||||
'file' => $file
|
||||
)));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -447,7 +447,7 @@ class Project extends Base
|
|||
$this->forbidden(true);
|
||||
}
|
||||
|
||||
$this->response->xml($this->template->load('project/feed', array(
|
||||
$this->response->xml($this->template->render('project/feed', array(
|
||||
'events' => $this->projectActivity->getProject($project['id']),
|
||||
'project' => $project,
|
||||
)));
|
||||
|
|
|
|||
|
|
@ -89,7 +89,7 @@ class Task extends Base
|
|||
public function create(array $values = array(), array $errors = array())
|
||||
{
|
||||
$project = $this->getProject();
|
||||
$method = $this->request->isAjax() ? 'load' : 'layout';
|
||||
$method = $this->request->isAjax() ? 'render' : 'layout';
|
||||
|
||||
if (empty($values)) {
|
||||
|
||||
|
|
@ -179,7 +179,7 @@ class Task extends Base
|
|||
);
|
||||
|
||||
if ($ajax) {
|
||||
$this->response->html($this->template->load('task/edit', $params));
|
||||
$this->response->html($this->template->render('task/edit', $params));
|
||||
}
|
||||
else {
|
||||
$this->response->html($this->taskLayout('task/edit', $params));
|
||||
|
|
@ -410,7 +410,7 @@ class Task extends Base
|
|||
);
|
||||
|
||||
if ($ajax) {
|
||||
$this->response->html($this->template->load('task/edit_description', $params));
|
||||
$this->response->html($this->template->render('task/edit_description', $params));
|
||||
}
|
||||
else {
|
||||
$this->response->html($this->taskLayout('task/edit_description', $params));
|
||||
|
|
|
|||
|
|
@ -76,7 +76,7 @@ class User extends Base
|
|||
*/
|
||||
private function layout($template, array $params)
|
||||
{
|
||||
$content = $this->template->load($template, $params);
|
||||
$content = $this->template->render($template, $params);
|
||||
$params['user_content_for_layout'] = $content;
|
||||
$params['board_selector'] = $this->projectPermission->getAllowedProjects($this->acl->getUserId());
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,629 @@
|
|||
<?php
|
||||
|
||||
namespace Core;
|
||||
|
||||
use Pimple\Container;
|
||||
use Parsedown;
|
||||
|
||||
/**
|
||||
* Template helpers
|
||||
*
|
||||
* @package core
|
||||
* @author Frederic Guillot
|
||||
*/
|
||||
class Helper
|
||||
{
|
||||
/**
|
||||
* 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];
|
||||
}
|
||||
|
||||
/**
|
||||
* 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);
|
||||
}
|
||||
|
||||
/**
|
||||
* HTML escaping
|
||||
*
|
||||
* @param string $value Value to escape
|
||||
* @return string
|
||||
*/
|
||||
public function e($value)
|
||||
{
|
||||
return htmlspecialchars($value, ENT_QUOTES, 'UTF-8', false);
|
||||
}
|
||||
|
||||
/**
|
||||
* Add a Javascript asset
|
||||
*
|
||||
* @param string $filename Filename
|
||||
* @return string
|
||||
*/
|
||||
public function js($filename)
|
||||
{
|
||||
return '<script type="text/javascript" src="'.$filename.'?'.filemtime($filename).'"></script>';
|
||||
}
|
||||
|
||||
/**
|
||||
* Add a stylesheet asset
|
||||
*
|
||||
* @param string $filename Filename
|
||||
* @return string
|
||||
*/
|
||||
public function css($filename)
|
||||
{
|
||||
return '<link rel="stylesheet" href="'.$filename.'?'.filemtime($filename).'" media="screen">';
|
||||
}
|
||||
|
||||
/**
|
||||
* 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 .= '<ul class="form-errors">';
|
||||
|
||||
foreach ($errors[$name] as $error) {
|
||||
$html .= '<li>'.$this->e($error).'</li>';
|
||||
}
|
||||
|
||||
$html .= '</ul>';
|
||||
}
|
||||
|
||||
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 '<input type="hidden" name="csrf_token" value="'.Security::getCSRFToken().'"/>';
|
||||
}
|
||||
|
||||
/**
|
||||
* 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 '<input type="hidden" name="'.$name.'" id="form-'.$name.'" '.$this->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(), $class = '')
|
||||
{
|
||||
$html = '<select name="'.$name.'" id="form-'.$name.'" class="'.$class.'">';
|
||||
|
||||
foreach ($options as $id => $value) {
|
||||
|
||||
$html .= '<option value="'.$this->e($id).'"';
|
||||
|
||||
if (isset($values->$name) && $id == $values->$name) $html .= ' selected="selected"';
|
||||
if (isset($values[$name]) && $id == $values[$name]) $html .= ' selected="selected"';
|
||||
|
||||
$html .= '>'.$this->e($value).'</option>';
|
||||
}
|
||||
|
||||
$html .= '</select>';
|
||||
$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 '<label><input type="radio" name="'.$name.'" class="'.$class.'" value="'.$this->e($value).'" '.($selected ? 'selected="selected"' : '').'>'.$this->e($label).'</label>';
|
||||
}
|
||||
|
||||
/**
|
||||
* 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 '<label><input type="checkbox" name="'.$name.'" class="'.$class.'" value="'.$this->e($value).'" '.($checked ? 'checked="checked"' : '').'> '.$this->e($label).'</label>';
|
||||
}
|
||||
|
||||
/**
|
||||
* 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 '<label for="form-'.$name.'" '.implode(' ', $attributes).'>'.$this->e($label).'</label>';
|
||||
}
|
||||
|
||||
/**
|
||||
* 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 = '<textarea name="'.$name.'" id="form-'.$name.'" class="'.$class.'" ';
|
||||
$html .= implode(' ', $attributes).'>';
|
||||
$html .= isset($values->$name) ? $this->e($values->$name) : isset($values[$name]) ? $values[$name] : '';
|
||||
$html .= '</textarea>';
|
||||
$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 = '<input type="'.$type.'" name="'.$name.'" id="form-'.$name.'" '.$this->formValue($values, $name).' class="'.$class.'" ';
|
||||
$html .= implode(' ', $attributes).'/>';
|
||||
if (in_array('required', $attributes)) $html .= '<span class="form-required">*</span>';
|
||||
$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 '<a href="'.$this->u($controller, $action, $params, $csrf).'" class="'.$class.'" title="'.$title.'" '.($new_tab ? 'target="_blank"' : '').'>'.$label.'</a>';
|
||||
}
|
||||
|
||||
/**
|
||||
* URL query string
|
||||
*
|
||||
* 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)
|
||||
{
|
||||
$html = '?controller='.$controller.'&action='.$action;
|
||||
|
||||
if ($csrf) {
|
||||
$params['csrf_token'] = Security::getCSRFToken();
|
||||
}
|
||||
|
||||
foreach ($params as $key => $value) {
|
||||
$html .= '&'.$key.'='.$value;
|
||||
}
|
||||
|
||||
return $html;
|
||||
}
|
||||
|
||||
/**
|
||||
* Pagination links
|
||||
*
|
||||
* @param array $pagination Pagination information
|
||||
* @return string
|
||||
*/
|
||||
public function paginate(array $pagination)
|
||||
{
|
||||
extract($pagination);
|
||||
|
||||
if ($pagination['offset'] === 0 && ($total - $pagination['offset']) <= $limit) {
|
||||
return '';
|
||||
}
|
||||
|
||||
$html = '<div class="pagination">';
|
||||
$html .= '<span class="pagination-previous">';
|
||||
|
||||
if ($pagination['offset'] > 0) {
|
||||
$offset = $pagination['offset'] - $limit;
|
||||
$html .= $this->a('← '.t('Previous'), $controller, $action, $params + compact('offset', 'order', 'direction'));
|
||||
}
|
||||
else {
|
||||
$html .= '← '.t('Previous');
|
||||
}
|
||||
|
||||
$html .= '</span>';
|
||||
$html .= '<span class="pagination-next">';
|
||||
|
||||
if (($total - $pagination['offset']) > $limit) {
|
||||
$offset = $pagination['offset'] + $limit;
|
||||
$html .= $this->a(t('Next').' →', $controller, $action, $params + compact('offset', 'order', 'direction'));
|
||||
}
|
||||
else {
|
||||
$html .= t('Next').' →';
|
||||
}
|
||||
|
||||
$html .= '</span>';
|
||||
$html .= '</div>';
|
||||
|
||||
return $html;
|
||||
}
|
||||
|
||||
/**
|
||||
* Column sorting (work with pagination)
|
||||
*
|
||||
* @param string $label Column title
|
||||
* @param string $column SQL column name
|
||||
* @param array $pagination Pagination information
|
||||
* @return string
|
||||
*/
|
||||
public function order($label, $column, array $pagination)
|
||||
{
|
||||
extract($pagination);
|
||||
|
||||
$prefix = '';
|
||||
|
||||
if ($order === $column) {
|
||||
$prefix = $direction === 'DESC' ? '▼ ' : '▲ ';
|
||||
$direction = $direction === 'DESC' ? 'ASC' : 'DESC';
|
||||
}
|
||||
|
||||
$order = $column;
|
||||
|
||||
return $prefix.$this->a($label, $controller, $action, $params + compact('offset', 'order', 'direction'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Markdown transformation
|
||||
*
|
||||
* @param string $text Markdown content
|
||||
* @param array $link Link parameters for replacement
|
||||
* @return string
|
||||
*/
|
||||
public function markdown($text, array $link = array('controller' => 'task', 'action' => 'show', 'params' => array()))
|
||||
{
|
||||
$html = Parsedown::instance()
|
||||
->setMarkupEscaped(true) # escapes markup (HTML)
|
||||
->text($text);
|
||||
|
||||
// Replace task #123 by a link to the task
|
||||
$html = preg_replace_callback('!#(\d+)!i', function($matches) use ($link) { // TODO: Fix that
|
||||
return a(
|
||||
$matches[0],
|
||||
$link['controller'],
|
||||
$link['action'],
|
||||
$link['params'] + array('task_id' => $matches[1])
|
||||
);
|
||||
}, $html);
|
||||
|
||||
return $html;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the current URL without the querystring
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getCurrentBaseUrl()
|
||||
{
|
||||
$url = Request::isHTTPS() ? 'https://' : 'http://';
|
||||
$url .= $_SERVER['SERVER_NAME'];
|
||||
$url .= $_SERVER['SERVER_PORT'] == 80 || $_SERVER['SERVER_PORT'] == 443 ? '' : ':'.$_SERVER['SERVER_PORT'];
|
||||
$url .= dirname($_SERVER['PHP_SELF']) !== '/' ? dirname($_SERVER['PHP_SELF']).'/' : '/';
|
||||
|
||||
return $url;
|
||||
}
|
||||
|
||||
/**
|
||||
* Dispplay the flash session message
|
||||
*
|
||||
* @param string $html HTML wrapper
|
||||
* @return string
|
||||
*/
|
||||
public function flash($html)
|
||||
{
|
||||
$data = '';
|
||||
|
||||
if (isset($_SESSION['flash_message'])) {
|
||||
$data = sprintf($html, $this->e($_SESSION['flash_message']));
|
||||
unset($_SESSION['flash_message']);
|
||||
}
|
||||
|
||||
return $data;
|
||||
}
|
||||
|
||||
/**
|
||||
* Display the flash session error message
|
||||
*
|
||||
* @param string $html HTML wrapper
|
||||
* @return string
|
||||
*/
|
||||
public function flashError($html)
|
||||
{
|
||||
$data = '';
|
||||
|
||||
if (isset($_SESSION['flash_error_message'])) {
|
||||
$data = sprintf($html, $this->e($_SESSION['flash_error_message']));
|
||||
unset($_SESSION['flash_error_message']);
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
|
@ -2,13 +2,15 @@
|
|||
|
||||
namespace Core;
|
||||
|
||||
use ArrayAccess;
|
||||
|
||||
/**
|
||||
* Session class
|
||||
*
|
||||
* @package core
|
||||
* @author Frederic Guillot
|
||||
*/
|
||||
class Session
|
||||
class Session implements ArrayAccess
|
||||
{
|
||||
/**
|
||||
* Sesion lifetime
|
||||
|
|
@ -59,7 +61,7 @@ class Session
|
|||
ini_set('session.entropy_length', '32');
|
||||
ini_set('session.hash_bits_per_character', 6);
|
||||
|
||||
// If session was autostarted with session.auto_start = 1 in php.ini destroy it
|
||||
// If the session was autostarted with session.auto_start = 1 in php.ini destroy it
|
||||
if (isset($_SESSION)) {
|
||||
session_destroy();
|
||||
}
|
||||
|
|
@ -88,19 +90,17 @@ class Session
|
|||
$_SESSION = array();
|
||||
|
||||
// Destroy the session cookie
|
||||
if (ini_get('session.use_cookies')) {
|
||||
$params = session_get_cookie_params();
|
||||
$params = session_get_cookie_params();
|
||||
|
||||
setcookie(
|
||||
session_name(),
|
||||
'',
|
||||
time() - 42000,
|
||||
$params['path'],
|
||||
$params['domain'],
|
||||
$params['secure'],
|
||||
$params['httponly']
|
||||
);
|
||||
}
|
||||
setcookie(
|
||||
session_name(),
|
||||
'',
|
||||
time() - 42000,
|
||||
$params['path'],
|
||||
$params['domain'],
|
||||
$params['secure'],
|
||||
$params['httponly']
|
||||
);
|
||||
|
||||
// Destroy session data
|
||||
session_destroy();
|
||||
|
|
@ -127,4 +127,24 @@ class Session
|
|||
{
|
||||
$_SESSION['flash_error_message'] = $message;
|
||||
}
|
||||
|
||||
public function offsetSet($offset, $value)
|
||||
{
|
||||
$_SESSION[$offset] = $value;
|
||||
}
|
||||
|
||||
public function offsetExists($offset)
|
||||
{
|
||||
return isset($_SESSION[$offset]);
|
||||
}
|
||||
|
||||
public function offsetUnset($offset)
|
||||
{
|
||||
unset($_SESSION[$offset]);
|
||||
}
|
||||
|
||||
public function offsetGet($offset)
|
||||
{
|
||||
return isset($_SESSION[$offset]) ? $_SESSION[$offset] : null;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ use LogicException;
|
|||
* @package core
|
||||
* @author Frederic Guillot
|
||||
*/
|
||||
class Template
|
||||
class Template extends Helper
|
||||
{
|
||||
/**
|
||||
* Template path
|
||||
|
|
@ -20,18 +20,18 @@ class Template
|
|||
const PATH = 'app/Template/';
|
||||
|
||||
/**
|
||||
* Load a template
|
||||
* Render a template
|
||||
*
|
||||
* Example:
|
||||
*
|
||||
* $template->load('template_name', ['bla' => 'value']);
|
||||
* $template->render('template_name', ['bla' => 'value']);
|
||||
*
|
||||
* @access public
|
||||
* @params string $__template_name Template name
|
||||
* @params array $__template_args Key/Value map of template variables
|
||||
* @return string
|
||||
*/
|
||||
public function load($__template_name, array $__template_args = array())
|
||||
public function render($__template_name, array $__template_args = array())
|
||||
{
|
||||
$__template_file = self::PATH.$__template_name.'.php';
|
||||
|
||||
|
|
@ -57,9 +57,9 @@ class Template
|
|||
*/
|
||||
public function layout($template_name, array $template_args = array(), $layout_name = 'layout')
|
||||
{
|
||||
return $this->load(
|
||||
return $this->render(
|
||||
$layout_name,
|
||||
$template_args + array('content_for_layout' => $this->load($template_name, $template_args))
|
||||
$template_args + array('content_for_layout' => $this->render($template_name, $template_args))
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -42,6 +42,7 @@ class Acl extends Base
|
|||
'category' => array('index', 'save', 'edit', 'update', 'confirm', 'remove'),
|
||||
'action' => array('index', 'event', 'params', 'create', 'confirm', 'remove'),
|
||||
'analytic' => array('tasks', 'users', 'cfd'),
|
||||
'swimlane' => array('index', 'save', 'change', 'edit', 'update', 'confirm', 'remove', 'disable', 'enable', 'moveup', 'movedown'),
|
||||
);
|
||||
|
||||
/**
|
||||
|
|
@ -96,7 +97,7 @@ class Acl extends Base
|
|||
*/
|
||||
public function isAdminUser()
|
||||
{
|
||||
return isset($_SESSION['user']['is_admin']) && $_SESSION['user']['is_admin'] === true;
|
||||
return isset($this->session['user']['is_admin']) && $this->session['user']['is_admin'] === true;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -107,7 +108,7 @@ class Acl extends Base
|
|||
*/
|
||||
public function isRegularUser()
|
||||
{
|
||||
return isset($_SESSION['user']['is_admin']) && $_SESSION['user']['is_admin'] === false;
|
||||
return isset($this->session['user']['is_admin']) && $this->session['user']['is_admin'] === false;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -118,7 +119,18 @@ class Acl extends Base
|
|||
*/
|
||||
public function getUserId()
|
||||
{
|
||||
return isset($_SESSION['user']['id']) ? (int) $_SESSION['user']['id'] : 0;
|
||||
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->acl->getUserId() == $user_id;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -129,7 +141,7 @@ class Acl extends Base
|
|||
*/
|
||||
public function isLogged()
|
||||
{
|
||||
return ! empty($_SESSION['user']);
|
||||
return ! empty($this->session['user']);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -142,10 +154,10 @@ class Acl extends Base
|
|||
public function isRememberMe($value = null)
|
||||
{
|
||||
if ($value !== null) {
|
||||
$_SESSION['is_remember_me'] = $value;
|
||||
$this->session['is_remember_me'] = $value;
|
||||
}
|
||||
|
||||
return empty($_SESSION['is_remember_me']) ? false : $_SESSION['is_remember_me'];
|
||||
return empty($this->session['is_remember_me']) ? false : $this->session['is_remember_me'];
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -10,6 +10,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
|
||||
|
|
|
|||
|
|
@ -76,12 +76,13 @@ class Config extends Base
|
|||
return $value ?: $default_value;
|
||||
}
|
||||
|
||||
if (! isset($_SESSION['config'][$name])) {
|
||||
$_SESSION['config'] = $this->getAll();
|
||||
// Cache config in session
|
||||
if (! isset($this->session['config'][$name])) {
|
||||
$this->session['config'] = $this->getAll();
|
||||
}
|
||||
|
||||
if (! empty($_SESSION['config'][$name])) {
|
||||
return $_SESSION['config'][$name];
|
||||
if (isset($this->session['config'][$name])) {
|
||||
return $this->session['config'][$name];
|
||||
}
|
||||
|
||||
return $default_value;
|
||||
|
|
@ -126,7 +127,7 @@ class Config extends Base
|
|||
*/
|
||||
public function reload()
|
||||
{
|
||||
$_SESSION['config'] = $this->getAll();
|
||||
$this->session['config'] = $this->getAll();
|
||||
$this->setupTranslations();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -3,7 +3,6 @@
|
|||
namespace Model;
|
||||
|
||||
use Core\Session;
|
||||
use Core\Template;
|
||||
use Swift_Message;
|
||||
use Swift_Mailer;
|
||||
use Swift_TransportException;
|
||||
|
|
@ -184,8 +183,10 @@ class Notification extends Base
|
|||
*/
|
||||
public function getMailContent($template, array $data)
|
||||
{
|
||||
$tpl = new Template;
|
||||
return $tpl->load('notification/'.$template, $data + array('application_url' => $this->config->get('application_url')));
|
||||
return $this->template->render(
|
||||
'notification/'.$template,
|
||||
$data + array('application_url' => $this->config->get('application_url'))
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -2,8 +2,6 @@
|
|||
|
||||
namespace Model;
|
||||
|
||||
use Core\Template;
|
||||
|
||||
/**
|
||||
* Project activity model
|
||||
*
|
||||
|
|
@ -134,8 +132,10 @@ class ProjectActivity extends Base
|
|||
*/
|
||||
public function getContent(array $params)
|
||||
{
|
||||
$tpl = new Template;
|
||||
return $tpl->load('event/'.str_replace('.', '_', $params['event_name']), $params);
|
||||
return $this->template->render(
|
||||
'event/'.str_replace('.', '_', $params['event_name']),
|
||||
$params
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -264,6 +264,10 @@ class ProjectPermission extends Base
|
|||
*/
|
||||
public function adminAllowed($project_id, $user_id)
|
||||
{
|
||||
if ($this->user->isAdmin($user_id)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if ($this->isUserAllowed($project_id, $user_id) && $this->project->isPrivate($project_id)) {
|
||||
return true;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -28,6 +28,17 @@ class User extends Base
|
|||
*/
|
||||
const EVERYBODY_ID = -1;
|
||||
|
||||
/**
|
||||
* Return the full name
|
||||
*
|
||||
* @param array $user User properties
|
||||
* @return string
|
||||
*/
|
||||
public function getFullname(array $user)
|
||||
{
|
||||
return $user['name'] ?: $user['username'];
|
||||
}
|
||||
|
||||
/**
|
||||
* Return true is the given user id is administrator
|
||||
*
|
||||
|
|
@ -54,7 +65,7 @@ class User extends Base
|
|||
*/
|
||||
public function getFavoriteProjectId()
|
||||
{
|
||||
return isset($_SESSION['user']['default_project_id']) ? $_SESSION['user']['default_project_id'] : 0;
|
||||
return isset($this->session['user']['default_project_id']) ? $this->session['user']['default_project_id'] : 0;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -65,7 +76,7 @@ class User extends Base
|
|||
*/
|
||||
public function getLastSeenProjectId()
|
||||
{
|
||||
return empty($_SESSION['user']['last_show_project_id']) ? 0 : $_SESSION['user']['last_show_project_id'];
|
||||
return empty($this->session['last_show_project_id']) ? 0 : $this->session['last_show_project_id'];
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -76,7 +87,7 @@ class User extends Base
|
|||
*/
|
||||
public function storeLastSeenProjectId($project_id)
|
||||
{
|
||||
$_SESSION['user']['last_show_project_id'] = (int) $project_id;
|
||||
$this->session['last_show_project_id'] = (int) $project_id;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -276,7 +287,7 @@ class User extends Base
|
|||
$result = $this->db->table(self::TABLE)->eq('id', $values['id'])->update($values);
|
||||
|
||||
// If the user is connected refresh his session
|
||||
if (Session::isOpen() && $_SESSION['user']['id'] == $values['id']) {
|
||||
if (Session::isOpen() && $this->acl->getUserId() == $values['id']) {
|
||||
$this->updateSession();
|
||||
}
|
||||
|
||||
|
|
@ -326,7 +337,7 @@ class User extends Base
|
|||
public function updateSession(array $user = array())
|
||||
{
|
||||
if (empty($user)) {
|
||||
$user = $this->getById($_SESSION['user']['id']);
|
||||
$user = $this->getById($this->acl->getUserId());
|
||||
}
|
||||
|
||||
if (isset($user['password'])) {
|
||||
|
|
@ -338,7 +349,7 @@ class User extends Base
|
|||
$user['is_admin'] = (bool) $user['is_admin'];
|
||||
$user['is_ldap_user'] = (bool) $user['is_ldap_user'];
|
||||
|
||||
$_SESSION['user'] = $user;
|
||||
$this->session['user'] = $user;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -457,7 +468,7 @@ class User extends Base
|
|||
if ($v->execute()) {
|
||||
|
||||
// Check password
|
||||
if ($this->authentication->authenticate($_SESSION['user']['username'], $values['current_password'])) {
|
||||
if ($this->authentication->authenticate($this->session['user']['username'], $values['current_password'])) {
|
||||
return array(true, array());
|
||||
}
|
||||
else {
|
||||
|
|
|
|||
|
|
@ -0,0 +1,72 @@
|
|||
<?php
|
||||
|
||||
namespace ServiceProvider;
|
||||
|
||||
use Model\Config;
|
||||
use Model\Project;
|
||||
use Model\Webhook;
|
||||
use Pimple\Container;
|
||||
use Pimple\ServiceProviderInterface;
|
||||
|
||||
class ClassProvider implements ServiceProviderInterface
|
||||
{
|
||||
private $classes = array(
|
||||
'Model' => array(
|
||||
'Acl',
|
||||
'Action',
|
||||
'Authentication',
|
||||
'Board',
|
||||
'Category',
|
||||
'Color',
|
||||
'Comment',
|
||||
'Config',
|
||||
'DateParser',
|
||||
'File',
|
||||
'GithubWebhook',
|
||||
'LastLogin',
|
||||
'Notification',
|
||||
'Project',
|
||||
'ProjectActivity',
|
||||
'ProjectAnalytics',
|
||||
'ProjectDailySummary',
|
||||
'ProjectPaginator',
|
||||
'ProjectPermission',
|
||||
'SubTask',
|
||||
'SubtaskPaginator',
|
||||
'Swimlane',
|
||||
'Task',
|
||||
'TaskCreation',
|
||||
'TaskDuplication',
|
||||
'TaskExport',
|
||||
'TaskFinder',
|
||||
'TaskModification',
|
||||
'TaskPaginator',
|
||||
'TaskPermission',
|
||||
'TaskPosition',
|
||||
'TaskStatus',
|
||||
'TaskValidator',
|
||||
'TimeTracking',
|
||||
'User',
|
||||
'Webhook',
|
||||
),
|
||||
'Core' => array(
|
||||
'Template',
|
||||
'Session',
|
||||
),
|
||||
);
|
||||
|
||||
public function register(Container $container)
|
||||
{
|
||||
foreach ($this->classes as $namespace => $classes) {
|
||||
|
||||
foreach ($classes as $name) {
|
||||
|
||||
$class = '\\'.$namespace.'\\'.$name;
|
||||
|
||||
$container[lcfirst($name)] = function ($c) use ($class) {
|
||||
return new $class($c);
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1,63 +0,0 @@
|
|||
<?php
|
||||
|
||||
namespace ServiceProvider;
|
||||
|
||||
use Model\Config;
|
||||
use Model\Project;
|
||||
use Model\Webhook;
|
||||
use Pimple\Container;
|
||||
use Pimple\ServiceProviderInterface;
|
||||
|
||||
class ModelProvider implements ServiceProviderInterface
|
||||
{
|
||||
private $models = array(
|
||||
'Acl',
|
||||
'Action',
|
||||
'Authentication',
|
||||
'Board',
|
||||
'Category',
|
||||
'Color',
|
||||
'Comment',
|
||||
'Config',
|
||||
'DateParser',
|
||||
'File',
|
||||
'GithubWebhook',
|
||||
'LastLogin',
|
||||
'Notification',
|
||||
'Project',
|
||||
'ProjectActivity',
|
||||
'ProjectAnalytics',
|
||||
'ProjectDailySummary',
|
||||
'ProjectPaginator',
|
||||
'ProjectPermission',
|
||||
'SubTask',
|
||||
'SubtaskPaginator',
|
||||
'Swimlane',
|
||||
'Task',
|
||||
'TaskCreation',
|
||||
'TaskDuplication',
|
||||
'TaskExport',
|
||||
'TaskFinder',
|
||||
'TaskModification',
|
||||
'TaskPaginator',
|
||||
'TaskPermission',
|
||||
'TaskPosition',
|
||||
'TaskStatus',
|
||||
'TaskValidator',
|
||||
'TimeTracking',
|
||||
'User',
|
||||
'Webhook',
|
||||
);
|
||||
|
||||
public function register(Container $container)
|
||||
{
|
||||
foreach ($this->models as $model) {
|
||||
|
||||
$class = '\Model\\'.$model;
|
||||
|
||||
$container[lcfirst($model)] = function ($c) use ($class) {
|
||||
return new $class($c);
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -3,15 +3,15 @@
|
|||
</div>
|
||||
|
||||
<h3><?= t('Choose an event') ?></h3>
|
||||
<form method="post" action="<?= Helper\u('action', 'params', array('project_id' => $project['id'])) ?>">
|
||||
<form method="post" action="<?= $this->u('action', 'params', array('project_id' => $project['id'])) ?>">
|
||||
|
||||
<?= Helper\form_csrf() ?>
|
||||
<?= $this->formCsrf() ?>
|
||||
|
||||
<?= Helper\form_hidden('project_id', $values) ?>
|
||||
<?= Helper\form_hidden('action_name', $values) ?>
|
||||
<?= $this->formHidden('project_id', $values) ?>
|
||||
<?= $this->formHidden('action_name', $values) ?>
|
||||
|
||||
<?= Helper\form_label(t('Event'), 'event_name') ?>
|
||||
<?= Helper\form_select('event_name', $events, $values) ?><br/>
|
||||
<?= $this->formLabel(t('Event'), 'event_name') ?>
|
||||
<?= $this->formSelect('event_name', $events, $values) ?><br/>
|
||||
|
||||
<div class="form-help">
|
||||
<?= t('When the selected event occurs execute the corresponding action.') ?>
|
||||
|
|
@ -20,6 +20,6 @@
|
|||
<div class="form-actions">
|
||||
<input type="submit" value="<?= t('Next step') ?>" class="btn btn-blue"/>
|
||||
<?= t('or') ?>
|
||||
<?= Helper\a(t('cancel'), 'action', 'index', array('project_id' => $project['id'])) ?>
|
||||
<?= $this->a(t('cancel'), 'action', 'index', array('project_id' => $project['id'])) ?>
|
||||
</div>
|
||||
</form>
|
||||
|
|
@ -15,26 +15,26 @@
|
|||
|
||||
<?php foreach ($actions as $action): ?>
|
||||
<tr>
|
||||
<td><?= Helper\in_list($action['event_name'], $available_events) ?></td>
|
||||
<td><?= Helper\in_list($action['action_name'], $available_actions) ?></td>
|
||||
<td><?= $this->inList($action['event_name'], $available_events) ?></td>
|
||||
<td><?= $this->inList($action['action_name'], $available_actions) ?></td>
|
||||
<td>
|
||||
<ul>
|
||||
<?php foreach ($action['params'] as $param): ?>
|
||||
<li>
|
||||
<?= Helper\in_list($param['name'], $available_params) ?> =
|
||||
<?= $this->inList($param['name'], $available_params) ?> =
|
||||
<strong>
|
||||
<?php if (Helper\contains($param['name'], 'column_id')): ?>
|
||||
<?= Helper\in_list($param['value'], $columns_list) ?>
|
||||
<?php elseif (Helper\contains($param['name'], 'user_id')): ?>
|
||||
<?= Helper\in_list($param['value'], $users_list) ?>
|
||||
<?php elseif (Helper\contains($param['name'], 'project_id')): ?>
|
||||
<?= Helper\in_list($param['value'], $projects_list) ?>
|
||||
<?php elseif (Helper\contains($param['name'], 'color_id')): ?>
|
||||
<?= Helper\in_list($param['value'], $colors_list) ?>
|
||||
<?php elseif (Helper\contains($param['name'], 'category_id')): ?>
|
||||
<?= Helper\in_list($param['value'], $categories_list) ?>
|
||||
<?php elseif (Helper\contains($param['name'], 'label')): ?>
|
||||
<?= Helper\escape($param['value']) ?>
|
||||
<?php if ($this->contains($param['name'], 'column_id')): ?>
|
||||
<?= $this->inList($param['value'], $columns_list) ?>
|
||||
<?php elseif ($this->contains($param['name'], 'user_id')): ?>
|
||||
<?= $this->inList($param['value'], $users_list) ?>
|
||||
<?php elseif ($this->contains($param['name'], 'project_id')): ?>
|
||||
<?= $this->inList($param['value'], $projects_list) ?>
|
||||
<?php elseif ($this->contains($param['name'], 'color_id')): ?>
|
||||
<?= $this->inList($param['value'], $colors_list) ?>
|
||||
<?php elseif ($this->contains($param['name'], 'category_id')): ?>
|
||||
<?= $this->inList($param['value'], $categories_list) ?>
|
||||
<?php elseif ($this->contains($param['name'], 'label')): ?>
|
||||
<?= $this->e($param['value']) ?>
|
||||
<?php endif ?>
|
||||
</strong>
|
||||
</li>
|
||||
|
|
@ -42,7 +42,7 @@
|
|||
</ul>
|
||||
</td>
|
||||
<td>
|
||||
<?= Helper\a(t('Remove'), 'action', 'confirm', array('project_id' => $project['id'], 'action_id' => $action['id'])) ?>
|
||||
<?= $this->a(t('Remove'), 'action', 'confirm', array('project_id' => $project['id'], 'action_id' => $action['id'])) ?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endforeach ?>
|
||||
|
|
@ -51,12 +51,12 @@
|
|||
<?php endif ?>
|
||||
|
||||
<h3><?= t('Add an action') ?></h3>
|
||||
<form method="post" action="<?= Helper\u('action', 'event', array('project_id' => $project['id'])) ?>" class="listing">
|
||||
<?= Helper\form_csrf() ?>
|
||||
<?= Helper\form_hidden('project_id', $values) ?>
|
||||
<form method="post" action="<?= $this->u('action', 'event', array('project_id' => $project['id'])) ?>" class="listing">
|
||||
<?= $this->formCsrf() ?>
|
||||
<?= $this->formHidden('project_id', $values) ?>
|
||||
|
||||
<?= Helper\form_label(t('Action'), 'action_name') ?>
|
||||
<?= Helper\form_select('action_name', $available_actions, $values) ?><br/>
|
||||
<?= $this->formLabel(t('Action'), 'action_name') ?>
|
||||
<?= $this->formSelect('action_name', $available_actions, $values) ?><br/>
|
||||
|
||||
<div class="form-actions">
|
||||
<input type="submit" value="<?= t('Next step') ?>" class="btn btn-blue"/>
|
||||
|
|
|
|||
|
|
@ -3,34 +3,34 @@
|
|||
</div>
|
||||
|
||||
<h3><?= t('Define action parameters') ?></h3>
|
||||
<form method="post" action="<?= Helper\u('action', 'create', array('project_id' => $project['id'])) ?>" autocomplete="off">
|
||||
<form method="post" action="<?= $this->u('action', 'create', array('project_id' => $project['id'])) ?>" autocomplete="off">
|
||||
|
||||
<?= Helper\form_csrf() ?>
|
||||
<?= $this->formCsrf() ?>
|
||||
|
||||
<?= Helper\form_hidden('project_id', $values) ?>
|
||||
<?= Helper\form_hidden('event_name', $values) ?>
|
||||
<?= Helper\form_hidden('action_name', $values) ?>
|
||||
<?= $this->formHidden('project_id', $values) ?>
|
||||
<?= $this->formHidden('event_name', $values) ?>
|
||||
<?= $this->formHidden('action_name', $values) ?>
|
||||
|
||||
<?php foreach ($action_params as $param_name => $param_desc): ?>
|
||||
|
||||
<?php if (Helper\contains($param_name, 'column_id')): ?>
|
||||
<?= Helper\form_label($param_desc, $param_name) ?>
|
||||
<?= Helper\form_select('params['.$param_name.']', $columns_list, $values) ?><br/>
|
||||
<?php elseif (Helper\contains($param_name, 'user_id')): ?>
|
||||
<?= Helper\form_label($param_desc, $param_name) ?>
|
||||
<?= Helper\form_select('params['.$param_name.']', $users_list, $values) ?><br/>
|
||||
<?php elseif (Helper\contains($param_name, 'project_id')): ?>
|
||||
<?= Helper\form_label($param_desc, $param_name) ?>
|
||||
<?= Helper\form_select('params['.$param_name.']', $projects_list, $values) ?><br/>
|
||||
<?php elseif (Helper\contains($param_name, 'color_id')): ?>
|
||||
<?= Helper\form_label($param_desc, $param_name) ?>
|
||||
<?= Helper\form_select('params['.$param_name.']', $colors_list, $values) ?><br/>
|
||||
<?php elseif (Helper\contains($param_name, 'category_id')): ?>
|
||||
<?= Helper\form_label($param_desc, $param_name) ?>
|
||||
<?= Helper\form_select('params['.$param_name.']', $categories_list, $values) ?><br/>
|
||||
<?php elseif (Helper\contains($param_name, 'label')): ?>
|
||||
<?= Helper\form_label($param_desc, $param_name) ?>
|
||||
<?= Helper\form_text('params['.$param_name.']', $values) ?>
|
||||
<?php if ($this->contains($param_name, 'column_id')): ?>
|
||||
<?= $this->formLabel($param_desc, $param_name) ?>
|
||||
<?= $this->formSelect('params['.$param_name.']', $columns_list, $values) ?><br/>
|
||||
<?php elseif ($this->contains($param_name, 'user_id')): ?>
|
||||
<?= $this->formLabel($param_desc, $param_name) ?>
|
||||
<?= $this->formSelect('params['.$param_name.']', $users_list, $values) ?><br/>
|
||||
<?php elseif ($this->contains($param_name, 'project_id')): ?>
|
||||
<?= $this->formLabel($param_desc, $param_name) ?>
|
||||
<?= $this->formSelect('params['.$param_name.']', $projects_list, $values) ?><br/>
|
||||
<?php elseif ($this->contains($param_name, 'color_id')): ?>
|
||||
<?= $this->formLabel($param_desc, $param_name) ?>
|
||||
<?= $this->formSelect('params['.$param_name.']', $colors_list, $values) ?><br/>
|
||||
<?php elseif ($this->contains($param_name, 'category_id')): ?>
|
||||
<?= $this->formLabel($param_desc, $param_name) ?>
|
||||
<?= $this->formSelect('params['.$param_name.']', $categories_list, $values) ?><br/>
|
||||
<?php elseif ($this->contains($param_name, 'label')): ?>
|
||||
<?= $this->formLabel($param_desc, $param_name) ?>
|
||||
<?= $this->formText('params['.$param_name.']', $values) ?>
|
||||
<?php endif ?>
|
||||
|
||||
<?php endforeach ?>
|
||||
|
|
@ -38,6 +38,6 @@
|
|||
<div class="form-actions">
|
||||
<input type="submit" value="<?= t('Save this action') ?>" class="btn btn-blue"/>
|
||||
<?= t('or') ?>
|
||||
<?= Helper\a(t('cancel'), 'action', 'index', array('project_id' => $project['id'])) ?>
|
||||
<?= $this->a(t('cancel'), 'action', 'index', array('project_id' => $project['id'])) ?>
|
||||
</div>
|
||||
</form>
|
||||
|
|
@ -4,12 +4,12 @@
|
|||
|
||||
<div class="confirm">
|
||||
<p class="alert alert-info">
|
||||
<?= t('Do you really want to remove this action: "%s"?', Helper\in_list($action['event_name'], $available_events).'/'.Helper\in_list($action['action_name'], $available_actions)) ?>
|
||||
<?= t('Do you really want to remove this action: "%s"?', $this->inList($action['event_name'], $available_events).'/'.$this->inList($action['action_name'], $available_actions)) ?>
|
||||
</p>
|
||||
|
||||
<div class="form-actions">
|
||||
<?= Helper\a(t('Yes'), 'action', 'remove', array('project_id' => $project['id'], 'action_id' => $action['id']), true, 'btn btn-red') ?>
|
||||
<?= $this->a(t('Yes'), 'action', 'remove', array('project_id' => $project['id'], 'action_id' => $action['id']), true, 'btn btn-red') ?>
|
||||
<?= t('or') ?>
|
||||
<?= Helper\a(t('cancel'), 'action', 'index', array('project_id' => $project['id'])) ?>
|
||||
<?= $this->a(t('cancel'), 'action', 'index', array('project_id' => $project['id'])) ?>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -6,24 +6,24 @@
|
|||
<p class="alert"><?= t('Not enough data to show the graph.') ?></p>
|
||||
<?php else: ?>
|
||||
<section id="analytic-cfd">
|
||||
<div id="chart" data-url="<?= Helper\u('analytic', 'cfd', array('project_id' => $project['id'], 'from' => $values['from'], 'to' => $values['to'])) ?>"></div>
|
||||
<div id="chart" data-url="<?= $this->u('analytic', 'cfd', array('project_id' => $project['id'], 'from' => $values['from'], 'to' => $values['to'])) ?>"></div>
|
||||
</section>
|
||||
<?php endif ?>
|
||||
|
||||
<hr/>
|
||||
|
||||
<form method="post" class="form-inline" action="<?= Helper\u('analytic', 'cfd', array('project_id' => $project['id'])) ?>" autocomplete="off">
|
||||
<form method="post" class="form-inline" action="<?= $this->u('analytic', 'cfd', array('project_id' => $project['id'])) ?>" autocomplete="off">
|
||||
|
||||
<?= Helper\form_csrf() ?>
|
||||
<?= $this->formCsrf() ?>
|
||||
|
||||
<div class="form-inline-group">
|
||||
<?= Helper\form_label(t('Start Date'), 'from') ?>
|
||||
<?= Helper\form_text('from', $values, array(), array('required', 'placeholder="'.Helper\in_list($date_format, $date_formats).'"'), 'form-date') ?>
|
||||
<?= $this->formLabel(t('Start Date'), 'from') ?>
|
||||
<?= $this->formText('from', $values, array(), array('required', 'placeholder="'.$this->inList($date_format, $date_formats).'"'), 'form-date') ?>
|
||||
</div>
|
||||
|
||||
<div class="form-inline-group">
|
||||
<?= Helper\form_label(t('End Date'), 'to') ?>
|
||||
<?= Helper\form_text('to', $values, array(), array('required', 'placeholder="'.Helper\in_list($date_format, $date_formats).'"'), 'form-date') ?>
|
||||
<?= $this->formLabel(t('End Date'), 'to') ?>
|
||||
<?= $this->formText('to', $values, array(), array('required', 'placeholder="'.$this->inList($date_format, $date_formats).'"'), 'form-date') ?>
|
||||
</div>
|
||||
|
||||
<div class="form-inline-group">
|
||||
|
|
|
|||
|
|
@ -1,15 +1,15 @@
|
|||
<?= Helper\js('assets/js/d3.v3.4.8.min.js') ?>
|
||||
<?= Helper\js('assets/js/dimple.v2.1.0.min.js') ?>
|
||||
<?= $this->js('assets/js/d3.v3.4.8.min.js') ?>
|
||||
<?= $this->js('assets/js/dimple.v2.1.0.min.js') ?>
|
||||
|
||||
<section id="main">
|
||||
<div class="page-header">
|
||||
<ul>
|
||||
<li><i class="fa fa-table fa-fw"></i><?= Helper\a(t('Back to the board'), 'board', 'show', array('project_id' => $project['id'])) ?></li>
|
||||
<li><i class="fa fa-table fa-fw"></i><?= $this->a(t('Back to the board'), 'board', 'show', array('project_id' => $project['id'])) ?></li>
|
||||
</ul>
|
||||
</div>
|
||||
<section class="sidebar-container" id="analytic-section">
|
||||
|
||||
<?= Helper\template('analytic/sidebar', array('project' => $project)) ?>
|
||||
<?= $this->render('analytic/sidebar', array('project' => $project)) ?>
|
||||
|
||||
<div class="sidebar-content">
|
||||
<?= $analytic_content_for_layout ?>
|
||||
|
|
|
|||
|
|
@ -2,13 +2,13 @@
|
|||
<h2><?= t('Reportings') ?></h2>
|
||||
<ul>
|
||||
<li>
|
||||
<?= Helper\a(t('Task distribution'), 'analytic', 'tasks', array('project_id' => $project['id'])) ?>
|
||||
<?= $this->a(t('Task distribution'), 'analytic', 'tasks', array('project_id' => $project['id'])) ?>
|
||||
</li>
|
||||
<li>
|
||||
<?= Helper\a(t('User repartition'), 'analytic', 'users', array('project_id' => $project['id'])) ?>
|
||||
<?= $this->a(t('User repartition'), 'analytic', 'users', array('project_id' => $project['id'])) ?>
|
||||
</li>
|
||||
<li>
|
||||
<?= Helper\a(t('Cumulative flow diagram'), 'analytic', 'cfd', array('project_id' => $project['id'])) ?>
|
||||
<?= $this->a(t('Cumulative flow diagram'), 'analytic', 'cfd', array('project_id' => $project['id'])) ?>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
|
@ -7,7 +7,7 @@
|
|||
<?php else: ?>
|
||||
<section id="analytic-task-repartition">
|
||||
|
||||
<div id="chart" data-url="<?= Helper\u('analytic', 'tasks', array('project_id' => $project['id'])) ?>"></div>
|
||||
<div id="chart" data-url="<?= $this->u('analytic', 'tasks', array('project_id' => $project['id'])) ?>"></div>
|
||||
|
||||
<table>
|
||||
<tr>
|
||||
|
|
@ -18,7 +18,7 @@
|
|||
<?php foreach ($metrics as $metric): ?>
|
||||
<tr>
|
||||
<td>
|
||||
<?= Helper\escape($metric['column_title']) ?>
|
||||
<?= $this->e($metric['column_title']) ?>
|
||||
</td>
|
||||
<td>
|
||||
<?= $metric['nb_tasks'] ?>
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@
|
|||
<?php else: ?>
|
||||
<section id="analytic-user-repartition">
|
||||
|
||||
<div id="chart" data-url="<?= Helper\u('analytic', 'users', array('project_id' => $project['id'])) ?>"></div>
|
||||
<div id="chart" data-url="<?= $this->u('analytic', 'users', array('project_id' => $project['id'])) ?>"></div>
|
||||
|
||||
<table>
|
||||
<tr>
|
||||
|
|
@ -18,7 +18,7 @@
|
|||
<?php foreach ($metrics as $metric): ?>
|
||||
<tr>
|
||||
<td>
|
||||
<?= Helper\escape($metric['user']) ?>
|
||||
<?= $this->e($metric['user']) ?>
|
||||
</td>
|
||||
<td>
|
||||
<?= $metric['nb_tasks'] ?>
|
||||
|
|
|
|||
|
|
@ -1,26 +1,26 @@
|
|||
<section id="main">
|
||||
<div class="page-header">
|
||||
<ul>
|
||||
<?php if (Helper\is_admin()): ?>
|
||||
<li><i class="fa fa-plus fa-fw"></i><?= Helper\a(t('New project'), 'project', 'create') ?></li>
|
||||
<?php if ($this->acl->isAdminUser()): ?>
|
||||
<li><i class="fa fa-plus fa-fw"></i><?= $this->a(t('New project'), 'project', 'create') ?></li>
|
||||
<?php endif ?>
|
||||
<li><i class="fa fa-lock fa-fw"></i><?= Helper\a(t('New private project'), 'project', 'create', array('private' => 1)) ?></li>
|
||||
<li><i class="fa fa-folder fa-fw"></i><?= Helper\a(t('Project management'), 'project', 'index') ?></li>
|
||||
<?php if (Helper\is_admin()): ?>
|
||||
<li><i class="fa fa-user fa-fw"></i><?= Helper\a(t('User management'), 'user', 'index') ?></li>
|
||||
<li><i class="fa fa-cog fa-fw"></i><?= Helper\a(t('Settings'), 'config', 'index') ?></li>
|
||||
<li><i class="fa fa-lock fa-fw"></i><?= $this->a(t('New private project'), 'project', 'create', array('private' => 1)) ?></li>
|
||||
<li><i class="fa fa-folder fa-fw"></i><?= $this->a(t('Project management'), 'project', 'index') ?></li>
|
||||
<?php if ($this->acl->isAdminUser()): ?>
|
||||
<li><i class="fa fa-user fa-fw"></i><?= $this->a(t('User management'), 'user', 'index') ?></li>
|
||||
<li><i class="fa fa-cog fa-fw"></i><?= $this->a(t('Settings'), 'config', 'index') ?></li>
|
||||
<?php endif ?>
|
||||
</ul>
|
||||
</div>
|
||||
<section id="dashboard">
|
||||
<div class="dashboard-left-column">
|
||||
<?= Helper\Template('app/projects', array('projects' => $projects, 'pagination' => $project_pagination)) ?>
|
||||
<?= Helper\Template('app/tasks', array('tasks' => $tasks, 'pagination' => $task_pagination)) ?>
|
||||
<?= Helper\Template('app/subtasks', array('subtasks' => $subtasks, 'pagination' => $subtask_pagination)) ?>
|
||||
<?= $this->render('app/projects', array('projects' => $projects, 'pagination' => $project_pagination)) ?>
|
||||
<?= $this->render('app/tasks', array('tasks' => $tasks, 'pagination' => $task_pagination)) ?>
|
||||
<?= $this->render('app/subtasks', array('subtasks' => $subtasks, 'pagination' => $subtask_pagination)) ?>
|
||||
</div>
|
||||
<div class="dashboard-right-column">
|
||||
<h2><?= t('Activity stream') ?></h2>
|
||||
<?= Helper\template('project/events', array('events' => $events)) ?>
|
||||
<?= $this->render('project/events', array('events' => $events)) ?>
|
||||
</div>
|
||||
</section>
|
||||
</section>
|
||||
|
|
@ -4,30 +4,30 @@
|
|||
<?php else: ?>
|
||||
<table class="table-fixed">
|
||||
<tr>
|
||||
<th class="column-8"><?= Helper\order('Id', 'id', $pagination) ?></th>
|
||||
<th class="column-20"><?= Helper\order(t('Project'), 'name', $pagination) ?></th>
|
||||
<th class="column-8"><?= $this->order('Id', 'id', $pagination) ?></th>
|
||||
<th class="column-20"><?= $this->order(t('Project'), 'name', $pagination) ?></th>
|
||||
<th><?= t('Columns') ?></th>
|
||||
</tr>
|
||||
<?php foreach ($projects as $project): ?>
|
||||
<tr>
|
||||
<td>
|
||||
<?= Helper\a('#'.$project['id'], 'board', 'show', array('project_id' => $project['id']), false, 'dashboard-table-link') ?>
|
||||
<?= $this->a('#'.$project['id'], 'board', 'show', array('project_id' => $project['id']), false, 'dashboard-table-link') ?>
|
||||
</td>
|
||||
<td>
|
||||
<?php if (Helper\is_project_admin($project)): ?>
|
||||
<?= Helper\a('<i class="fa fa-cog"></i>', 'project', 'show', array('project_id' => $project['id']), false, 'dashboard-table-link', t('Settings')) ?>
|
||||
<?php if ($this->projectPermission->adminAllowed($project['id'], $this->acl->getUserId())): ?>
|
||||
<?= $this->a('<i class="fa fa-cog"></i>', 'project', 'show', array('project_id' => $project['id']), false, 'dashboard-table-link', t('Settings')) ?>
|
||||
<?php endif ?>
|
||||
<?= Helper\a(Helper\escape($project['name']), 'board', 'show', array('project_id' => $project['id'])) ?>
|
||||
<?= $this->a($this->e($project['name']), 'board', 'show', array('project_id' => $project['id'])) ?>
|
||||
</td>
|
||||
<td class="dashboard-project-stats">
|
||||
<?php foreach ($project['columns'] as $column): ?>
|
||||
<strong title="<?= t('Task count') ?>"><?= $column['nb_tasks'] ?></strong>
|
||||
<span><?= Helper\escape($column['title']) ?></span>
|
||||
<span><?= $this->e($column['title']) ?></span>
|
||||
<?php endforeach ?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endforeach ?>
|
||||
</table>
|
||||
|
||||
<?= Helper\paginate($pagination) ?>
|
||||
<?= $this->paginate($pagination) ?>
|
||||
<?php endif ?>
|
||||
|
|
@ -4,28 +4,28 @@
|
|||
<?php else: ?>
|
||||
<table class="table-fixed">
|
||||
<tr>
|
||||
<th class="column-10"><?= Helper\order('Id', 'tasks.id', $pagination) ?></th>
|
||||
<th class="column-20"><?= Helper\order(t('Project'), 'project_name', $pagination) ?></th>
|
||||
<th class="column-15"><?= Helper\order(t('Status'), 'status', $pagination) ?></th>
|
||||
<th><?= Helper\order(t('Subtask'), 'title', $pagination) ?></th>
|
||||
<th class="column-10"><?= $this->order('Id', 'tasks.id', $pagination) ?></th>
|
||||
<th class="column-20"><?= $this->order(t('Project'), 'project_name', $pagination) ?></th>
|
||||
<th class="column-15"><?= $this->order(t('Status'), 'status', $pagination) ?></th>
|
||||
<th><?= $this->order(t('Subtask'), 'title', $pagination) ?></th>
|
||||
</tr>
|
||||
<?php foreach ($subtasks as $subtask): ?>
|
||||
<tr>
|
||||
<td class="task-table task-<?= $subtask['color_id'] ?>">
|
||||
<?= Helper\a('#'.$subtask['task_id'], 'task', 'show', array('task_id' => $subtask['task_id'])) ?>
|
||||
<?= $this->a('#'.$subtask['task_id'], 'task', 'show', array('task_id' => $subtask['task_id'])) ?>
|
||||
</td>
|
||||
<td>
|
||||
<?= Helper\a(Helper\escape($subtask['project_name']), 'board', 'show', array('project_id' => $subtask['project_id'])) ?>
|
||||
<?= $this->a($this->e($subtask['project_name']), 'board', 'show', array('project_id' => $subtask['project_id'])) ?>
|
||||
</td>
|
||||
<td>
|
||||
<?= Helper\escape($subtask['status_name']) ?>
|
||||
<?= $this->e($subtask['status_name']) ?>
|
||||
</td>
|
||||
<td>
|
||||
<?= Helper\a(Helper\escape($subtask['title']), 'task', 'show', array('task_id' => $subtask['task_id'])) ?>
|
||||
<?= $this->a($this->e($subtask['title']), 'task', 'show', array('task_id' => $subtask['task_id'])) ?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endforeach ?>
|
||||
</table>
|
||||
|
||||
<?= Helper\paginate($pagination) ?>
|
||||
<?= $this->paginate($pagination) ?>
|
||||
<?php endif ?>
|
||||
|
|
@ -4,21 +4,21 @@
|
|||
<?php else: ?>
|
||||
<table class="table-fixed">
|
||||
<tr>
|
||||
<th class="column-8"><?= Helper\order('Id', 'tasks.id', $pagination) ?></th>
|
||||
<th class="column-20"><?= Helper\order(t('Project'), 'project_name', $pagination) ?></th>
|
||||
<th><?= Helper\order(t('Task'), 'title', $pagination) ?></th>
|
||||
<th class="column-20"><?= Helper\order(t('Due date'), 'date_due', $pagination) ?></th>
|
||||
<th class="column-8"><?= $this->order('Id', 'tasks.id', $pagination) ?></th>
|
||||
<th class="column-20"><?= $this->order(t('Project'), 'project_name', $pagination) ?></th>
|
||||
<th><?= $this->order(t('Task'), 'title', $pagination) ?></th>
|
||||
<th class="column-20"><?= $this->order(t('Due date'), 'date_due', $pagination) ?></th>
|
||||
</tr>
|
||||
<?php foreach ($tasks as $task): ?>
|
||||
<tr>
|
||||
<td class="task-table task-<?= $task['color_id'] ?>">
|
||||
<?= Helper\a('#'.$task['id'], 'task', 'show', array('task_id' => $task['id'])) ?>
|
||||
<?= $this->a('#'.$task['id'], 'task', 'show', array('task_id' => $task['id'])) ?>
|
||||
</td>
|
||||
<td>
|
||||
<?= Helper\a(Helper\escape($task['project_name']), 'board', 'show', array('project_id' => $task['project_id'])) ?>
|
||||
<?= $this->a($this->e($task['project_name']), 'board', 'show', array('project_id' => $task['project_id'])) ?>
|
||||
</td>
|
||||
<td>
|
||||
<?= Helper\a(Helper\escape($task['title']), 'task', 'show', array('task_id' => $task['id'])) ?>
|
||||
<?= $this->a($this->e($task['title']), 'task', 'show', array('task_id' => $task['id'])) ?>
|
||||
</td>
|
||||
<td>
|
||||
<?= dt('%B %e, %Y', $task['date_due']) ?>
|
||||
|
|
@ -27,5 +27,5 @@
|
|||
<?php endforeach ?>
|
||||
</table>
|
||||
|
||||
<?= Helper\paginate($pagination) ?>
|
||||
<?= $this->paginate($pagination) ?>
|
||||
<?php endif ?>
|
||||
|
|
@ -1,20 +1,20 @@
|
|||
<section id="main">
|
||||
<section>
|
||||
<h3><?= t('Change assignee for the task "%s"', $values['title']) ?></h3>
|
||||
<form method="post" action="<?= Helper\u('board', 'updateAssignee', array('task_id' => $values['id'])) ?>">
|
||||
<form method="post" action="<?= $this->u('board', 'updateAssignee', array('task_id' => $values['id'])) ?>">
|
||||
|
||||
<?= Helper\form_csrf() ?>
|
||||
<?= $this->formCsrf() ?>
|
||||
|
||||
<?= Helper\form_hidden('id', $values) ?>
|
||||
<?= Helper\form_hidden('project_id', $values) ?>
|
||||
<?= $this->formHidden('id', $values) ?>
|
||||
<?= $this->formHidden('project_id', $values) ?>
|
||||
|
||||
<?= Helper\form_label(t('Assignee'), 'owner_id') ?>
|
||||
<?= Helper\form_select('owner_id', $users_list, $values) ?><br/>
|
||||
<?= $this->formLabel(t('Assignee'), 'owner_id') ?>
|
||||
<?= $this->formSelect('owner_id', $users_list, $values) ?><br/>
|
||||
|
||||
<div class="form-actions">
|
||||
<input type="submit" value="<?= t('Save') ?>" class="btn btn-blue"/>
|
||||
<?= t('or') ?>
|
||||
<?= Helper\a(t('cancel'), 'board', 'show', array('project_id' => $project['id'])) ?>
|
||||
<?= $this->a(t('cancel'), 'board', 'show', array('project_id' => $project['id'])) ?>
|
||||
</div>
|
||||
</form>
|
||||
</section>
|
||||
|
|
|
|||
|
|
@ -1,20 +1,20 @@
|
|||
<section id="main">
|
||||
<section>
|
||||
<h3><?= t('Change category for the task "%s"', $values['title']) ?></h3>
|
||||
<form method="post" action="<?= Helper\u('board', 'updateCategory', array('task_id' => $values['id'])) ?>">
|
||||
<form method="post" action="<?= $this->u('board', 'updateCategory', array('task_id' => $values['id'])) ?>">
|
||||
|
||||
<?= Helper\form_csrf() ?>
|
||||
<?= $this->formCsrf() ?>
|
||||
|
||||
<?= Helper\form_hidden('id', $values) ?>
|
||||
<?= Helper\form_hidden('project_id', $values) ?>
|
||||
<?= $this->formHidden('id', $values) ?>
|
||||
<?= $this->formHidden('project_id', $values) ?>
|
||||
|
||||
<?= Helper\form_label(t('Category'), 'category_id') ?>
|
||||
<?= Helper\form_select('category_id', $categories_list, $values) ?><br/>
|
||||
<?= $this->formLabel(t('Category'), 'category_id') ?>
|
||||
<?= $this->formSelect('category_id', $categories_list, $values) ?><br/>
|
||||
|
||||
<div class="form-actions">
|
||||
<input type="submit" value="<?= t('Save') ?>" class="btn btn-blue"/>
|
||||
<?= t('or') ?>
|
||||
<?= Helper\a(t('cancel'), 'board', 'show', array('project_id' => $project['id'])) ?>
|
||||
<?= $this->a(t('cancel'), 'board', 'show', array('project_id' => $project['id'])) ?>
|
||||
</div>
|
||||
</form>
|
||||
</section>
|
||||
|
|
|
|||
|
|
@ -1,12 +1,12 @@
|
|||
<section>
|
||||
<?php foreach ($comments as $comment): ?>
|
||||
<p class="comment-title">
|
||||
<span class="comment-username"><?= Helper\escape($comment['name'] ?: $comment['username']) ?></span> @ <span class="comment-date"><?= dt('%b %e, %Y, %k:%M %p', $comment['date']) ?></span>
|
||||
<span class="comment-username"><?= $this->e($comment['name'] ?: $comment['username']) ?></span> @ <span class="comment-date"><?= dt('%b %e, %Y, %k:%M %p', $comment['date']) ?></span>
|
||||
</p>
|
||||
|
||||
<div class="comment-inner">
|
||||
<div class="markdown">
|
||||
<?= Helper\markdown($comment['comment']) ?>
|
||||
<?= $this->markdown($comment['comment']) ?>
|
||||
</div>
|
||||
</div>
|
||||
<?php endforeach ?>
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
<section class="tooltip-large">
|
||||
<div class="markdown">
|
||||
<?= Helper\markdown($task['description']) ?>
|
||||
<?= $this->markdown($task['description']) ?>
|
||||
</div>
|
||||
</section>
|
||||
|
|
@ -4,8 +4,8 @@
|
|||
<section>
|
||||
|
||||
<h3><?= t('Change columns') ?></h3>
|
||||
<form method="post" action="<?= Helper\u('board', 'update', array('project_id' => $project['id'])) ?>" autocomplete="off">
|
||||
<?= Helper\form_csrf() ?>
|
||||
<form method="post" action="<?= $this->u('board', 'update', array('project_id' => $project['id'])) ?>" autocomplete="off">
|
||||
<?= $this->formCsrf() ?>
|
||||
<?php $i = 0; ?>
|
||||
<table>
|
||||
<tr>
|
||||
|
|
@ -16,23 +16,23 @@
|
|||
</tr>
|
||||
<?php foreach ($columns as $column): ?>
|
||||
<tr>
|
||||
<td><?= Helper\form_label('#'.++$i, 'title['.$column['id'].']', array('title="column_id='.$column['id'].'"')) ?></td>
|
||||
<td><?= Helper\form_text('title['.$column['id'].']', $values, $errors, array('required')) ?></td>
|
||||
<td><?= Helper\form_number('task_limit['.$column['id'].']', $values, $errors, array('placeholder="'.t('limit').'"')) ?></td>
|
||||
<td><?= $this->formLabel('#'.++$i, 'title['.$column['id'].']', array('title="column_id='.$column['id'].'"')) ?></td>
|
||||
<td><?= $this->formText('title['.$column['id'].']', $values, $errors, array('required')) ?></td>
|
||||
<td><?= $this->formNumber('task_limit['.$column['id'].']', $values, $errors, array('placeholder="'.t('limit').'"')) ?></td>
|
||||
<td>
|
||||
<ul>
|
||||
<?php if ($column['position'] != 1): ?>
|
||||
<li>
|
||||
<?= Helper\a(t('Move Up'), 'board', 'moveColumn', array('project_id' => $project['id'], 'column_id' => $column['id'], 'direction' => 'up'), true) ?>
|
||||
<?= $this->a(t('Move Up'), 'board', 'moveColumn', array('project_id' => $project['id'], 'column_id' => $column['id'], 'direction' => 'up'), true) ?>
|
||||
</li>
|
||||
<?php endif ?>
|
||||
<?php if ($column['position'] != count($columns)): ?>
|
||||
<li>
|
||||
<?= Helper\a(t('Move Down'), 'board', 'moveColumn', array('project_id' => $project['id'], 'column_id' => $column['id'], 'direction' => 'down'), true) ?>
|
||||
<?= $this->a(t('Move Down'), 'board', 'moveColumn', array('project_id' => $project['id'], 'column_id' => $column['id'], 'direction' => 'down'), true) ?>
|
||||
</li>
|
||||
<?php endif ?>
|
||||
<li>
|
||||
<?= Helper\a(t('Remove'), 'board', 'remove', array('project_id' => $project['id'], 'column_id' => $column['id'])) ?>
|
||||
<?= $this->a(t('Remove'), 'board', 'remove', array('project_id' => $project['id'], 'column_id' => $column['id'])) ?>
|
||||
</li>
|
||||
</ul>
|
||||
</td>
|
||||
|
|
@ -46,14 +46,14 @@
|
|||
</form>
|
||||
<hr/>
|
||||
<h3><?= t('Add a new column') ?></h3>
|
||||
<form method="post" action="<?= Helper\u('board', 'add', array('project_id' => $project['id'])) ?>" autocomplete="off">
|
||||
<form method="post" action="<?= $this->u('board', 'add', array('project_id' => $project['id'])) ?>" autocomplete="off">
|
||||
|
||||
<?= Helper\form_csrf() ?>
|
||||
<?= $this->formCsrf() ?>
|
||||
|
||||
<?= Helper\form_hidden('project_id', $values) ?>
|
||||
<?= $this->formHidden('project_id', $values) ?>
|
||||
|
||||
<?= Helper\form_label(t('Title'), 'title') ?>
|
||||
<?= Helper\form_text('title', $values, $errors, array('required')) ?>
|
||||
<?= $this->formLabel(t('Title'), 'title') ?>
|
||||
<?= $this->formText('title', $values, $errors, array('required')) ?>
|
||||
|
||||
<div class="form-actions">
|
||||
<input type="submit" value="<?= t('Add this column') ?>" class="btn btn-blue"/>
|
||||
|
|
|
|||
|
|
@ -2,8 +2,8 @@
|
|||
<?php foreach ($files as $file): ?>
|
||||
<i class="fa fa-file-o fa-fw"></i>
|
||||
|
||||
<?= Helper\a(
|
||||
Helper\escape($file['name']),
|
||||
<?= $this->a(
|
||||
$this->e($file['name']),
|
||||
'file',
|
||||
'download',
|
||||
array('file_id' => $file['id'], 'task_id' => $file['task_id'])
|
||||
|
|
|
|||
|
|
@ -2,34 +2,34 @@
|
|||
<ul class="board-filters">
|
||||
<li class="hide-tablet">
|
||||
<?= t('Filter by user') ?>
|
||||
<?= Helper\form_select('user_id', $users) ?>
|
||||
<?= $this->formSelect('user_id', $users) ?>
|
||||
</li>
|
||||
<li class="hide-tablet">
|
||||
<?= t('Filter by category') ?>
|
||||
<?= Helper\form_select('category_id', $categories) ?>
|
||||
<?= $this->formSelect('category_id', $categories) ?>
|
||||
</li>
|
||||
<li class="hide-tablet">
|
||||
<a href="#" id="filter-due-date"><?= t('Filter by due date') ?></a>
|
||||
</li>
|
||||
<li>
|
||||
<i class="fa fa-search"></i>
|
||||
<?= Helper\a(t('Search'), 'project', 'search', array('project_id' => $project['id'])) ?>
|
||||
<?= $this->a(t('Search'), 'project', 'search', array('project_id' => $project['id'])) ?>
|
||||
</li>
|
||||
<li>
|
||||
<i class="fa fa-check-square-o fa-fw"></i>
|
||||
<?= Helper\a(t('Completed tasks'), 'project', 'tasks', array('project_id' => $project['id'])) ?>
|
||||
<?= $this->a(t('Completed tasks'), 'project', 'tasks', array('project_id' => $project['id'])) ?>
|
||||
</li>
|
||||
<li>
|
||||
<i class="fa fa-dashboard fa-fw"></i>
|
||||
<?= Helper\a(t('Activity'), 'project', 'activity', array('project_id' => $project['id'])) ?>
|
||||
<?= $this->a(t('Activity'), 'project', 'activity', array('project_id' => $project['id'])) ?>
|
||||
</li>
|
||||
<li>
|
||||
<i class="fa fa-line-chart fa-fw"></i>
|
||||
<?= Helper\a(t('Analytics'), 'analytic', 'tasks', array('project_id' => $project['id'])) ?>
|
||||
<?= $this->a(t('Analytics'), 'analytic', 'tasks', array('project_id' => $project['id'])) ?>
|
||||
</li>
|
||||
<?php if (Helper\is_admin()): ?>
|
||||
<?php if ($this->projectPermission->adminAllowed($project['id'], $this->acl->getUserId())): ?>
|
||||
<li><i class="fa fa-cog fa-fw"></i>
|
||||
<?= Helper\a(t('Configure'), 'project', 'show', array('project_id' => $project['id'])) ?>
|
||||
<?= $this->a(t('Configure'), 'project', 'show', array('project_id' => $project['id'])) ?>
|
||||
<?php endif ?>
|
||||
</ul>
|
||||
</div>
|
||||
|
|
@ -1,12 +1,12 @@
|
|||
<section id="main">
|
||||
|
||||
<?= Helper\template('board/filters', array(
|
||||
<?= $this->render('board/filters', array(
|
||||
'categories' => $categories,
|
||||
'users' => $users,
|
||||
'project' => $project,
|
||||
)) ?>
|
||||
|
||||
<?= Helper\template('board/show', array(
|
||||
<?= $this->render('board/show', array(
|
||||
'project' => $project,
|
||||
'swimlanes' => $swimlanes,
|
||||
'categories' => $categories,
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
<section id="main" class="public-board">
|
||||
|
||||
<?= Helper\template('board/show', array(
|
||||
<?= $this->render('board/show', array(
|
||||
'project' => $project,
|
||||
'swimlanes' => $swimlanes,
|
||||
'categories' => $categories,
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@
|
|||
</p>
|
||||
|
||||
<div class="form-actions">
|
||||
<?= Helper\a(t('Yes'), 'board', 'remove', array('project_id' => $project['id'], 'column_id' => $column['id'], 'remove' => 'yes'), true, 'btn btn-red') ?>
|
||||
<?= t('or') ?> <?= Helper\a(t('cancel'), 'board', 'edit', array('project_id' => $project['id'])) ?>
|
||||
<?= $this->a(t('Yes'), 'board', 'remove', array('project_id' => $project['id'], 'column_id' => $column['id'], 'remove' => 'yes'), true, 'btn btn-red') ?>
|
||||
<?= t('or') ?> <?= $this->a(t('cancel'), 'board', 'edit', array('project_id' => $project['id'])) ?>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -5,8 +5,8 @@
|
|||
<table id="board"
|
||||
data-project-id="<?= $project['id'] ?>"
|
||||
data-check-interval="<?= $board_private_refresh_interval ?>"
|
||||
data-save-url="<?= Helper\u('board', 'save', array('project_id' => $project['id'])) ?>"
|
||||
data-check-url="<?= Helper\u('board', 'check', array('project_id' => $project['id'], 'timestamp' => time())) ?>"
|
||||
data-save-url="<?= $this->u('board', 'save', array('project_id' => $project['id'])) ?>"
|
||||
data-check-url="<?= $this->u('board', 'check', array('project_id' => $project['id'], 'timestamp' => time())) ?>"
|
||||
>
|
||||
<?php endif ?>
|
||||
|
||||
|
|
@ -15,7 +15,7 @@
|
|||
<p class="alert alert-error"><?= t('There is no column in your project!') ?></p>
|
||||
<?php break ?>
|
||||
<?php else: ?>
|
||||
<?= Helper\template('board/swimlane', array(
|
||||
<?= $this->render('board/swimlane', array(
|
||||
'project' => $project,
|
||||
'swimlane' => $swimlane,
|
||||
'board_highlight_period' => $board_highlight_period,
|
||||
|
|
|
|||
|
|
@ -1,13 +1,13 @@
|
|||
<section id="tooltip-subtasks">
|
||||
<?php foreach ($subtasks as $subtask): ?>
|
||||
<?= Helper\a(
|
||||
trim(Helper\template('subtask/icons', array('subtask' => $subtask))) . Helper\escape($subtask['title']),
|
||||
<?= $this->a(
|
||||
trim($this->render('subtask/icons', array('subtask' => $subtask))) . $this->e($subtask['title']),
|
||||
'board',
|
||||
'toggleSubtask',
|
||||
array('task_id' => $subtask['task_id'], 'subtask_id' => $subtask['id'])
|
||||
) ?>
|
||||
|
||||
<?= Helper\escape(empty($subtask['username']) ? '' : ' ['.Helper\get_username($subtask).']') ?>
|
||||
<?= $this->e(empty($subtask['username']) ? '' : ' ['.$this->getFullname($subtask).']') ?>
|
||||
|
||||
<br/>
|
||||
<?php endforeach ?>
|
||||
|
|
|
|||
|
|
@ -7,15 +7,15 @@
|
|||
<th>
|
||||
<?php if (! $not_editable): ?>
|
||||
<div class="board-add-icon">
|
||||
<?= Helper\a('+', 'task', 'create', array('project_id' => $column['project_id'], 'column_id' => $column['id'], 'swimlane_id' => $swimlane['id']), false, 'task-creation-popover', t('Add a new task')) ?>
|
||||
<?= $this->a('+', 'task', 'create', array('project_id' => $column['project_id'], 'column_id' => $column['id'], 'swimlane_id' => $swimlane['id']), false, 'task-creation-popover', t('Add a new task')) ?>
|
||||
</div>
|
||||
<?php endif ?>
|
||||
|
||||
<?= Helper\escape($column['title']) ?>
|
||||
<?= $this->e($column['title']) ?>
|
||||
|
||||
<?php if ($column['task_limit']): ?>
|
||||
<span title="<?= t('Task limit') ?>" class="task-limit">
|
||||
(<span id="task-number-column-<?= $column['id'] ?>"><?= $column['nb_tasks'] ?></span>/<?= Helper\escape($column['task_limit']) ?>)
|
||||
(<span id="task-number-column-<?= $column['id'] ?>"><?= $column['nb_tasks'] ?></span>/<?= $this->e($column['task_limit']) ?>)
|
||||
</span>
|
||||
<?php else: ?>
|
||||
<span title="<?= t('Task count') ?>" class="task-count">
|
||||
|
|
@ -28,7 +28,7 @@
|
|||
<tr>
|
||||
<?php if (! $hide_swimlane): ?>
|
||||
<th class="board-swimlane-title">
|
||||
<?= Helper\escape($swimlane['name']) ?>
|
||||
<?= $this->e($swimlane['name']) ?>
|
||||
</th>
|
||||
<?php endif ?>
|
||||
|
||||
|
|
@ -46,7 +46,7 @@
|
|||
<?php endif ?>
|
||||
|
||||
<?php foreach ($column['tasks'] as $task): ?>
|
||||
<?= Helper\template('board/task', array(
|
||||
<?= $this->render('board/task', array(
|
||||
'project' => $project,
|
||||
'task' => $task,
|
||||
'categories' => $categories,
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@
|
|||
|
||||
<div class="task-board task-<?= $task['color_id'] ?> <?= $task['date_modification'] > time() - $board_highlight_period ? 'task-board-recent' : '' ?>">
|
||||
|
||||
<?= Helper\a('#'.$task['id'], 'task', 'readonly', array('task_id' => $task['id'], 'token' => $project['token'])) ?>
|
||||
<?= $this->a('#'.$task['id'], 'task', 'readonly', array('task_id' => $task['id'], 'token' => $project['token'])) ?>
|
||||
|
||||
<?php if ($task['reference']): ?>
|
||||
<span class="task-board-reference" title="<?= t('Reference') ?>">
|
||||
|
|
@ -23,11 +23,11 @@
|
|||
</span>
|
||||
|
||||
<?php if ($task['score']): ?>
|
||||
<span class="task-score"><?= Helper\escape($task['score']) ?></span>
|
||||
<span class="task-score"><?= $this->e($task['score']) ?></span>
|
||||
<?php endif ?>
|
||||
|
||||
<div class="task-board-title">
|
||||
<?= Helper\a(Helper\escape($task['title']), 'task', 'readonly', array('task_id' => $task['id'], 'token' => $project['token'])) ?>
|
||||
<?= $this->a($this->e($task['title']), 'task', 'readonly', array('task_id' => $task['id'], 'token' => $project['token'])) ?>
|
||||
</div>
|
||||
|
||||
<?php else: ?>
|
||||
|
|
@ -37,10 +37,10 @@
|
|||
data-owner-id="<?= $task['owner_id'] ?>"
|
||||
data-category-id="<?= $task['category_id'] ?>"
|
||||
data-due-date="<?= $task['date_due'] ?>"
|
||||
data-task-url="<?= Helper\u('task', 'show', array('task_id' => $task['id'])) ?>"
|
||||
data-task-url="<?= $this->u('task', 'show', array('task_id' => $task['id'])) ?>"
|
||||
title="<?= t('View this task') ?>">
|
||||
|
||||
<?= Helper\a('#'.$task['id'], 'task', 'edit', array('task_id' => $task['id']), false, 'task-edit-popover', t('Edit this task')) ?>
|
||||
<?= $this->a('#'.$task['id'], 'task', 'edit', array('task_id' => $task['id']), false, 'task-edit-popover', t('Edit this task')) ?>
|
||||
|
||||
<?php if ($task['reference']): ?>
|
||||
<span class="task-board-reference" title="<?= t('Reference') ?>">
|
||||
|
|
@ -51,9 +51,9 @@
|
|||
-
|
||||
|
||||
<span class="task-board-user">
|
||||
<?= Helper\a(
|
||||
<?= $this->a(
|
||||
(! empty($task['owner_id']) ? t('Assigned to %s', $task['assignee_name'] ?: $task['assignee_username']) : t('Nobody assigned')) .
|
||||
( Helper\is_current_user($task['owner_id']) ? ' <i class="fa fa-star"></i>' : ''),
|
||||
( $this->acl->isCurrentUser($task['owner_id']) ? ' <i class="fa fa-star"></i>' : ''),
|
||||
'board',
|
||||
'changeAssignee',
|
||||
array('task_id' => $task['id']),
|
||||
|
|
@ -64,11 +64,11 @@
|
|||
</span>
|
||||
|
||||
<?php if ($task['score']): ?>
|
||||
<span class="task-score"><?= Helper\escape($task['score']) ?></span>
|
||||
<span class="task-score"><?= $this->e($task['score']) ?></span>
|
||||
<?php endif ?>
|
||||
|
||||
<div class="task-board-title">
|
||||
<?= Helper\a(Helper\escape($task['title']), 'task', 'show', array('task_id' => $task['id']), false, '', t('View this task')) ?>
|
||||
<?= $this->a($this->e($task['title']), 'task', 'show', array('task_id' => $task['id']), false, '', t('View this task')) ?>
|
||||
</div>
|
||||
|
||||
<?php endif ?>
|
||||
|
|
@ -77,8 +77,8 @@
|
|||
<?php if ($task['category_id']): ?>
|
||||
<div class="task-board-category-container">
|
||||
<span class="task-board-category">
|
||||
<?= Helper\a(
|
||||
Helper\in_list($task['category_id'], $categories),
|
||||
<?= $this->a(
|
||||
$this->inList($task['category_id'], $categories),
|
||||
'board',
|
||||
'changeCategory',
|
||||
array('task_id' => $task['id']),
|
||||
|
|
@ -103,19 +103,19 @@
|
|||
<div class="task-board-icons">
|
||||
|
||||
<?php if (! empty($task['nb_subtasks'])): ?>
|
||||
<span title="<?= t('Sub-Tasks') ?>" class="task-board-tooltip" data-href="<?= helper\u('board', 'subtasks', array('task_id' => $task['id'])) ?>"><?= $task['nb_completed_subtasks'].'/'.$task['nb_subtasks'] ?> <i class="fa fa-bars"></i></span>
|
||||
<span title="<?= t('Sub-Tasks') ?>" class="task-board-tooltip" data-href="<?= $this->u('board', 'subtasks', array('task_id' => $task['id'])) ?>"><?= $task['nb_completed_subtasks'].'/'.$task['nb_subtasks'] ?> <i class="fa fa-bars"></i></span>
|
||||
<?php endif ?>
|
||||
|
||||
<?php if (! empty($task['nb_files'])): ?>
|
||||
<span title="<?= t('Attachments') ?>" class="task-board-tooltip" data-href="<?= helper\u('board', 'attachments', array('task_id' => $task['id'])) ?>"><?= $task['nb_files'] ?> <i class="fa fa-paperclip"></i></span>
|
||||
<span title="<?= t('Attachments') ?>" class="task-board-tooltip" data-href="<?= $this->u('board', 'attachments', array('task_id' => $task['id'])) ?>"><?= $task['nb_files'] ?> <i class="fa fa-paperclip"></i></span>
|
||||
<?php endif ?>
|
||||
|
||||
<?php if (! empty($task['nb_comments'])): ?>
|
||||
<span title="<?= p($task['nb_comments'], t('%d comment', $task['nb_comments']), t('%d comments', $task['nb_comments'])) ?>" class="task-board-tooltip" data-href="<?= helper\u('board', 'comments', array('task_id' => $task['id'])) ?>"><?= $task['nb_comments'] ?> <i class="fa fa-comment-o"></i></span>
|
||||
<span title="<?= p($task['nb_comments'], t('%d comment', $task['nb_comments']), t('%d comments', $task['nb_comments'])) ?>" class="task-board-tooltip" data-href="<?= $this->u('board', 'comments', array('task_id' => $task['id'])) ?>"><?= $task['nb_comments'] ?> <i class="fa fa-comment-o"></i></span>
|
||||
<?php endif ?>
|
||||
|
||||
<?php if (! empty($task['description'])): ?>
|
||||
<span title="<?= t('Description') ?>" class="task-board-tooltip" data-href="<?= helper\u('board', 'description', array('task_id' => $task['id'])) ?>">
|
||||
<span title="<?= t('Description') ?>" class="task-board-tooltip" data-href="<?= $this->u('board', 'description', array('task_id' => $task['id'])) ?>">
|
||||
<?php if (! isset($not_editable)): ?>
|
||||
<a class="task-description-popover" href="?controller=task&action=description&task_id=<?= $task['id'] ?>"><i class="fa fa-file-text-o" data-href="?controller=task&action=description&task_id=<?= $task['id'] ?>"></i></a>
|
||||
<?php else: ?>
|
||||
|
|
|
|||
|
|
@ -2,15 +2,15 @@
|
|||
<h2><?= t('Category modification for the project "%s"', $project['name']) ?></h2>
|
||||
</div>
|
||||
|
||||
<form method="post" action="<?= Helper\u('category', 'update', array('project_id' => $project['id'], 'category_id' => $values['id'])) ?>" autocomplete="off">
|
||||
<form method="post" action="<?= $this->u('category', 'update', array('project_id' => $project['id'], 'category_id' => $values['id'])) ?>" autocomplete="off">
|
||||
|
||||
<?= Helper\form_csrf() ?>
|
||||
<?= $this->formCsrf() ?>
|
||||
|
||||
<?= Helper\form_hidden('id', $values) ?>
|
||||
<?= Helper\form_hidden('project_id', $values) ?>
|
||||
<?= $this->formHidden('id', $values) ?>
|
||||
<?= $this->formHidden('project_id', $values) ?>
|
||||
|
||||
<?= Helper\form_label(t('Category Name'), 'name') ?>
|
||||
<?= Helper\form_text('name', $values, $errors, array('autofocus required')) ?>
|
||||
<?= $this->formLabel(t('Category Name'), 'name') ?>
|
||||
<?= $this->formText('name', $values, $errors, array('autofocus required')) ?>
|
||||
|
||||
<div class="form-actions">
|
||||
<input type="submit" value="<?= t('Save') ?>" class="btn btn-blue"/>
|
||||
|
|
|
|||
|
|
@ -9,14 +9,14 @@
|
|||
</tr>
|
||||
<?php foreach ($categories as $category_id => $category_name): ?>
|
||||
<tr>
|
||||
<td><?= Helper\escape($category_name) ?></td>
|
||||
<td><?= $this->e($category_name) ?></td>
|
||||
<td>
|
||||
<ul>
|
||||
<li>
|
||||
<?= Helper\a(t('Edit'), 'category', 'edit', array('project_id' => $project['id'], 'category_id' => $category_id)) ?>
|
||||
<?= $this->a(t('Edit'), 'category', 'edit', array('project_id' => $project['id'], 'category_id' => $category_id)) ?>
|
||||
</li>
|
||||
<li>
|
||||
<?= Helper\a(t('Remove'), 'category', 'confirm', array('project_id' => $project['id'], 'category_id' => $category_id)) ?>
|
||||
<?= $this->a(t('Remove'), 'category', 'confirm', array('project_id' => $project['id'], 'category_id' => $category_id)) ?>
|
||||
</li>
|
||||
</ul>
|
||||
</td>
|
||||
|
|
@ -28,13 +28,13 @@
|
|||
<div class="page-header">
|
||||
<h2><?= t('Add a new category') ?></h2>
|
||||
</div>
|
||||
<form method="post" action="<?= Helper\u('category', 'save', array('project_id' => $project['id'])) ?>" autocomplete="off">
|
||||
<form method="post" action="<?= $this->u('category', 'save', array('project_id' => $project['id'])) ?>" autocomplete="off">
|
||||
|
||||
<?= Helper\form_csrf() ?>
|
||||
<?= Helper\form_hidden('project_id', $values) ?>
|
||||
<?= $this->formCsrf() ?>
|
||||
<?= $this->formHidden('project_id', $values) ?>
|
||||
|
||||
<?= Helper\form_label(t('Category Name'), 'name') ?>
|
||||
<?= Helper\form_text('name', $values, $errors, array('autofocus required')) ?>
|
||||
<?= $this->formLabel(t('Category Name'), 'name') ?>
|
||||
<?= $this->formText('name', $values, $errors, array('autofocus required')) ?>
|
||||
|
||||
<div class="form-actions">
|
||||
<input type="submit" value="<?= t('Save') ?>" class="btn btn-blue"/>
|
||||
|
|
|
|||
|
|
@ -9,9 +9,9 @@
|
|||
</p>
|
||||
|
||||
<div class="form-actions">
|
||||
<?= Helper\a(t('Yes'), 'category', 'remove', array('project_id' => $project['id'], 'category_id' => $category['id']), true, 'btn btn-red') ?>
|
||||
<?= $this->a(t('Yes'), 'category', 'remove', array('project_id' => $project['id'], 'category_id' => $category['id']), true, 'btn btn-red') ?>
|
||||
<?= t('or') ?>
|
||||
<?= Helper\a(t('cancel'), 'category', 'index', array('project_id' => $project['id'])) ?>
|
||||
<?= $this->a(t('cancel'), 'category', 'index', array('project_id' => $project['id'])) ?>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
|
@ -2,10 +2,10 @@
|
|||
<h2><?= t('Add a comment') ?></h2>
|
||||
</div>
|
||||
|
||||
<form method="post" action="<?= Helper\u('comment', 'save', array('task_id' => $task['id'])) ?>" autocomplete="off">
|
||||
<?= Helper\form_csrf() ?>
|
||||
<?= Helper\form_hidden('task_id', $values) ?>
|
||||
<?= Helper\form_hidden('user_id', $values) ?>
|
||||
<form method="post" action="<?= $this->u('comment', 'save', array('task_id' => $task['id'])) ?>" autocomplete="off">
|
||||
<?= $this->formCsrf() ?>
|
||||
<?= $this->formHidden('task_id', $values) ?>
|
||||
<?= $this->formHidden('user_id', $values) ?>
|
||||
|
||||
<div class="form-tabs">
|
||||
<ul class="form-tabs-nav">
|
||||
|
|
@ -17,7 +17,7 @@
|
|||
</li>
|
||||
</ul>
|
||||
<div class="write-area">
|
||||
<?= Helper\form_textarea('comment', $values, $errors, array(! isset($skip_cancel) ? 'autofocus' : '', 'required', 'placeholder="'.t('Leave a comment').'"'), 'comment-textarea') ?>
|
||||
<?= $this->formTextarea('comment', $values, $errors, array(! isset($skip_cancel) ? 'autofocus' : '', 'required', 'placeholder="'.t('Leave a comment').'"'), 'comment-textarea') ?>
|
||||
</div>
|
||||
<div class="preview-area">
|
||||
<div class="markdown"></div>
|
||||
|
|
@ -30,7 +30,7 @@
|
|||
<input type="submit" value="<?= t('Save') ?>" class="btn btn-blue"/>
|
||||
<?php if (! isset($skip_cancel)): ?>
|
||||
<?= t('or') ?>
|
||||
<?= Helper\a(t('cancel'), 'task', 'show', array('task_id' => $task['id'])) ?>
|
||||
<?= $this->a(t('cancel'), 'task', 'show', array('task_id' => $task['id'])) ?>
|
||||
<?php endif ?>
|
||||
</div>
|
||||
</form>
|
||||
|
|
|
|||
|
|
@ -2,11 +2,11 @@
|
|||
<h2><?= t('Edit a comment') ?></h2>
|
||||
</div>
|
||||
|
||||
<form method="post" action="<?= Helper\u('comment', 'update', array('task_id' => $task['id'], 'comment_id' => $comment['id'])) ?>" autocomplete="off">
|
||||
<form method="post" action="<?= $this->u('comment', 'update', array('task_id' => $task['id'], 'comment_id' => $comment['id'])) ?>" autocomplete="off">
|
||||
|
||||
<?= Helper\form_csrf() ?>
|
||||
<?= Helper\form_hidden('id', $values) ?>
|
||||
<?= Helper\form_hidden('task_id', $values) ?>
|
||||
<?= $this->formCsrf() ?>
|
||||
<?= $this->formHidden('id', $values) ?>
|
||||
<?= $this->formHidden('task_id', $values) ?>
|
||||
|
||||
<div class="form-tabs">
|
||||
<ul class="form-tabs-nav">
|
||||
|
|
@ -18,7 +18,7 @@
|
|||
</li>
|
||||
</ul>
|
||||
<div class="write-area">
|
||||
<?= Helper\form_textarea('comment', $values, $errors, array('autofocus', 'required', 'placeholder="'.t('Leave a comment').'"'), 'comment-textarea') ?>
|
||||
<?= $this->formTextarea('comment', $values, $errors, array('autofocus', 'required', 'placeholder="'.t('Leave a comment').'"'), 'comment-textarea') ?>
|
||||
</div>
|
||||
<div class="preview-area">
|
||||
<div class="markdown"></div>
|
||||
|
|
@ -30,6 +30,6 @@
|
|||
<div class="form-actions">
|
||||
<input type="submit" value="<?= t('Update') ?>" class="btn btn-blue"/>
|
||||
<?= t('or') ?>
|
||||
<?= Helper\a(t('cancel'), 'task', 'show', array('task_id' => $task['id'])) ?>
|
||||
<?= $this->a(t('cancel'), 'task', 'show', array('task_id' => $task['id'])) ?>
|
||||
</div>
|
||||
</form>
|
||||
|
|
|
|||
|
|
@ -7,11 +7,11 @@
|
|||
<?= t('Do you really want to remove this comment?') ?>
|
||||
</p>
|
||||
|
||||
<?= Helper\template('comment/show', array('comment' => $comment, 'task' => $task, 'preview' => true)) ?>
|
||||
<?= $this->render('comment/show', array('comment' => $comment, 'task' => $task, 'preview' => true)) ?>
|
||||
|
||||
<div class="form-actions">
|
||||
<?= Helper\a(t('Yes'), 'comment', 'remove', array('task_id' => $task['id'], 'comment_id' => $comment['id']), true, 'btn btn-red') ?>
|
||||
<?= $this->a(t('Yes'), 'comment', 'remove', array('task_id' => $task['id'], 'comment_id' => $comment['id']), true, 'btn btn-red') ?>
|
||||
<?= t('or') ?>
|
||||
<?= Helper\a(t('cancel'), 'task', 'show', array('task_id' => $task['id'])) ?>
|
||||
<?= $this->a(t('cancel'), 'task', 'show', array('task_id' => $task['id'])) ?>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
<div class="comment <?= isset($preview) ? 'comment-preview' : '' ?>" id="comment-<?= $comment['id'] ?>">
|
||||
|
||||
<p class="comment-title">
|
||||
<span class="comment-username"><?= Helper\escape($comment['name'] ?: $comment['username']) ?></span> @ <span class="comment-date"><?= dt('%B %e, %Y at %k:%M %p', $comment['date']) ?></span>
|
||||
<span class="comment-username"><?= $this->e($comment['name'] ?: $comment['username']) ?></span> @ <span class="comment-date"><?= dt('%B %e, %Y at %k:%M %p', $comment['date']) ?></span>
|
||||
</p>
|
||||
|
||||
<div class="comment-inner">
|
||||
|
|
@ -9,12 +9,12 @@
|
|||
<?php if (! isset($preview)): ?>
|
||||
<ul class="comment-actions">
|
||||
<li><a href="#comment-<?= $comment['id'] ?>"><?= t('link') ?></a></li>
|
||||
<?php if ((! isset($not_editable) || ! $not_editable) && (Helper\is_admin() || Helper\is_current_user($comment['user_id']))): ?>
|
||||
<?php if ((! isset($not_editable) || ! $not_editable) && ($this->acl->isAdminUser() || $this->acl->isCurrentUser($comment['user_id']))): ?>
|
||||
<li>
|
||||
<?= Helper\a(t('remove'), 'comment', 'confirm', array('task_id' => $task['id'], 'comment_id' => $comment['id'])) ?>
|
||||
<?= $this->a(t('remove'), 'comment', 'confirm', array('task_id' => $task['id'], 'comment_id' => $comment['id'])) ?>
|
||||
</li>
|
||||
<li>
|
||||
<?= Helper\a(t('edit'), 'comment', 'edit', array('task_id' => $task['id'], 'comment_id' => $comment['id'])) ?>
|
||||
<?= $this->a(t('edit'), 'comment', 'edit', array('task_id' => $task['id'], 'comment_id' => $comment['id'])) ?>
|
||||
</li>
|
||||
<?php endif ?>
|
||||
</ul>
|
||||
|
|
@ -22,7 +22,7 @@
|
|||
|
||||
<div class="markdown">
|
||||
<?php if (isset($is_public) && $is_public): ?>
|
||||
<?= Helper\markdown(
|
||||
<?= $this->markdown(
|
||||
$comment['comment'],
|
||||
array(
|
||||
'controller' => 'task',
|
||||
|
|
@ -33,7 +33,7 @@
|
|||
)
|
||||
) ?>
|
||||
<?php else: ?>
|
||||
<?= Helper\markdown($comment['comment']) ?>
|
||||
<?= $this->markdown($comment['comment']) ?>
|
||||
<?php endif ?>
|
||||
</div>
|
||||
|
||||
|
|
|
|||
|
|
@ -21,19 +21,19 @@
|
|||
<ul>
|
||||
<li>
|
||||
<?= t('Database driver:') ?>
|
||||
<strong><?= Helper\escape(DB_DRIVER) ?></strong>
|
||||
<strong><?= $this->e(DB_DRIVER) ?></strong>
|
||||
</li>
|
||||
<?php if (DB_DRIVER === 'sqlite'): ?>
|
||||
<li>
|
||||
<?= t('Database size:') ?>
|
||||
<strong><?= Helper\format_bytes($db_size) ?></strong>
|
||||
<strong><?= $this->formatBytes($db_size) ?></strong>
|
||||
</li>
|
||||
<li>
|
||||
<?= Helper\a(t('Download the database'), 'config', 'downloadDb', array(), true) ?>
|
||||
<?= $this->a(t('Download the database'), 'config', 'downloadDb', array(), true) ?>
|
||||
<?= t('(Gzip compressed Sqlite file)') ?>
|
||||
</li>
|
||||
<li>
|
||||
<?= Helper\a(t('Optimize the database'), 'config', 'optimizeDb', array(), true) ?>
|
||||
<?= $this->a(t('Optimize the database'), 'config', 'optimizeDb', array(), true) ?>
|
||||
<?= t('(VACUUM command)') ?>
|
||||
</li>
|
||||
<?php endif ?>
|
||||
|
|
|
|||
|
|
@ -5,14 +5,14 @@
|
|||
<ul>
|
||||
<li>
|
||||
<?= t('API token:') ?>
|
||||
<strong><?= Helper\escape($values['api_token']) ?></strong>
|
||||
<strong><?= $this->e($values['api_token']) ?></strong>
|
||||
</li>
|
||||
<li>
|
||||
<?= t('API endpoint:') ?>
|
||||
<input type="text" class="auto-select" readonly="readonly" value="<?= Helper\get_current_base_url().'jsonrpc.php' ?>">
|
||||
<input type="text" class="auto-select" readonly="readonly" value="<?= $this->getCurrentBaseUrl().'jsonrpc.php' ?>">
|
||||
</li>
|
||||
<li>
|
||||
<?= Helper\a(t('Reset token'), 'config', 'token', array('type' => 'api'), true) ?>
|
||||
<?= $this->a(t('Reset token'), 'config', 'token', array('type' => 'api'), true) ?>
|
||||
</li>
|
||||
</ul>
|
||||
</section>
|
||||
|
|
@ -2,22 +2,22 @@
|
|||
<h2><?= t('Application settings') ?></h2>
|
||||
</div>
|
||||
<section>
|
||||
<form method="post" action="<?= Helper\u('config', 'application') ?>" autocomplete="off">
|
||||
<form method="post" action="<?= $this->u('config', 'application') ?>" autocomplete="off">
|
||||
|
||||
<?= Helper\form_csrf() ?>
|
||||
<?= $this->formCsrf() ?>
|
||||
|
||||
<?= Helper\form_label(t('Application URL'), 'application_url') ?>
|
||||
<?= Helper\form_text('application_url', $values, $errors, array('placeholder="http://example.kanboard.net/"')) ?><br/>
|
||||
<?= $this->formLabel(t('Application URL'), 'application_url') ?>
|
||||
<?= $this->formText('application_url', $values, $errors, array('placeholder="http://example.kanboard.net/"')) ?><br/>
|
||||
<p class="form-help"><?= t('Example: http://example.kanboard.net/ (used by email notifications)') ?></p>
|
||||
|
||||
<?= Helper\form_label(t('Language'), 'application_language') ?>
|
||||
<?= Helper\form_select('application_language', $languages, $values, $errors) ?><br/>
|
||||
<?= $this->formLabel(t('Language'), 'application_language') ?>
|
||||
<?= $this->formSelect('application_language', $languages, $values, $errors) ?><br/>
|
||||
|
||||
<?= Helper\form_label(t('Timezone'), 'application_timezone') ?>
|
||||
<?= Helper\form_select('application_timezone', $timezones, $values, $errors) ?><br/>
|
||||
<?= $this->formLabel(t('Timezone'), 'application_timezone') ?>
|
||||
<?= $this->formSelect('application_timezone', $timezones, $values, $errors) ?><br/>
|
||||
|
||||
<?= Helper\form_label(t('Date format'), 'application_date_format') ?>
|
||||
<?= Helper\form_select('application_date_format', $date_formats, $values, $errors) ?><br/>
|
||||
<?= $this->formLabel(t('Date format'), 'application_date_format') ?>
|
||||
<?= $this->formSelect('application_date_format', $date_formats, $values, $errors) ?><br/>
|
||||
<p class="form-help"><?= t('ISO format is always accepted, example: "%s" and "%s"', date('Y-m-d'), date('Y_m_d')) ?></p>
|
||||
|
||||
<div class="form-actions">
|
||||
|
|
|
|||
|
|
@ -2,24 +2,24 @@
|
|||
<h2><?= t('Board settings') ?></h2>
|
||||
</div>
|
||||
<section>
|
||||
<form method="post" action="<?= Helper\u('config', 'board') ?>" autocomplete="off">
|
||||
<form method="post" action="<?= $this->u('config', 'board') ?>" autocomplete="off">
|
||||
|
||||
<?= Helper\form_csrf() ?>
|
||||
<?= $this->formCsrf() ?>
|
||||
|
||||
<?= Helper\form_label(t('Task highlight period'), 'board_highlight_period') ?>
|
||||
<?= Helper\form_number('board_highlight_period', $values, $errors) ?><br/>
|
||||
<?= $this->formLabel(t('Task highlight period'), 'board_highlight_period') ?>
|
||||
<?= $this->formNumber('board_highlight_period', $values, $errors) ?><br/>
|
||||
<p class="form-help"><?= t('Period (in second) to consider a task was modified recently (0 to disable, 2 days by default)') ?></p>
|
||||
|
||||
<?= Helper\form_label(t('Refresh interval for public board'), 'board_public_refresh_interval') ?>
|
||||
<?= Helper\form_number('board_public_refresh_interval', $values, $errors) ?><br/>
|
||||
<?= $this->formLabel(t('Refresh interval for public board'), 'board_public_refresh_interval') ?>
|
||||
<?= $this->formNumber('board_public_refresh_interval', $values, $errors) ?><br/>
|
||||
<p class="form-help"><?= t('Frequency in second (60 seconds by default)') ?></p>
|
||||
|
||||
<?= Helper\form_label(t('Refresh interval for private board'), 'board_private_refresh_interval') ?>
|
||||
<?= Helper\form_number('board_private_refresh_interval', $values, $errors) ?><br/>
|
||||
<?= $this->formLabel(t('Refresh interval for private board'), 'board_private_refresh_interval') ?>
|
||||
<?= $this->formNumber('board_private_refresh_interval', $values, $errors) ?><br/>
|
||||
<p class="form-help"><?= t('Frequency in second (0 to disable this feature, 10 seconds by default)') ?></p>
|
||||
|
||||
<?= Helper\form_label(t('Default columns for new projects (Comma-separated)'), 'board_columns') ?>
|
||||
<?= Helper\form_text('board_columns', $values, $errors) ?><br/>
|
||||
<?= $this->formLabel(t('Default columns for new projects (Comma-separated)'), 'board_columns') ?>
|
||||
<?= $this->formText('board_columns', $values, $errors) ?><br/>
|
||||
<p class="form-help"><?= t('Default values are "%s"', $default_columns) ?></p>
|
||||
|
||||
<div class="form-actions">
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
<section id="main">
|
||||
<section class="sidebar-container" id="config-section">
|
||||
|
||||
<?= Helper\template('config/sidebar') ?>
|
||||
<?= $this->render('config/sidebar') ?>
|
||||
|
||||
<div class="sidebar-content">
|
||||
<?= $config_content_for_layout ?>
|
||||
|
|
|
|||
|
|
@ -2,19 +2,19 @@
|
|||
<h2><?= t('Actions') ?></h2>
|
||||
<ul>
|
||||
<li>
|
||||
<?= Helper\a(t('About'), 'config', 'index') ?>
|
||||
<?= $this->a(t('About'), 'config', 'index') ?>
|
||||
</li>
|
||||
<li>
|
||||
<?= Helper\a(t('Application settings'), 'config', 'application') ?>
|
||||
<?= $this->a(t('Application settings'), 'config', 'application') ?>
|
||||
</li>
|
||||
<li>
|
||||
<?= Helper\a(t('Board settings'), 'config', 'board') ?>
|
||||
<?= $this->a(t('Board settings'), 'config', 'board') ?>
|
||||
</li>
|
||||
<li>
|
||||
<?= Helper\a(t('Webhooks'), 'config', 'webhook') ?>
|
||||
<?= $this->a(t('Webhooks'), 'config', 'webhook') ?>
|
||||
</li>
|
||||
<li>
|
||||
<?= Helper\a(t('API'), 'config', 'api') ?>
|
||||
<?= $this->a(t('API'), 'config', 'api') ?>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
|
@ -2,15 +2,15 @@
|
|||
<h2><?= t('Webhook settings') ?></h2>
|
||||
</div>
|
||||
<section>
|
||||
<form method="post" action="<?= Helper\u('config', 'webhook') ?>" autocomplete="off">
|
||||
<form method="post" action="<?= $this->u('config', 'webhook') ?>" autocomplete="off">
|
||||
|
||||
<?= Helper\form_csrf() ?>
|
||||
<?= $this->formCsrf() ?>
|
||||
|
||||
<?= Helper\form_label(t('Webhook URL for task creation'), 'webhook_url_task_creation') ?>
|
||||
<?= Helper\form_text('webhook_url_task_creation', $values, $errors) ?><br/>
|
||||
<?= $this->formLabel(t('Webhook URL for task creation'), 'webhook_url_task_creation') ?>
|
||||
<?= $this->formText('webhook_url_task_creation', $values, $errors) ?><br/>
|
||||
|
||||
<?= Helper\form_label(t('Webhook URL for task modification'), 'webhook_url_task_modification') ?>
|
||||
<?= Helper\form_text('webhook_url_task_modification', $values, $errors) ?><br/>
|
||||
<?= $this->formLabel(t('Webhook URL for task modification'), 'webhook_url_task_modification') ?>
|
||||
<?= $this->formText('webhook_url_task_modification', $values, $errors) ?><br/>
|
||||
|
||||
<div class="form-actions">
|
||||
<input type="submit" value="<?= t('Save') ?>" class="btn btn-blue"/>
|
||||
|
|
@ -25,14 +25,14 @@
|
|||
<ul>
|
||||
<li>
|
||||
<?= t('Webhook token:') ?>
|
||||
<strong><?= Helper\escape($values['webhook_token']) ?></strong>
|
||||
<strong><?= $this->e($values['webhook_token']) ?></strong>
|
||||
</li>
|
||||
<li>
|
||||
<?= t('URL for task creation:') ?>
|
||||
<input type="text" class="auto-select" readonly="readonly" value="<?= Helper\get_current_base_url().Helper\u('webhook', 'task', array('token' => $values['webhook_token'])) ?>">
|
||||
<input type="text" class="auto-select" readonly="readonly" value="<?= $this->getCurrentBaseUrl().$this->u('webhook', 'task', array('token' => $values['webhook_token'])) ?>">
|
||||
</li>
|
||||
<li>
|
||||
<?= Helper\a(t('Reset token'), 'config', 'token', array('type' => 'webhook'), true) ?>
|
||||
<?= $this->a(t('Reset token'), 'config', 'token', array('type' => 'webhook'), true) ?>
|
||||
</li>
|
||||
</ul>
|
||||
</section>
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
<p class="activity-title">
|
||||
<?= e('%s commented the task <a href="?controller=task&action=show&task_id=%d">#%d</a>', Helper\escape($author), $task_id, $task_id) ?>
|
||||
<?= e('%s commented the task <a href="?controller=task&action=show&task_id=%d">#%d</a>', $this->e($author), $task_id, $task_id) ?>
|
||||
</p>
|
||||
<div class="activity-description">
|
||||
<em><?= Helper\escape($task['title']) ?></em><br/>
|
||||
<div class="markdown"><?= Helper\markdown($comment['comment']) ?></div>
|
||||
<em><?= $this->e($task['title']) ?></em><br/>
|
||||
<div class="markdown"><?= $this->markdown($comment['comment']) ?></div>
|
||||
</div>
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
<p class="activity-title">
|
||||
<?= e('%s updated a comment on the task <a href="?controller=task&action=show&task_id=%d">#%d</a>', Helper\escape($author), $task_id, $task_id) ?>
|
||||
<?= e('%s updated a comment on the task <a href="?controller=task&action=show&task_id=%d">#%d</a>', $this->e($author), $task_id, $task_id) ?>
|
||||
</p>
|
||||
<div class="activity-description">
|
||||
<em><?= Helper\escape($task['title']) ?></em><br/>
|
||||
<em><?= $this->e($task['title']) ?></em><br/>
|
||||
</div>
|
||||
|
|
@ -1,12 +1,12 @@
|
|||
<p class="activity-title">
|
||||
<?= e('%s created a subtask for the task <a href="?controller=task&action=show&task_id=%d">#%d</a>', Helper\escape($author), $task_id, $task_id) ?>
|
||||
<?= e('%s created a subtask for the task <a href="?controller=task&action=show&task_id=%d">#%d</a>', $this->e($author), $task_id, $task_id) ?>
|
||||
</p>
|
||||
<div class="activity-description">
|
||||
<p><em><?= Helper\escape($task['title']) ?></em></p>
|
||||
<p><em><?= $this->e($task['title']) ?></em></p>
|
||||
|
||||
<ul>
|
||||
<li>
|
||||
<?= Helper\escape($subtask['title']) ?> (<strong><?= Helper\escape($subtask['status_name']) ?></strong>)
|
||||
<?= $this->e($subtask['title']) ?> (<strong><?= $this->e($subtask['status_name']) ?></strong>)
|
||||
</li>
|
||||
<li>
|
||||
<?php if ($subtask['username']): ?>
|
||||
|
|
|
|||
|
|
@ -1,12 +1,12 @@
|
|||
<p class="activity-title">
|
||||
<?= e('%s updated a subtask for the task <a href="?controller=task&action=show&task_id=%d">#%d</a>', Helper\escape($author), $task_id, $task_id) ?>
|
||||
<?= e('%s updated a subtask for the task <a href="?controller=task&action=show&task_id=%d">#%d</a>', $this->e($author), $task_id, $task_id) ?>
|
||||
</p>
|
||||
<div class="activity-description">
|
||||
<p><em><?= Helper\escape($task['title']) ?></em></p>
|
||||
<p><em><?= $this->e($task['title']) ?></em></p>
|
||||
|
||||
<ul>
|
||||
<li>
|
||||
<?= Helper\escape($subtask['title']) ?> (<strong><?= Helper\escape($subtask['status_name']) ?></strong>)
|
||||
<?= $this->e($subtask['title']) ?> (<strong><?= $this->e($subtask['status_name']) ?></strong>)
|
||||
</li>
|
||||
<li>
|
||||
<?php if ($subtask['username']): ?>
|
||||
|
|
|
|||
|
|
@ -1,12 +1,12 @@
|
|||
<p class="activity-title">
|
||||
<?= e(
|
||||
'%s change the assignee of the task <a href="?controller=task&action=show&task_id=%d">#%d</a> to %s',
|
||||
Helper\escape($author),
|
||||
$this->e($author),
|
||||
$task_id,
|
||||
$task_id,
|
||||
Helper\escape($task['assignee_name'] ?: $task['assignee_username'])
|
||||
$this->e($task['assignee_name'] ?: $task['assignee_username'])
|
||||
) ?>
|
||||
</p>
|
||||
<p class="activity-description">
|
||||
<em><?= Helper\escape($task['title']) ?></em>
|
||||
<em><?= $this->e($task['title']) ?></em>
|
||||
</p>
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
<p class="activity-title">
|
||||
<?= e('%s closed the task <a href="?controller=task&action=show&task_id=%d">#%d</a>', Helper\escape($author), $task_id, $task_id) ?>
|
||||
<?= e('%s closed the task <a href="?controller=task&action=show&task_id=%d">#%d</a>', $this->e($author), $task_id, $task_id) ?>
|
||||
</p>
|
||||
<p class="activity-description">
|
||||
<em><?= Helper\escape($task['title']) ?></em>
|
||||
<em><?= $this->e($task['title']) ?></em>
|
||||
</p>
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
<p class="activity-title">
|
||||
<?= e('%s created the task <a href="?controller=task&action=show&task_id=%d">#%d</a>', Helper\escape($author), $task_id, $task_id) ?>
|
||||
<?= e('%s created the task <a href="?controller=task&action=show&task_id=%d">#%d</a>', $this->e($author), $task_id, $task_id) ?>
|
||||
</p>
|
||||
<p class="activity-description">
|
||||
<em><?= Helper\escape($task['title']) ?></em>
|
||||
<em><?= $this->e($task['title']) ?></em>
|
||||
</p>
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
<p class="activity-title">
|
||||
<?= e('%s moved the task <a href="?controller=task&action=show&task_id=%d">#%d</a> to the column "%s"', Helper\escape($author), $task_id, $task_id, Helper\escape($task['column_title'])) ?>
|
||||
<?= e('%s moved the task <a href="?controller=task&action=show&task_id=%d">#%d</a> to the column "%s"', $this->e($author), $task_id, $task_id, $this->e($task['column_title'])) ?>
|
||||
</p>
|
||||
<p class="activity-description">
|
||||
<em><?= Helper\escape($task['title']) ?></em>
|
||||
<em><?= $this->e($task['title']) ?></em>
|
||||
</p>
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
<p class="activity-title">
|
||||
<?= e('%s moved the task <a href="?controller=task&action=show&task_id=%d">#%d</a> to the position #%d in the column "%s"', Helper\escape($author), $task_id, $task_id, $task['position'], Helper\escape($task['column_title'])) ?>
|
||||
<?= e('%s moved the task <a href="?controller=task&action=show&task_id=%d">#%d</a> to the position #%d in the column "%s"', $this->e($author), $task_id, $task_id, $task['position'], $this->e($task['column_title'])) ?>
|
||||
</p>
|
||||
<p class="activity-description">
|
||||
<em><?= Helper\escape($task['title']) ?></em>
|
||||
<em><?= $this->e($task['title']) ?></em>
|
||||
</p>
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
<p class="activity-title">
|
||||
<?= e('%s open the task <a href="?controller=task&action=show&task_id=%d">#%d</a>', Helper\escape($author), $task_id, $task_id) ?>
|
||||
<?= e('%s open the task <a href="?controller=task&action=show&task_id=%d">#%d</a>', $this->e($author), $task_id, $task_id) ?>
|
||||
</p>
|
||||
<p class="activity-description">
|
||||
<em><?= Helper\escape($task['title']) ?></em>
|
||||
<em><?= $this->e($task['title']) ?></em>
|
||||
</p>
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
<p class="activity-title">
|
||||
<?= e('%s updated the task <a href="?controller=task&action=show&task_id=%d">#%d</a>', Helper\escape($author), $task_id, $task_id) ?>
|
||||
<?= e('%s updated the task <a href="?controller=task&action=show&task_id=%d">#%d</a>', $this->e($author), $task_id, $task_id) ?>
|
||||
</p>
|
||||
<p class="activity-description">
|
||||
<em><?= Helper\escape($task['title']) ?></em>
|
||||
<em><?= $this->e($task['title']) ?></em>
|
||||
</p>
|
||||
|
|
@ -2,13 +2,13 @@
|
|||
<h2><?= t('Attach a document') ?></h2>
|
||||
</div>
|
||||
|
||||
<form action="<?= Helper\u('file', 'save', array('task_id' => $task['id'])) ?>" method="post" enctype="multipart/form-data">
|
||||
<?= Helper\form_csrf() ?>
|
||||
<form action="<?= $this->u('file', 'save', array('task_id' => $task['id'])) ?>" method="post" enctype="multipart/form-data">
|
||||
<?= $this->formCsrf() ?>
|
||||
<input type="file" name="files[]" multiple />
|
||||
<div class="form-help"><?= t('Maximum size: ') ?><?= is_integer($max_size) ? Helper\format_bytes($max_size) : $max_size ?></div>
|
||||
<div class="form-help"><?= t('Maximum size: ') ?><?= is_integer($max_size) ? $this->formatBytes($max_size) : $max_size ?></div>
|
||||
<div class="form-actions">
|
||||
<input type="submit" value="<?= t('Save') ?>" class="btn btn-blue"/>
|
||||
<?= t('or') ?>
|
||||
<?= Helper\a(t('cancel'), 'task', 'show', array('task_id' => $task['id'])) ?>
|
||||
<?= $this->a(t('cancel'), 'task', 'show', array('task_id' => $task['id'])) ?>
|
||||
</div>
|
||||
</form>
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
<div class="page-header">
|
||||
<h2><?= Helper\escape($file['name']) ?></h2>
|
||||
<h2><?= $this->e($file['name']) ?></h2>
|
||||
<div class="task-file-viewer">
|
||||
<img src="<?= Helper\u('file', 'image', array('file_id' => $file['id'], 'task_id' => $file['task_id'])) ?>" alt="<?= Helper\escape($file['name']) ?>"/>
|
||||
<img src="<?= $this->u('file', 'image', array('file_id' => $file['id'], 'task_id' => $file['task_id'])) ?>" alt="<?= $this->e($file['name']) ?>"/>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -4,12 +4,12 @@
|
|||
|
||||
<div class="confirm">
|
||||
<p class="alert alert-info">
|
||||
<?= t('Do you really want to remove this file: "%s"?', Helper\escape($file['name'])) ?>
|
||||
<?= t('Do you really want to remove this file: "%s"?', $this->e($file['name'])) ?>
|
||||
</p>
|
||||
|
||||
<div class="form-actions">
|
||||
<?= Helper\a(t('Yes'), 'file', 'remove', array('task_id' => $task['id'], 'file_id' => $file['id']), true, 'btn btn-red') ?>
|
||||
<?= $this->a(t('Yes'), 'file', 'remove', array('task_id' => $task['id'], 'file_id' => $file['id']), true, 'btn btn-red') ?>
|
||||
<?= t('or') ?>
|
||||
<?= Helper\a(t('cancel'), 'task', 'show', array('task_id' => $task['id'])) ?>
|
||||
<?= $this->a(t('cancel'), 'task', 'show', array('task_id' => $task['id'])) ?>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -8,12 +8,12 @@
|
|||
<ul class="task-show-files">
|
||||
<?php foreach ($files as $file): ?>
|
||||
<li>
|
||||
<?= Helper\a(Helper\escape($file['name']), 'file', 'download', array('task_id' => $task['id'], 'file_id' => $file['id'])) ?>
|
||||
<?= $this->a($this->e($file['name']), 'file', 'download', array('task_id' => $task['id'], 'file_id' => $file['id'])) ?>
|
||||
<span class="task-show-file-actions">
|
||||
<?php if ($file['is_image']): ?>
|
||||
<?= Helper\a(t('open'), 'file', 'open', array('task_id' => $task['id'], 'file_id' => $file['id']), false, 'file-popover') ?>,
|
||||
<?= $this->a(t('open'), 'file', 'open', array('task_id' => $task['id'], 'file_id' => $file['id']), false, 'file-popover') ?>,
|
||||
<?php endif ?>
|
||||
<?= Helper\a(t('remove'), 'file', 'confirm', array('task_id' => $task['id'], 'file_id' => $file['id'])) ?>
|
||||
<?= $this->a(t('remove'), 'file', 'confirm', array('task_id' => $task['id'], 'file_id' => $file['id'])) ?>
|
||||
</span>
|
||||
</li>
|
||||
<?php endforeach ?>
|
||||
|
|
|
|||
|
|
@ -11,10 +11,10 @@
|
|||
<?php endif ?>
|
||||
|
||||
<?php if (! isset($not_editable)): ?>
|
||||
<?= Helper\js('assets/js/app.js') ?>
|
||||
<?= $this->js('assets/js/app.js') ?>
|
||||
<?php endif ?>
|
||||
|
||||
<?= Helper\css('assets/css/app.css') ?>
|
||||
<?= $this->css('assets/css/app.css') ?>
|
||||
|
||||
<link rel="icon" type="image/png" href="assets/img/favicon.png">
|
||||
<link rel="apple-touch-icon" href="assets/img/touch-icon-iphone.png">
|
||||
|
|
@ -22,36 +22,36 @@
|
|||
<link rel="apple-touch-icon" sizes="114x114" href="assets/img/touch-icon-iphone-retina.png">
|
||||
<link rel="apple-touch-icon" sizes="144x144" href="assets/img/touch-icon-ipad-retina.png">
|
||||
|
||||
<title><?= isset($title) ? Helper\escape($title) : 'Kanboard' ?></title>
|
||||
<title><?= isset($title) ? $this->e($title) : 'Kanboard' ?></title>
|
||||
</head>
|
||||
<body data-status-url="<?= Helper\u('app', 'status') ?>" data-login-url="<?= Helper\u('user', 'login') ?>">
|
||||
<body data-status-url="<?= $this->u('app', 'status') ?>" data-login-url="<?= $this->u('user', 'login') ?>">
|
||||
<?php if (isset($no_layout) && $no_layout): ?>
|
||||
<?= $content_for_layout ?>
|
||||
<?php else: ?>
|
||||
<header>
|
||||
<nav>
|
||||
<h1><?= Helper\a('<i class="fa fa-home fa-fw"></i>', 'app', 'index', array(), false, 'home-link', t('Dashboard')).' '.Helper\summary(Helper\escape($title)) ?></h1>
|
||||
<h1><?= $this->a('<i class="fa fa-home fa-fw"></i>', 'app', 'index', array(), false, 'home-link', t('Dashboard')).' '.$this->summary($this->e($title)) ?></h1>
|
||||
<ul>
|
||||
<?php if (isset($board_selector) && ! empty($board_selector)): ?>
|
||||
<li>
|
||||
<select id="board-selector" data-placeholder="<?= t('Display another project') ?>" data-board-url="<?= Helper\u('board', 'show', array('project_id' => '%d')) ?>">
|
||||
<select id="board-selector" data-placeholder="<?= t('Display another project') ?>" data-board-url="<?= $this->u('board', 'show', array('project_id' => '%d')) ?>">
|
||||
<option value=""></option>
|
||||
<?php foreach($board_selector as $board_id => $board_name): ?>
|
||||
<option value="<?= $board_id ?>"><?= Helper\escape($board_name) ?></option>
|
||||
<option value="<?= $board_id ?>"><?= $this->e($board_name) ?></option>
|
||||
<?php endforeach ?>
|
||||
</select>
|
||||
</li>
|
||||
<?php endif ?>
|
||||
<li>
|
||||
<?= Helper\a(t('Logout'), 'user', 'logout', array(), true) ?>
|
||||
<span class="username hide-tablet">(<?= Helper\a(Helper\escape(Helper\get_username()), 'user', 'show', array('user_id' => Helper\get_user_id())) ?>)</span>
|
||||
<?= $this->a(t('Logout'), 'user', 'logout', array(), true) ?>
|
||||
<span class="username hide-tablet">(<?= $this->a($this->e($this->getFullname()), 'user', 'show', array('user_id' => $this->acl->getUserId())) ?>)</span>
|
||||
</li>
|
||||
</ul>
|
||||
</nav>
|
||||
</header>
|
||||
<section class="page">
|
||||
<?= Helper\flash('<div class="alert alert-success alert-fade-out">%s</div>') ?>
|
||||
<?= Helper\flash_error('<div class="alert alert-error">%s</div>') ?>
|
||||
<?= $this->flash('<div class="alert alert-success alert-fade-out">%s</div>') ?>
|
||||
<?= $this->flashError('<div class="alert alert-error">%s</div>') ?>
|
||||
<?= $content_for_layout ?>
|
||||
</section>
|
||||
<?php endif ?>
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
<h2><?= Helper\escape($task['title']) ?> (#<?= $task['id'] ?>)</h2>
|
||||
<h2><?= $this->e($task['title']) ?> (#<?= $task['id'] ?>)</h2>
|
||||
|
||||
<h3><?= t('New comment posted by %s', $comment['name'] ?: $comment['username']) ?></h3>
|
||||
|
||||
<?= Helper\markdown($comment['comment']) ?>
|
||||
<?= $this->markdown($comment['comment']) ?>
|
||||
|
||||
<?= Helper\template('notification/footer', array('task' => $task, 'application_url' => $application_url)) ?>
|
||||
<?= $this->render('notification/footer', array('task' => $task, 'application_url' => $application_url)) ?>
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
<h2><?= Helper\escape($task['title']) ?> (#<?= $task['id'] ?>)</h2>
|
||||
<h2><?= $this->e($task['title']) ?> (#<?= $task['id'] ?>)</h2>
|
||||
|
||||
<h3><?= t('Comment updated') ?></h3>
|
||||
|
||||
<?= Helper\markdown($comment['comment']) ?>
|
||||
<?= $this->markdown($comment['comment']) ?>
|
||||
|
||||
<?= Helper\template('notification/footer', array('task' => $task, 'application_url' => $application_url)) ?>
|
||||
<?= $this->render('notification/footer', array('task' => $task, 'application_url' => $application_url)) ?>
|
||||
|
|
@ -1,5 +1,5 @@
|
|||
<h2><?= Helper\escape($task['title']) ?> (#<?= $task['id'] ?>)</h2>
|
||||
<h2><?= $this->e($task['title']) ?> (#<?= $task['id'] ?>)</h2>
|
||||
|
||||
<p><?= t('New attachment added "%s"', $file['name']) ?></p>
|
||||
|
||||
<?= Helper\template('notification/footer', array('task' => $task, 'application_url' => $application_url)) ?>
|
||||
<?= $this->render('notification/footer', array('task' => $task, 'application_url' => $application_url)) ?>
|
||||
|
|
@ -1,17 +1,17 @@
|
|||
<h2><?= Helper\escape($task['title']) ?> (#<?= $task['id'] ?>)</h2>
|
||||
<h2><?= $this->e($task['title']) ?> (#<?= $task['id'] ?>)</h2>
|
||||
|
||||
<h3><?= t('New sub-task') ?></h3>
|
||||
|
||||
<ul>
|
||||
<li><?= t('Title:') ?> <?= Helper\escape($subtask['title']) ?></li>
|
||||
<li><?= t('Status:') ?> <?= Helper\escape($subtask['status_name']) ?></li>
|
||||
<li><?= t('Assignee:') ?> <?= Helper\escape($subtask['name'] ?: $subtask['username'] ?: '?') ?></li>
|
||||
<li><?= t('Title:') ?> <?= $this->e($subtask['title']) ?></li>
|
||||
<li><?= t('Status:') ?> <?= $this->e($subtask['status_name']) ?></li>
|
||||
<li><?= t('Assignee:') ?> <?= $this->e($subtask['name'] ?: $subtask['username'] ?: '?') ?></li>
|
||||
<li>
|
||||
<?= t('Time tracking:') ?>
|
||||
<?php if (! empty($subtask['time_estimated'])): ?>
|
||||
<strong><?= Helper\escape($subtask['time_estimated']).'h' ?></strong> <?= t('estimated') ?>
|
||||
<strong><?= $this->e($subtask['time_estimated']).'h' ?></strong> <?= t('estimated') ?>
|
||||
<?php endif ?>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<?= Helper\template('notification/footer', array('task' => $task, 'application_url' => $application_url)) ?>
|
||||
<?= $this->render('notification/footer', array('task' => $task, 'application_url' => $application_url)) ?>
|
||||
|
|
@ -1,21 +1,21 @@
|
|||
<h2><?= Helper\escape($task['title']) ?> (#<?= $task['id'] ?>)</h2>
|
||||
<h2><?= $this->e($task['title']) ?> (#<?= $task['id'] ?>)</h2>
|
||||
|
||||
<h3><?= t('Sub-task updated') ?></h3>
|
||||
|
||||
<ul>
|
||||
<li><?= t('Title:') ?> <?= Helper\escape($subtask['title']) ?></li>
|
||||
<li><?= t('Status:') ?> <?= Helper\escape($subtask['status_name']) ?></li>
|
||||
<li><?= t('Assignee:') ?> <?= Helper\escape($subtask['name'] ?: $subtask['username'] ?: '?') ?></li>
|
||||
<li><?= t('Title:') ?> <?= $this->e($subtask['title']) ?></li>
|
||||
<li><?= t('Status:') ?> <?= $this->e($subtask['status_name']) ?></li>
|
||||
<li><?= t('Assignee:') ?> <?= $this->e($subtask['name'] ?: $subtask['username'] ?: '?') ?></li>
|
||||
<li>
|
||||
<?= t('Time tracking:') ?>
|
||||
<?php if (! empty($subtask['time_spent'])): ?>
|
||||
<strong><?= Helper\escape($subtask['time_spent']).'h' ?></strong> <?= t('spent') ?>
|
||||
<strong><?= $this->e($subtask['time_spent']).'h' ?></strong> <?= t('spent') ?>
|
||||
<?php endif ?>
|
||||
|
||||
<?php if (! empty($subtask['time_estimated'])): ?>
|
||||
<strong><?= Helper\escape($subtask['time_estimated']).'h' ?></strong> <?= t('estimated') ?>
|
||||
<strong><?= $this->e($subtask['time_estimated']).'h' ?></strong> <?= t('estimated') ?>
|
||||
<?php endif ?>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<?= Helper\template('notification/footer', array('task' => $task, 'application_url' => $application_url)) ?>
|
||||
<?= $this->render('notification/footer', array('task' => $task, 'application_url' => $application_url)) ?>
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
<h2><?= Helper\escape($task['title']) ?> (#<?= $task['id'] ?>)</h2>
|
||||
<h2><?= $this->e($task['title']) ?> (#<?= $task['id'] ?>)</h2>
|
||||
|
||||
<ul>
|
||||
<li>
|
||||
|
|
@ -14,7 +14,7 @@
|
|||
|
||||
<?php if (! empty($task['description'])): ?>
|
||||
<h2><?= t('Description') ?></h2>
|
||||
<?= Helper\markdown($task['description']) ?: t('There is no description.') ?>
|
||||
<?= $this->markdown($task['description']) ?: t('There is no description.') ?>
|
||||
<?php endif ?>
|
||||
|
||||
<?= Helper\template('notification/footer', array('task' => $task, 'application_url' => $application_url)) ?>
|
||||
<?= $this->render('notification/footer', array('task' => $task, 'application_url' => $application_url)) ?>
|
||||
|
|
@ -1,5 +1,5 @@
|
|||
<h2><?= Helper\escape($task['title']) ?> (#<?= $task['id'] ?>)</h2>
|
||||
<h2><?= $this->e($task['title']) ?> (#<?= $task['id'] ?>)</h2>
|
||||
|
||||
<p><?= t('The task #%d have been closed.', $task['id']) ?></p>
|
||||
|
||||
<?= Helper\template('notification/footer', array('task' => $task, 'application_url' => $application_url)) ?>
|
||||
<?= $this->render('notification/footer', array('task' => $task, 'application_url' => $application_url)) ?>
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
<h2><?= Helper\escape($task['title']) ?> (#<?= $task['id'] ?>)</h2>
|
||||
<h2><?= $this->e($task['title']) ?> (#<?= $task['id'] ?>)</h2>
|
||||
|
||||
<ul>
|
||||
<li>
|
||||
|
|
@ -25,19 +25,19 @@
|
|||
</li>
|
||||
<li>
|
||||
<?= t('Column on the board:') ?>
|
||||
<strong><?= Helper\escape($task['column_title']) ?></strong>
|
||||
<strong><?= $this->e($task['column_title']) ?></strong>
|
||||
</li>
|
||||
<li><?= t('Task position:').' '.Helper\escape($task['position']) ?></li>
|
||||
<li><?= t('Task position:').' '.$this->e($task['position']) ?></li>
|
||||
<?php if ($task['category_name']): ?>
|
||||
<li>
|
||||
<?= t('Category:') ?> <strong><?= Helper\escape($task['category_name']) ?></strong>
|
||||
<?= t('Category:') ?> <strong><?= $this->e($task['category_name']) ?></strong>
|
||||
</li>
|
||||
<?php endif ?>
|
||||
</ul>
|
||||
|
||||
<?php if (! empty($task['description'])): ?>
|
||||
<h2><?= t('Description') ?></h2>
|
||||
<?= Helper\markdown($task['description']) ?>
|
||||
<?= $this->markdown($task['description']) ?>
|
||||
<?php endif ?>
|
||||
|
||||
<?= Helper\template('notification/footer', array('task' => $task, 'application_url' => $application_url)) ?>
|
||||
<?= $this->render('notification/footer', array('task' => $task, 'application_url' => $application_url)) ?>
|
||||
|
|
@ -5,9 +5,9 @@
|
|||
<li>
|
||||
(<strong>#<?= $task['id'] ?></strong>)
|
||||
<?php if ($application_url): ?>
|
||||
<a href="<?= $application_url.'?controller=task&action=show&task_id='.$task['id'] ?>"><?= Helper\escape($task['title']) ?></a>
|
||||
<a href="<?= $application_url.'?controller=task&action=show&task_id='.$task['id'] ?>"><?= $this->e($task['title']) ?></a>
|
||||
<?php else: ?>
|
||||
<?= Helper\escape($task['title']) ?>
|
||||
<?= $this->e($task['title']) ?>
|
||||
<?php endif ?>
|
||||
(<?= dt('%B %e, %Y', $task['date_due']) ?>)
|
||||
<?php if ($task['assignee_username']): ?>
|
||||
|
|
@ -17,4 +17,4 @@
|
|||
<?php endforeach ?>
|
||||
</ul>
|
||||
|
||||
<?= Helper\template('notification/footer', array('task' => $task)) ?>
|
||||
<?= $this->render('notification/footer', array('task' => $task)) ?>
|
||||
|
|
|
|||
|
|
@ -1,11 +1,11 @@
|
|||
<h2><?= Helper\escape($task['title']) ?> (#<?= $task['id'] ?>)</h2>
|
||||
<h2><?= $this->e($task['title']) ?> (#<?= $task['id'] ?>)</h2>
|
||||
|
||||
<ul>
|
||||
<li>
|
||||
<?= t('Column on the board:') ?>
|
||||
<strong><?= Helper\escape($task['column_title']) ?></strong>
|
||||
<strong><?= $this->e($task['column_title']) ?></strong>
|
||||
</li>
|
||||
<li><?= t('Task position:').' '.Helper\escape($task['position']) ?></li>
|
||||
<li><?= t('Task position:').' '.$this->e($task['position']) ?></li>
|
||||
</ul>
|
||||
|
||||
<?= Helper\template('notification/footer', array('task' => $task, 'application_url' => $application_url)) ?>
|
||||
<?= $this->render('notification/footer', array('task' => $task, 'application_url' => $application_url)) ?>
|
||||
|
|
@ -1,11 +1,11 @@
|
|||
<h2><?= Helper\escape($task['title']) ?> (#<?= $task['id'] ?>)</h2>
|
||||
<h2><?= $this->e($task['title']) ?> (#<?= $task['id'] ?>)</h2>
|
||||
|
||||
<ul>
|
||||
<li>
|
||||
<?= t('Column on the board:') ?>
|
||||
<strong><?= Helper\escape($task['column_title']) ?></strong>
|
||||
<strong><?= $this->e($task['column_title']) ?></strong>
|
||||
</li>
|
||||
<li><?= t('Task position:').' '.Helper\escape($task['position']) ?></li>
|
||||
<li><?= t('Task position:').' '.$this->e($task['position']) ?></li>
|
||||
</ul>
|
||||
|
||||
<?= Helper\template('notification/footer', array('task' => $task, 'application_url' => $application_url)) ?>
|
||||
<?= $this->render('notification/footer', array('task' => $task, 'application_url' => $application_url)) ?>
|
||||
|
|
@ -1,5 +1,5 @@
|
|||
<h2><?= Helper\escape($task['title']) ?> (#<?= $task['id'] ?>)</h2>
|
||||
<h2><?= $this->e($task['title']) ?> (#<?= $task['id'] ?>)</h2>
|
||||
|
||||
<p><?= t('The task #%d have been opened.', $task['id']) ?></p>
|
||||
|
||||
<?= Helper\template('notification/footer', array('task' => $task, 'application_url' => $application_url)) ?>
|
||||
<?= $this->render('notification/footer', array('task' => $task, 'application_url' => $application_url)) ?>
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
<h2><?= Helper\escape($task['title']) ?> (#<?= $task['id'] ?>)</h2>
|
||||
<h2><?= $this->e($task['title']) ?> (#<?= $task['id'] ?>)</h2>
|
||||
|
||||
<ul>
|
||||
<li>
|
||||
|
|
@ -25,19 +25,19 @@
|
|||
</li>
|
||||
<li>
|
||||
<?= t('Column on the board:') ?>
|
||||
<strong><?= Helper\escape($task['column_title']) ?></strong>
|
||||
<strong><?= $this->e($task['column_title']) ?></strong>
|
||||
</li>
|
||||
<li><?= t('Task position:').' '.Helper\escape($task['position']) ?></li>
|
||||
<li><?= t('Task position:').' '.$this->e($task['position']) ?></li>
|
||||
<?php if ($task['category_name']): ?>
|
||||
<li>
|
||||
<?= t('Category:') ?> <strong><?= Helper\escape($task['category_name']) ?></strong>
|
||||
<?= t('Category:') ?> <strong><?= $this->e($task['category_name']) ?></strong>
|
||||
</li>
|
||||
<?php endif ?>
|
||||
</ul>
|
||||
|
||||
<?php if (! empty($task['description'])): ?>
|
||||
<h2><?= t('Description') ?></h2>
|
||||
<?= Helper\markdown($task['description']) ?: t('There is no description.') ?>
|
||||
<?= $this->markdown($task['description']) ?: t('There is no description.') ?>
|
||||
<?php endif ?>
|
||||
|
||||
<?= Helper\template('notification/footer', array('task' => $task, 'application_url' => $application_url)) ?>
|
||||
<?= $this->render('notification/footer', array('task' => $task, 'application_url' => $application_url)) ?>
|
||||
|
|
@ -1,15 +1,15 @@
|
|||
<section id="main">
|
||||
<div class="page-header">
|
||||
<ul>
|
||||
<li><i class="fa fa-table fa-fw"></i><?= Helper\a(t('Back to the board'), 'board', 'show', array('project_id' => $project['id'])) ?></li>
|
||||
<li><i class="fa fa-search fa-fw"></i><?= Helper\a(t('Search'), 'project', 'search', array('project_id' => $project['id'])) ?></li>
|
||||
<li><i class="fa fa-check-square-o fa-fw"></i><?= Helper\a(t('Completed tasks'), 'project', 'tasks', array('project_id' => $project['id'])) ?></li>
|
||||
<li><i class="fa fa-table fa-fw"></i><?= $this->a(t('Back to the board'), 'board', 'show', array('project_id' => $project['id'])) ?></li>
|
||||
<li><i class="fa fa-search fa-fw"></i><?= $this->a(t('Search'), 'project', 'search', array('project_id' => $project['id'])) ?></li>
|
||||
<li><i class="fa fa-check-square-o fa-fw"></i><?= $this->a(t('Completed tasks'), 'project', 'tasks', array('project_id' => $project['id'])) ?></li>
|
||||
<?php if ($project['is_public']): ?>
|
||||
<li><i class="fa fa-rss-square fa-fw"></i><?= Helper\a(t('RSS feed'), 'project', 'feed', array('token' => $project['token']), false, '', '', true) ?></li>
|
||||
<li><i class="fa fa-rss-square fa-fw"></i><?= $this->a(t('RSS feed'), 'project', 'feed', array('token' => $project['token']), false, '', '', true) ?></li>
|
||||
<?php endif ?>
|
||||
</ul>
|
||||
</div>
|
||||
<section>
|
||||
<?= Helper\template('project/events', array('events' => $events)) ?>
|
||||
<?= $this->render('project/events', array('events' => $events)) ?>
|
||||
</section>
|
||||
</section>
|
||||
|
|
@ -8,7 +8,7 @@
|
|||
</p>
|
||||
|
||||
<div class="form-actions">
|
||||
<?= Helper\a(t('Yes'), 'project', 'disable', array('project_id' => $project['id'], 'disable' => 'yes'), true, 'btn btn-red') ?>
|
||||
<?= t('or') ?> <?= Helper\a(t('cancel'), 'project', 'show', array('project_id' => $project['id'])) ?>
|
||||
<?= $this->a(t('Yes'), 'project', 'disable', array('project_id' => $project['id'], 'disable' => 'yes'), true, 'btn btn-red') ?>
|
||||
<?= t('or') ?> <?= $this->a(t('cancel'), 'project', 'show', array('project_id' => $project['id'])) ?>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -8,7 +8,7 @@
|
|||
</p>
|
||||
|
||||
<div class="form-actions">
|
||||
<?= Helper\a(t('Yes'), 'project', 'duplicate', array('project_id' => $project['id'], 'duplicate' => 'yes'), true, 'btn btn-red') ?>
|
||||
<?= t('or') ?> <?= Helper\a(t('cancel'), 'project', 'show', array('project_id' => $project['id'])) ?>
|
||||
<?= $this->a(t('Yes'), 'project', 'duplicate', array('project_id' => $project['id'], 'duplicate' => 'yes'), true, 'btn btn-red') ?>
|
||||
<?= t('or') ?> <?= $this->a(t('cancel'), 'project', 'show', array('project_id' => $project['id'])) ?>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -1,13 +1,13 @@
|
|||
<div class="page-header">
|
||||
<h2><?= t('Edit project') ?></h2>
|
||||
</div>
|
||||
<form method="post" action="<?= Helper\u('project', 'update', array('project_id' => $values['id'])) ?>" autocomplete="off">
|
||||
<form method="post" action="<?= $this->u('project', 'update', array('project_id' => $values['id'])) ?>" autocomplete="off">
|
||||
|
||||
<?= Helper\form_csrf() ?>
|
||||
<?= Helper\form_hidden('id', $values) ?>
|
||||
<?= $this->formCsrf() ?>
|
||||
<?= $this->formHidden('id', $values) ?>
|
||||
|
||||
<?= Helper\form_label(t('Name'), 'name') ?>
|
||||
<?= Helper\form_text('name', $values, $errors, array('required')) ?>
|
||||
<?= $this->formLabel(t('Name'), 'name') ?>
|
||||
<?= $this->formText('name', $values, $errors, array('required')) ?>
|
||||
|
||||
<div class="form-actions">
|
||||
<input type="submit" value="<?= t('Save') ?>" class="btn btn-blue"/>
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@
|
|||
</p>
|
||||
|
||||
<div class="form-actions">
|
||||
<?= Helper\a(t('Yes'), 'project', 'enable', array('project_id' => $project['id'], 'enable' => 'yes'), true, 'btn btn-red') ?>
|
||||
<?= t('or') ?> <?= Helper\a(t('cancel'), 'project', 'show', array('project_id' => $project['id'])) ?>
|
||||
<?= $this->a(t('Yes'), 'project', 'enable', array('project_id' => $project['id'], 'enable' => 'yes'), true, 'btn btn-red') ?>
|
||||
<?= t('or') ?> <?= $this->a(t('cancel'), 'project', 'show', array('project_id' => $project['id'])) ?>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -5,11 +5,11 @@
|
|||
<?php foreach ($events as $event): ?>
|
||||
<div class="activity-event">
|
||||
<p class="activity-datetime">
|
||||
<?php if (Helper\contains($event['event_name'], 'subtask')): ?>
|
||||
<?php if ($this->contains($event['event_name'], 'subtask')): ?>
|
||||
<i class="fa fa-tasks"></i>
|
||||
<?php elseif (Helper\contains($event['event_name'], 'task')): ?>
|
||||
<?php elseif ($this->contains($event['event_name'], 'task')): ?>
|
||||
<i class="fa fa-newspaper-o"></i>
|
||||
<?php elseif (Helper\contains($event['event_name'], 'comment')): ?>
|
||||
<?php elseif ($this->contains($event['event_name'], 'comment')): ?>
|
||||
<i class="fa fa-comments-o"></i>
|
||||
<?php endif ?>
|
||||
<?= dt('%B %e, %Y at %k:%M %p', $event['date_creation']) ?>
|
||||
|
|
|
|||
|
|
@ -8,15 +8,15 @@
|
|||
|
||||
<form method="get" action="?" autocomplete="off">
|
||||
|
||||
<?= Helper\form_hidden('controller', $values) ?>
|
||||
<?= Helper\form_hidden('action', $values) ?>
|
||||
<?= Helper\form_hidden('project_id', $values) ?>
|
||||
<?= $this->formHidden('controller', $values) ?>
|
||||
<?= $this->formHidden('action', $values) ?>
|
||||
<?= $this->formHidden('project_id', $values) ?>
|
||||
|
||||
<?= Helper\form_label(t('Start Date'), 'from') ?>
|
||||
<?= Helper\form_text('from', $values, $errors, array('required', 'placeholder="'.Helper\in_list($date_format, $date_formats).'"'), 'form-date') ?><br/>
|
||||
<?= $this->formLabel(t('Start Date'), 'from') ?>
|
||||
<?= $this->formText('from', $values, $errors, array('required', 'placeholder="'.$this->inList($date_format, $date_formats).'"'), 'form-date') ?><br/>
|
||||
|
||||
<?= Helper\form_label(t('End Date'), 'to') ?>
|
||||
<?= Helper\form_text('to', $values, $errors, array('required', 'placeholder="'.Helper\in_list($date_format, $date_formats).'"'), 'form-date') ?>
|
||||
<?= $this->formLabel(t('End Date'), 'to') ?>
|
||||
<?= $this->formText('to', $values, $errors, array('required', 'placeholder="'.$this->inList($date_format, $date_formats).'"'), 'form-date') ?>
|
||||
|
||||
<div class="form-help"><?= t('Others formats accepted: %s and %s', date('Y-m-d'), date('Y_m_d')) ?></div>
|
||||
|
||||
|
|
|
|||
|
|
@ -6,15 +6,15 @@
|
|||
|
||||
<form method="get" action="?" autocomplete="off">
|
||||
|
||||
<?= Helper\form_hidden('controller', $values) ?>
|
||||
<?= Helper\form_hidden('action', $values) ?>
|
||||
<?= Helper\form_hidden('project_id', $values) ?>
|
||||
<?= $this->formHidden('controller', $values) ?>
|
||||
<?= $this->formHidden('action', $values) ?>
|
||||
<?= $this->formHidden('project_id', $values) ?>
|
||||
|
||||
<?= Helper\form_label(t('Start Date'), 'from') ?>
|
||||
<?= Helper\form_text('from', $values, $errors, array('required', 'placeholder="'.Helper\in_list($date_format, $date_formats).'"'), 'form-date') ?><br/>
|
||||
<?= $this->formLabel(t('Start Date'), 'from') ?>
|
||||
<?= $this->formText('from', $values, $errors, array('required', 'placeholder="'.$this->inList($date_format, $date_formats).'"'), 'form-date') ?><br/>
|
||||
|
||||
<?= Helper\form_label(t('End Date'), 'to') ?>
|
||||
<?= Helper\form_text('to', $values, $errors, array('required', 'placeholder="'.Helper\in_list($date_format, $date_formats).'"'), 'form-date') ?>
|
||||
<?= $this->formLabel(t('End Date'), 'to') ?>
|
||||
<?= $this->formText('to', $values, $errors, array('required', 'placeholder="'.$this->inList($date_format, $date_formats).'"'), 'form-date') ?>
|
||||
|
||||
<div class="form-help"><?= t('Others formats accepted: %s and %s', date('Y-m-d'), date('Y_m_d')) ?></div>
|
||||
|
||||
|
|
|
|||
|
|
@ -1,21 +1,21 @@
|
|||
<?= '<?xml version="1.0" encoding="utf-8"?>' ?>
|
||||
<feed xml:lang="en-US" xmlns="http://www.w3.org/2005/Atom">
|
||||
<title><?= t('%s\'s activity', $project['name']) ?></title>
|
||||
<link rel="alternate" type="text/html" href="<?= Helper\get_current_base_url() ?>"/>
|
||||
<link rel="self" type="application/atom+xml" href="<?= Helper\get_current_base_url().Helper\u('project', 'feed', array('token' => $project['token'])) ?>"/>
|
||||
<link rel="alternate" type="text/html" href="<?= $this->getCurrentBaseUrl() ?>"/>
|
||||
<link rel="self" type="application/atom+xml" href="<?= $this->getCurrentBaseUrl().$this->u('project', 'feed', array('token' => $project['token'])) ?>"/>
|
||||
<updated><?= date(DATE_ATOM) ?></updated>
|
||||
<id><?= Helper\get_current_base_url() ?></id>
|
||||
<icon><?= Helper\get_current_base_url() ?>assets/img/favicon.png</icon>
|
||||
<id><?= $this->getCurrentBaseUrl() ?></id>
|
||||
<icon><?= $this->getCurrentBaseUrl() ?>assets/img/favicon.png</icon>
|
||||
|
||||
<?php foreach ($events as $e): ?>
|
||||
<entry>
|
||||
<title type="text"><?= $e['event_title'] ?></title>
|
||||
<link rel="alternate" href="<?= Helper\get_current_base_url().Helper\u('task', 'show', array('task_id' => $e['task_id'])) ?>"/>
|
||||
<link rel="alternate" href="<?= $this->getCurrentBaseUrl().$this->u('task', 'show', array('task_id' => $e['task_id'])) ?>"/>
|
||||
<id><?= $e['id'].'-'.$e['event_name'].'-'.$e['task_id'].'-'.$e['date_creation'] ?></id>
|
||||
<published><?= date(DATE_ATOM, $e['date_creation']) ?></published>
|
||||
<updated><?= date(DATE_ATOM, $e['date_creation']) ?></updated>
|
||||
<author>
|
||||
<name><?= Helper\escape($e['author']) ?></name>
|
||||
<name><?= $this->e($e['author']) ?></name>
|
||||
</author>
|
||||
<content type="html">
|
||||
<![CDATA[
|
||||
|
|
|
|||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue