summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
Diffstat (limited to 'app')
-rw-r--r--app/Action/TaskLogMoveAnotherColumn.php1
-rw-r--r--app/Api/Base.php1
-rw-r--r--app/Api/Me.php1
-rw-r--r--app/Auth/Gitlab.php2
-rw-r--r--app/Controller/Base.php3
-rw-r--r--app/Integration/BitbucketWebhook.php1
-rw-r--r--app/Integration/GithubWebhook.php1
-rw-r--r--app/Integration/GitlabWebhook.php1
-rw-r--r--app/Model/Base.php2
-rw-r--r--app/Model/ProjectDailyColumnStats.php4
-rw-r--r--app/Model/Subtask.php2
-rw-r--r--[-rwxr-xr-x]app/Model/TaskDuplication.php0
-rw-r--r--app/Model/User.php3
-rw-r--r--app/Model/UserSession.php2
-rw-r--r--app/Schema/Mysql.php165
-rw-r--r--app/Schema/Postgres.php145
-rw-r--r--app/Schema/Sqlite.php175
-rw-r--r--app/Template/board/task_footer.php2
-rw-r--r--app/check_setup.php10
-rw-r--r--app/functions.php11
20 files changed, 247 insertions, 285 deletions
diff --git a/app/Action/TaskLogMoveAnotherColumn.php b/app/Action/TaskLogMoveAnotherColumn.php
index 39c7710f..a699c4ab 100644
--- a/app/Action/TaskLogMoveAnotherColumn.php
+++ b/app/Action/TaskLogMoveAnotherColumn.php
@@ -2,7 +2,6 @@
namespace Kanboard\Action;
-use Kanboard\Model\GithubWebhook;
use Kanboard\Model\Task;
/**
diff --git a/app/Api/Base.php b/app/Api/Base.php
index 82397b20..0959817e 100644
--- a/app/Api/Base.php
+++ b/app/Api/Base.php
@@ -2,7 +2,6 @@
namespace Kanboard\Api;
-use JsonRPC\AuthenticationFailure;
use JsonRPC\AccessDeniedException;
/**
diff --git a/app/Api/Me.php b/app/Api/Me.php
index 16ce0aee..2c332a8c 100644
--- a/app/Api/Me.php
+++ b/app/Api/Me.php
@@ -3,7 +3,6 @@
namespace Kanboard\Api;
use Kanboard\Model\Subtask as SubtaskModel;
-use Kanboard\Model\Task as TaskModel;
/**
* Me API controller
diff --git a/app/Auth/Gitlab.php b/app/Auth/Gitlab.php
index 8df3a5ec..a59bc1fa 100644
--- a/app/Auth/Gitlab.php
+++ b/app/Auth/Gitlab.php
@@ -86,7 +86,7 @@ class Gitlab extends Base
* Get OAuth2 configured service
*
* @access public
- * @return KanboardCore\OAuth2
+ * @return Kanboard\Core\OAuth2
*/
public function getService()
{
diff --git a/app/Controller/Base.php b/app/Controller/Base.php
index 1efd4566..a955b12c 100644
--- a/app/Controller/Base.php
+++ b/app/Controller/Base.php
@@ -6,9 +6,6 @@ use Pimple\Container;
use Kanboard\Core\Security;
use Kanboard\Core\Request;
use Kanboard\Core\Response;
-use Kanboard\Core\Template;
-use Kanboard\Core\Session;
-use Kanboard\Model\LastLogin;
use Symfony\Component\EventDispatcher\Event;
/**
diff --git a/app/Integration/BitbucketWebhook.php b/app/Integration/BitbucketWebhook.php
index 44e5bd74..97a39437 100644
--- a/app/Integration/BitbucketWebhook.php
+++ b/app/Integration/BitbucketWebhook.php
@@ -3,7 +3,6 @@
namespace Kanboard\Integration;
use Kanboard\Event\GenericEvent;
-use Kanboard\Model\Task;
/**
* Bitbucket Webhook
diff --git a/app/Integration/GithubWebhook.php b/app/Integration/GithubWebhook.php
index a4333723..c8b53e37 100644
--- a/app/Integration/GithubWebhook.php
+++ b/app/Integration/GithubWebhook.php
@@ -3,7 +3,6 @@
namespace Kanboard\Integration;
use Kanboard\Event\GenericEvent;
-use Kanboard\Model\Task;
/**
* Github Webhook
diff --git a/app/Integration/GitlabWebhook.php b/app/Integration/GitlabWebhook.php
index fb75d95a..b3f9b0b5 100644
--- a/app/Integration/GitlabWebhook.php
+++ b/app/Integration/GitlabWebhook.php
@@ -3,7 +3,6 @@
namespace Kanboard\Integration;
use Kanboard\Event\GenericEvent;
-use Kanboard\Model\Task;
/**
* Gitlab Webhook
diff --git a/app/Model/Base.php b/app/Model/Base.php
index ab07949b..c1b2fae3 100644
--- a/app/Model/Base.php
+++ b/app/Model/Base.php
@@ -2,8 +2,6 @@
namespace Kanboard\Model;
-use Pimple\Container;
-
/**
* Base model class
*
diff --git a/app/Model/ProjectDailyColumnStats.php b/app/Model/ProjectDailyColumnStats.php
index abab0241..8ed6137f 100644
--- a/app/Model/ProjectDailyColumnStats.php
+++ b/app/Model/ProjectDailyColumnStats.php
@@ -2,6 +2,8 @@
namespace Kanboard\Model;
+use PicoDb\Database;
+
/**
* Project Daily Column Stats
*
@@ -32,7 +34,7 @@ class ProjectDailyColumnStats extends Base
{
$status = $this->config->get('cfd_include_closed_tasks') == 1 ? array(Task::STATUS_OPEN, Task::STATUS_CLOSED) : array(Task::STATUS_OPEN);
- return $this->db->transaction(function ($db) use ($project_id, $date, $status) {
+ return $this->db->transaction(function (Database $db) use ($project_id, $date, $status) {
$column_ids = $db->table(Board::TABLE)->eq('project_id', $project_id)->findAllByColumn('id');
diff --git a/app/Model/Subtask.php b/app/Model/Subtask.php
index 94b13a0e..f81e5b1c 100644
--- a/app/Model/Subtask.php
+++ b/app/Model/Subtask.php
@@ -352,8 +352,6 @@ class Subtask extends Base
/**
* Change the status of subtask
*
- * Todo -> In progress -> Done -> Todo -> etc...
- *
* @access public
* @param integer $subtask_id
* @return bool
diff --git a/app/Model/TaskDuplication.php b/app/Model/TaskDuplication.php
index e81fb232..e81fb232 100755..100644
--- a/app/Model/TaskDuplication.php
+++ b/app/Model/TaskDuplication.php
diff --git a/app/Model/User.php b/app/Model/User.php
index c4d26c9c..6e7e94e0 100644
--- a/app/Model/User.php
+++ b/app/Model/User.php
@@ -2,6 +2,7 @@
namespace Kanboard\Model;
+use PicoDb\Database;
use SimpleValidator\Validator;
use SimpleValidator\Validators;
use Kanboard\Core\Session;
@@ -335,7 +336,7 @@ class User extends Base
*/
public function remove($user_id)
{
- return $this->db->transaction(function ($db) use ($user_id) {
+ return $this->db->transaction(function (Database $db) use ($user_id) {
// All assigned tasks are now unassigned (no foreign key)
if (! $db->table(Task::TABLE)->eq('owner_id', $user_id)->update(array('owner_id' => 0))) {
diff --git a/app/Model/UserSession.php b/app/Model/UserSession.php
index 56359bf2..1778114e 100644
--- a/app/Model/UserSession.php
+++ b/app/Model/UserSession.php
@@ -2,8 +2,6 @@
namespace Kanboard\Model;
-use Kanboard\Core\Translator;
-
/**
* User Session
*
diff --git a/app/Schema/Mysql.php b/app/Schema/Mysql.php
index 7051bfb4..a021c1cc 100644
--- a/app/Schema/Mysql.php
+++ b/app/Schema/Mysql.php
@@ -4,11 +4,10 @@ namespace Schema;
use PDO;
use Kanboard\Core\Security;
-use Kanboard\Model\Link;
const VERSION = 93;
-function version_93($pdo)
+function version_93(PDO $pdo)
{
$pdo->exec("
CREATE TABLE user_has_metadata (
@@ -58,7 +57,7 @@ function version_93($pdo)
$pdo->exec("DELETE FROM settings WHERE `option`='integration_slack_webhook_channel'");
}
-function version_92($pdo)
+function version_92(PDO $pdo)
{
$pdo->exec("
CREATE TABLE project_has_notification_types (
@@ -72,12 +71,12 @@ function version_92($pdo)
");
}
-function version_91($pdo)
+function version_91(PDO $pdo)
{
$pdo->exec("ALTER TABLE custom_filters ADD COLUMN `append` TINYINT(1) DEFAULT 0");
}
-function version_90($pdo)
+function version_90(PDO $pdo)
{
$pdo->exec("ALTER TABLE tasks MODIFY date_due BIGINT");
$pdo->exec("ALTER TABLE tasks MODIFY date_creation BIGINT");
@@ -96,7 +95,7 @@ function version_90($pdo)
$pdo->exec('ALTER TABLE users MODIFY `lock_expiration_date` BIGINT');
}
-function version_89($pdo)
+function version_89(PDO $pdo)
{
$pdo->exec("
CREATE TABLE user_has_unread_notifications (
@@ -133,7 +132,7 @@ function version_89($pdo)
}
}
-function version_88($pdo)
+function version_88(PDO $pdo)
{
$pdo->exec("
CREATE TABLE custom_filters (
@@ -150,7 +149,7 @@ function version_88($pdo)
");
}
-function version_87($pdo)
+function version_87(PDO $pdo)
{
$pdo->exec("
CREATE TABLE plugin_schema_versions (
@@ -161,45 +160,45 @@ function version_87($pdo)
");
}
-function version_86($pdo)
+function version_86(PDO $pdo)
{
$pdo->exec("ALTER TABLE swimlanes ADD COLUMN description TEXT");
}
-function version_85($pdo)
+function version_85(PDO $pdo)
{
$pdo->exec("ALTER TABLE users ADD COLUMN gitlab_id INT");
}
-function version_84($pdo)
+function version_84(PDO $pdo)
{
$pdo->exec("ALTER TABLE projects ADD COLUMN start_date VARCHAR(10) DEFAULT ''");
$pdo->exec("ALTER TABLE projects ADD COLUMN end_date VARCHAR(10) DEFAULT ''");
}
-function version_83($pdo)
+function version_83(PDO $pdo)
{
$pdo->exec("ALTER TABLE users ADD COLUMN is_project_admin INT DEFAULT 0");
}
-function version_82($pdo)
+function version_82(PDO $pdo)
{
$pdo->exec("ALTER TABLE users ADD COLUMN nb_failed_login INT DEFAULT 0");
$pdo->exec("ALTER TABLE users ADD COLUMN lock_expiration_date INT DEFAULT 0");
}
-function version_81($pdo)
+function version_81(PDO $pdo)
{
$pdo->exec("INSERT INTO settings VALUES ('subtask_time_tracking', '1')");
$pdo->exec("INSERT INTO settings VALUES ('cfd_include_closed_tasks', '1')");
}
-function version_80($pdo)
+function version_80(PDO $pdo)
{
$pdo->exec("INSERT INTO settings VALUES ('default_color', 'yellow')");
}
-function version_79($pdo)
+function version_79(PDO $pdo)
{
$pdo->exec("
CREATE TABLE project_daily_stats (
@@ -218,23 +217,23 @@ function version_79($pdo)
$pdo->exec('RENAME TABLE project_daily_summaries TO project_daily_column_stats');
}
-function version_78($pdo)
+function version_78(PDO $pdo)
{
$pdo->exec("ALTER TABLE project_integrations ADD COLUMN slack_webhook_channel VARCHAR(255) DEFAULT ''");
$pdo->exec("INSERT INTO settings VALUES ('integration_slack_webhook_channel', '')");
}
-function version_77($pdo)
+function version_77(PDO $pdo)
{
$pdo->exec('ALTER TABLE users DROP COLUMN `default_project_id`');
}
-function version_76($pdo)
+function version_76(PDO $pdo)
{
$pdo->exec("DELETE FROM `settings` WHERE `option`='subtask_time_tracking'");
}
-function version_75($pdo)
+function version_75(PDO $pdo)
{
$pdo->exec('ALTER TABLE comments DROP FOREIGN KEY comments_ibfk_2');
$pdo->exec('ALTER TABLE comments MODIFY task_id INT NOT NULL');
@@ -242,7 +241,7 @@ function version_75($pdo)
$pdo->exec('ALTER TABLE comments CHANGE COLUMN `date` `date_creation` INT NOT NULL');
}
-function version_74($pdo)
+function version_74(PDO $pdo)
{
$pdo->exec('ALTER TABLE project_has_categories MODIFY project_id INT NOT NULL');
$pdo->exec('ALTER TABLE project_has_categories MODIFY name VARCHAR(255) NOT NULL');
@@ -277,17 +276,17 @@ function version_74($pdo)
$pdo->exec('ALTER TABLE user_has_notifications MODIFY user_id INT NOT NULL');
}
-function version_73($pdo)
+function version_73(PDO $pdo)
{
$pdo->exec("ALTER TABLE users ADD COLUMN notifications_filter INT DEFAULT 4");
}
-function version_72($pdo)
+function version_72(PDO $pdo)
{
$pdo->exec('ALTER TABLE files MODIFY name VARCHAR(255)');
}
-function version_71($pdo)
+function version_71(PDO $pdo)
{
$rq = $pdo->prepare('INSERT INTO `settings` VALUES (?, ?)');
$rq->execute(array('webhook_url', ''));
@@ -296,17 +295,13 @@ function version_71($pdo)
$pdo->exec("DELETE FROM `settings` WHERE `option`='webhook_url_task_modification'");
}
-function version_70($pdo)
+function version_70(PDO $pdo)
{
$pdo->exec("ALTER TABLE users ADD COLUMN token VARCHAR(255) DEFAULT ''");
}
-function version_69($pdo)
+function version_69(PDO $pdo)
{
- $rq = $pdo->prepare("SELECT `value` FROM `settings` WHERE `option`='subtask_forecast'");
- $rq->execute();
- $result = $rq->fetch(PDO::FETCH_ASSOC);
-
$rq = $pdo->prepare('INSERT INTO settings VALUES (?, ?)');
$rq->execute(array('calendar_user_subtasks_time_tracking', 0));
$rq->execute(array('calendar_user_tasks', 'date_started'));
@@ -315,7 +310,7 @@ function version_69($pdo)
$pdo->exec("DELETE FROM `settings` WHERE `option`='subtask_forecast'");
}
-function version_68($pdo)
+function version_68(PDO $pdo)
{
$rq = $pdo->prepare('INSERT INTO settings VALUES (?, ?)');
$rq->execute(array('integration_jabber', '0'));
@@ -335,7 +330,7 @@ function version_68($pdo)
$pdo->exec("ALTER TABLE project_integrations ADD COLUMN jabber_room VARCHAR(255) DEFAULT ''");
}
-function version_67($pdo)
+function version_67(PDO $pdo)
{
$pdo->exec('ALTER TABLE tasks ADD COLUMN recurrence_status INTEGER NOT NULL DEFAULT 0');
$pdo->exec('ALTER TABLE tasks ADD COLUMN recurrence_trigger INTEGER NOT NULL DEFAULT 0');
@@ -346,12 +341,12 @@ function version_67($pdo)
$pdo->exec('ALTER TABLE tasks ADD COLUMN recurrence_child INTEGER');
}
-function version_66($pdo)
+function version_66(PDO $pdo)
{
$pdo->exec("ALTER TABLE projects ADD COLUMN identifier VARCHAR(50) DEFAULT ''");
}
-function version_65($pdo)
+function version_65(PDO $pdo)
{
$pdo->exec("
CREATE TABLE project_integrations (
@@ -369,36 +364,36 @@ function version_65($pdo)
");
}
-function version_64($pdo)
+function version_64(PDO $pdo)
{
$pdo->exec('ALTER TABLE project_daily_summaries ADD COLUMN score INT NOT NULL DEFAULT 0');
}
-function version_63($pdo)
+function version_63(PDO $pdo)
{
$pdo->exec('ALTER TABLE project_has_categories ADD COLUMN description TEXT');
}
-function version_62($pdo)
+function version_62(PDO $pdo)
{
$pdo->exec('ALTER TABLE files ADD COLUMN `date` INT NOT NULL DEFAULT 0');
$pdo->exec('ALTER TABLE files ADD COLUMN `user_id` INT NOT NULL DEFAULT 0');
$pdo->exec('ALTER TABLE files ADD COLUMN `size` INT NOT NULL DEFAULT 0');
}
-function version_61($pdo)
+function version_61(PDO $pdo)
{
$pdo->exec('ALTER TABLE users ADD COLUMN twofactor_activated TINYINT(1) DEFAULT 0');
$pdo->exec('ALTER TABLE users ADD COLUMN twofactor_secret CHAR(16)');
}
-function version_60($pdo)
+function version_60(PDO $pdo)
{
$rq = $pdo->prepare('INSERT INTO settings VALUES (?, ?)');
$rq->execute(array('integration_gravatar', '0'));
}
-function version_59($pdo)
+function version_59(PDO $pdo)
{
$rq = $pdo->prepare('INSERT INTO settings VALUES (?, ?)');
$rq->execute(array('integration_hipchat', '0'));
@@ -407,14 +402,14 @@ function version_59($pdo)
$rq->execute(array('integration_hipchat_room_token', ''));
}
-function version_58($pdo)
+function version_58(PDO $pdo)
{
$rq = $pdo->prepare('INSERT INTO settings VALUES (?, ?)');
$rq->execute(array('integration_slack_webhook', '0'));
$rq->execute(array('integration_slack_webhook_url', ''));
}
-function version_57($pdo)
+function version_57(PDO $pdo)
{
$pdo->exec('CREATE TABLE currencies (`currency` CHAR(3) NOT NULL UNIQUE, `rate` FLOAT DEFAULT 0) ENGINE=InnoDB CHARSET=utf8');
@@ -422,7 +417,7 @@ function version_57($pdo)
$rq->execute(array('application_currency', 'USD'));
}
-function version_56($pdo)
+function version_56(PDO $pdo)
{
$pdo->exec('CREATE TABLE transitions (
`id` INT NOT NULL AUTO_INCREMENT,
@@ -446,24 +441,24 @@ function version_56($pdo)
$pdo->exec("CREATE INDEX transitions_user_index ON transitions(user_id)");
}
-function version_55($pdo)
+function version_55(PDO $pdo)
{
$rq = $pdo->prepare('INSERT INTO settings VALUES (?, ?)');
$rq->execute(array('subtask_forecast', '0'));
}
-function version_54($pdo)
+function version_54(PDO $pdo)
{
$rq = $pdo->prepare('INSERT INTO settings VALUES (?, ?)');
$rq->execute(array('application_stylesheet', ''));
}
-function version_53($pdo)
+function version_53(PDO $pdo)
{
$pdo->exec("ALTER TABLE subtask_time_tracking ADD COLUMN time_spent FLOAT DEFAULT 0");
}
-function version_49($pdo)
+function version_49(PDO $pdo)
{
$pdo->exec('ALTER TABLE subtasks ADD COLUMN position INTEGER DEFAULT 1');
@@ -485,18 +480,18 @@ function version_49($pdo)
}
}
-function version_48($pdo)
+function version_48(PDO $pdo)
{
$pdo->exec('RENAME TABLE task_has_files TO files');
$pdo->exec('RENAME TABLE task_has_subtasks TO subtasks');
}
-function version_47($pdo)
+function version_47(PDO $pdo)
{
$pdo->exec('ALTER TABLE projects ADD COLUMN description TEXT');
}
-function version_46($pdo)
+function version_46(PDO $pdo)
{
$pdo->exec("CREATE TABLE links (
id INT NOT NULL AUTO_INCREMENT,
@@ -534,7 +529,7 @@ function version_46($pdo)
$rq->execute(array('is fixed by', 10));
}
-function version_45($pdo)
+function version_45(PDO $pdo)
{
$pdo->exec('ALTER TABLE tasks ADD COLUMN date_moved INT DEFAULT 0');
@@ -567,12 +562,12 @@ function version_45($pdo)
$pdo->exec("UPDATE tasks SET date_moved = date_creation WHERE date_moved IS NULL OR date_moved = 0");
}
-function version_44($pdo)
+function version_44(PDO $pdo)
{
$pdo->exec('ALTER TABLE users ADD COLUMN disable_login_form TINYINT(1) DEFAULT 0');
}
-function version_43($pdo)
+function version_43(PDO $pdo)
{
$rq = $pdo->prepare('INSERT INTO settings VALUES (?, ?)');
$rq->execute(array('subtask_restriction', '0'));
@@ -592,18 +587,18 @@ function version_43($pdo)
");
}
-function version_42($pdo)
+function version_42(PDO $pdo)
{
$pdo->exec('ALTER TABLE columns ADD COLUMN description TEXT');
}
-function version_41($pdo)
+function version_41(PDO $pdo)
{
$pdo->exec('ALTER TABLE users ADD COLUMN timezone VARCHAR(50)');
$pdo->exec('ALTER TABLE users ADD COLUMN language CHAR(5)');
}
-function version_40($pdo)
+function version_40(PDO $pdo)
{
// Avoid some full table scans
$pdo->exec('CREATE INDEX users_admin_idx ON users(is_admin)');
@@ -627,13 +622,13 @@ function version_40($pdo)
}
}
-function version_39($pdo)
+function version_39(PDO $pdo)
{
$rq = $pdo->prepare('INSERT INTO settings VALUES (?, ?)');
$rq->execute(array('project_categories', ''));
}
-function version_38($pdo)
+function version_38(PDO $pdo)
{
$pdo->exec("
CREATE TABLE swimlanes (
@@ -653,17 +648,17 @@ function version_38($pdo)
$pdo->exec("ALTER TABLE projects ADD COLUMN show_default_swimlane INT DEFAULT 1");
}
-function version_37($pdo)
+function version_37(PDO $pdo)
{
$pdo->exec("ALTER TABLE project_has_users ADD COLUMN is_owner TINYINT(1) DEFAULT '0'");
}
-function version_36($pdo)
+function version_36(PDO $pdo)
{
$pdo->exec('ALTER TABLE tasks MODIFY title VARCHAR(255) NOT NULL');
}
-function version_35($pdo)
+function version_35(PDO $pdo)
{
$pdo->exec("
CREATE TABLE project_daily_summaries (
@@ -681,12 +676,12 @@ function version_35($pdo)
$pdo->exec('CREATE UNIQUE INDEX project_daily_column_stats_idx ON project_daily_summaries(day, project_id, column_id)');
}
-function version_34($pdo)
+function version_34(PDO $pdo)
{
$pdo->exec("ALTER TABLE projects ADD COLUMN is_everybody_allowed TINYINT(1) DEFAULT '0'");
}
-function version_33($pdo)
+function version_33(PDO $pdo)
{
$pdo->exec("
CREATE TABLE project_activities (
@@ -709,7 +704,7 @@ function version_33($pdo)
$pdo->exec('DROP TABLE subtask_has_events');
}
-function version_32($pdo)
+function version_32(PDO $pdo)
{
$pdo->exec("ALTER TABLE tasks ADD COLUMN date_started INTEGER");
$pdo->exec("ALTER TABLE tasks ADD COLUMN time_spent FLOAT DEFAULT 0");
@@ -719,18 +714,18 @@ function version_32($pdo)
$pdo->exec("ALTER TABLE task_has_subtasks MODIFY time_spent FLOAT");
}
-function version_31($pdo)
+function version_31(PDO $pdo)
{
$pdo->exec("ALTER TABLE projects ADD COLUMN is_private TINYINT(1) DEFAULT '0'");
}
-function version_30($pdo)
+function version_30(PDO $pdo)
{
$rq = $pdo->prepare('INSERT INTO settings VALUES (?, ?)');
$rq->execute(array('application_date_format', 'm/d/Y'));
}
-function version_29($pdo)
+function version_29(PDO $pdo)
{
$pdo->exec("
CREATE TABLE settings (
@@ -760,7 +755,7 @@ function version_29($pdo)
$pdo->exec('DROP TABLE config');
}
-function version_28($pdo)
+function version_28(PDO $pdo)
{
$pdo->exec("ALTER TABLE tasks ADD COLUMN reference VARCHAR(50) DEFAULT ''");
$pdo->exec("ALTER TABLE comments ADD COLUMN reference VARCHAR(50) DEFAULT ''");
@@ -769,17 +764,17 @@ function version_28($pdo)
$pdo->exec('CREATE INDEX comments_reference_idx ON comments(reference)');
}
-function version_27($pdo)
+function version_27(PDO $pdo)
{
$pdo->exec('CREATE UNIQUE INDEX users_username_idx ON users(username)');
}
-function version_26($pdo)
+function version_26(PDO $pdo)
{
$pdo->exec("ALTER TABLE config ADD COLUMN default_columns VARCHAR(255) DEFAULT ''");
}
-function version_25($pdo)
+function version_25(PDO $pdo)
{
$pdo->exec("
CREATE TABLE task_has_events (
@@ -834,12 +829,12 @@ function version_25($pdo)
");
}
-function version_24($pdo)
+function version_24(PDO $pdo)
{
$pdo->exec("ALTER TABLE projects ADD COLUMN is_public TINYINT(1) DEFAULT '0'");
}
-function version_23($pdo)
+function version_23(PDO $pdo)
{
$pdo->exec("ALTER TABLE users ADD COLUMN notifications_enabled TINYINT(1) DEFAULT '0'");
@@ -854,30 +849,30 @@ function version_23($pdo)
");
}
-function version_22($pdo)
+function version_22(PDO $pdo)
{
$pdo->exec("ALTER TABLE config ADD COLUMN webhooks_url_task_modification VARCHAR(255)");
$pdo->exec("ALTER TABLE config ADD COLUMN webhooks_url_task_creation VARCHAR(255)");
}
-function version_21($pdo)
+function version_21(PDO $pdo)
{
$pdo->exec("ALTER TABLE tasks ADD COLUMN creator_id INTEGER DEFAULT '0'");
$pdo->exec("ALTER TABLE tasks ADD COLUMN date_modification INTEGER DEFAULT '0'");
}
-function version_20($pdo)
+function version_20(PDO $pdo)
{
$pdo->exec("ALTER TABLE users ADD COLUMN github_id VARCHAR(30)");
}
-function version_19($pdo)
+function version_19(PDO $pdo)
{
$pdo->exec("ALTER TABLE config ADD COLUMN api_token VARCHAR(255) DEFAULT ''");
$pdo->exec("UPDATE config SET api_token='".Security::generateToken()."'");
}
-function version_18($pdo)
+function version_18(PDO $pdo)
{
$pdo->exec("
CREATE TABLE task_has_subtasks (
@@ -894,7 +889,7 @@ function version_18($pdo)
);
}
-function version_17($pdo)
+function version_17(PDO $pdo)
{
$pdo->exec("
CREATE TABLE task_has_files (
@@ -909,7 +904,7 @@ function version_17($pdo)
);
}
-function version_16($pdo)
+function version_16(PDO $pdo)
{
$pdo->exec("
CREATE TABLE project_has_categories (
@@ -925,24 +920,24 @@ function version_16($pdo)
$pdo->exec("ALTER TABLE tasks ADD COLUMN category_id INT DEFAULT 0");
}
-function version_15($pdo)
+function version_15(PDO $pdo)
{
$pdo->exec("ALTER TABLE projects ADD COLUMN last_modified INT DEFAULT 0");
}
-function version_14($pdo)
+function version_14(PDO $pdo)
{
$pdo->exec("ALTER TABLE users ADD COLUMN name VARCHAR(255)");
$pdo->exec("ALTER TABLE users ADD COLUMN email VARCHAR(255)");
$pdo->exec("ALTER TABLE users ADD COLUMN google_id VARCHAR(30)");
}
-function version_13($pdo)
+function version_13(PDO $pdo)
{
$pdo->exec("ALTER TABLE users ADD COLUMN is_ldap_user TINYINT(1) DEFAULT 0");
}
-function version_12($pdo)
+function version_12(PDO $pdo)
{
$pdo->exec("
CREATE TABLE remember_me (
@@ -974,7 +969,7 @@ function version_12($pdo)
);
}
-function version_1($pdo)
+function version_1(PDO $pdo)
{
$pdo->exec("
CREATE TABLE config (
diff --git a/app/Schema/Postgres.php b/app/Schema/Postgres.php
index 9e12a5e8..a3fb6d49 100644
--- a/app/Schema/Postgres.php
+++ b/app/Schema/Postgres.php
@@ -4,11 +4,10 @@ namespace Schema;
use PDO;
use Kanboard\Core\Security;
-use Kanboard\Model\Link;
const VERSION = 73;
-function version_73($pdo)
+function version_73(PDO $pdo)
{
$pdo->exec("
CREATE TABLE user_has_metadata (
@@ -58,7 +57,7 @@ function version_73($pdo)
$pdo->exec("DELETE FROM settings WHERE \"option\"='integration_slack_webhook_channel'");
}
-function version_72($pdo)
+function version_72(PDO $pdo)
{
$pdo->exec("
CREATE TABLE project_has_notification_types (
@@ -71,12 +70,12 @@ function version_72($pdo)
");
}
-function version_71($pdo)
+function version_71(PDO $pdo)
{
$pdo->exec("ALTER TABLE custom_filters ADD COLUMN \"append\" BOOLEAN DEFAULT '0'");
}
-function version_70($pdo)
+function version_70(PDO $pdo)
{
$pdo->exec("ALTER TABLE tasks ALTER COLUMN date_due TYPE BIGINT");
$pdo->exec("ALTER TABLE tasks ALTER COLUMN date_creation TYPE BIGINT");
@@ -95,7 +94,7 @@ function version_70($pdo)
$pdo->exec('ALTER TABLE users ALTER COLUMN "lock_expiration_date" TYPE BIGINT');
}
-function version_69($pdo)
+function version_69(PDO $pdo)
{
$pdo->exec("
CREATE TABLE user_has_unread_notifications (
@@ -130,7 +129,7 @@ function version_69($pdo)
}
}
-function version_68($pdo)
+function version_68(PDO $pdo)
{
$pdo->exec("
CREATE TABLE custom_filters (
@@ -144,7 +143,7 @@ function version_68($pdo)
");
}
-function version_67($pdo)
+function version_67(PDO $pdo)
{
$pdo->exec("
CREATE TABLE plugin_schema_versions (
@@ -154,45 +153,45 @@ function version_67($pdo)
");
}
-function version_66($pdo)
+function version_66(PDO $pdo)
{
$pdo->exec("ALTER TABLE swimlanes ADD COLUMN description TEXT");
}
-function version_65($pdo)
+function version_65(PDO $pdo)
{
$pdo->exec("ALTER TABLE users ADD COLUMN gitlab_id INTEGER");
}
-function version_64($pdo)
+function version_64(PDO $pdo)
{
$pdo->exec("ALTER TABLE projects ADD COLUMN start_date VARCHAR(10) DEFAULT ''");
$pdo->exec("ALTER TABLE projects ADD COLUMN end_date VARCHAR(10) DEFAULT ''");
}
-function version_63($pdo)
+function version_63(PDO $pdo)
{
$pdo->exec("ALTER TABLE users ADD COLUMN is_project_admin BOOLEAN DEFAULT '0'");
}
-function version_62($pdo)
+function version_62(PDO $pdo)
{
$pdo->exec("ALTER TABLE users ADD COLUMN nb_failed_login INTEGER DEFAULT 0");
$pdo->exec("ALTER TABLE users ADD COLUMN lock_expiration_date INTEGER DEFAULT 0");
}
-function version_61($pdo)
+function version_61(PDO $pdo)
{
$pdo->exec("INSERT INTO settings VALUES ('subtask_time_tracking', '1')");
$pdo->exec("INSERT INTO settings VALUES ('cfd_include_closed_tasks', '1')");
}
-function version_60($pdo)
+function version_60(PDO $pdo)
{
$pdo->exec("INSERT INTO settings VALUES ('default_color', 'yellow')");
}
-function version_59($pdo)
+function version_59(PDO $pdo)
{
$pdo->exec("
CREATE TABLE project_daily_stats (
@@ -210,23 +209,23 @@ function version_59($pdo)
$pdo->exec('ALTER TABLE project_daily_summaries RENAME TO project_daily_column_stats');
}
-function version_58($pdo)
+function version_58(PDO $pdo)
{
$pdo->exec("ALTER TABLE project_integrations ADD COLUMN slack_webhook_channel VARCHAR(255) DEFAULT ''");
$pdo->exec("INSERT INTO settings VALUES ('integration_slack_webhook_channel', '')");
}
-function version_57($pdo)
+function version_57(PDO $pdo)
{
$pdo->exec('ALTER TABLE users DROP COLUMN "default_project_id"');
}
-function version_56($pdo)
+function version_56(PDO $pdo)
{
$pdo->exec('DELETE FROM "settings" WHERE "option"=\'subtask_time_tracking\'');
}
-function version_55($pdo)
+function version_55(PDO $pdo)
{
$pdo->exec('ALTER TABLE comments DROP CONSTRAINT IF EXISTS comments_user_id_fkey');
$pdo->exec("ALTER TABLE comments ALTER COLUMN task_id SET NOT NULL");
@@ -235,7 +234,7 @@ function version_55($pdo)
$pdo->exec("ALTER TABLE comments ALTER COLUMN date_creation SET NOT NULL");
}
-function version_54($pdo)
+function version_54(PDO $pdo)
{
$pdo->exec("ALTER TABLE project_has_categories ALTER COLUMN project_id SET NOT NULL");
$pdo->exec("ALTER TABLE project_has_categories ALTER COLUMN name SET NOT NULL");
@@ -271,12 +270,12 @@ function version_54($pdo)
$pdo->exec("ALTER TABLE user_has_notifications ALTER COLUMN user_id SET NOT NULL");
}
-function version_53($pdo)
+function version_53(PDO $pdo)
{
$pdo->exec("ALTER TABLE users ADD COLUMN notifications_filter INTEGER DEFAULT 4");
}
-function version_52($pdo)
+function version_52(PDO $pdo)
{
$rq = $pdo->prepare('INSERT INTO settings VALUES (?, ?)');
$rq->execute(array('webhook_url', ''));
@@ -285,17 +284,13 @@ function version_52($pdo)
$pdo->exec("DELETE FROM settings WHERE option='webhook_url_task_modification'");
}
-function version_51($pdo)
+function version_51(PDO $pdo)
{
$pdo->exec("ALTER TABLE users ADD COLUMN token VARCHAR(255) DEFAULT ''");
}
-function version_50($pdo)
+function version_50(PDO $pdo)
{
- $rq = $pdo->prepare("SELECT value FROM settings WHERE option='subtask_forecast'");
- $rq->execute();
- $result = $rq->fetch(PDO::FETCH_ASSOC);
-
$rq = $pdo->prepare('INSERT INTO settings VALUES (?, ?)');
$rq->execute(array('calendar_user_subtasks_time_tracking', 0));
$rq->execute(array('calendar_user_tasks', 'date_started'));
@@ -304,7 +299,7 @@ function version_50($pdo)
$pdo->exec("DELETE FROM settings WHERE option='subtask_forecast'");
}
-function version_49($pdo)
+function version_49(PDO $pdo)
{
$rq = $pdo->prepare('INSERT INTO settings VALUES (?, ?)');
$rq->execute(array('integration_jabber', '0'));
@@ -324,7 +319,7 @@ function version_49($pdo)
$pdo->exec("ALTER TABLE project_integrations ADD COLUMN jabber_room VARCHAR(255) DEFAULT ''");
}
-function version_48($pdo)
+function version_48(PDO $pdo)
{
$pdo->exec('ALTER TABLE tasks ADD COLUMN recurrence_status INTEGER NOT NULL DEFAULT 0');
$pdo->exec('ALTER TABLE tasks ADD COLUMN recurrence_trigger INTEGER NOT NULL DEFAULT 0');
@@ -335,12 +330,12 @@ function version_48($pdo)
$pdo->exec('ALTER TABLE tasks ADD COLUMN recurrence_child INTEGER');
}
-function version_47($pdo)
+function version_47(PDO $pdo)
{
$pdo->exec("ALTER TABLE projects ADD COLUMN identifier VARCHAR(50) DEFAULT ''");
}
-function version_46($pdo)
+function version_46(PDO $pdo)
{
$pdo->exec("
CREATE TABLE project_integrations (
@@ -357,36 +352,36 @@ function version_46($pdo)
");
}
-function version_45($pdo)
+function version_45(PDO $pdo)
{
$pdo->exec('ALTER TABLE project_daily_summaries ADD COLUMN score INTEGER NOT NULL DEFAULT 0');
}
-function version_44($pdo)
+function version_44(PDO $pdo)
{
$pdo->exec('ALTER TABLE project_has_categories ADD COLUMN description TEXT');
}
-function version_43($pdo)
+function version_43(PDO $pdo)
{
$pdo->exec('ALTER TABLE files ADD COLUMN "date" INTEGER NOT NULL DEFAULT 0');
$pdo->exec('ALTER TABLE files ADD COLUMN "user_id" INTEGER NOT NULL DEFAULT 0');
$pdo->exec('ALTER TABLE files ADD COLUMN "size" INTEGER NOT NULL DEFAULT 0');
}
-function version_42($pdo)
+function version_42(PDO $pdo)
{
$pdo->exec('ALTER TABLE users ADD COLUMN twofactor_activated BOOLEAN DEFAULT \'0\'');
$pdo->exec('ALTER TABLE users ADD COLUMN twofactor_secret CHAR(16)');
}
-function version_41($pdo)
+function version_41(PDO $pdo)
{
$rq = $pdo->prepare('INSERT INTO settings VALUES (?, ?)');
$rq->execute(array('integration_gravatar', '0'));
}
-function version_40($pdo)
+function version_40(PDO $pdo)
{
$rq = $pdo->prepare('INSERT INTO settings VALUES (?, ?)');
$rq->execute(array('integration_hipchat', '0'));
@@ -395,14 +390,14 @@ function version_40($pdo)
$rq->execute(array('integration_hipchat_room_token', ''));
}
-function version_39($pdo)
+function version_39(PDO $pdo)
{
$rq = $pdo->prepare('INSERT INTO settings VALUES (?, ?)');
$rq->execute(array('integration_slack_webhook', '0'));
$rq->execute(array('integration_slack_webhook_url', ''));
}
-function version_38($pdo)
+function version_38(PDO $pdo)
{
$pdo->exec('CREATE TABLE currencies ("currency" CHAR(3) NOT NULL UNIQUE, "rate" REAL DEFAULT 0)');
@@ -410,7 +405,7 @@ function version_38($pdo)
$rq->execute(array('application_currency', 'USD'));
}
-function version_37($pdo)
+function version_37(PDO $pdo)
{
$pdo->exec('CREATE TABLE transitions (
"id" SERIAL PRIMARY KEY,
@@ -433,24 +428,24 @@ function version_37($pdo)
$pdo->exec("CREATE INDEX transitions_user_index ON transitions(user_id)");
}
-function version_36($pdo)
+function version_36(PDO $pdo)
{
$rq = $pdo->prepare('INSERT INTO settings VALUES (?, ?)');
$rq->execute(array('subtask_forecast', '0'));
}
-function version_35($pdo)
+function version_35(PDO $pdo)
{
$rq = $pdo->prepare('INSERT INTO settings VALUES (?, ?)');
$rq->execute(array('application_stylesheet', ''));
}
-function version_34($pdo)
+function version_34(PDO $pdo)
{
$pdo->exec("ALTER TABLE subtask_time_tracking ADD COLUMN time_spent REAL DEFAULT 0");
}
-function version_30($pdo)
+function version_30(PDO $pdo)
{
$pdo->exec('ALTER TABLE subtasks ADD COLUMN position INTEGER DEFAULT 1');
@@ -472,18 +467,18 @@ function version_30($pdo)
}
}
-function version_29($pdo)
+function version_29(PDO $pdo)
{
$pdo->exec('ALTER TABLE task_has_files RENAME TO files');
$pdo->exec('ALTER TABLE task_has_subtasks RENAME TO subtasks');
}
-function version_28($pdo)
+function version_28(PDO $pdo)
{
$pdo->exec('ALTER TABLE projects ADD COLUMN description TEXT');
}
-function version_27($pdo)
+function version_27(PDO $pdo)
{
$pdo->exec('CREATE TABLE links (
"id" SERIAL PRIMARY KEY,
@@ -519,7 +514,7 @@ function version_27($pdo)
$rq->execute(array('is fixed by', 10));
}
-function version_26($pdo)
+function version_26(PDO $pdo)
{
$pdo->exec('ALTER TABLE tasks ADD COLUMN date_moved INT DEFAULT 0');
@@ -552,12 +547,12 @@ function version_26($pdo)
$pdo->exec("UPDATE tasks SET date_moved = date_creation WHERE date_moved IS NULL OR date_moved = 0");
}
-function version_25($pdo)
+function version_25(PDO $pdo)
{
$pdo->exec("ALTER TABLE users ADD COLUMN disable_login_form BOOLEAN DEFAULT '0'");
}
-function version_24($pdo)
+function version_24(PDO $pdo)
{
$rq = $pdo->prepare('INSERT INTO settings VALUES (?, ?)');
$rq->execute(array('subtask_restriction', '0'));
@@ -576,18 +571,18 @@ function version_24($pdo)
');
}
-function version_23($pdo)
+function version_23(PDO $pdo)
{
$pdo->exec('ALTER TABLE columns ADD COLUMN description TEXT');
}
-function version_22($pdo)
+function version_22(PDO $pdo)
{
$pdo->exec('ALTER TABLE users ADD COLUMN timezone VARCHAR(50)');
$pdo->exec('ALTER TABLE users ADD COLUMN language CHAR(5)');
}
-function version_21($pdo)
+function version_21(PDO $pdo)
{
// Avoid some full table scans
$pdo->exec('CREATE INDEX users_admin_idx ON users(is_admin)');
@@ -611,13 +606,13 @@ function version_21($pdo)
}
}
-function version_20($pdo)
+function version_20(PDO $pdo)
{
$rq = $pdo->prepare('INSERT INTO settings VALUES (?, ?)');
$rq->execute(array('project_categories', ''));
}
-function version_19($pdo)
+function version_19(PDO $pdo)
{
$pdo->exec("
CREATE TABLE swimlanes (
@@ -636,17 +631,17 @@ function version_19($pdo)
$pdo->exec("ALTER TABLE projects ADD COLUMN show_default_swimlane BOOLEAN DEFAULT '1'");
}
-function version_18($pdo)
+function version_18(PDO $pdo)
{
$pdo->exec("ALTER TABLE project_has_users ADD COLUMN is_owner BOOLEAN DEFAULT '0'");
}
-function version_17($pdo)
+function version_17(PDO $pdo)
{
$pdo->exec('ALTER TABLE tasks ALTER COLUMN title SET NOT NULL');
}
-function version_16($pdo)
+function version_16(PDO $pdo)
{
$pdo->exec("
CREATE TABLE project_daily_summaries (
@@ -663,12 +658,12 @@ function version_16($pdo)
$pdo->exec('CREATE UNIQUE INDEX project_daily_column_stats_idx ON project_daily_summaries(day, project_id, column_id)');
}
-function version_15($pdo)
+function version_15(PDO $pdo)
{
$pdo->exec("ALTER TABLE projects ADD COLUMN is_everybody_allowed BOOLEAN DEFAULT '0'");
}
-function version_14($pdo)
+function version_14(PDO $pdo)
{
$pdo->exec("
CREATE TABLE project_activities (
@@ -690,7 +685,7 @@ function version_14($pdo)
$pdo->exec('DROP TABLE subtask_has_events');
}
-function version_13($pdo)
+function version_13(PDO $pdo)
{
$pdo->exec("ALTER TABLE tasks ADD COLUMN date_started INTEGER");
$pdo->exec("ALTER TABLE tasks ADD COLUMN time_spent FLOAT DEFAULT 0");
@@ -700,18 +695,18 @@ function version_13($pdo)
$pdo->exec("ALTER TABLE task_has_subtasks ALTER COLUMN time_spent TYPE FLOAT");
}
-function version_12($pdo)
+function version_12(PDO $pdo)
{
$pdo->exec("ALTER TABLE projects ADD COLUMN is_private BOOLEAN DEFAULT '0'");
}
-function version_11($pdo)
+function version_11(PDO $pdo)
{
$rq = $pdo->prepare('INSERT INTO settings VALUES (?, ?)');
$rq->execute(array('application_date_format', 'm/d/Y'));
}
-function version_10($pdo)
+function version_10(PDO $pdo)
{
$pdo->exec("
CREATE TABLE settings (
@@ -741,7 +736,7 @@ function version_10($pdo)
$pdo->exec('DROP TABLE config');
}
-function version_9($pdo)
+function version_9(PDO $pdo)
{
$pdo->exec("ALTER TABLE tasks ADD COLUMN reference VARCHAR(50) DEFAULT ''");
$pdo->exec("ALTER TABLE comments ADD COLUMN reference VARCHAR(50) DEFAULT ''");
@@ -750,17 +745,17 @@ function version_9($pdo)
$pdo->exec('CREATE INDEX comments_reference_idx ON comments(reference)');
}
-function version_8($pdo)
+function version_8(PDO $pdo)
{
$pdo->exec('CREATE UNIQUE INDEX users_username_idx ON users(username)');
}
-function version_7($pdo)
+function version_7(PDO $pdo)
{
$pdo->exec("ALTER TABLE config ADD COLUMN default_columns VARCHAR(255) DEFAULT ''");
}
-function version_6($pdo)
+function version_6(PDO $pdo)
{
$pdo->exec("
CREATE TABLE task_has_events (
@@ -812,12 +807,12 @@ function version_6($pdo)
");
}
-function version_5($pdo)
+function version_5(PDO $pdo)
{
$pdo->exec("ALTER TABLE projects ADD COLUMN is_public BOOLEAN DEFAULT '0'");
}
-function version_4($pdo)
+function version_4(PDO $pdo)
{
$pdo->exec("ALTER TABLE users ADD COLUMN notifications_enabled BOOLEAN DEFAULT '0'");
@@ -832,19 +827,19 @@ function version_4($pdo)
");
}
-function version_3($pdo)
+function version_3(PDO $pdo)
{
$pdo->exec("ALTER TABLE config ADD COLUMN webhooks_url_task_modification VARCHAR(255)");
$pdo->exec("ALTER TABLE config ADD COLUMN webhooks_url_task_creation VARCHAR(255)");
}
-function version_2($pdo)
+function version_2(PDO $pdo)
{
$pdo->exec("ALTER TABLE tasks ADD COLUMN creator_id INTEGER DEFAULT 0");
$pdo->exec("ALTER TABLE tasks ADD COLUMN date_modification INTEGER DEFAULT 0");
}
-function version_1($pdo)
+function version_1(PDO $pdo)
{
$pdo->exec("
CREATE TABLE config (
diff --git a/app/Schema/Sqlite.php b/app/Schema/Sqlite.php
index e8dcf50e..b9ab86f8 100644
--- a/app/Schema/Sqlite.php
+++ b/app/Schema/Sqlite.php
@@ -4,11 +4,10 @@ namespace Schema;
use Kanboard\Core\Security;
use PDO;
-use Kanboard\Model\Link;
const VERSION = 88;
-function version_88($pdo)
+function version_88(PDO $pdo)
{
$pdo->exec("
CREATE TABLE user_has_metadata (
@@ -58,7 +57,7 @@ function version_88($pdo)
$pdo->exec("DELETE FROM settings WHERE \"option\"='integration_slack_webhook_channel'");
}
-function version_87($pdo)
+function version_87(PDO $pdo)
{
$pdo->exec("
CREATE TABLE project_has_notification_types (
@@ -71,12 +70,12 @@ function version_87($pdo)
");
}
-function version_86($pdo)
+function version_86(PDO $pdo)
{
$pdo->exec("ALTER TABLE custom_filters ADD COLUMN append INTEGER DEFAULT 0");
}
-function version_85($pdo)
+function version_85(PDO $pdo)
{
$pdo->exec("
CREATE TABLE user_has_unread_notifications (
@@ -111,7 +110,7 @@ function version_85($pdo)
}
}
-function version_84($pdo)
+function version_84(PDO $pdo)
{
$pdo->exec("
CREATE TABLE custom_filters (
@@ -125,7 +124,7 @@ function version_84($pdo)
");
}
-function version_83($pdo)
+function version_83(PDO $pdo)
{
$pdo->exec("
CREATE TABLE plugin_schema_versions (
@@ -135,45 +134,45 @@ function version_83($pdo)
");
}
-function version_82($pdo)
+function version_82(PDO $pdo)
{
$pdo->exec("ALTER TABLE swimlanes ADD COLUMN description TEXT");
}
-function version_81($pdo)
+function version_81(PDO $pdo)
{
$pdo->exec("ALTER TABLE users ADD COLUMN gitlab_id INTEGER");
}
-function version_80($pdo)
+function version_80(PDO $pdo)
{
$pdo->exec("ALTER TABLE projects ADD COLUMN start_date TEXT DEFAULT ''");
$pdo->exec("ALTER TABLE projects ADD COLUMN end_date TEXT DEFAULT ''");
}
-function version_79($pdo)
+function version_79(PDO $pdo)
{
$pdo->exec("ALTER TABLE users ADD COLUMN is_project_admin INTEGER DEFAULT 0");
}
-function version_78($pdo)
+function version_78(PDO $pdo)
{
$pdo->exec("ALTER TABLE users ADD COLUMN nb_failed_login INTEGER DEFAULT 0");
$pdo->exec("ALTER TABLE users ADD COLUMN lock_expiration_date INTEGER DEFAULT 0");
}
-function version_77($pdo)
+function version_77(PDO $pdo)
{
$pdo->exec("INSERT INTO settings VALUES ('subtask_time_tracking', '1')");
$pdo->exec("INSERT INTO settings VALUES ('cfd_include_closed_tasks', '1')");
}
-function version_76($pdo)
+function version_76(PDO $pdo)
{
$pdo->exec("INSERT INTO settings VALUES ('default_color', 'yellow')");
}
-function version_75($pdo)
+function version_75(PDO $pdo)
{
$pdo->exec("
CREATE TABLE project_daily_stats (
@@ -191,18 +190,18 @@ function version_75($pdo)
$pdo->exec('ALTER TABLE project_daily_summaries RENAME TO project_daily_column_stats');
}
-function version_74($pdo)
+function version_74(PDO $pdo)
{
$pdo->exec("ALTER TABLE project_integrations ADD COLUMN slack_webhook_channel TEXT DEFAULT ''");
$pdo->exec("INSERT INTO settings VALUES ('integration_slack_webhook_channel', '')");
}
-function version_73($pdo)
+function version_73(PDO $pdo)
{
$pdo->exec("DELETE FROM settings WHERE option='subtask_time_tracking'");
}
-function version_72($pdo)
+function version_72(PDO $pdo)
{
$pdo->exec(
'ALTER TABLE comments RENAME TO comments_bak'
@@ -229,12 +228,12 @@ function version_72($pdo)
);
}
-function version_71($pdo)
+function version_71(PDO $pdo)
{
$pdo->exec("ALTER TABLE users ADD COLUMN notifications_filter INTEGER DEFAULT 4");
}
-function version_70($pdo)
+function version_70(PDO $pdo)
{
$rq = $pdo->prepare('INSERT INTO settings VALUES (?, ?)');
$rq->execute(array('webhook_url', ''));
@@ -243,17 +242,13 @@ function version_70($pdo)
$pdo->exec("DELETE FROM settings WHERE option='webhook_url_task_modification'");
}
-function version_69($pdo)
+function version_69(PDO $pdo)
{
$pdo->exec("ALTER TABLE users ADD COLUMN token TEXT DEFAULT ''");
}
-function version_68($pdo)
+function version_68(PDO $pdo)
{
- $rq = $pdo->prepare("SELECT value FROM settings WHERE option='subtask_forecast'");
- $rq->execute();
- $result = $rq->fetch(PDO::FETCH_ASSOC);
-
$rq = $pdo->prepare('INSERT INTO settings VALUES (?, ?)');
$rq->execute(array('calendar_user_subtasks_time_tracking', 0));
$rq->execute(array('calendar_user_tasks', 'date_started'));
@@ -262,7 +257,7 @@ function version_68($pdo)
$pdo->exec("DELETE FROM settings WHERE option='subtask_forecast'");
}
-function version_67($pdo)
+function version_67(PDO $pdo)
{
$rq = $pdo->prepare('INSERT INTO settings VALUES (?, ?)');
$rq->execute(array('integration_jabber', '0'));
@@ -282,7 +277,7 @@ function version_67($pdo)
$pdo->exec("ALTER TABLE project_integrations ADD COLUMN jabber_room TEXT DEFAULT ''");
}
-function version_66($pdo)
+function version_66(PDO $pdo)
{
$pdo->exec('ALTER TABLE tasks ADD COLUMN recurrence_status INTEGER NOT NULL DEFAULT 0');
$pdo->exec('ALTER TABLE tasks ADD COLUMN recurrence_trigger INTEGER NOT NULL DEFAULT 0');
@@ -293,12 +288,12 @@ function version_66($pdo)
$pdo->exec('ALTER TABLE tasks ADD COLUMN recurrence_child INTEGER');
}
-function version_65($pdo)
+function version_65(PDO $pdo)
{
$pdo->exec("ALTER TABLE projects ADD COLUMN identifier TEXT DEFAULT ''");
}
-function version_64($pdo)
+function version_64(PDO $pdo)
{
$pdo->exec("
CREATE TABLE project_integrations (
@@ -315,36 +310,36 @@ function version_64($pdo)
");
}
-function version_63($pdo)
+function version_63(PDO $pdo)
{
$pdo->exec('ALTER TABLE project_daily_summaries ADD COLUMN score INTEGER NOT NULL DEFAULT 0');
}
-function version_62($pdo)
+function version_62(PDO $pdo)
{
$pdo->exec('ALTER TABLE project_has_categories ADD COLUMN description TEXT');
}
-function version_61($pdo)
+function version_61(PDO $pdo)
{
$pdo->exec('ALTER TABLE files ADD COLUMN "date" INTEGER NOT NULL DEFAULT 0');
$pdo->exec('ALTER TABLE files ADD COLUMN "user_id" INTEGER NOT NULL DEFAULT 0');
$pdo->exec('ALTER TABLE files ADD COLUMN "size" INTEGER NOT NULL DEFAULT 0');
}
-function version_60($pdo)
+function version_60(PDO $pdo)
{
$pdo->exec('ALTER TABLE users ADD COLUMN twofactor_activated INTEGER DEFAULT 0');
$pdo->exec('ALTER TABLE users ADD COLUMN twofactor_secret TEXT');
}
-function version_59($pdo)
+function version_59(PDO $pdo)
{
$rq = $pdo->prepare('INSERT INTO settings VALUES (?, ?)');
$rq->execute(array('integration_gravatar', '0'));
}
-function version_58($pdo)
+function version_58(PDO $pdo)
{
$rq = $pdo->prepare('INSERT INTO settings VALUES (?, ?)');
$rq->execute(array('integration_hipchat', '0'));
@@ -353,14 +348,14 @@ function version_58($pdo)
$rq->execute(array('integration_hipchat_room_token', ''));
}
-function version_57($pdo)
+function version_57(PDO $pdo)
{
$rq = $pdo->prepare('INSERT INTO settings VALUES (?, ?)');
$rq->execute(array('integration_slack_webhook', '0'));
$rq->execute(array('integration_slack_webhook_url', ''));
}
-function version_56($pdo)
+function version_56(PDO $pdo)
{
$pdo->exec('CREATE TABLE currencies ("currency" TEXT NOT NULL UNIQUE, "rate" REAL DEFAULT 0)');
@@ -368,7 +363,7 @@ function version_56($pdo)
$rq->execute(array('application_currency', 'USD'));
}
-function version_55($pdo)
+function version_55(PDO $pdo)
{
$pdo->exec('CREATE TABLE transitions (
"id" INTEGER PRIMARY KEY,
@@ -391,24 +386,24 @@ function version_55($pdo)
$pdo->exec("CREATE INDEX transitions_user_index ON transitions(user_id)");
}
-function version_54($pdo)
+function version_54(PDO $pdo)
{
$rq = $pdo->prepare('INSERT INTO settings VALUES (?, ?)');
$rq->execute(array('subtask_forecast', '0'));
}
-function version_53($pdo)
+function version_53(PDO $pdo)
{
$rq = $pdo->prepare('INSERT INTO settings VALUES (?, ?)');
$rq->execute(array('application_stylesheet', ''));
}
-function version_52($pdo)
+function version_52(PDO $pdo)
{
$pdo->exec("ALTER TABLE subtask_time_tracking ADD COLUMN time_spent REAL DEFAULT 0");
}
-function version_48($pdo)
+function version_48(PDO $pdo)
{
$pdo->exec('ALTER TABLE subtasks ADD COLUMN position INTEGER DEFAULT 1');
@@ -432,18 +427,18 @@ function version_48($pdo)
}
}
-function version_47($pdo)
+function version_47(PDO $pdo)
{
$pdo->exec('ALTER TABLE task_has_files RENAME TO files');
$pdo->exec('ALTER TABLE task_has_subtasks RENAME TO subtasks');
}
-function version_46($pdo)
+function version_46(PDO $pdo)
{
$pdo->exec('ALTER TABLE projects ADD COLUMN description TEXT');
}
-function version_45($pdo)
+function version_45(PDO $pdo)
{
$pdo->exec("CREATE TABLE links (
id INTEGER PRIMARY KEY,
@@ -479,7 +474,7 @@ function version_45($pdo)
$rq->execute(array('is fixed by', 10));
}
-function version_44($pdo)
+function version_44(PDO $pdo)
{
$pdo->exec('ALTER TABLE tasks ADD COLUMN date_moved INTEGER DEFAULT 0');
@@ -512,12 +507,12 @@ function version_44($pdo)
$pdo->exec("UPDATE tasks SET date_moved = date_creation WHERE date_moved IS NULL OR date_moved = 0");
}
-function version_43($pdo)
+function version_43(PDO $pdo)
{
$pdo->exec('ALTER TABLE users ADD COLUMN disable_login_form INTEGER DEFAULT 0');
}
-function version_42($pdo)
+function version_42(PDO $pdo)
{
$rq = $pdo->prepare('INSERT INTO settings VALUES (?, ?)');
$rq->execute(array('subtask_restriction', '0'));
@@ -536,18 +531,18 @@ function version_42($pdo)
");
}
-function version_41($pdo)
+function version_41(PDO $pdo)
{
$pdo->exec('ALTER TABLE columns ADD COLUMN description TEXT');
}
-function version_40($pdo)
+function version_40(PDO $pdo)
{
$pdo->exec('ALTER TABLE users ADD COLUMN timezone TEXT');
$pdo->exec('ALTER TABLE users ADD COLUMN language TEXT');
}
-function version_39($pdo)
+function version_39(PDO $pdo)
{
// Avoid some full table scans
$pdo->exec('CREATE INDEX users_admin_idx ON users(is_admin)');
@@ -571,13 +566,13 @@ function version_39($pdo)
}
}
-function version_38($pdo)
+function version_38(PDO $pdo)
{
$rq = $pdo->prepare('INSERT INTO settings VALUES (?, ?)');
$rq->execute(array('project_categories', ''));
}
-function version_37($pdo)
+function version_37(PDO $pdo)
{
$pdo->exec("
CREATE TABLE swimlanes (
@@ -596,12 +591,12 @@ function version_37($pdo)
$pdo->exec("ALTER TABLE projects ADD COLUMN show_default_swimlane INTEGER DEFAULT 1");
}
-function version_36($pdo)
+function version_36(PDO $pdo)
{
$pdo->exec('ALTER TABLE project_has_users ADD COLUMN is_owner INTEGER DEFAULT "0"');
}
-function version_35($pdo)
+function version_35(PDO $pdo)
{
$pdo->exec("
CREATE TABLE project_daily_summaries (
@@ -618,12 +613,12 @@ function version_35($pdo)
$pdo->exec('CREATE UNIQUE INDEX project_daily_column_stats_idx ON project_daily_summaries(day, project_id, column_id)');
}
-function version_34($pdo)
+function version_34(PDO $pdo)
{
$pdo->exec('ALTER TABLE projects ADD COLUMN is_everybody_allowed INTEGER DEFAULT "0"');
}
-function version_33($pdo)
+function version_33(PDO $pdo)
{
$pdo->exec("
CREATE TABLE project_activities (
@@ -645,25 +640,25 @@ function version_33($pdo)
$pdo->exec('DROP TABLE subtask_has_events');
}
-function version_32($pdo)
+function version_32(PDO $pdo)
{
$pdo->exec("ALTER TABLE tasks ADD COLUMN date_started INTEGER");
$pdo->exec("ALTER TABLE tasks ADD COLUMN time_spent NUMERIC DEFAULT 0");
$pdo->exec("ALTER TABLE tasks ADD COLUMN time_estimated NUMERIC DEFAULT 0");
}
-function version_31($pdo)
+function version_31(PDO $pdo)
{
$pdo->exec('ALTER TABLE projects ADD COLUMN is_private INTEGER DEFAULT "0"');
}
-function version_30($pdo)
+function version_30(PDO $pdo)
{
$rq = $pdo->prepare('INSERT INTO settings VALUES (?, ?)');
$rq->execute(array('application_date_format', 'm/d/Y'));
}
-function version_29($pdo)
+function version_29(PDO $pdo)
{
$pdo->exec("
CREATE TABLE settings (
@@ -693,7 +688,7 @@ function version_29($pdo)
$pdo->exec('DROP TABLE config');
}
-function version_28($pdo)
+function version_28(PDO $pdo)
{
$pdo->exec("ALTER TABLE tasks ADD COLUMN reference TEXT DEFAULT ''");
$pdo->exec("ALTER TABLE comments ADD COLUMN reference TEXT DEFAULT ''");
@@ -702,17 +697,17 @@ function version_28($pdo)
$pdo->exec('CREATE INDEX comments_reference_idx ON comments(reference)');
}
-function version_27($pdo)
+function version_27(PDO $pdo)
{
$pdo->exec('CREATE UNIQUE INDEX users_username_idx ON users(username)');
}
-function version_26($pdo)
+function version_26(PDO $pdo)
{
$pdo->exec("ALTER TABLE config ADD COLUMN default_columns TEXT DEFAULT ''");
}
-function version_25($pdo)
+function version_25(PDO $pdo)
{
$pdo->exec("
CREATE TABLE task_has_events (
@@ -764,12 +759,12 @@ function version_25($pdo)
");
}
-function version_24($pdo)
+function version_24(PDO $pdo)
{
$pdo->exec('ALTER TABLE projects ADD COLUMN is_public INTEGER DEFAULT "0"');
}
-function version_23($pdo)
+function version_23(PDO $pdo)
{
$pdo->exec("ALTER TABLE users ADD COLUMN notifications_enabled INTEGER DEFAULT '0'");
@@ -784,30 +779,30 @@ function version_23($pdo)
");
}
-function version_22($pdo)
+function version_22(PDO $pdo)
{
$pdo->exec("ALTER TABLE config ADD COLUMN webhooks_url_task_modification TEXT");
$pdo->exec("ALTER TABLE config ADD COLUMN webhooks_url_task_creation TEXT");
}
-function version_21($pdo)
+function version_21(PDO $pdo)
{
$pdo->exec("ALTER TABLE tasks ADD COLUMN creator_id INTEGER DEFAULT '0'");
$pdo->exec("ALTER TABLE tasks ADD COLUMN date_modification INTEGER DEFAULT '0'");
}
-function version_20($pdo)
+function version_20(PDO $pdo)
{
$pdo->exec("ALTER TABLE users ADD COLUMN github_id TEXT");
}
-function version_19($pdo)
+function version_19(PDO $pdo)
{
$pdo->exec("ALTER TABLE config ADD COLUMN api_token TEXT DEFAULT ''");
$pdo->exec("UPDATE config SET api_token='".Security::generateToken()."'");
}
-function version_18($pdo)
+function version_18(PDO $pdo)
{
$pdo->exec("
CREATE TABLE task_has_subtasks (
@@ -823,7 +818,7 @@ function version_18($pdo)
);
}
-function version_17($pdo)
+function version_17(PDO $pdo)
{
$pdo->exec("
CREATE TABLE task_has_files (
@@ -837,7 +832,7 @@ function version_17($pdo)
);
}
-function version_16($pdo)
+function version_16(PDO $pdo)
{
$pdo->exec("
CREATE TABLE project_has_categories (
@@ -852,24 +847,24 @@ function version_16($pdo)
$pdo->exec("ALTER TABLE tasks ADD COLUMN category_id INTEGER DEFAULT 0");
}
-function version_15($pdo)
+function version_15(PDO $pdo)
{
$pdo->exec("ALTER TABLE projects ADD COLUMN last_modified INTEGER DEFAULT 0");
}
-function version_14($pdo)
+function version_14(PDO $pdo)
{
$pdo->exec("ALTER TABLE users ADD COLUMN name TEXT");
$pdo->exec("ALTER TABLE users ADD COLUMN email TEXT");
$pdo->exec("ALTER TABLE users ADD COLUMN google_id TEXT");
}
-function version_13($pdo)
+function version_13(PDO $pdo)
{
$pdo->exec("ALTER TABLE users ADD COLUMN is_ldap_user INTEGER DEFAULT 0");
}
-function version_12($pdo)
+function version_12(PDO $pdo)
{
$pdo->exec(
'CREATE TABLE remember_me (
@@ -900,7 +895,7 @@ function version_12($pdo)
$pdo->exec('CREATE INDEX last_logins_user_idx ON last_logins(user_id)');
}
-function version_11($pdo)
+function version_11(PDO $pdo)
{
$pdo->exec(
'ALTER TABLE comments RENAME TO comments_bak'
@@ -927,7 +922,7 @@ function version_11($pdo)
);
}
-function version_10($pdo)
+function version_10(PDO $pdo)
{
$pdo->exec(
'CREATE TABLE actions (
@@ -950,12 +945,12 @@ function version_10($pdo)
);
}
-function version_9($pdo)
+function version_9(PDO $pdo)
{
$pdo->exec("ALTER TABLE tasks ADD COLUMN date_due INTEGER");
}
-function version_8($pdo)
+function version_8(PDO $pdo)
{
$pdo->exec(
'CREATE TABLE comments (
@@ -970,7 +965,7 @@ function version_8($pdo)
);
}
-function version_7($pdo)
+function version_7(PDO $pdo)
{
$pdo->exec("
CREATE TABLE project_has_users (
@@ -984,33 +979,33 @@ function version_7($pdo)
");
}
-function version_6($pdo)
+function version_6(PDO $pdo)
{
$pdo->exec("ALTER TABLE columns ADD COLUMN task_limit INTEGER DEFAULT '0'");
}
-function version_5($pdo)
+function version_5(PDO $pdo)
{
$pdo->exec("ALTER TABLE tasks ADD COLUMN score INTEGER");
}
-function version_4($pdo)
+function version_4(PDO $pdo)
{
$pdo->exec("ALTER TABLE config ADD COLUMN timezone TEXT DEFAULT 'UTC'");
}
-function version_3($pdo)
+function version_3(PDO $pdo)
{
$pdo->exec('ALTER TABLE projects ADD COLUMN token TEXT');
}
-function version_2($pdo)
+function version_2(PDO $pdo)
{
$pdo->exec('ALTER TABLE tasks ADD COLUMN date_completed INTEGER');
$pdo->exec('UPDATE tasks SET date_completed=date_creation WHERE is_active=0');
}
-function version_1($pdo)
+function version_1(PDO $pdo)
{
$pdo->exec("
CREATE TABLE config (
diff --git a/app/Template/board/task_footer.php b/app/Template/board/task_footer.php
index 3583ee1a..d486b638 100644
--- a/app/Template/board/task_footer.php
+++ b/app/Template/board/task_footer.php
@@ -47,7 +47,7 @@
<?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="tooltip" data-href="<?= $this->url->href('board', 'comments', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?>"><i class="fa fa-comment-o"></i>&nbsp;<?= $task['nb_comments'] ?></span>
+ <span title="<?= $task['nb_comments'] == 1 ? t('%d comment', $task['nb_comments']) : t('%d comments', $task['nb_comments']) ?>" class="tooltip" data-href="<?= $this->url->href('board', 'comments', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?>"><i class="fa fa-comment-o"></i>&nbsp;<?= $task['nb_comments'] ?></span>
<?php endif ?>
<?php if (! empty($task['description'])): ?>
diff --git a/app/check_setup.php b/app/check_setup.php
index 65f291e5..be52a718 100644
--- a/app/check_setup.php
+++ b/app/check_setup.php
@@ -2,7 +2,7 @@
// PHP 5.3.3 minimum
if (version_compare(PHP_VERSION, '5.3.3', '<')) {
- die('This software require PHP 5.3.3 minimum');
+ throw new Exception('This software require PHP 5.3.3 minimum');
}
// Checks for PHP < 5.4
@@ -10,23 +10,23 @@ if (version_compare(PHP_VERSION, '5.4.0', '<')) {
// Short tags must be enabled for PHP < 5.4
if (! ini_get('short_open_tag')) {
- die('This software require to have short tags enabled if you have PHP < 5.4 ("short_open_tag = On")');
+ throw new Exception('This software require to have short tags enabled if you have PHP < 5.4 ("short_open_tag = On")');
}
// Magic quotes are deprecated since PHP 5.4
if (get_magic_quotes_gpc()) {
- die('This software require to have "Magic quotes" disabled, it\'s deprecated since PHP 5.4 ("magic_quotes_gpc = Off")');
+ throw new Exception('This software require to have "Magic quotes" disabled, it\'s deprecated since PHP 5.4 ("magic_quotes_gpc = Off")');
}
}
// Check extension: PDO
if (! extension_loaded('pdo_sqlite') && ! extension_loaded('pdo_mysql') && ! extension_loaded('pdo_pgsql')) {
- die('PHP extension required: pdo_sqlite or pdo_mysql or pdo_pgsql');
+ throw new Exception('PHP extension required: pdo_sqlite or pdo_mysql or pdo_pgsql');
}
// Check extension: mbstring
if (! extension_loaded('mbstring')) {
- die('PHP extension required: mbstring');
+ throw new Exception('PHP extension required: mbstring');
}
// Fix wrong value for arg_separator.output, used by the function http_build_query()
diff --git a/app/functions.php b/app/functions.php
index 9bb7a8c8..fe6e6757 100644
--- a/app/functions.php
+++ b/app/functions.php
@@ -41,14 +41,3 @@ function dt($format, $timestamp)
{
return Translator::getInstance()->datetime($format, $timestamp);
}
-
-/**
- * Handle plurals, return $t2 if $value > 1
- *
- * @todo Improve this function
- * @return mixed
- */
-function p($value, $t1, $t2)
-{
- return $value > 1 ? $t2 : $t1;
-}