Improve settings page and move some config parameters to the database
This commit is contained in:
2
Vagrantfile
vendored
2
Vagrantfile
vendored
@@ -6,7 +6,7 @@ VAGRANTFILE_API_VERSION = "2"
|
|||||||
$script = <<SCRIPT
|
$script = <<SCRIPT
|
||||||
# install packages
|
# install packages
|
||||||
apt-get update
|
apt-get update
|
||||||
apt-get install -y apache2 php5 php5-sqlite php5-ldap php5-xdebug
|
apt-get install -y apache2 php5 php5-sqlite php5-ldap php5-xdebug php5-curl php5-mysql php5-pgsql
|
||||||
service apache2 restart
|
service apache2 restart
|
||||||
rm -f /var/www/html/index.html
|
rm -f /var/www/html/index.html
|
||||||
date > /etc/vagrant_provisioned_at
|
date > /etc/vagrant_provisioned_at
|
||||||
|
|||||||
@@ -5,7 +5,6 @@ namespace Controller;
|
|||||||
use Core\Tool;
|
use Core\Tool;
|
||||||
use Core\Registry;
|
use Core\Registry;
|
||||||
use Core\Security;
|
use Core\Security;
|
||||||
use Core\Translator;
|
|
||||||
use Model\LastLogin;
|
use Model\LastLogin;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -123,12 +122,8 @@ abstract class Base
|
|||||||
$this->response->hsts();
|
$this->response->hsts();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Load translations
|
$this->config->setupTranslations();
|
||||||
$language = $this->config->get('language', 'en_US');
|
$this->config->setupTimezone();
|
||||||
if ($language !== 'en_US') Translator::load($language);
|
|
||||||
|
|
||||||
// Set timezone
|
|
||||||
date_default_timezone_set($this->config->get('timezone', 'UTC'));
|
|
||||||
|
|
||||||
// Authentication
|
// Authentication
|
||||||
if (! $this->authentication->isAuthenticated($controller, $action)) {
|
if (! $this->authentication->isAuthenticated($controller, $action)) {
|
||||||
|
|||||||
@@ -177,8 +177,8 @@ class Board extends Base
|
|||||||
'categories' => $this->category->getList($project['id'], false),
|
'categories' => $this->category->getList($project['id'], false),
|
||||||
'title' => $project['name'],
|
'title' => $project['name'],
|
||||||
'no_layout' => true,
|
'no_layout' => true,
|
||||||
'auto_refresh' => true,
|
|
||||||
'not_editable' => true,
|
'not_editable' => true,
|
||||||
|
'board_public_refresh_interval' => $this->config->get('board_public_refresh_interval'),
|
||||||
)));
|
)));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -238,6 +238,8 @@ class Board extends Base
|
|||||||
'menu' => 'boards',
|
'menu' => 'boards',
|
||||||
'title' => $projects[$project['id']],
|
'title' => $projects[$project['id']],
|
||||||
'board_selector' => $board_selector,
|
'board_selector' => $board_selector,
|
||||||
|
'board_private_refresh_interval' => $this->config->get('board_private_refresh_interval'),
|
||||||
|
'board_highlight_period' => $this->config->get('board_highlight_period'),
|
||||||
)));
|
)));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -407,6 +409,8 @@ class Board extends Base
|
|||||||
'current_project_id' => $project_id,
|
'current_project_id' => $project_id,
|
||||||
'board' => $this->board->get($project_id),
|
'board' => $this->board->get($project_id),
|
||||||
'categories' => $this->category->getList($project_id, false),
|
'categories' => $this->category->getList($project_id, false),
|
||||||
|
'board_private_refresh_interval' => $this->config->get('board_private_refresh_interval'),
|
||||||
|
'board_highlight_period' => $this->config->get('board_highlight_period'),
|
||||||
)),
|
)),
|
||||||
201
|
201
|
||||||
);
|
);
|
||||||
@@ -443,6 +447,8 @@ class Board extends Base
|
|||||||
'current_project_id' => $project_id,
|
'current_project_id' => $project_id,
|
||||||
'board' => $this->board->get($project_id),
|
'board' => $this->board->get($project_id),
|
||||||
'categories' => $this->category->getList($project_id, false),
|
'categories' => $this->category->getList($project_id, false),
|
||||||
|
'board_private_refresh_interval' => $this->config->get('board_private_refresh_interval'),
|
||||||
|
'board_highlight_period' => $this->config->get('board_highlight_period'),
|
||||||
))
|
))
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -11,55 +11,114 @@ namespace Controller;
|
|||||||
class Config extends Base
|
class Config extends Base
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* Display the settings page
|
* Common layout for config views
|
||||||
|
*
|
||||||
|
* @access private
|
||||||
|
* @param string $template Template name
|
||||||
|
* @param array $params Template parameters
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
private function layout($template, array $params)
|
||||||
|
{
|
||||||
|
$params['values'] = $this->config->getAll();
|
||||||
|
$params['errors'] = array();
|
||||||
|
$params['menu'] = 'config';
|
||||||
|
$params['config_content_for_layout'] = $this->template->load($template, $params);
|
||||||
|
|
||||||
|
return $this->template->layout('config_layout', $params);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Common method between pages
|
||||||
|
*
|
||||||
|
* @access private
|
||||||
|
* @param string $redirect Action to redirect after saving the form
|
||||||
|
*/
|
||||||
|
private function common($redirect)
|
||||||
|
{
|
||||||
|
if ($this->request->isPost()) {
|
||||||
|
|
||||||
|
$values = $this->request->getValues();
|
||||||
|
|
||||||
|
if ($this->config->save($values)) {
|
||||||
|
$this->config->reload();
|
||||||
|
$this->session->flash(t('Settings saved successfully.'));
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
$this->session->flashError(t('Unable to save your settings.'));
|
||||||
|
}
|
||||||
|
|
||||||
|
$this->response->redirect('?controller=config&action='.$redirect);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Display the about page
|
||||||
*
|
*
|
||||||
* @access public
|
* @access public
|
||||||
*/
|
*/
|
||||||
public function index()
|
public function index()
|
||||||
{
|
{
|
||||||
$this->response->html($this->template->layout('config_index', array(
|
$this->response->html($this->layout('config_about', array(
|
||||||
'db_size' => $this->config->getDatabaseSize(),
|
'db_size' => $this->config->getDatabaseSize(),
|
||||||
|
'title' => t('About'),
|
||||||
|
)));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Display the application settings page
|
||||||
|
*
|
||||||
|
* @access public
|
||||||
|
*/
|
||||||
|
public function application()
|
||||||
|
{
|
||||||
|
$this->common('application');
|
||||||
|
|
||||||
|
$this->response->html($this->layout('config_application', array(
|
||||||
|
'title' => t('Application settings'),
|
||||||
'languages' => $this->config->getLanguages(),
|
'languages' => $this->config->getLanguages(),
|
||||||
'values' => $this->config->getAll(),
|
|
||||||
'errors' => array(),
|
|
||||||
'menu' => 'config',
|
|
||||||
'title' => t('Settings'),
|
|
||||||
'timezones' => $this->config->getTimezones(),
|
'timezones' => $this->config->getTimezones(),
|
||||||
|
)));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Display the board settings page
|
||||||
|
*
|
||||||
|
* @access public
|
||||||
|
*/
|
||||||
|
public function board()
|
||||||
|
{
|
||||||
|
$this->common('board');
|
||||||
|
|
||||||
|
$this->response->html($this->layout('config_board', array(
|
||||||
|
'title' => t('Board settings'),
|
||||||
'default_columns' => implode(', ', $this->board->getDefaultColumns()),
|
'default_columns' => implode(', ', $this->board->getDefaultColumns()),
|
||||||
)));
|
)));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Validate and save settings
|
* Display the webhook settings page
|
||||||
*
|
*
|
||||||
* @access public
|
* @access public
|
||||||
*/
|
*/
|
||||||
public function save()
|
public function webhook()
|
||||||
{
|
{
|
||||||
$values = $this->request->getValues();
|
$this->common('webhook');
|
||||||
list($valid, $errors) = $this->config->validateModification($values);
|
|
||||||
|
|
||||||
if ($valid) {
|
$this->response->html($this->layout('config_webhook', array(
|
||||||
|
'title' => t('Webhook settings'),
|
||||||
if ($this->config->save($values)) {
|
)));
|
||||||
$this->config->reload();
|
|
||||||
$this->session->flash(t('Settings saved successfully.'));
|
|
||||||
} else {
|
|
||||||
$this->session->flashError(t('Unable to save your settings.'));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->response->redirect('?controller=config');
|
/**
|
||||||
}
|
* Display the api settings page
|
||||||
|
*
|
||||||
$this->response->html($this->template->layout('config_index', array(
|
* @access public
|
||||||
'db_size' => $this->config->getDatabaseSize(),
|
*/
|
||||||
'languages' => $this->config->getLanguages(),
|
public function api()
|
||||||
'values' => $values,
|
{
|
||||||
'errors' => $errors,
|
$this->response->html($this->layout('config_api', array(
|
||||||
'menu' => 'config',
|
'title' => t('API'),
|
||||||
'title' => t('Settings'),
|
|
||||||
'timezones' => $this->config->getTimezones(),
|
|
||||||
'default_columns' => implode(', ', $this->board->getDefaultColumns()),
|
|
||||||
)));
|
)));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -89,15 +148,18 @@ class Config extends Base
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Regenerate all application tokens
|
* Regenerate webhook token
|
||||||
*
|
*
|
||||||
* @access public
|
* @access public
|
||||||
*/
|
*/
|
||||||
public function tokens()
|
public function token()
|
||||||
{
|
{
|
||||||
|
$type = $this->request->getStringParam('type');
|
||||||
|
|
||||||
$this->checkCSRFParam();
|
$this->checkCSRFParam();
|
||||||
$this->config->regenerateTokens();
|
$this->config->regenerateToken($type.'_token');
|
||||||
$this->session->flash(t('All tokens have been regenerated.'));
|
|
||||||
$this->response->redirect('?controller=config');
|
$this->session->flash(t('Token regenerated.'));
|
||||||
|
$this->response->redirect('?controller=config&action='.$type);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -73,7 +73,7 @@ class User extends Base
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Common layout for project views
|
* Common layout for user views
|
||||||
*
|
*
|
||||||
* @access private
|
* @access private
|
||||||
* @param string $template Template name
|
* @param string $template Template name
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ class Webhook extends Base
|
|||||||
*/
|
*/
|
||||||
public function task()
|
public function task()
|
||||||
{
|
{
|
||||||
if ($this->config->get('webhooks_token') !== $this->request->getStringParam('token')) {
|
if ($this->config->get('webhook_token') !== $this->request->getStringParam('token')) {
|
||||||
$this->response->text('Not Authorized', 401);
|
$this->response->text('Not Authorized', 401);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -49,7 +49,7 @@ class Webhook extends Base
|
|||||||
*/
|
*/
|
||||||
public function github()
|
public function github()
|
||||||
{
|
{
|
||||||
if ($this->config->get('webhooks_token') !== $this->request->getStringParam('token')) {
|
if ($this->config->get('webhook_token') !== $this->request->getStringParam('token')) {
|
||||||
$this->response->text('Not Authorized', 401);
|
$this->response->text('Not Authorized', 401);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -83,7 +83,7 @@ return array(
|
|||||||
'Settings' => 'Einstellungen',
|
'Settings' => 'Einstellungen',
|
||||||
'Application settings' => 'Anwendungskonfiguration',
|
'Application settings' => 'Anwendungskonfiguration',
|
||||||
'Language' => 'Sprache',
|
'Language' => 'Sprache',
|
||||||
'Webhooks token:' => 'Webhooks Token:',
|
// 'Webhook token:' => '',
|
||||||
'API token:' => 'API Token:',
|
'API token:' => 'API Token:',
|
||||||
'More information' => 'Mehr Informationen',
|
'More information' => 'Mehr Informationen',
|
||||||
'Database size:' => 'Datenbankgröße:',
|
'Database size:' => 'Datenbankgröße:',
|
||||||
@@ -516,4 +516,22 @@ return array(
|
|||||||
// 'Reference' => '',
|
// 'Reference' => '',
|
||||||
// 'Reference: %s' => '',
|
// 'Reference: %s' => '',
|
||||||
// 'Label' => '',
|
// 'Label' => '',
|
||||||
|
// 'Database' => '',
|
||||||
|
// 'About' => '',
|
||||||
|
// 'Database driver:' => '',
|
||||||
|
// 'Board settings' => '',
|
||||||
|
// 'URL and token' => '',
|
||||||
|
// 'Webhook settings' => '',
|
||||||
|
// 'URL for task creation:' => '',
|
||||||
|
// 'Reset token' => '',
|
||||||
|
// 'API endpoint:' => '',
|
||||||
|
// 'Refresh interval for private board' => '',
|
||||||
|
// 'Refresh interval for public board' => '',
|
||||||
|
// 'Task highlight period' => '',
|
||||||
|
// 'Period (in second) to consider a task was modified recently (0 to disable, 2 days by default)' => '',
|
||||||
|
// 'Frequency in second (60 seconds by default)' => '',
|
||||||
|
// 'Frequency in second (0 to disable this feature, 10 seconds by default)' => '',
|
||||||
|
// 'Application URL' => '',
|
||||||
|
// 'Example: http://example.kanboard.net/ (used by email notifications)' => '',
|
||||||
|
// 'Token regenerated.' => '',
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -83,7 +83,7 @@ return array(
|
|||||||
'Settings' => 'Preferencias',
|
'Settings' => 'Preferencias',
|
||||||
'Application settings' => 'Parámetros de la aplicación',
|
'Application settings' => 'Parámetros de la aplicación',
|
||||||
'Language' => 'Idioma',
|
'Language' => 'Idioma',
|
||||||
'Webhooks token:' => 'Ficha de seguridad (token) para los webhooks :',
|
'Webhook token:' => 'Ficha de seguridad (token) para los webhooks :',
|
||||||
'API token:' => 'Ficha de seguridad (token) para API:',
|
'API token:' => 'Ficha de seguridad (token) para API:',
|
||||||
'More information' => 'Más informaciones',
|
'More information' => 'Más informaciones',
|
||||||
'Database size:' => 'Tamaño de la base de datos:',
|
'Database size:' => 'Tamaño de la base de datos:',
|
||||||
@@ -516,4 +516,22 @@ return array(
|
|||||||
// 'Reference' => '',
|
// 'Reference' => '',
|
||||||
// 'Reference: %s' => '',
|
// 'Reference: %s' => '',
|
||||||
// 'Label' => '',
|
// 'Label' => '',
|
||||||
|
// 'Database' => '',
|
||||||
|
// 'About' => '',
|
||||||
|
// 'Database driver:' => '',
|
||||||
|
// 'Board settings' => '',
|
||||||
|
// 'URL and token' => '',
|
||||||
|
// 'Webhook settings' => '',
|
||||||
|
// 'URL for task creation:' => '',
|
||||||
|
// 'Reset token' => '',
|
||||||
|
// 'API endpoint:' => '',
|
||||||
|
// 'Refresh interval for private board' => '',
|
||||||
|
// 'Refresh interval for public board' => '',
|
||||||
|
// 'Task highlight period' => '',
|
||||||
|
// 'Period (in second) to consider a task was modified recently (0 to disable, 2 days by default)' => '',
|
||||||
|
// 'Frequency in second (60 seconds by default)' => '',
|
||||||
|
// 'Frequency in second (0 to disable this feature, 10 seconds by default)' => '',
|
||||||
|
// 'Application URL' => '',
|
||||||
|
// 'Example: http://example.kanboard.net/ (used by email notifications)' => '',
|
||||||
|
// 'Token regenerated.' => '',
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -83,7 +83,7 @@ return array(
|
|||||||
'Settings' => 'Asetukset',
|
'Settings' => 'Asetukset',
|
||||||
'Application settings' => 'Ohjelman asetukset',
|
'Application settings' => 'Ohjelman asetukset',
|
||||||
'Language' => 'Kieli',
|
'Language' => 'Kieli',
|
||||||
'Webhooks token:' => 'Webhooks avain:',
|
'Webhook token:' => 'Webhooks avain:',
|
||||||
// 'API token:' => '',
|
// 'API token:' => '',
|
||||||
'More information' => 'Lisätietoja',
|
'More information' => 'Lisätietoja',
|
||||||
'Database size:' => 'Tietokannan koko:',
|
'Database size:' => 'Tietokannan koko:',
|
||||||
@@ -516,4 +516,22 @@ return array(
|
|||||||
// 'Reference' => '',
|
// 'Reference' => '',
|
||||||
// 'Reference: %s' => '',
|
// 'Reference: %s' => '',
|
||||||
// 'Label' => '',
|
// 'Label' => '',
|
||||||
|
// 'Database' => '',
|
||||||
|
// 'About' => '',
|
||||||
|
// 'Database driver:' => '',
|
||||||
|
// 'Board settings' => '',
|
||||||
|
// 'URL and token' => '',
|
||||||
|
// 'Webhook settings' => '',
|
||||||
|
// 'URL for task creation:' => '',
|
||||||
|
// 'Reset token' => '',
|
||||||
|
// 'API endpoint:' => '',
|
||||||
|
// 'Refresh interval for private board' => '',
|
||||||
|
// 'Refresh interval for public board' => '',
|
||||||
|
// 'Task highlight period' => '',
|
||||||
|
// 'Period (in second) to consider a task was modified recently (0 to disable, 2 days by default)' => '',
|
||||||
|
// 'Frequency in second (60 seconds by default)' => '',
|
||||||
|
// 'Frequency in second (0 to disable this feature, 10 seconds by default)' => '',
|
||||||
|
// 'Application URL' => '',
|
||||||
|
// 'Example: http://example.kanboard.net/ (used by email notifications)' => '',
|
||||||
|
// 'Token regenerated.' => '',
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -83,7 +83,7 @@ return array(
|
|||||||
'Settings' => 'Préférences',
|
'Settings' => 'Préférences',
|
||||||
'Application settings' => 'Paramètres de l\'application',
|
'Application settings' => 'Paramètres de l\'application',
|
||||||
'Language' => 'Langue',
|
'Language' => 'Langue',
|
||||||
'Webhooks token:' => 'Jeton de securité pour les webhooks :',
|
'Webhook token:' => 'Jeton de securité pour les webhooks :',
|
||||||
'API token:' => 'Jeton de securité pour l\'API :',
|
'API token:' => 'Jeton de securité pour l\'API :',
|
||||||
'More information' => 'Plus d\'informations',
|
'More information' => 'Plus d\'informations',
|
||||||
'Database size:' => 'Taille de la base de données :',
|
'Database size:' => 'Taille de la base de données :',
|
||||||
@@ -516,4 +516,22 @@ return array(
|
|||||||
'Reference' => 'Référence',
|
'Reference' => 'Référence',
|
||||||
'Reference: %s' => 'Référence : %s',
|
'Reference: %s' => 'Référence : %s',
|
||||||
'Label' => 'Libellé',
|
'Label' => 'Libellé',
|
||||||
|
'Database' => 'Base de données',
|
||||||
|
'About' => 'A propos',
|
||||||
|
'Database driver:' => 'Type de base de données :',
|
||||||
|
'Board settings' => 'Paramètres du tableau',
|
||||||
|
'URL and token' => 'URL et jeton de sécurité',
|
||||||
|
'Webhook settings' => 'Paramètres pour les webhooks',
|
||||||
|
'URL for task creation:' => 'URL pour la création de tâche :',
|
||||||
|
'Reset token' => 'Regénérer le jeton de sécurité',
|
||||||
|
'API endpoint:' => 'URL de l\'API :',
|
||||||
|
'Refresh interval for private board' => 'Intervalle pour rafraîchir un tableau privé',
|
||||||
|
'Refresh interval for public board' => 'Intervalle pour rafraîchir un tableau public',
|
||||||
|
'Task highlight period' => 'Durée pour mettre une tâche en évidence',
|
||||||
|
'Period (in second) to consider a task was modified recently (0 to disable, 2 days by default)' => 'Durée en seconde pour considérer une tâche comme récemment modifiée (0 pour désactiver, 2 jours par défaut)',
|
||||||
|
'Frequency in second (60 seconds by default)' => 'Fréquence en seconde (60 secondes par défaut)',
|
||||||
|
'Frequency in second (0 to disable this feature, 10 seconds by default)' => 'Fréquence en seconde (0 pour désactiver, 10 secondes par défaut)',
|
||||||
|
'Application URL' => 'URL de l\'application',
|
||||||
|
'Example: http://example.kanboard.net/ (used by email notifications)' => 'Exemple : http://exemple.kanboard.net/ (utilisé pour les notifications)',
|
||||||
|
'Token regenerated.' => 'Jeton de sécurité regénéré.',
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -83,7 +83,7 @@ return array(
|
|||||||
'Settings' => 'Impostazioni',
|
'Settings' => 'Impostazioni',
|
||||||
'Application settings' => 'Impostazioni dell\'applicazione',
|
'Application settings' => 'Impostazioni dell\'applicazione',
|
||||||
'Language' => 'Lingua',
|
'Language' => 'Lingua',
|
||||||
'Webhooks token:' => 'Identificatore (token) per i webhooks :',
|
'Webhook token:' => 'Identificatore (token) per i webhooks :',
|
||||||
// 'API token:' => '',
|
// 'API token:' => '',
|
||||||
'More information' => 'Più informazioni',
|
'More information' => 'Più informazioni',
|
||||||
'Database size:' => 'Dimensioni della base dati:',
|
'Database size:' => 'Dimensioni della base dati:',
|
||||||
@@ -516,4 +516,22 @@ return array(
|
|||||||
// 'Reference' => '',
|
// 'Reference' => '',
|
||||||
// 'Reference: %s' => '',
|
// 'Reference: %s' => '',
|
||||||
// 'Label' => '',
|
// 'Label' => '',
|
||||||
|
// 'Database' => '',
|
||||||
|
// 'About' => '',
|
||||||
|
// 'Database driver:' => '',
|
||||||
|
// 'Board settings' => '',
|
||||||
|
// 'URL and token' => '',
|
||||||
|
// 'Webhook settings' => '',
|
||||||
|
// 'URL for task creation:' => '',
|
||||||
|
// 'Reset token' => '',
|
||||||
|
// 'API endpoint:' => '',
|
||||||
|
// 'Refresh interval for private board' => '',
|
||||||
|
// 'Refresh interval for public board' => '',
|
||||||
|
// 'Task highlight period' => '',
|
||||||
|
// 'Period (in second) to consider a task was modified recently (0 to disable, 2 days by default)' => '',
|
||||||
|
// 'Frequency in second (60 seconds by default)' => '',
|
||||||
|
// 'Frequency in second (0 to disable this feature, 10 seconds by default)' => '',
|
||||||
|
// 'Application URL' => '',
|
||||||
|
// 'Example: http://example.kanboard.net/ (used by email notifications)' => '',
|
||||||
|
// 'Token regenerated.' => '',
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -83,7 +83,7 @@ return array(
|
|||||||
'Settings' => 'Ustawienia',
|
'Settings' => 'Ustawienia',
|
||||||
'Application settings' => 'Ustawienia aplikacji',
|
'Application settings' => 'Ustawienia aplikacji',
|
||||||
'Language' => 'Język',
|
'Language' => 'Język',
|
||||||
'Webhooks token:' => 'Token :',
|
'Webhook token:' => 'Token :',
|
||||||
// 'API token:' => '',
|
// 'API token:' => '',
|
||||||
'More information' => 'Więcej informacji',
|
'More information' => 'Więcej informacji',
|
||||||
'Database size:' => 'Rozmiar bazy danych :',
|
'Database size:' => 'Rozmiar bazy danych :',
|
||||||
@@ -516,4 +516,22 @@ return array(
|
|||||||
// 'Reference' => '',
|
// 'Reference' => '',
|
||||||
// 'Reference: %s' => '',
|
// 'Reference: %s' => '',
|
||||||
// 'Label' => '',
|
// 'Label' => '',
|
||||||
|
// 'Database' => '',
|
||||||
|
// 'About' => '',
|
||||||
|
// 'Database driver:' => '',
|
||||||
|
// 'Board settings' => '',
|
||||||
|
// 'URL and token' => '',
|
||||||
|
// 'Webhook settings' => '',
|
||||||
|
// 'URL for task creation:' => '',
|
||||||
|
// 'Reset token' => '',
|
||||||
|
// 'API endpoint:' => '',
|
||||||
|
// 'Refresh interval for private board' => '',
|
||||||
|
// 'Refresh interval for public board' => '',
|
||||||
|
// 'Task highlight period' => '',
|
||||||
|
// 'Period (in second) to consider a task was modified recently (0 to disable, 2 days by default)' => '',
|
||||||
|
// 'Frequency in second (60 seconds by default)' => '',
|
||||||
|
// 'Frequency in second (0 to disable this feature, 10 seconds by default)' => '',
|
||||||
|
// 'Application URL' => '',
|
||||||
|
// 'Example: http://example.kanboard.net/ (used by email notifications)' => '',
|
||||||
|
// 'Token regenerated.' => '',
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -83,7 +83,7 @@ return array(
|
|||||||
'Settings' => 'Preferências',
|
'Settings' => 'Preferências',
|
||||||
'Application settings' => 'Preferências da aplicação',
|
'Application settings' => 'Preferências da aplicação',
|
||||||
'Language' => 'Idioma',
|
'Language' => 'Idioma',
|
||||||
'Webhooks token:' => 'Token de webhooks:',
|
'Webhook token:' => 'Token de webhooks:',
|
||||||
'API token:' => 'API Token:',
|
'API token:' => 'API Token:',
|
||||||
'More information' => 'Mais informação',
|
'More information' => 'Mais informação',
|
||||||
'Database size:' => 'Tamanho do banco de dados:',
|
'Database size:' => 'Tamanho do banco de dados:',
|
||||||
@@ -516,4 +516,22 @@ return array(
|
|||||||
// 'Reference' => '',
|
// 'Reference' => '',
|
||||||
// 'Reference: %s' => '',
|
// 'Reference: %s' => '',
|
||||||
// 'Label' => '',
|
// 'Label' => '',
|
||||||
|
// 'Database' => '',
|
||||||
|
// 'About' => '',
|
||||||
|
// 'Database driver:' => '',
|
||||||
|
// 'Board settings' => '',
|
||||||
|
// 'URL and token' => '',
|
||||||
|
// 'Webhook settings' => '',
|
||||||
|
// 'URL for task creation:' => '',
|
||||||
|
// 'Reset token' => '',
|
||||||
|
// 'API endpoint:' => '',
|
||||||
|
// 'Refresh interval for private board' => '',
|
||||||
|
// 'Refresh interval for public board' => '',
|
||||||
|
// 'Task highlight period' => '',
|
||||||
|
// 'Period (in second) to consider a task was modified recently (0 to disable, 2 days by default)' => '',
|
||||||
|
// 'Frequency in second (60 seconds by default)' => '',
|
||||||
|
// 'Frequency in second (0 to disable this feature, 10 seconds by default)' => '',
|
||||||
|
// 'Application URL' => '',
|
||||||
|
// 'Example: http://example.kanboard.net/ (used by email notifications)' => '',
|
||||||
|
// 'Token regenerated.' => '',
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -83,7 +83,7 @@ return array(
|
|||||||
'Settings' => 'Настройки',
|
'Settings' => 'Настройки',
|
||||||
'Application settings' => 'Настройки приложения',
|
'Application settings' => 'Настройки приложения',
|
||||||
'Language' => 'Язык',
|
'Language' => 'Язык',
|
||||||
'Webhooks token:' => 'Webhooks токен :',
|
'Webhook token:' => 'Webhooks токен :',
|
||||||
'API token:' => 'API токен :',
|
'API token:' => 'API токен :',
|
||||||
'More information' => 'Подробнее',
|
'More information' => 'Подробнее',
|
||||||
'Database size:' => 'Размер базы данных :',
|
'Database size:' => 'Размер базы данных :',
|
||||||
@@ -516,4 +516,22 @@ return array(
|
|||||||
// 'Reference' => '',
|
// 'Reference' => '',
|
||||||
// 'Reference: %s' => '',
|
// 'Reference: %s' => '',
|
||||||
// 'Label' => '',
|
// 'Label' => '',
|
||||||
|
// 'Database' => '',
|
||||||
|
// 'About' => '',
|
||||||
|
// 'Database driver:' => '',
|
||||||
|
// 'Board settings' => '',
|
||||||
|
// 'URL and token' => '',
|
||||||
|
// 'Webhook settings' => '',
|
||||||
|
// 'URL for task creation:' => '',
|
||||||
|
// 'Reset token' => '',
|
||||||
|
// 'API endpoint:' => '',
|
||||||
|
// 'Refresh interval for private board' => '',
|
||||||
|
// 'Refresh interval for public board' => '',
|
||||||
|
// 'Task highlight period' => '',
|
||||||
|
// 'Period (in second) to consider a task was modified recently (0 to disable, 2 days by default)' => '',
|
||||||
|
// 'Frequency in second (60 seconds by default)' => '',
|
||||||
|
// 'Frequency in second (0 to disable this feature, 10 seconds by default)' => '',
|
||||||
|
// 'Application URL' => '',
|
||||||
|
// 'Example: http://example.kanboard.net/ (used by email notifications)' => '',
|
||||||
|
// 'Token regenerated.' => '',
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -83,7 +83,7 @@ return array(
|
|||||||
'Settings' => 'Inställningar',
|
'Settings' => 'Inställningar',
|
||||||
'Application settings' => 'Applikationsinställningar',
|
'Application settings' => 'Applikationsinställningar',
|
||||||
'Language' => 'Språk',
|
'Language' => 'Språk',
|
||||||
'Webhooks token:' => 'Token för webhooks:',
|
'Webhook token:' => 'Token för webhooks:',
|
||||||
'API token:' => 'API token:',
|
'API token:' => 'API token:',
|
||||||
'More information' => 'Mer information',
|
'More information' => 'Mer information',
|
||||||
'Database size:' => 'Databasstorlek:',
|
'Database size:' => 'Databasstorlek:',
|
||||||
@@ -516,4 +516,22 @@ return array(
|
|||||||
// 'Reference' => '',
|
// 'Reference' => '',
|
||||||
// 'Reference: %s' => '',
|
// 'Reference: %s' => '',
|
||||||
// 'Label' => '',
|
// 'Label' => '',
|
||||||
|
// 'Database' => '',
|
||||||
|
// 'About' => '',
|
||||||
|
// 'Database driver:' => '',
|
||||||
|
// 'Board settings' => '',
|
||||||
|
// 'URL and token' => '',
|
||||||
|
// 'Webhook settings' => '',
|
||||||
|
// 'URL for task creation:' => '',
|
||||||
|
// 'Reset token' => '',
|
||||||
|
// 'API endpoint:' => '',
|
||||||
|
// 'Refresh interval for private board' => '',
|
||||||
|
// 'Refresh interval for public board' => '',
|
||||||
|
// 'Task highlight period' => '',
|
||||||
|
// 'Period (in second) to consider a task was modified recently (0 to disable, 2 days by default)' => '',
|
||||||
|
// 'Frequency in second (60 seconds by default)' => '',
|
||||||
|
// 'Frequency in second (0 to disable this feature, 10 seconds by default)' => '',
|
||||||
|
// 'Application URL' => '',
|
||||||
|
// 'Example: http://example.kanboard.net/ (used by email notifications)' => '',
|
||||||
|
// 'Token regenerated.' => '',
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -83,7 +83,7 @@ return array(
|
|||||||
'Settings' => '设置',
|
'Settings' => '设置',
|
||||||
'Application settings' => '应用设置',
|
'Application settings' => '应用设置',
|
||||||
'Language' => '语言',
|
'Language' => '语言',
|
||||||
'Webhooks token:' => '页面钩子令牌:',
|
'Webhook token:' => '页面钩子令牌:',
|
||||||
// 'API token:' => '',
|
// 'API token:' => '',
|
||||||
'More information' => '更多信息',
|
'More information' => '更多信息',
|
||||||
'Database size:' => '数据库大小:',
|
'Database size:' => '数据库大小:',
|
||||||
@@ -516,4 +516,22 @@ return array(
|
|||||||
// 'Reference' => '',
|
// 'Reference' => '',
|
||||||
// 'Reference: %s' => '',
|
// 'Reference: %s' => '',
|
||||||
// 'Label' => '',
|
// 'Label' => '',
|
||||||
|
// 'Database' => '',
|
||||||
|
// 'About' => '',
|
||||||
|
// 'Database driver:' => '',
|
||||||
|
// 'Board settings' => '',
|
||||||
|
// 'URL and token' => '',
|
||||||
|
// 'Webhook settings' => '',
|
||||||
|
// 'URL for task creation:' => '',
|
||||||
|
// 'Reset token' => '',
|
||||||
|
// 'API endpoint:' => '',
|
||||||
|
// 'Refresh interval for private board' => '',
|
||||||
|
// 'Refresh interval for public board' => '',
|
||||||
|
// 'Task highlight period' => '',
|
||||||
|
// 'Period (in second) to consider a task was modified recently (0 to disable, 2 days by default)' => '',
|
||||||
|
// 'Frequency in second (60 seconds by default)' => '',
|
||||||
|
// 'Frequency in second (0 to disable this feature, 10 seconds by default)' => '',
|
||||||
|
// 'Application URL' => '',
|
||||||
|
// 'Example: http://example.kanboard.net/ (used by email notifications)' => '',
|
||||||
|
// 'Token regenerated.' => '',
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ use SimpleValidator\Validator;
|
|||||||
use SimpleValidator\Validators;
|
use SimpleValidator\Validators;
|
||||||
use Core\Translator;
|
use Core\Translator;
|
||||||
use Core\Security;
|
use Core\Security;
|
||||||
|
use Core\Session;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Config model
|
* Config model
|
||||||
@@ -20,7 +21,7 @@ class Config extends Base
|
|||||||
*
|
*
|
||||||
* @var string
|
* @var string
|
||||||
*/
|
*/
|
||||||
const TABLE = 'config';
|
const TABLE = 'settings';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get available timezones
|
* Get available timezones
|
||||||
@@ -68,6 +69,11 @@ class Config extends Base
|
|||||||
*/
|
*/
|
||||||
public function get($name, $default_value = '')
|
public function get($name, $default_value = '')
|
||||||
{
|
{
|
||||||
|
if (! Session::isOpen()) {
|
||||||
|
$value = $this->db->table(self::TABLE)->eq('option', $name)->findOneColumn('value');
|
||||||
|
return $value ?: $default_value;
|
||||||
|
}
|
||||||
|
|
||||||
if (! isset($_SESSION['config'][$name])) {
|
if (! isset($_SESSION['config'][$name])) {
|
||||||
$_SESSION['config'] = $this->getAll();
|
$_SESSION['config'] = $this->getAll();
|
||||||
}
|
}
|
||||||
@@ -87,7 +93,7 @@ class Config extends Base
|
|||||||
*/
|
*/
|
||||||
public function getAll()
|
public function getAll()
|
||||||
{
|
{
|
||||||
return $this->db->table(self::TABLE)->findOne();
|
return $this->db->table(self::TABLE)->listing('option', 'value');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -99,8 +105,16 @@ class Config extends Base
|
|||||||
*/
|
*/
|
||||||
public function save(array $values)
|
public function save(array $values)
|
||||||
{
|
{
|
||||||
$_SESSION['config'] = $values;
|
foreach ($values as $option => $value) {
|
||||||
return $this->db->table(self::TABLE)->update($values);
|
|
||||||
|
$result = $this->db->table(self::TABLE)->eq('option', $option)->update(array('value' => $value));
|
||||||
|
|
||||||
|
if (! $result) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -111,27 +125,31 @@ class Config extends Base
|
|||||||
public function reload()
|
public function reload()
|
||||||
{
|
{
|
||||||
$_SESSION['config'] = $this->getAll();
|
$_SESSION['config'] = $this->getAll();
|
||||||
Translator::load($this->get('language', 'en_US'));
|
$this->setupTranslations();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Validate settings modification
|
* Load translations
|
||||||
*
|
*
|
||||||
* @access public
|
* @access public
|
||||||
* @param array $values Form values
|
|
||||||
* @return array $valid, $errors [0] = Success or not, [1] = List of errors
|
|
||||||
*/
|
*/
|
||||||
public function validateModification(array $values)
|
public function setupTranslations()
|
||||||
{
|
{
|
||||||
$v = new Validator($values, array(
|
$language = $this->get('application_language', 'en_US');
|
||||||
new Validators\Required('language', t('The language is required')),
|
|
||||||
new Validators\Required('timezone', t('The timezone is required')),
|
|
||||||
));
|
|
||||||
|
|
||||||
return array(
|
if ($language !== 'en_US') {
|
||||||
$v->execute(),
|
Translator::load($language);
|
||||||
$v->getErrors()
|
}
|
||||||
);
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set timezone
|
||||||
|
*
|
||||||
|
* @access public
|
||||||
|
*/
|
||||||
|
public function setupTimezone()
|
||||||
|
{
|
||||||
|
date_default_timezone_set($this->get('application_timezone', 'UTC'));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -168,21 +186,15 @@ class Config extends Base
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Regenerate all tokens (projects and webhooks)
|
* Regenerate a token
|
||||||
*
|
*
|
||||||
* @access public
|
* @access public
|
||||||
|
* @param string $option Parameter name
|
||||||
*/
|
*/
|
||||||
public function regenerateTokens()
|
public function regenerateToken($option)
|
||||||
{
|
{
|
||||||
$this->db->table(self::TABLE)->update(array(
|
return $this->db->table(self::TABLE)
|
||||||
'webhooks_token' => Security::generateToken(),
|
->eq('option', $option)
|
||||||
'api_token' => Security::generateToken(),
|
->update(array('value' => Security::generateToken()));
|
||||||
));
|
|
||||||
|
|
||||||
$projects = $this->db->table(Project::TABLE)->findAllByColumn('id');
|
|
||||||
|
|
||||||
foreach ($projects as $project_id) {
|
|
||||||
$this->db->table(Project::TABLE)->eq('id', $project_id)->update(array('token' => Security::generateToken()));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -182,7 +182,7 @@ class Notification extends Base
|
|||||||
public function getMailContent($template, array $data)
|
public function getMailContent($template, array $data)
|
||||||
{
|
{
|
||||||
$tpl = new Template;
|
$tpl = new Template;
|
||||||
return $tpl->load($template, $data);
|
return $tpl->load($template, $data + array('application_url' => $this->config->get('application_url')));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -287,7 +287,7 @@ class Project extends Base
|
|||||||
}
|
}
|
||||||
|
|
||||||
$project_id = $this->db->getConnection()->getLastId();
|
$project_id = $this->db->getConnection()->getLastId();
|
||||||
$column_names = explode(',', $this->config->get('default_columns', implode(',', $this->board->getDefaultColumns())));
|
$column_names = explode(',', $this->config->get('board_columns', implode(',', $this->board->getDefaultColumns())));
|
||||||
$columns = array();
|
$columns = array();
|
||||||
|
|
||||||
foreach ($column_names as $column_name) {
|
foreach ($column_names as $column_name) {
|
||||||
|
|||||||
@@ -64,9 +64,9 @@ class Webhook extends Base
|
|||||||
*/
|
*/
|
||||||
public function attachEvents()
|
public function attachEvents()
|
||||||
{
|
{
|
||||||
$this->url_task_creation = $this->config->get('webhooks_url_task_creation');
|
$this->url_task_creation = $this->config->get('webhook_url_task_creation');
|
||||||
$this->url_task_modification = $this->config->get('webhooks_url_task_modification');
|
$this->url_task_modification = $this->config->get('webhook_url_task_modification');
|
||||||
$this->token = $this->config->get('webhooks_token');
|
$this->token = $this->config->get('webhook_token');
|
||||||
|
|
||||||
if ($this->url_task_creation) {
|
if ($this->url_task_creation) {
|
||||||
$this->attachCreateEvents();
|
$this->attachCreateEvents();
|
||||||
|
|||||||
@@ -2,9 +2,40 @@
|
|||||||
|
|
||||||
namespace Schema;
|
namespace Schema;
|
||||||
|
|
||||||
|
use PDO;
|
||||||
use Core\Security;
|
use Core\Security;
|
||||||
|
|
||||||
const VERSION = 28;
|
const VERSION = 29;
|
||||||
|
|
||||||
|
function version_29($pdo)
|
||||||
|
{
|
||||||
|
$pdo->exec("
|
||||||
|
CREATE TABLE settings (
|
||||||
|
option VARCHAR(100) PRIMARY KEY,
|
||||||
|
value VARCHAR(255) DEFAULT ''
|
||||||
|
)
|
||||||
|
");
|
||||||
|
|
||||||
|
// Migrate old config parameters
|
||||||
|
$rq = $pdo->prepare('SELECT * FROM config');
|
||||||
|
$rq->execute();
|
||||||
|
$parameters = $rq->fetch(PDO::FETCH_ASSOC);
|
||||||
|
|
||||||
|
$rq = $pdo->prepare('INSERT INTO settings VALUES (?, ?)');
|
||||||
|
$rq->execute(array('board_highlight_period', defined('RECENT_TASK_PERIOD') ? RECENT_TASK_PERIOD : 48*60*60));
|
||||||
|
$rq->execute(array('board_public_refresh_interval', defined('BOARD_PUBLIC_CHECK_INTERVAL') ? BOARD_PUBLIC_CHECK_INTERVAL : 60));
|
||||||
|
$rq->execute(array('board_private_refresh_interval', defined('BOARD_CHECK_INTERVAL') ? BOARD_CHECK_INTERVAL : 10));
|
||||||
|
$rq->execute(array('board_columns', $parameters['default_columns']));
|
||||||
|
$rq->execute(array('webhook_url_task_creation', $parameters['webhooks_url_task_creation']));
|
||||||
|
$rq->execute(array('webhook_url_task_modification', $parameters['webhooks_url_task_modification']));
|
||||||
|
$rq->execute(array('webhook_token', $parameters['webhooks_token']));
|
||||||
|
$rq->execute(array('api_token', $parameters['api_token']));
|
||||||
|
$rq->execute(array('application_language', $parameters['language']));
|
||||||
|
$rq->execute(array('application_timezone', $parameters['timezone']));
|
||||||
|
$rq->execute(array('application_url', defined('KANBOARD_URL') ? KANBOARD_URL : ''));
|
||||||
|
|
||||||
|
$pdo->exec('DROP TABLE config');
|
||||||
|
}
|
||||||
|
|
||||||
function version_28($pdo)
|
function version_28($pdo)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -2,9 +2,40 @@
|
|||||||
|
|
||||||
namespace Schema;
|
namespace Schema;
|
||||||
|
|
||||||
|
use PDO;
|
||||||
use Core\Security;
|
use Core\Security;
|
||||||
|
|
||||||
const VERSION = 9;
|
const VERSION = 10;
|
||||||
|
|
||||||
|
function version_10($pdo)
|
||||||
|
{
|
||||||
|
$pdo->exec("
|
||||||
|
CREATE TABLE settings (
|
||||||
|
option VARCHAR(100) PRIMARY KEY,
|
||||||
|
value VARCHAR(255) DEFAULT ''
|
||||||
|
)
|
||||||
|
");
|
||||||
|
|
||||||
|
// Migrate old config parameters
|
||||||
|
$rq = $pdo->prepare('SELECT * FROM config');
|
||||||
|
$rq->execute();
|
||||||
|
$parameters = $rq->fetch(PDO::FETCH_ASSOC);
|
||||||
|
|
||||||
|
$rq = $pdo->prepare('INSERT INTO settings VALUES (?, ?)');
|
||||||
|
$rq->execute(array('board_highlight_period', defined('RECENT_TASK_PERIOD') ? RECENT_TASK_PERIOD : 48*60*60));
|
||||||
|
$rq->execute(array('board_public_refresh_interval', defined('BOARD_PUBLIC_CHECK_INTERVAL') ? BOARD_PUBLIC_CHECK_INTERVAL : 60));
|
||||||
|
$rq->execute(array('board_private_refresh_interval', defined('BOARD_CHECK_INTERVAL') ? BOARD_CHECK_INTERVAL : 10));
|
||||||
|
$rq->execute(array('board_columns', $parameters['default_columns']));
|
||||||
|
$rq->execute(array('webhook_url_task_creation', $parameters['webhooks_url_task_creation']));
|
||||||
|
$rq->execute(array('webhook_url_task_modification', $parameters['webhooks_url_task_modification']));
|
||||||
|
$rq->execute(array('webhook_token', $parameters['webhooks_token']));
|
||||||
|
$rq->execute(array('api_token', $parameters['api_token']));
|
||||||
|
$rq->execute(array('application_language', $parameters['language']));
|
||||||
|
$rq->execute(array('application_timezone', $parameters['timezone']));
|
||||||
|
$rq->execute(array('application_url', defined('KANBOARD_URL') ? KANBOARD_URL : ''));
|
||||||
|
|
||||||
|
$pdo->exec('DROP TABLE config');
|
||||||
|
}
|
||||||
|
|
||||||
function version_9($pdo)
|
function version_9($pdo)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -3,8 +3,39 @@
|
|||||||
namespace Schema;
|
namespace Schema;
|
||||||
|
|
||||||
use Core\Security;
|
use Core\Security;
|
||||||
|
use PDO;
|
||||||
|
|
||||||
const VERSION = 28;
|
const VERSION = 29;
|
||||||
|
|
||||||
|
function version_29($pdo)
|
||||||
|
{
|
||||||
|
$pdo->exec("
|
||||||
|
CREATE TABLE settings (
|
||||||
|
option TEXT PRIMARY KEY,
|
||||||
|
value TEXT DEFAULT ''
|
||||||
|
)
|
||||||
|
");
|
||||||
|
|
||||||
|
// Migrate old config parameters
|
||||||
|
$rq = $pdo->prepare('SELECT * FROM config');
|
||||||
|
$rq->execute();
|
||||||
|
$parameters = $rq->fetch(PDO::FETCH_ASSOC);
|
||||||
|
|
||||||
|
$rq = $pdo->prepare('INSERT INTO settings VALUES (?, ?)');
|
||||||
|
$rq->execute(array('board_highlight_period', defined('RECENT_TASK_PERIOD') ? RECENT_TASK_PERIOD : 48*60*60));
|
||||||
|
$rq->execute(array('board_public_refresh_interval', defined('BOARD_PUBLIC_CHECK_INTERVAL') ? BOARD_PUBLIC_CHECK_INTERVAL : 60));
|
||||||
|
$rq->execute(array('board_private_refresh_interval', defined('BOARD_CHECK_INTERVAL') ? BOARD_CHECK_INTERVAL : 10));
|
||||||
|
$rq->execute(array('board_columns', $parameters['default_columns']));
|
||||||
|
$rq->execute(array('webhook_url_task_creation', $parameters['webhooks_url_task_creation']));
|
||||||
|
$rq->execute(array('webhook_url_task_modification', $parameters['webhooks_url_task_modification']));
|
||||||
|
$rq->execute(array('webhook_token', $parameters['webhooks_token']));
|
||||||
|
$rq->execute(array('api_token', $parameters['api_token']));
|
||||||
|
$rq->execute(array('application_language', $parameters['language']));
|
||||||
|
$rq->execute(array('application_timezone', $parameters['timezone']));
|
||||||
|
$rq->execute(array('application_url', defined('KANBOARD_URL') ? KANBOARD_URL : ''));
|
||||||
|
|
||||||
|
$pdo->exec('DROP TABLE config');
|
||||||
|
}
|
||||||
|
|
||||||
function version_28($pdo)
|
function version_28($pdo)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -26,7 +26,13 @@
|
|||||||
<?php if (empty($board)): ?>
|
<?php if (empty($board)): ?>
|
||||||
<p class="alert alert-error"><?= t('There is no column in your project!') ?></p>
|
<p class="alert alert-error"><?= t('There is no column in your project!') ?></p>
|
||||||
<?php else: ?>
|
<?php else: ?>
|
||||||
<?= Helper\template('board_show', array('current_project_id' => $current_project_id, 'board' => $board, 'categories' => $categories)) ?>
|
<?= Helper\template('board_show', array(
|
||||||
|
'current_project_id' => $current_project_id,
|
||||||
|
'board' => $board,
|
||||||
|
'categories' => $categories,
|
||||||
|
'board_private_refresh_interval' => $board_private_refresh_interval,
|
||||||
|
'board_highlight_period' => $board_highlight_period,
|
||||||
|
)) ?>
|
||||||
<?php endif ?>
|
<?php endif ?>
|
||||||
|
|
||||||
</section>
|
</section>
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
<table id="board" data-project-id="<?= $current_project_id ?>" data-time="<?= time() ?>" data-check-interval="<?= BOARD_CHECK_INTERVAL ?>" data-csrf-token=<?= \Core\Security::getCSRFToken() ?>>
|
<table id="board" data-project-id="<?= $current_project_id ?>" data-time="<?= time() ?>" data-check-interval="<?= $board_private_refresh_interval ?>" data-csrf-token=<?= \Core\Security::getCSRFToken() ?>>
|
||||||
<tr>
|
<tr>
|
||||||
<?php $column_with = round(100 / count($board), 2); ?>
|
<?php $column_with = round(100 / count($board), 2); ?>
|
||||||
<?php foreach ($board as $column): ?>
|
<?php foreach ($board as $column): ?>
|
||||||
@@ -32,7 +32,7 @@
|
|||||||
data-task-limit="<?= $column['task_limit'] ?>"
|
data-task-limit="<?= $column['task_limit'] ?>"
|
||||||
>
|
>
|
||||||
<?php foreach ($column['tasks'] as $task): ?>
|
<?php foreach ($column['tasks'] as $task): ?>
|
||||||
<div class="task-board draggable-item task-<?= $task['color_id'] ?> <?= $task['date_modification'] > time() - RECENT_TASK_PERIOD ? 'task-board-recent' : '' ?>"
|
<div class="task-board draggable-item task-<?= $task['color_id'] ?> <?= $task['date_modification'] > time() - $board_highlight_period ? 'task-board-recent' : '' ?>"
|
||||||
data-task-id="<?= $task['id'] ?>"
|
data-task-id="<?= $task['id'] ?>"
|
||||||
data-owner-id="<?= $task['owner_id'] ?>"
|
data-owner-id="<?= $task['owner_id'] ?>"
|
||||||
data-category-id="<?= $task['category_id'] ?>"
|
data-category-id="<?= $task['category_id'] ?>"
|
||||||
|
|||||||
41
app/Templates/config_about.php
Normal file
41
app/Templates/config_about.php
Normal file
@@ -0,0 +1,41 @@
|
|||||||
|
<div class="page-header">
|
||||||
|
<h2><?= t('About') ?></h2>
|
||||||
|
</div>
|
||||||
|
<section class="listing">
|
||||||
|
<ul>
|
||||||
|
<li>
|
||||||
|
<?= t('Official website:') ?>
|
||||||
|
<a href="http://kanboard.net/" target="_blank" rel="noreferer">http://kanboard.net/</a>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<?= t('Application version:') ?>
|
||||||
|
<strong><?= APP_VERSION ?></strong>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</section>
|
||||||
|
|
||||||
|
<div class="page-header">
|
||||||
|
<h2><?= t('Database') ?></h2>
|
||||||
|
</div>
|
||||||
|
<section class="listing">
|
||||||
|
<ul>
|
||||||
|
<li>
|
||||||
|
<?= t('Database driver:') ?>
|
||||||
|
<strong><?= Helper\escape(DB_DRIVER) ?></strong>
|
||||||
|
</li>
|
||||||
|
<?php if (DB_DRIVER === 'sqlite'): ?>
|
||||||
|
<li>
|
||||||
|
<?= t('Database size:') ?>
|
||||||
|
<strong><?= Helper\format_bytes($db_size) ?></strong>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<?= Helper\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) ?>
|
||||||
|
<?= t('(VACUUM command)') ?>
|
||||||
|
</li>
|
||||||
|
<?php endif ?>
|
||||||
|
</ul>
|
||||||
|
</section>
|
||||||
18
app/Templates/config_api.php
Normal file
18
app/Templates/config_api.php
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
<div class="page-header">
|
||||||
|
<h2><?= t('API') ?></h2>
|
||||||
|
</div>
|
||||||
|
<section class="listing">
|
||||||
|
<ul>
|
||||||
|
<li>
|
||||||
|
<?= t('API token:') ?>
|
||||||
|
<strong><?= Helper\escape($values['api_token']) ?></strong>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<?= t('API endpoint:') ?>
|
||||||
|
<input type="text" readonly="readonly" value="<?= Helper\get_current_base_url().'jsonrpc.php' ?>">
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<?= Helper\a(t('Reset token'), 'config', 'token', array('type' => 'api'), true) ?>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</section>
|
||||||
23
app/Templates/config_application.php
Normal file
23
app/Templates/config_application.php
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
<div class="page-header">
|
||||||
|
<h2><?= t('Application settings') ?></h2>
|
||||||
|
</div>
|
||||||
|
<section>
|
||||||
|
<form method="post" action="<?= Helper\u('config', 'application') ?>" autocomplete="off">
|
||||||
|
|
||||||
|
<?= Helper\form_csrf() ?>
|
||||||
|
|
||||||
|
<?= Helper\form_label(t('Application URL'), 'application_url') ?>
|
||||||
|
<?= Helper\form_text('application_url', $values, $errors, array('placeholder="http://example.kanboar.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/>
|
||||||
|
|
||||||
|
<?= Helper\form_label(t('Timezone'), 'application_timezone') ?>
|
||||||
|
<?= Helper\form_select('application_timezone', $timezones, $values, $errors) ?><br/>
|
||||||
|
|
||||||
|
<div class="form-actions">
|
||||||
|
<input type="submit" value="<?= t('Save') ?>" class="btn btn-blue"/>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
</section>
|
||||||
29
app/Templates/config_board.php
Normal file
29
app/Templates/config_board.php
Normal file
@@ -0,0 +1,29 @@
|
|||||||
|
<div class="page-header">
|
||||||
|
<h2><?= t('Board settings') ?></h2>
|
||||||
|
</div>
|
||||||
|
<section>
|
||||||
|
<form method="post" action="<?= Helper\u('config', 'board') ?>" autocomplete="off">
|
||||||
|
|
||||||
|
<?= Helper\form_csrf() ?>
|
||||||
|
|
||||||
|
<?= Helper\form_label(t('Task highlight period'), 'board_highlight_period') ?>
|
||||||
|
<?= Helper\form_number('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/>
|
||||||
|
<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/>
|
||||||
|
<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/>
|
||||||
|
<p class="form-help"><?= t('Default values are "%s"', $default_columns) ?></p>
|
||||||
|
|
||||||
|
<div class="form-actions">
|
||||||
|
<input type="submit" value="<?= t('Save') ?>" class="btn btn-blue"/>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
</section>
|
||||||
@@ -1,71 +0,0 @@
|
|||||||
<section id="main">
|
|
||||||
|
|
||||||
<div class="page-header">
|
|
||||||
<h2><?= t('Application settings') ?></h2>
|
|
||||||
</div>
|
|
||||||
<section>
|
|
||||||
<form method="post" action="?controller=config&action=save" autocomplete="off">
|
|
||||||
|
|
||||||
<?= Helper\form_csrf() ?>
|
|
||||||
|
|
||||||
<?= Helper\form_label(t('Language'), 'language') ?>
|
|
||||||
<?= Helper\form_select('language', $languages, $values, $errors) ?><br/>
|
|
||||||
|
|
||||||
<?= Helper\form_label(t('Timezone'), 'timezone') ?>
|
|
||||||
<?= Helper\form_select('timezone', $timezones, $values, $errors) ?><br/>
|
|
||||||
|
|
||||||
<?= Helper\form_label(t('Webhook URL for task creation'), 'webhooks_url_task_creation') ?>
|
|
||||||
<?= Helper\form_text('webhooks_url_task_creation', $values, $errors) ?><br/>
|
|
||||||
|
|
||||||
<?= Helper\form_label(t('Webhook URL for task modification'), 'webhooks_url_task_modification') ?>
|
|
||||||
<?= Helper\form_text('webhooks_url_task_modification', $values, $errors) ?><br/>
|
|
||||||
|
|
||||||
<?= Helper\form_label(t('Default columns for new projects (Comma-separated)'), 'default_columns') ?>
|
|
||||||
<?= Helper\form_text('default_columns', $values, $errors) ?><br/>
|
|
||||||
<p class="form-help"><?= t('Default values are "%s"', $default_columns) ?></p>
|
|
||||||
|
|
||||||
<div class="form-actions">
|
|
||||||
<input type="submit" value="<?= t('Save') ?>" class="btn btn-blue"/>
|
|
||||||
</div>
|
|
||||||
</form>
|
|
||||||
</section>
|
|
||||||
|
|
||||||
<div class="page-header">
|
|
||||||
<h2><?= t('More information') ?></h2>
|
|
||||||
</div>
|
|
||||||
<section class="settings">
|
|
||||||
<ul>
|
|
||||||
<li><a href="?controller=config&action=tokens<?= Helper\param_csrf() ?>"><?= t('Reset all tokens') ?></a></li>
|
|
||||||
<li>
|
|
||||||
<?= t('Webhooks token:') ?>
|
|
||||||
<strong><?= Helper\escape($values['webhooks_token']) ?></strong>
|
|
||||||
</li>
|
|
||||||
<li>
|
|
||||||
<?= t('API token:') ?>
|
|
||||||
<strong><?= Helper\escape($values['api_token']) ?></strong>
|
|
||||||
</li>
|
|
||||||
<?php if (DB_DRIVER === 'sqlite'): ?>
|
|
||||||
<li>
|
|
||||||
<?= t('Database size:') ?>
|
|
||||||
<strong><?= Helper\format_bytes($db_size) ?></strong>
|
|
||||||
</li>
|
|
||||||
<li>
|
|
||||||
<a href="?controller=config&action=downloadDb<?= Helper\param_csrf() ?>"><?= t('Download the database') ?></a>
|
|
||||||
<?= t('(Gzip compressed Sqlite file)') ?>
|
|
||||||
</li>
|
|
||||||
<li>
|
|
||||||
<a href="?controller=config&action=optimizeDb <?= Helper\param_csrf() ?>"><?= t('Optimize the database') ?></a>
|
|
||||||
<?= t('(VACUUM command)') ?>
|
|
||||||
</li>
|
|
||||||
<?php endif ?>
|
|
||||||
<li>
|
|
||||||
<?= t('Official website:') ?>
|
|
||||||
<a href="http://kanboard.net/" target="_blank" rel="noreferer">http://kanboard.net/</a>
|
|
||||||
</li>
|
|
||||||
<li>
|
|
||||||
<?= t('Application version:') ?>
|
|
||||||
<?= APP_VERSION ?>
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</section>
|
|
||||||
</section>
|
|
||||||
13
app/Templates/config_layout.php
Normal file
13
app/Templates/config_layout.php
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
<section id="main">
|
||||||
|
<div class="page-header">
|
||||||
|
<h2><?= t('Settings') ?></h2>
|
||||||
|
</div>
|
||||||
|
<section class="config-show" id="config-section">
|
||||||
|
|
||||||
|
<?= Helper\template('config_sidebar') ?>
|
||||||
|
|
||||||
|
<div class="config-show-main">
|
||||||
|
<?= $config_content_for_layout ?>
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
</section>
|
||||||
22
app/Templates/config_sidebar.php
Normal file
22
app/Templates/config_sidebar.php
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
<div class="config-show-sidebar">
|
||||||
|
<h2><?= t('Actions') ?></h2>
|
||||||
|
<div class="config-show-actions">
|
||||||
|
<ul>
|
||||||
|
<li>
|
||||||
|
<?= Helper\a(t('About'), 'config', 'index') ?>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<?= Helper\a(t('Application settings'), 'config', 'application') ?>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<?= Helper\a(t('Board settings'), 'config', 'board') ?>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<?= Helper\a(t('Webhooks'), 'config', 'webhook') ?>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<?= Helper\a(t('API'), 'config', 'api') ?>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
38
app/Templates/config_webhook.php
Normal file
38
app/Templates/config_webhook.php
Normal file
@@ -0,0 +1,38 @@
|
|||||||
|
<div class="page-header">
|
||||||
|
<h2><?= t('Webhook settings') ?></h2>
|
||||||
|
</div>
|
||||||
|
<section>
|
||||||
|
<form method="post" action="<?= Helper\u('config', 'webhook') ?>" autocomplete="off">
|
||||||
|
|
||||||
|
<?= Helper\form_csrf() ?>
|
||||||
|
|
||||||
|
<?= Helper\form_label(t('Webhook URL for task creation'), 'webhook_url_task_creation') ?>
|
||||||
|
<?= Helper\form_text('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/>
|
||||||
|
|
||||||
|
<div class="form-actions">
|
||||||
|
<input type="submit" value="<?= t('Save') ?>" class="btn btn-blue"/>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
</section>
|
||||||
|
|
||||||
|
<div class="page-header">
|
||||||
|
<h2><?= t('URL and token') ?></h2>
|
||||||
|
</div>
|
||||||
|
<section class="listing">
|
||||||
|
<ul>
|
||||||
|
<li>
|
||||||
|
<?= t('Webhook token:') ?>
|
||||||
|
<strong><?= Helper\escape($values['webhook_token']) ?></strong>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<?= t('URL for task creation:') ?>
|
||||||
|
<input type="text" readonly="readonly" value="<?= Helper\get_current_base_url().Helper\u('webhook', 'task', array('token' => $values['webhook_token'])) ?>">
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<?= Helper\a(t('Reset token'), 'config', 'token', array('type' => 'webhook'), true) ?>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</section>
|
||||||
@@ -6,8 +6,8 @@
|
|||||||
<meta name="mobile-web-app-capable" content="yes">
|
<meta name="mobile-web-app-capable" content="yes">
|
||||||
<meta name="robots" content="noindex,nofollow">
|
<meta name="robots" content="noindex,nofollow">
|
||||||
|
|
||||||
<?php if (isset($auto_refresh)): ?>
|
<?php if (isset($board_public_refresh_interval)): ?>
|
||||||
<meta http-equiv="refresh" content="<?= BOARD_PUBLIC_CHECK_INTERVAL ?>" >
|
<meta http-equiv="refresh" content="<?= $board_public_refresh_interval ?>" >
|
||||||
<?php endif ?>
|
<?php endif ?>
|
||||||
|
|
||||||
<?php if (! isset($not_editable)): ?>
|
<?php if (! isset($not_editable)): ?>
|
||||||
|
|||||||
@@ -4,4 +4,4 @@
|
|||||||
|
|
||||||
<?= Helper\markdown($comment['comment']) ?>
|
<?= Helper\markdown($comment['comment']) ?>
|
||||||
|
|
||||||
<?= Helper\template('notification_footer', array('task' => $task)) ?>
|
<?= Helper\template('notification_footer', array('task' => $task, 'application_url' => $application_url)) ?>
|
||||||
@@ -4,4 +4,4 @@
|
|||||||
|
|
||||||
<?= Helper\markdown($comment['comment']) ?>
|
<?= Helper\markdown($comment['comment']) ?>
|
||||||
|
|
||||||
<?= Helper\template('notification_footer', array('task' => $task)) ?>
|
<?= Helper\template('notification_footer', array('task' => $task, 'application_url' => $application_url)) ?>
|
||||||
@@ -2,4 +2,4 @@
|
|||||||
|
|
||||||
<h3><?= t('New attachment added "%s"', $file['name']) ?></h3>
|
<h3><?= t('New attachment added "%s"', $file['name']) ?></h3>
|
||||||
|
|
||||||
<?= Helper\template('notification_footer', array('task' => $task)) ?>
|
<?= Helper\template('notification_footer', array('task' => $task, 'application_url' => $application_url)) ?>
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
<hr/>
|
<hr/>
|
||||||
Kanboard
|
Kanboard
|
||||||
|
|
||||||
<?php if (defined('KANBOARD_URL')): ?>
|
<?php if ($application_url): ?>
|
||||||
- <a href="<?= KANBOARD_URL.'?controller=task&action=show&task_id='.$task['id'] ?>"><?= t('view the task on Kanboard') ?></a>.
|
- <a href="<?= $application_url.'?controller=task&action=show&task_id='.$task['id'] ?>"><?= t('view the task on Kanboard') ?></a>.
|
||||||
<?php endif ?>
|
<?php endif ?>
|
||||||
|
|||||||
@@ -14,4 +14,4 @@
|
|||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
<?= Helper\template('notification_footer', array('task' => $task)) ?>
|
<?= Helper\template('notification_footer', array('task' => $task, 'application_url' => $application_url)) ?>
|
||||||
@@ -18,4 +18,4 @@
|
|||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
<?= Helper\template('notification_footer', array('task' => $task)) ?>
|
<?= Helper\template('notification_footer', array('task' => $task, 'application_url' => $application_url)) ?>
|
||||||
@@ -17,4 +17,4 @@
|
|||||||
<?= Helper\markdown($task['description']) ?: t('There is no description.') ?>
|
<?= Helper\markdown($task['description']) ?: t('There is no description.') ?>
|
||||||
<?php endif ?>
|
<?php endif ?>
|
||||||
|
|
||||||
<?= Helper\template('notification_footer', array('task' => $task)) ?>
|
<?= Helper\template('notification_footer', array('task' => $task, 'application_url' => $application_url)) ?>
|
||||||
@@ -2,4 +2,4 @@
|
|||||||
|
|
||||||
<p><?= t('The task #%d have been closed.', $task['id']) ?></p>
|
<p><?= t('The task #%d have been closed.', $task['id']) ?></p>
|
||||||
|
|
||||||
<?= Helper\template('notification_footer', array('task' => $task)) ?>
|
<?= Helper\template('notification_footer', array('task' => $task, 'application_url' => $application_url)) ?>
|
||||||
@@ -40,4 +40,4 @@
|
|||||||
<?= Helper\markdown($task['description']) ?>
|
<?= Helper\markdown($task['description']) ?>
|
||||||
<?php endif ?>
|
<?php endif ?>
|
||||||
|
|
||||||
<?= Helper\template('notification_footer', array('task' => $task)) ?>
|
<?= Helper\template('notification_footer', array('task' => $task, 'application_url' => $application_url)) ?>
|
||||||
@@ -12,4 +12,4 @@
|
|||||||
<?php endforeach ?>
|
<?php endforeach ?>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
<?= Helper\template('notification_footer', array('task' => $task)) ?>
|
<?= Helper\template('notification_footer', array('task' => $task, 'application_url' => $application_url)) ?>
|
||||||
@@ -8,4 +8,4 @@
|
|||||||
<li><?= t('Task position:').' '.Helper\escape($task['position']) ?></li>
|
<li><?= t('Task position:').' '.Helper\escape($task['position']) ?></li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
<?= Helper\template('notification_footer', array('task' => $task)) ?>
|
<?= Helper\template('notification_footer', array('task' => $task, 'application_url' => $application_url)) ?>
|
||||||
@@ -8,4 +8,4 @@
|
|||||||
<li><?= t('Task position:').' '.Helper\escape($task['position']) ?></li>
|
<li><?= t('Task position:').' '.Helper\escape($task['position']) ?></li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
<?= Helper\template('notification_footer', array('task' => $task)) ?>
|
<?= Helper\template('notification_footer', array('task' => $task, 'application_url' => $application_url)) ?>
|
||||||
@@ -2,4 +2,4 @@
|
|||||||
|
|
||||||
<p><?= t('The task #%d have been opened.', $task['id']) ?></p>
|
<p><?= t('The task #%d have been opened.', $task['id']) ?></p>
|
||||||
|
|
||||||
<?= Helper\template('notification_footer', array('task' => $task)) ?>
|
<?= Helper\template('notification_footer', array('task' => $task, 'application_url' => $application_url)) ?>
|
||||||
@@ -40,4 +40,4 @@
|
|||||||
<?= Helper\markdown($task['description']) ?: t('There is no description.') ?>
|
<?= Helper\markdown($task['description']) ?: t('There is no description.') ?>
|
||||||
<?php endif ?>
|
<?php endif ?>
|
||||||
|
|
||||||
<?= Helper\template('notification_footer', array('task' => $task)) ?>
|
<?= Helper\template('notification_footer', array('task' => $task, 'application_url' => $application_url)) ?>
|
||||||
@@ -4,7 +4,7 @@
|
|||||||
|
|
||||||
<?php if ($project['is_public']): ?>
|
<?php if ($project['is_public']): ?>
|
||||||
|
|
||||||
<div class="settings">
|
<div class="listing">
|
||||||
<ul class="no-bullet">
|
<ul class="no-bullet">
|
||||||
<li><strong><i class="fa fa-share-alt"></i> <a href="?controller=board&action=readonly&token=<?= $project['token'] ?>" target="_blank"><?= t('Public link') ?></a></strong></li>
|
<li><strong><i class="fa fa-share-alt"></i> <a href="?controller=board&action=readonly&token=<?= $project['token'] ?>" target="_blank"><?= t('Public link') ?></a></strong></li>
|
||||||
<li><strong><i class="fa fa-rss-square"></i> <a href="?controller=project&action=feed&token=<?= $project['token'] ?>" target="_blank"><?= t('RSS feed') ?></a></strong></li>
|
<li><strong><i class="fa fa-rss-square"></i> <a href="?controller=project&action=feed&token=<?= $project['token'] ?>" target="_blank"><?= t('RSS feed') ?></a></strong></li>
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
<div class="page-header">
|
<div class="page-header">
|
||||||
<h2><?= t('Summary') ?></h2>
|
<h2><?= t('Summary') ?></h2>
|
||||||
</div>
|
</div>
|
||||||
<ul class="settings">
|
<ul class="listing">
|
||||||
<li><strong><?= $project['is_active'] ? t('Active') : t('Inactive') ?></strong></li>
|
<li><strong><?= $project['is_active'] ? t('Active') : t('Inactive') ?></strong></li>
|
||||||
|
|
||||||
<?php if ($project['is_public']): ?>
|
<?php if ($project['is_public']): ?>
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
<?php if (GOOGLE_AUTH): ?>
|
<?php if (GOOGLE_AUTH): ?>
|
||||||
<h3><i class="fa fa-google"></i> <?= t('Google Account') ?></h3>
|
<h3><i class="fa fa-google"></i> <?= t('Google Account') ?></h3>
|
||||||
|
|
||||||
<p class="settings">
|
<p class="listing">
|
||||||
<?php if (Helper\is_current_user($user['id'])): ?>
|
<?php if (Helper\is_current_user($user['id'])): ?>
|
||||||
<?php if (empty($user['google_id'])): ?>
|
<?php if (empty($user['google_id'])): ?>
|
||||||
<a href="?controller=user&action=google<?= Helper\param_csrf() ?>"><?= t('Link my Google Account') ?></a>
|
<a href="?controller=user&action=google<?= Helper\param_csrf() ?>"><?= t('Link my Google Account') ?></a>
|
||||||
@@ -21,7 +21,7 @@
|
|||||||
<?php if (GITHUB_AUTH): ?>
|
<?php if (GITHUB_AUTH): ?>
|
||||||
<h3><i class="fa fa-github"></i> <?= t('Github Account') ?></h3>
|
<h3><i class="fa fa-github"></i> <?= t('Github Account') ?></h3>
|
||||||
|
|
||||||
<p class="settings">
|
<p class="listing">
|
||||||
<?php if (Helper\is_current_user($user['id'])): ?>
|
<?php if (Helper\is_current_user($user['id'])): ?>
|
||||||
<?php if (empty($user['github_id'])): ?>
|
<?php if (empty($user['github_id'])): ?>
|
||||||
<a href="?controller=user&action=gitHub<?= Helper\param_csrf() ?>"><?= t('Link my GitHub Account') ?></a>
|
<a href="?controller=user&action=gitHub<?= Helper\param_csrf() ?>"><?= t('Link my GitHub Account') ?></a>
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
<div class="page-header">
|
<div class="page-header">
|
||||||
<h2><?= t('Summary') ?></h2>
|
<h2><?= t('Summary') ?></h2>
|
||||||
</div>
|
</div>
|
||||||
<ul class="settings">
|
<ul class="listing">
|
||||||
<li><?= t('Username:') ?> <strong><?= Helper\escape($user['username']) ?></strong></li>
|
<li><?= t('Username:') ?> <strong><?= Helper\escape($user['username']) ?></strong></li>
|
||||||
<li><?= t('Name:') ?> <strong><?= Helper\escape($user['name']) ?></strong></li>
|
<li><?= t('Name:') ?> <strong><?= Helper\escape($user['name']) ?></strong></li>
|
||||||
<li><?= t('Email:') ?> <strong><?= Helper\escape($user['email']) ?></strong></li>
|
<li><?= t('Email:') ?> <strong><?= Helper\escape($user['email']) ?></strong></li>
|
||||||
|
|||||||
@@ -1,14 +1,5 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
// Board refresh frequency in seconds for the public board view
|
|
||||||
defined('BOARD_PUBLIC_CHECK_INTERVAL') or define('BOARD_PUBLIC_CHECK_INTERVAL', 60);
|
|
||||||
|
|
||||||
// Board refresh frequency in seconds (the value 0 disable this feature)
|
|
||||||
defined('BOARD_CHECK_INTERVAL') or define('BOARD_CHECK_INTERVAL', 10);
|
|
||||||
|
|
||||||
// Period (in second) to consider a task was modified recently
|
|
||||||
defined('RECENT_TASK_PERIOD') or define('RECENT_TASK_PERIOD', 48*60*60);
|
|
||||||
|
|
||||||
// Custom session save path
|
// Custom session save path
|
||||||
defined('SESSION_SAVE_PATH') or define('SESSION_SAVE_PATH', '');
|
defined('SESSION_SAVE_PATH') or define('SESSION_SAVE_PATH', '');
|
||||||
|
|
||||||
|
|||||||
@@ -556,16 +556,37 @@ function form_numeric($name, $values = array(), array $errors = array(), array $
|
|||||||
* @param string $controller Controller name
|
* @param string $controller Controller name
|
||||||
* @param string $action Action name
|
* @param string $action Action name
|
||||||
* @param array $params Url parameters
|
* @param array $params Url parameters
|
||||||
|
* @param boolean $csrf Add a CSRF token
|
||||||
* @param string $class CSS class attribute
|
* @param string $class CSS class attribute
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
function a($label, $controller, $action, array $params = array(), $css = '')
|
function a($label, $controller, $action, array $params = array(), $csrf = false, $class = '')
|
||||||
{
|
{
|
||||||
$html = '<a href="?controller='.$controller.'&action='.$action;
|
return '<a href="'.u($controller, $action, $params, $csrf).'" class="'.$class.'"/>'.$label.'</a>';
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* URL
|
||||||
|
*
|
||||||
|
* a('link', '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
|
||||||
|
*/
|
||||||
|
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) {
|
foreach ($params as $key => $value) {
|
||||||
$html .= '&'.$key.'='.$value;
|
$html .= '&'.$key.'='.$value;
|
||||||
}
|
}
|
||||||
|
|
||||||
return '" class="'.$class.'"/>'.$label.'</a>';
|
return $html;
|
||||||
}
|
}
|
||||||
@@ -724,18 +724,21 @@ a.task-board-nobody {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* task view */
|
/* task view */
|
||||||
|
.config-show,
|
||||||
.user-show,
|
.user-show,
|
||||||
.project-show,
|
.project-show,
|
||||||
.task-show {
|
.task-show {
|
||||||
position: relative;
|
position: relative;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.config-show-main,
|
||||||
.user-show-main,
|
.user-show-main,
|
||||||
.project-show-main,
|
.project-show-main,
|
||||||
.task-show-main {
|
.task-show-main {
|
||||||
margin-left: 330px;
|
margin-left: 330px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.config-show-sidebar,
|
||||||
.user-show-sidebar,
|
.user-show-sidebar,
|
||||||
.project-show-sidebar,
|
.project-show-sidebar,
|
||||||
.task-show-sidebar {
|
.task-show-sidebar {
|
||||||
@@ -750,6 +753,7 @@ a.task-board-nobody {
|
|||||||
border-radius: 5px;
|
border-radius: 5px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.config-show-sidebar li,
|
||||||
.user-show-sidebar li,
|
.user-show-sidebar li,
|
||||||
.project-show-sidebar li,
|
.project-show-sidebar li,
|
||||||
.task-show-sidebar li {
|
.task-show-sidebar li {
|
||||||
@@ -1004,9 +1008,8 @@ tr td.task-orange,
|
|||||||
border-color: rgb(255, 172, 98);
|
border-color: rgb(255, 172, 98);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* config page */
|
/* listing block */
|
||||||
.listing,
|
.listing {
|
||||||
.settings {
|
|
||||||
border-radius: 4px;
|
border-radius: 4px;
|
||||||
padding: 8px 35px 8px 14px;
|
padding: 8px 35px 8px 14px;
|
||||||
margin-bottom: 20px;
|
margin-bottom: 20px;
|
||||||
@@ -1015,8 +1018,7 @@ tr td.task-orange,
|
|||||||
background-color: #f0f0f0;
|
background-color: #f0f0f0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.listing li,
|
.listing li {
|
||||||
.settings li {
|
|
||||||
list-style-type: square;
|
list-style-type: square;
|
||||||
margin-left: 20px;
|
margin-left: 20px;
|
||||||
margin-bottom: 3px;
|
margin-bottom: 3px;
|
||||||
|
|||||||
@@ -1,8 +1,5 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
// Your Kanboard base URL, example: http://demo.kanboard.net/ (used by email notifications or CLI scripts)
|
|
||||||
define('KANBOARD_URL', '');
|
|
||||||
|
|
||||||
// E-mail address for the "From" header (notifications)
|
// E-mail address for the "From" header (notifications)
|
||||||
define('MAIL_FROM', 'notifications@kanboard.net');
|
define('MAIL_FROM', 'notifications@kanboard.net');
|
||||||
|
|
||||||
@@ -19,15 +16,6 @@ define('MAIL_SMTP_ENCRYPTION', null); // Valid values are "null", "ssl" or "tls"
|
|||||||
// Sendmail command to use when the transport is "sendmail"
|
// Sendmail command to use when the transport is "sendmail"
|
||||||
define('MAIL_SENDMAIL_COMMAND', '/usr/sbin/sendmail -bs');
|
define('MAIL_SENDMAIL_COMMAND', '/usr/sbin/sendmail -bs');
|
||||||
|
|
||||||
// Auto-refresh frequency in seconds for the public board view (60 seconds by default)
|
|
||||||
define('BOARD_PUBLIC_CHECK_INTERVAL', 60);
|
|
||||||
|
|
||||||
// Board refresh frequency in seconds (the value 0 disable this feature, 10 seconds by default)
|
|
||||||
define('BOARD_CHECK_INTERVAL', 10);
|
|
||||||
|
|
||||||
// Period (in second) to consider a task was modified recently (0 to disable, 2 days by default)
|
|
||||||
define('RECENT_TASK_PERIOD', 48*60*60);
|
|
||||||
|
|
||||||
// Database driver: sqlite, mysql or postgres (sqlite by default)
|
// Database driver: sqlite, mysql or postgres (sqlite by default)
|
||||||
define('DB_DRIVER', 'sqlite');
|
define('DB_DRIVER', 'sqlite');
|
||||||
|
|
||||||
|
|||||||
@@ -2,7 +2,6 @@
|
|||||||
|
|
||||||
require __DIR__.'/app/common.php';
|
require __DIR__.'/app/common.php';
|
||||||
|
|
||||||
use Core\Translator;
|
|
||||||
use JsonRPC\Server;
|
use JsonRPC\Server;
|
||||||
use Model\Project;
|
use Model\Project;
|
||||||
use Model\ProjectPermission;
|
use Model\ProjectPermission;
|
||||||
@@ -19,6 +18,9 @@ use Model\Webhook;
|
|||||||
use Model\Notification;
|
use Model\Notification;
|
||||||
|
|
||||||
$config = new Config($registry);
|
$config = new Config($registry);
|
||||||
|
$config->setupTranslations();
|
||||||
|
$config->setupTimezone();
|
||||||
|
|
||||||
$project = new Project($registry);
|
$project = new Project($registry);
|
||||||
$projectPermission = new ProjectPermission($registry);
|
$projectPermission = new ProjectPermission($registry);
|
||||||
$task = new Task($registry);
|
$task = new Task($registry);
|
||||||
@@ -37,14 +39,9 @@ $project->attachEvents();
|
|||||||
$webhook->attachEvents();
|
$webhook->attachEvents();
|
||||||
$notification->attachEvents();
|
$notification->attachEvents();
|
||||||
|
|
||||||
// Load translations
|
|
||||||
$language = $config->get('language', 'en_US');
|
|
||||||
if ($language !== 'en_US') Translator::load($language);
|
|
||||||
|
|
||||||
$server = new Server;
|
$server = new Server;
|
||||||
$server->authentication(array('jsonrpc' => $config->get('api_token')));
|
$server->authentication(array('jsonrpc' => $config->get('api_token')));
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Project procedures
|
* Project procedures
|
||||||
*/
|
*/
|
||||||
|
|||||||
10
kanboard
10
kanboard
@@ -5,20 +5,14 @@ require __DIR__.'/app/common.php';
|
|||||||
|
|
||||||
use Core\Cli;
|
use Core\Cli;
|
||||||
use Core\Tool;
|
use Core\Tool;
|
||||||
use Core\Translator;
|
|
||||||
use Model\Config;
|
use Model\Config;
|
||||||
use Model\Task;
|
use Model\Task;
|
||||||
use Model\TaskExport;
|
use Model\TaskExport;
|
||||||
use Model\Notification;
|
use Model\Notification;
|
||||||
|
|
||||||
$config = new Config($registry);
|
$config = new Config($registry);
|
||||||
|
$config->setupTranslations();
|
||||||
// Load translations
|
$config->setupTimezone();
|
||||||
$language = $config->get('language', 'en_US');
|
|
||||||
if ($language !== 'en_US') Translator::load($language);
|
|
||||||
|
|
||||||
// Set timezone
|
|
||||||
date_default_timezone_set($config->get('timezone', 'UTC'));
|
|
||||||
|
|
||||||
// Setup CLI
|
// Setup CLI
|
||||||
$cli = new Cli;
|
$cli = new Cli;
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
</testsuite>
|
</testsuite>
|
||||||
</testsuites>
|
</testsuites>
|
||||||
<php>
|
<php>
|
||||||
<const name="API_URL" value="http://localhost:8000/jsonrpc.php" />
|
<const name="API_URL" value="http://localhost:8080/jsonrpc.php" />
|
||||||
<const name="API_KEY" value="19ffd9709d03ce50675c3a43d1c49c1ac207f4bc45f06c5b2701fbdf8929" />
|
<const name="API_KEY" value="19ffd9709d03ce50675c3a43d1c49c1ac207f4bc45f06c5b2701fbdf8929" />
|
||||||
<const name="DB_DRIVER" value="mysql" />
|
<const name="DB_DRIVER" value="mysql" />
|
||||||
<const name="DB_NAME" value="kanboard" />
|
<const name="DB_NAME" value="kanboard" />
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
</testsuite>
|
</testsuite>
|
||||||
</testsuites>
|
</testsuites>
|
||||||
<php>
|
<php>
|
||||||
<const name="API_URL" value="http://localhost:8000/jsonrpc.php" />
|
<const name="API_URL" value="http://localhost:8080/jsonrpc.php" />
|
||||||
<const name="API_KEY" value="19ffd9709d03ce50675c3a43d1c49c1ac207f4bc45f06c5b2701fbdf8929" />
|
<const name="API_KEY" value="19ffd9709d03ce50675c3a43d1c49c1ac207f4bc45f06c5b2701fbdf8929" />
|
||||||
<const name="DB_DRIVER" value="postgres" />
|
<const name="DB_DRIVER" value="postgres" />
|
||||||
<const name="DB_NAME" value="kanboard" />
|
<const name="DB_NAME" value="kanboard" />
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
</testsuite>
|
</testsuite>
|
||||||
</testsuites>
|
</testsuites>
|
||||||
<php>
|
<php>
|
||||||
<const name="API_URL" value="http://localhost:8000/jsonrpc.php" />
|
<const name="API_URL" value="http://localhost:8080/jsonrpc.php" />
|
||||||
<const name="API_KEY" value="19ffd9709d03ce50675c3a43d1c49c1ac207f4bc45f06c5b2701fbdf8929" />
|
<const name="API_KEY" value="19ffd9709d03ce50675c3a43d1c49c1ac207f4bc45f06c5b2701fbdf8929" />
|
||||||
<const name="DB_DRIVER" value="sqlite" />
|
<const name="DB_DRIVER" value="sqlite" />
|
||||||
<const name="DB_FILENAME" value="data/db.sqlite" />
|
<const name="DB_FILENAME" value="data/db.sqlite" />
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ class Api extends PHPUnit_Framework_TestCase
|
|||||||
|
|
||||||
setup_db();
|
setup_db();
|
||||||
|
|
||||||
$pdo->exec("UPDATE config SET api_token='".API_KEY."'");
|
$pdo->exec("UPDATE settings SET value='".API_KEY."' WHERE option='api_token'");
|
||||||
$pdo = null;
|
$pdo = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -27,8 +27,10 @@ class BoardTest extends Base
|
|||||||
$this->assertEquals('Done', $columns[4]);
|
$this->assertEquals('Done', $columns[4]);
|
||||||
|
|
||||||
// Custom columns: spaces should be trimed and no empty columns
|
// Custom columns: spaces should be trimed and no empty columns
|
||||||
|
$input = ' column #1 , column #2, ';
|
||||||
|
|
||||||
$this->assertTrue($c->save(array('default_columns' => ' column #1 , column #2, ')));
|
$this->assertTrue($c->save(array('board_columns' => $input)));
|
||||||
|
$this->assertEquals($input, $c->get('board_columns'));
|
||||||
|
|
||||||
$this->assertEquals(2, $p->create(array('name' => 'UnitTest2')));
|
$this->assertEquals(2, $p->create(array('name' => 'UnitTest2')));
|
||||||
$columns = $b->getColumnsList(2);
|
$columns = $b->getColumnsList(2);
|
||||||
|
|||||||
@@ -10,14 +10,14 @@ class ConfigTest extends Base
|
|||||||
{
|
{
|
||||||
$c = new Config($this->registry);
|
$c = new Config($this->registry);
|
||||||
|
|
||||||
$this->assertEquals('en_US', $c->get('language'));
|
$this->assertEquals('en_US', $c->get('application_language'));
|
||||||
$this->assertEquals('UTC', $c->get('timezone'));
|
$this->assertEquals('UTC', $c->get('application_timezone'));
|
||||||
|
|
||||||
$this->assertEmpty($c->get('webhooks_url_task_modification'));
|
$this->assertEmpty($c->get('webhook_url_task_modification'));
|
||||||
$this->assertEmpty($c->get('webhooks_url_task_creation'));
|
$this->assertEmpty($c->get('webhook_url_task_creation'));
|
||||||
$this->assertEmpty($c->get('default_columns'));
|
$this->assertEmpty($c->get('board_columns'));
|
||||||
|
|
||||||
$this->assertNotEmpty($c->get('webhooks_token'));
|
$this->assertNotEmpty($c->get('webhook_token'));
|
||||||
$this->assertNotEmpty($c->get('api_token'));
|
$this->assertNotEmpty($c->get('api_token'));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -25,8 +25,8 @@ class ConfigTest extends Base
|
|||||||
{
|
{
|
||||||
$c = new Config($this->registry);
|
$c = new Config($this->registry);
|
||||||
|
|
||||||
$this->assertEquals('', $c->get('default_columns'));
|
$this->assertEquals('', $c->get('board_columns'));
|
||||||
$this->assertEquals('test', $c->get('default_columns', 'test'));
|
$this->assertEquals('test', $c->get('board_columns', 'test'));
|
||||||
$this->assertEquals(0, $c->get('default_columns', 0));
|
$this->assertEquals(0, $c->get('board_columns', 0));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user