From d772e865d041fa73b015b532ce62dea3a8be654b Mon Sep 17 00:00:00 2001 From: ByteHamster Date: Thu, 5 Mar 2020 13:24:36 +0100 Subject: [PATCH 1/4] Fixed broken database class --- Core/Frameworks/Flake/Core/Database.php | 8 ++++---- Core/Frameworks/Flake/Core/Database/Mysql.php | 4 ---- Core/Frameworks/Flake/Core/Database/Sqlite.php | 4 ---- 3 files changed, 4 insertions(+), 12 deletions(-) diff --git a/Core/Frameworks/Flake/Core/Database.php b/Core/Frameworks/Flake/Core/Database.php index 5aeb4f5..2ede625 100644 --- a/Core/Frameworks/Flake/Core/Database.php +++ b/Core/Frameworks/Flake/Core/Database.php @@ -29,10 +29,10 @@ namespace Flake\Core; abstract class Database extends \Flake\Core\FLObject { - private $debugOutput; - private $debug_lastBuiltQuery; - private $store_lastBuiltQuery; - private $oDb; + protected $debugOutput; + protected $debug_lastBuiltQuery; + protected $store_lastBuiltQuery; + protected $oDb; /* common stuff */ diff --git a/Core/Frameworks/Flake/Core/Database/Mysql.php b/Core/Frameworks/Flake/Core/Database/Mysql.php index 8c6f641..f80e6c7 100644 --- a/Core/Frameworks/Flake/Core/Database/Mysql.php +++ b/Core/Frameworks/Flake/Core/Database/Mysql.php @@ -29,10 +29,6 @@ namespace Flake\Core\Database; class Mysql extends \Flake\Core\Database { - protected $oDb = false; // current DB link - protected $debugOutput = false; - protected $store_lastBuiltQuery = true; - protected $debug_lastBuiltQuery = ""; protected $sHost = ""; protected $sDbName = ""; protected $sUsername = ""; diff --git a/Core/Frameworks/Flake/Core/Database/Sqlite.php b/Core/Frameworks/Flake/Core/Database/Sqlite.php index 471dcbb..0d793e1 100644 --- a/Core/Frameworks/Flake/Core/Database/Sqlite.php +++ b/Core/Frameworks/Flake/Core/Database/Sqlite.php @@ -29,10 +29,6 @@ namespace Flake\Core\Database; class Sqlite extends \Flake\Core\Database { - protected $oDb = false; // current DB link - protected $debugOutput = false; - protected $store_lastBuiltQuery = true; - protected $debug_lastBuiltQuery = ""; protected $sDbPath = ""; function __construct($sDbPath) { From 251b7f431af1e22c1581f31ffe1c680bb4e7dc43 Mon Sep 17 00:00:00 2001 From: Phil Davis Date: Thu, 5 Mar 2020 22:02:03 +0545 Subject: [PATCH 2/4] Remove unneeded ignoreErrors entry from phpstan.neon --- phpstan.neon | 3 --- 1 file changed, 3 deletions(-) diff --git a/phpstan.neon b/phpstan.neon index 0f71779..14a75c4 100644 --- a/phpstan.neon +++ b/phpstan.neon @@ -17,6 +17,3 @@ parameters: - message: '#Access to undefined constant Flake\\Core\\Model::LABELFIELD.#' path: Core/Frameworks/Flake/Core/Model.php - - - message: '#Declaration of Flake\\Core\\Datastructure\\Chain::push\(Flake\\Core\\Datastructure\\Chainable \$value\) should be compatible with SplDoublyLinkedList::push\(\$value\)#' - path: Core/Frameworks/Flake/Core/Datastructure/Chain.php From 7268ed5cbd275d8d159ac6e887a28a07c04db7c6 Mon Sep 17 00:00:00 2001 From: ByteHamster Date: Wed, 11 Mar 2020 23:33:57 +0100 Subject: [PATCH 3/4] Warn users that they probably downloaded the wrong zip file --- Core/Frameworks/Baikal/WWWRoot/index.php | 2 +- Core/Frameworks/BaikalAdmin/WWWRoot/index.php | 2 +- Core/Frameworks/BaikalAdmin/WWWRoot/install/index.php | 2 +- html/cal.php | 2 +- html/card.php | 2 +- html/dav.php | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Core/Frameworks/Baikal/WWWRoot/index.php b/Core/Frameworks/Baikal/WWWRoot/index.php index 092a21c..d70abc6 100644 --- a/Core/Frameworks/Baikal/WWWRoot/index.php +++ b/Core/Frameworks/Baikal/WWWRoot/index.php @@ -40,7 +40,7 @@ if (file_exists(getcwd() . "/Core")) { } if (!file_exists(PROJECT_PATH_ROOT . 'vendor/')) { - die('

Incomplete installation

Baïkal dependencies have not been installed. Please, execute "composer install" in the folder where you installed Baïkal.'); + die('

Incomplete installation

Baïkal dependencies have not been installed. If you are a regular user, this means that you probably downloaded the wrong zip file.

To install the dependencies manually, execute "composer install" in the Baïkal root folder.

'); } require PROJECT_PATH_ROOT . 'vendor/autoload.php'; diff --git a/Core/Frameworks/BaikalAdmin/WWWRoot/index.php b/Core/Frameworks/BaikalAdmin/WWWRoot/index.php index db5676f..32bdfaa 100644 --- a/Core/Frameworks/BaikalAdmin/WWWRoot/index.php +++ b/Core/Frameworks/BaikalAdmin/WWWRoot/index.php @@ -41,7 +41,7 @@ if (file_exists(dirname(getcwd()) . "/Core")) { } if (!file_exists(PROJECT_PATH_ROOT . 'vendor/')) { - die('

Incomplete installation

Baïkal dependencies have not been installed. Please, execute "composer install" in the folder where you installed Baïkal.'); + die('

Incomplete installation

Baïkal dependencies have not been installed. If you are a regular user, this means that you probably downloaded the wrong zip file.

To install the dependencies manually, execute "composer install" in the Baïkal root folder.

'); } require PROJECT_PATH_ROOT . 'vendor/autoload.php'; diff --git a/Core/Frameworks/BaikalAdmin/WWWRoot/install/index.php b/Core/Frameworks/BaikalAdmin/WWWRoot/install/index.php index 371b48c..547214f 100644 --- a/Core/Frameworks/BaikalAdmin/WWWRoot/install/index.php +++ b/Core/Frameworks/BaikalAdmin/WWWRoot/install/index.php @@ -46,7 +46,7 @@ if (file_exists(dirname(dirname(getcwd())) . "/Core")) { } if (!file_exists(PROJECT_PATH_ROOT . 'vendor/')) { - die('

Incomplete installation

Baïkal dependencies have not been installed. Please, execute "composer install" in the folder where you installed Baïkal.'); + die('

Incomplete installation

Baïkal dependencies have not been installed. If you are a regular user, this means that you probably downloaded the wrong zip file.

To install the dependencies manually, execute "composer install" in the Baïkal root folder.

'); } require PROJECT_PATH_ROOT . "vendor/autoload.php"; diff --git a/html/cal.php b/html/cal.php index 0992bff..7242048 100644 --- a/html/cal.php +++ b/html/cal.php @@ -40,7 +40,7 @@ if (file_exists(getcwd() . "/Core")) { } if (!file_exists(PROJECT_PATH_ROOT . 'vendor/')) { - die('

Incomplete installation

Baïkal dependencies have not been installed. Please, execute "composer install" in the folder where you installed Baïkal.'); + die('

Incomplete installation

Baïkal dependencies have not been installed. If you are a regular user, this means that you probably downloaded the wrong zip file.

To install the dependencies manually, execute "composer install" in the Baïkal root folder.

'); } require PROJECT_PATH_ROOT . 'vendor/autoload.php'; diff --git a/html/card.php b/html/card.php index 5501ca1..1ee24a0 100644 --- a/html/card.php +++ b/html/card.php @@ -40,7 +40,7 @@ if (file_exists(getcwd() . "/Core")) { } if (!file_exists(PROJECT_PATH_ROOT . 'vendor/')) { - die('

Incomplete installation

Baïkal dependencies have not been installed. Please, execute "composer install" in the folder where you installed Baïkal.'); + die('

Incomplete installation

Baïkal dependencies have not been installed. If you are a regular user, this means that you probably downloaded the wrong zip file.

To install the dependencies manually, execute "composer install" in the Baïkal root folder.

'); } require PROJECT_PATH_ROOT . 'vendor/autoload.php'; diff --git a/html/dav.php b/html/dav.php index 12429e5..d068b54 100644 --- a/html/dav.php +++ b/html/dav.php @@ -40,7 +40,7 @@ if (file_exists(getcwd() . "/Core")) { } if (!file_exists(PROJECT_PATH_ROOT . 'vendor/')) { - die('

Incomplete installation

Baïkal dependencies have not been installed. Please, execute "composer install" in the folder where you installed Baïkal.'); + die('

Incomplete installation

Baïkal dependencies have not been installed. If you are a regular user, this means that you probably downloaded the wrong zip file.

To install the dependencies manually, execute "composer install" in the Baïkal root folder.

'); } require PROJECT_PATH_ROOT . 'vendor/autoload.php'; From 918841ff1c27df0964551223358884394ac71389 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cornelius=20Mat=C4=9Bjka?= Date: Tue, 3 Mar 2020 15:37:37 +0100 Subject: [PATCH 4/4] Add event count column in calendar overview --- Core/Frameworks/BaikalAdmin/Controller/User/Calendars.php | 1 + .../BaikalAdmin/Resources/Templates/User/Calendars.html | 2 ++ 2 files changed, 3 insertions(+) diff --git a/Core/Frameworks/BaikalAdmin/Controller/User/Calendars.php b/Core/Frameworks/BaikalAdmin/Controller/User/Calendars.php index ce68727..162abe3 100644 --- a/Core/Frameworks/BaikalAdmin/Controller/User/Calendars.php +++ b/Core/Frameworks/BaikalAdmin/Controller/User/Calendars.php @@ -68,6 +68,7 @@ class Calendars extends \Flake\Core\Controller { "linkdelete" => $this->linkDelete($calendar), "icon" => $calendar->icon(), "label" => $calendar->label(), + "events" => $calendar->getEventsBaseRequester()->count(), "description" => $calendar->get("description"), ]; } diff --git a/Core/Frameworks/BaikalAdmin/Resources/Templates/User/Calendars.html b/Core/Frameworks/BaikalAdmin/Resources/Templates/User/Calendars.html index acae86a..b1baaf9 100644 --- a/Core/Frameworks/BaikalAdmin/Resources/Templates/User/Calendars.html +++ b/Core/Frameworks/BaikalAdmin/Resources/Templates/User/Calendars.html @@ -10,6 +10,7 @@ Display name + Events Description @@ -18,6 +19,7 @@ {% for calendar in calendars %} {{ calendar.label|escape }} + {{ calendar.events|escape }} {{ calendar.description|escape }}