diff --git a/src/install/sql/content.sql b/src/install/sql/content.sql
index 0ea6817fa..26e07a185 100644
--- a/src/install/sql/content.sql
+++ b/src/install/sql/content.sql
@@ -133,11 +133,10 @@ LOCK TABLES `extension` WRITE;
INSERT INTO `extension` (`id`, `type`, `name`, `status`, `version`, `manifest`)
VALUES
- (1,'mod','kb','installed','1.0.0','{\"id\":\"kb\",\"type\":\"mod\",\"name\":\"Knowledge Base\",\"description\":\"Knowledge base module for FOSSBilling\",\"homepage_url\":\"https:\\/\\/github.com\\/FOSSBilling\",\"author\":\"FOSSBilling\",\"author_url\":\"http:\\/\\/extensions.fossbilling.org\\/\",\"license\":\"https:\\/\\/github.com\\/FOSSBilling\\/FOSSBilling\\/blob\\/main\\/LICENSE\",\"version\":\"1.0.0\",\"icon_url\":\"\\/modules\\/Kb\\/icon.svg\",\"download_url\":null,\"project_url\":\"https:\\/\\/extensions.fossbilling.org\\/\",\"minimum_boxbilling_version\":null,\"maximum_boxbilling_version\":null}'),
- (2,'mod','news','installed','1.0.0','{\"id\":\"news\",\"type\":\"mod\",\"name\":\"News\",\"description\":\"News module for FOSSBilling\",\"homepage_url\":\"https:\\/\\/github.com\\/FOSSBilling\",\"author\":\"FOSSBilling\",\"author_url\":\"http:\\/\\/extensions.fossbilling.org\\/\",\"license\":\"https:\\/\\/github.com\\/FOSSBilling\\/FOSSBilling\\/blob\\/main\\/LICENSE\",\"version\":\"1.0.0\",\"icon_url\":\"\\/modules\\/News\\/icon.svg\",\"download_url\":null,\"project_url\":\"https:\\/\\/extensions.fossbilling.org\\/\",\"minimum_boxbilling_version\":null,\"maximum_boxbilling_version\":null}'),
- (3,'mod','branding','installed','0.0.1','{\"id\":\"branding\",\"type\":\"mod\",\"name\":\"Branding\",\"description\":\"Show your support by voluntarily displaying references to FOSSBilling.\",\"homepage_url\":\"https:\\/\\/fossbilling.org\",\"author\":\"FOSSBilling\",\"author_url\":\"https:\\/\\/fossbilling.org\",\"license\":\"https:\\/\\/github.com\\/FOSSBilling\\/FOSSBilling\\/blob\\/main\\/LICENSE\",\"version\":\"0.0.1\",\"icon_url\":\"\\/modules\\/Branding\\/icon.svg\",\"download_url\":null,\"project_url\":\"https:\\/\\/extensions.fossbilling.org\\/\",\"minimum_boxbilling_version\":null,\"maximum_boxbilling_version\":null}'),
- (4,'mod','redirect','installed','1.0.0','{\"id\":\"redirect\",\"type\":\"mod\",\"name\":\"Redirect\",\"description\":\"Manage redirects\",\"homepage_url\":\"https:\\/\\/fossbilling.org\\/\",\"author\":\"FOSSBilling\",\"author_url\":\"https:\\/\\/www.fossbilling.org\",\"license\":\"N\\/A\",\"version\":\"1.0.0\",\"icon_url\":\"\\/modules\\/Redirect\\/icon.svg\",\"download_url\":null,\"project_url\":\"https:\\/\\/extensions.fossbilling.org\\/\",\"minimum_boxbilling_version\":null,\"maximum_boxbilling_version\":null}'),
- (5,'mod','wysiwyg','installed','1.0.0','{\"id\":\"wysiwyg\",\"type\":\"mod\",\"name\":\"Wysiwyg\",\"description\":\"Integrates a What You See Is What You Get (WYSIWYG) editor to your admin panel.\",\"homepage_url\":\"https:\\/\\/fossbilling.org\\/\",\"author\":\"FOSSBilling\",\"author_url\":\"https:\\/\\/extensions.fossbilling.org\\/\",\"license\":\"N\\/A\",\"version\":\"1.0.0\",\"icon_url\":\"\\/modules\\/Wysiwyg\\/icon.svg\",\"download_url\":null,\"project_url\":\"https:\\/\\/extensions.fossbilling.org\\/\",\"minimum_boxbilling_version\":null,\"maximum_boxbilling_version\":null}');
+ (1,'mod','news','installed','1.0.0','{\"id\":\"news\",\"type\":\"mod\",\"name\":\"News\",\"description\":\"News module for FOSSBilling\",\"homepage_url\":\"https:\\/\\/github.com\\/FOSSBilling\",\"author\":\"FOSSBilling\",\"author_url\":\"http:\\/\\/extensions.fossbilling.org\\/\",\"license\":\"https:\\/\\/github.com\\/FOSSBilling\\/FOSSBilling\\/blob\\/main\\/LICENSE\",\"version\":\"1.0.0\",\"icon_url\":\"\\/modules\\/News\\/icon.svg\",\"download_url\":null,\"project_url\":\"https:\\/\\/extensions.fossbilling.org\\/\",\"minimum_boxbilling_version\":null,\"maximum_boxbilling_version\":null}'),
+ (2,'mod','branding','installed','0.0.1','{\"id\":\"branding\",\"type\":\"mod\",\"name\":\"Branding\",\"description\":\"Show your support by voluntarily displaying references to FOSSBilling.\",\"homepage_url\":\"https:\\/\\/fossbilling.org\",\"author\":\"FOSSBilling\",\"author_url\":\"https:\\/\\/fossbilling.org\",\"license\":\"https:\\/\\/github.com\\/FOSSBilling\\/FOSSBilling\\/blob\\/main\\/LICENSE\",\"version\":\"0.0.1\",\"icon_url\":\"\\/modules\\/Branding\\/icon.svg\",\"download_url\":null,\"project_url\":\"https:\\/\\/extensions.fossbilling.org\\/\",\"minimum_boxbilling_version\":null,\"maximum_boxbilling_version\":null}'),
+ (3,'mod','redirect','installed','1.0.0','{\"id\":\"redirect\",\"type\":\"mod\",\"name\":\"Redirect\",\"description\":\"Manage redirects\",\"homepage_url\":\"https:\\/\\/fossbilling.org\\/\",\"author\":\"FOSSBilling\",\"author_url\":\"https:\\/\\/www.fossbilling.org\",\"license\":\"N\\/A\",\"version\":\"1.0.0\",\"icon_url\":\"\\/modules\\/Redirect\\/icon.svg\",\"download_url\":null,\"project_url\":\"https:\\/\\/extensions.fossbilling.org\\/\",\"minimum_boxbilling_version\":null,\"maximum_boxbilling_version\":null}'),
+ (4,'mod','wysiwyg','installed','1.0.0','{\"id\":\"wysiwyg\",\"type\":\"mod\",\"name\":\"Wysiwyg\",\"description\":\"Integrates a What You See Is What You Get (WYSIWYG) editor to your admin panel.\",\"homepage_url\":\"https:\\/\\/fossbilling.org\\/\",\"author\":\"FOSSBilling\",\"author_url\":\"https:\\/\\/extensions.fossbilling.org\\/\",\"license\":\"N\\/A\",\"version\":\"1.0.0\",\"icon_url\":\"\\/modules\\/Wysiwyg\\/icon.svg\",\"download_url\":null,\"project_url\":\"https:\\/\\/extensions.fossbilling.org\\/\",\"minimum_boxbilling_version\":null,\"maximum_boxbilling_version\":null}');
/*!40000 ALTER TABLE `extension` ENABLE KEYS */;
UNLOCK TABLES;
@@ -168,34 +167,34 @@ UNLOCK TABLES;
-# Dump of table kb_article
+# Dump of table support_kb_article
# ------------------------------------------------------------
-LOCK TABLES `kb_article` WRITE;
-/*!40000 ALTER TABLE `kb_article` DISABLE KEYS */;
+LOCK TABLES `support_kb_article` WRITE;
+/*!40000 ALTER TABLE `support_kb_article` DISABLE KEYS */;
-INSERT INTO `kb_article` (`id`, `kb_article_category_id`, `views`, `title`, `content`, `slug`, `status`, `created_at`, `updated_at`)
+INSERT INTO `support_kb_article` (`id`, `kb_article_category_id`, `views`, `title`, `content`, `slug`, `status`, `created_at`, `updated_at`)
VALUES
(1,2,0,'How to contact support','Registered clients can contact our support team:\n------------------------------------------------------------\n\n* Login to clients area\n* Select **Support** menu item\n* Click **Submit new ticket**\n* Fill the form and press *Submit*\n\nGuests can contact our support team:\n------------------------------------------------------------\n\n* Use our contact form.\n* Fill the form and click *Submit*\n','how-to-contact-support','active','2022-12-01 12:00:00','2022-12-01 12:00:00'),
(2,2,0,'How to place new order','To place new order, follow these steps:\n------------------------------------------------------------\n\n* Select our services at *Order* page.\n* Depending on selected product, you might need to provide additional information to complete order request.\n* Click \"Continue\" and your product/service is now in shopping cart.\n* If you have promo code, you can apply it and get discount.\n* Click on \"Checkout\" button to proceed with checkout process\n * If you are already logged in, uou will be automaticaly redirected to new invoice\n * If you are registerd client, you can provide your login details\n * If you have never purchased any service from us, fill up client sign up form, and continue checkout\n* Choose payment method to pay for invoice. List of all avalable payment methods will be listed below invoice details.\n* Choose payment method\n* You will be redirected to payment gateway page\n* After successful payment, You will be redirected back to invoice page.\n* Depending on selected services your order will be reviewed and activated by our staff members.\n* After you receive confirmation email about order activation you are able to manage your services.\n','how-to-place-new-order','active','2022-12-01 12:00:00','2022-12-01 12:00:00'),
(3,2,0,'Example article','Example article heading\n------------------------------------------------------------\n\nCursus, parturient porta dis sit? Habitasse non, sociis porttitor, sagittis dapibus scelerisque? Pid, porttitor integer, montes. Hac, in? Arcu nunc integer nascetur dis nisi. In, sed a amet? Adipiscing odio mauris mauris, porta, integer, adipiscing habitasse, elementum phasellus, turpis in? Quis magna placerat eu, cursus urna mattis egestas, a ac massa turpis mus et odio pid in, urna dapibus ridiculus in turpis cursus ac a urna magna purus etiam ac nisi porttitor! Auctor est? In adipiscing, hac platea augue vut, hac est cum sagittis! Montes nascetur pulvinar tristique porta platea? Magnis vel etiam nisi augue auctor sit pulvinar! Aliquet rhoncus, elit porta? Magnis pulvinar eu turpis purus sociis a augue? Sit, nascetur! Mattis nisi, penatibus ac ac natoque auctor turpis.\n\nExample article heading\n------------------------------------------------------------\n\nUt diam cursus, elit pulvinar, habitasse purus? Enim. Urna? Velit arcu, rhoncus sociis sed, et, ultrices nascetur lacus vut purus tempor a. Vel? Sagittis integer scelerisque, dapibus lectus mid, magnis, augue duis velit etiam tortor! Eros, a et phasellus est ultricies integer elementum in, tempor sed parturient. Dictumst rhoncus, ut sed sagittis facilisis? In, proin? Urna augue in sociis enim dignissim! Velit magna tincidunt ac. Nunc, vel auctor porta enim integer. Phasellus amet eu. Tristique lundium arcu! In? Massa penatibus arcu, rhoncus augue ut pid pulvinar, porttitor, porta, et! A sit odio, proin natoque ultrices cras cras magna porttitor! Ultrices sed magna in! Porttitor nunc, tincidunt nec, amet integer aenean. Tincidunt, placerat nec dolor parturient et ac pulvinar a.\n','example-article-slug','active','2022-12-01 12:00:00','2022-12-01 12:00:00');
-/*!40000 ALTER TABLE `kb_article` ENABLE KEYS */;
+/*!40000 ALTER TABLE `support_kb_article` ENABLE KEYS */;
UNLOCK TABLES;
-# Dump of table kb_article_category
+# Dump of table support_kb_article_category
# ------------------------------------------------------------
-LOCK TABLES `kb_article_category` WRITE;
-/*!40000 ALTER TABLE `kb_article_category` DISABLE KEYS */;
+LOCK TABLES `support_kb_article_category` WRITE;
+/*!40000 ALTER TABLE `support_kb_article_category` DISABLE KEYS */;
-INSERT INTO `kb_article_category` (`id`, `title`, `description`, `slug`, `created_at`, `updated_at`)
+INSERT INTO `support_kb_article_category` (`id`, `title`, `description`, `slug`, `created_at`, `updated_at`)
VALUES
(1,'Frequently asked questions','Section for common issues','faq','2022-12-01 12:00:00','2022-12-01 12:00:00'),
(2,'How to''s','Section dedicated for tutorials','how-to','2022-12-01 12:00:00','2022-12-01 12:00:00');
-/*!40000 ALTER TABLE `kb_article_category` ENABLE KEYS */;
+/*!40000 ALTER TABLE `support_kb_article_category` ENABLE KEYS */;
UNLOCK TABLES;
@@ -316,7 +315,7 @@ LOCK TABLES `setting` WRITE;
INSERT INTO `setting` (`id`, `param`, `value`, `public`, `category`, `hash`, `created_at`, `updated_at`)
VALUES
- (1,'last_patch','34',0,NULL,NULL,'2022-12-01 12:00:00','2022-12-01 12:00:00'),
+ (1,'last_patch','36',0,NULL,NULL,'2022-12-01 12:00:00','2022-12-01 12:00:00'),
(2,'company_name','Company Name',0,NULL,NULL,'2022-12-01 12:00:00','2022-12-01 12:00:00'),
(3,'company_email','company@email.com',0,NULL,NULL,'2022-12-01 12:00:00','2022-12-01 12:00:00'),
(4,'company_signature','FOSSBilling.org - Client Management, Invoice and Support Software',0,NULL,NULL,'2022-12-01 12:00:00','2022-12-01 12:00:00'),
diff --git a/src/install/sql/content_test.sql b/src/install/sql/content_test.sql
index 1a8ae832c..462bdfdc9 100644
--- a/src/install/sql/content_test.sql
+++ b/src/install/sql/content_test.sql
@@ -162,11 +162,10 @@ LOCK TABLES `extension` WRITE;
INSERT INTO `extension` (`id`, `type`, `name`, `status`, `version`, `manifest`)
VALUES
- (1,'mod','kb','installed','1.0.0','{\"id\":\"kb\",\"type\":\"mod\",\"name\":\"Knowledge Base\",\"description\":\"Knowledge base module for FOSSBilling\",\"homepage_url\":\"https:\\/\\/github.com\\/FOSSBilling\",\"author\":\"FOSSBilling\",\"author_url\":\"http:\\/\\/extensions.fossbilling.org\\/\",\"license\":\"https:\\/\\/github.com\\/FOSSBilling\\/FOSSBilling\\/blob\\/main\\/LICENSE\",\"version\":\"1.0.0\",\"icon_url\":\"\\/modules\\/Kb\\/icon.svg\",\"download_url\":null,\"project_url\":\"https:\\/\\/extensions.fossbilling.org\\/\",\"minimum_boxbilling_version\":null,\"maximum_boxbilling_version\":null}'),
- (2,'mod','news','installed','1.0.0','{\"id\":\"news\",\"type\":\"mod\",\"name\":\"News\",\"description\":\"News module for FOSSBilling\",\"homepage_url\":\"https:\\/\\/github.com\\/FOSSBilling\",\"author\":\"FOSSBilling\",\"author_url\":\"http:\\/\\/extensions.fossbilling.org\\/\",\"license\":\"https:\\/\\/github.com\\/FOSSBilling\\/FOSSBilling\\/blob\\/main\\/LICENSE\",\"version\":\"1.0.0\",\"icon_url\":\"\\/modules\\/News\\/icon.svg\",\"download_url\":null,\"project_url\":\"https:\\/\\/extensions.fossbilling.org\\/\",\"minimum_boxbilling_version\":null,\"maximum_boxbilling_version\":null}'),
- (3,'mod','branding','installed','0.0.1','{\"id\":\"branding\",\"type\":\"mod\",\"name\":\"Branding\",\"description\":\"Show your support by voluntarily displaying references to FOSSBilling.\",\"homepage_url\":\"https:\\/\\/fossbilling.org\",\"author\":\"FOSSBilling\",\"author_url\":\"https:\\/\\/fossbilling.org\",\"license\":\"https:\\/\\/github.com\\/FOSSBilling\\/FOSSBilling\\/blob\\/main\\/LICENSE\",\"version\":\"0.0.1\",\"icon_url\":\"\\/modules\\/Branding\\/icon.svg\",\"download_url\":null,\"project_url\":\"https:\\/\\/extensions.fossbilling.org\\/\",\"minimum_boxbilling_version\":null,\"maximum_boxbilling_version\":null}'),
- (4,'mod','redirect','installed','1.0.0','{\"id\":\"redirect\",\"type\":\"mod\",\"name\":\"Redirect\",\"description\":\"Manage redirects\",\"homepage_url\":\"https:\\/\\/fossbilling.org\\/\",\"author\":\"FOSSBilling\",\"author_url\":\"https:\\/\\/www.fossbilling.org\",\"license\":\"N\\/A\",\"version\":\"1.0.0\",\"icon_url\":\"\\/modules\\/Redirect\\/icon.svg\",\"download_url\":null,\"project_url\":\"https:\\/\\/extensions.fossbilling.org\\/\",\"minimum_boxbilling_version\":null,\"maximum_boxbilling_version\":null}'),
- (5,'mod','wysiwyg','installed','1.0.0','{\"id\":\"wysiwyg\",\"type\":\"mod\",\"name\":\"Wysiwyg\",\"description\":\"Integrates a What You See Is What You Get (WYSIWYG) editor to your admin panel.\",\"homepage_url\":\"https:\\/\\/fossbilling.org\\/\",\"author\":\"FOSSBilling\",\"author_url\":\"https:\\/\\/extensions.fossbilling.org\\/\",\"license\":\"N\\/A\",\"version\":\"1.0.0\",\"icon_url\":\"\\/modules\\/Wysiwyg\\/icon.svg\",\"download_url\":null,\"project_url\":\"https:\\/\\/extensions.fossbilling.org\\/\",\"minimum_boxbilling_version\":null,\"maximum_boxbilling_version\":null}');
+ (1,'mod','news','installed','1.0.0','{\"id\":\"news\",\"type\":\"mod\",\"name\":\"News\",\"description\":\"News module for FOSSBilling\",\"homepage_url\":\"https:\\/\\/github.com\\/FOSSBilling\",\"author\":\"FOSSBilling\",\"author_url\":\"http:\\/\\/extensions.fossbilling.org\\/\",\"license\":\"https:\\/\\/github.com\\/FOSSBilling\\/FOSSBilling\\/blob\\/main\\/LICENSE\",\"version\":\"1.0.0\",\"icon_url\":\"\\/modules\\/News\\/icon.svg\",\"download_url\":null,\"project_url\":\"https:\\/\\/extensions.fossbilling.org\\/\",\"minimum_boxbilling_version\":null,\"maximum_boxbilling_version\":null}'),
+ (1,'mod','branding','installed','0.0.1','{\"id\":\"branding\",\"type\":\"mod\",\"name\":\"Branding\",\"description\":\"Show your support by voluntarily displaying references to FOSSBilling.\",\"homepage_url\":\"https:\\/\\/fossbilling.org\",\"author\":\"FOSSBilling\",\"author_url\":\"https:\\/\\/fossbilling.org\",\"license\":\"https:\\/\\/github.com\\/FOSSBilling\\/FOSSBilling\\/blob\\/main\\/LICENSE\",\"version\":\"0.0.1\",\"icon_url\":\"\\/modules\\/Branding\\/icon.svg\",\"download_url\":null,\"project_url\":\"https:\\/\\/extensions.fossbilling.org\\/\",\"minimum_boxbilling_version\":null,\"maximum_boxbilling_version\":null}'),
+ (3,'mod','redirect','installed','1.0.0','{\"id\":\"redirect\",\"type\":\"mod\",\"name\":\"Redirect\",\"description\":\"Manage redirects\",\"homepage_url\":\"https:\\/\\/fossbilling.org\\/\",\"author\":\"FOSSBilling\",\"author_url\":\"https:\\/\\/www.fossbilling.org\",\"license\":\"N\\/A\",\"version\":\"1.0.0\",\"icon_url\":\"\\/modules\\/Redirect\\/icon.svg\",\"download_url\":null,\"project_url\":\"https:\\/\\/extensions.fossbilling.org\\/\",\"minimum_boxbilling_version\":null,\"maximum_boxbilling_version\":null}'),
+ (4,'mod','wysiwyg','installed','1.0.0','{\"id\":\"wysiwyg\",\"type\":\"mod\",\"name\":\"Wysiwyg\",\"description\":\"Integrates a What You See Is What You Get (WYSIWYG) editor to your admin panel.\",\"homepage_url\":\"https:\\/\\/fossbilling.org\\/\",\"author\":\"FOSSBilling\",\"author_url\":\"https:\\/\\/extensions.fossbilling.org\\/\",\"license\":\"N\\/A\",\"version\":\"1.0.0\",\"icon_url\":\"\\/modules\\/Wysiwyg\\/icon.svg\",\"download_url\":null,\"project_url\":\"https:\\/\\/extensions.fossbilling.org\\/\",\"minimum_boxbilling_version\":null,\"maximum_boxbilling_version\":null}');
/*!40000 ALTER TABLE `extension` ENABLE KEYS */;
UNLOCK TABLES;
@@ -266,31 +265,31 @@ UNLOCK TABLES;
-# Dump of table kb_article
+# Dump of table support_kb_article
# ------------------------------------------------------------
-LOCK TABLES `kb_article` WRITE;
-/*!40000 ALTER TABLE `kb_article` DISABLE KEYS */;
+LOCK TABLES `support_kb_article` WRITE;
+/*!40000 ALTER TABLE `support_kb_article` DISABLE KEYS */;
-INSERT INTO `kb_article` (`id`, `kb_article_category_id`, `views`, `title`, `content`, `slug`, `status`, `created_at`, `updated_at`)
+INSERT INTO `support_kb_article` (`id`, `kb_article_category_id`, `views`, `title`, `content`, `slug`, `status`, `created_at`, `updated_at`)
VALUES
(1,1,0,'Live demo instructions','Please note that there may be other users logged into the demo at the\nsame time as you, who may be editing and changing settings at the same\ntime as your testing.\n\nSome features have been intentionally disabled in this demo instance.\n\nAdmin area can be accesed at:\n\n> [https://demo.fossbilling.org/admin](https://demo.fossbilling.org/admin/staff/login?email=admin@fossbilling.org&password=demo)\n>\n> Username: admin@fossbilling.org\n>\n> Password: demo\n\nClient area can be accesed at:\n> [https://demo.fossbilling.org/login](https://demo.fossbilling.org/login?email=client@fossbilling.org&password=demo)\n>\n> Username: client@fossbilling.org\n>\n> Password: demo\n','live-demo','active','2022-12-01 12:00:00','2022-12-01 12:00:00');
-/*!40000 ALTER TABLE `kb_article` ENABLE KEYS */;
+/*!40000 ALTER TABLE `support_kb_article` ENABLE KEYS */;
UNLOCK TABLES;
-# Dump of table kb_article_category
+# Dump of table support_kb_article_category
# ------------------------------------------------------------
-LOCK TABLES `kb_article_category` WRITE;
-/*!40000 ALTER TABLE `kb_article_category` DISABLE KEYS */;
+LOCK TABLES `support_kb_article_category` WRITE;
+/*!40000 ALTER TABLE `support_kb_article_category` DISABLE KEYS */;
-INSERT INTO `kb_article_category` (`id`, `title`, `description`, `slug`, `created_at`, `updated_at`)
+INSERT INTO `support_kb_article_category` (`id`, `title`, `description`, `slug`, `created_at`, `updated_at`)
VALUES
(1,'Instructions','Section for common issues','instructions','2022-12-01 12:00:00','2022-12-01 12:00:00'),
-/*!40000 ALTER TABLE `kb_article_category` ENABLE KEYS */;
+/*!40000 ALTER TABLE `support_kb_article_category` ENABLE KEYS */;
UNLOCK TABLES;
@@ -481,7 +480,7 @@ LOCK TABLES `setting` WRITE;
INSERT INTO `setting` (`id`, `param`, `value`, `public`, `category`, `hash`, `created_at`, `updated_at`)
VALUES
- (1,'last_patch','25',0,NULL,NULL,'2022-12-01 12:00:00','2022-12-01 12:00:00'),
+ (1,'last_patch','36',0,NULL,NULL,'2022-12-01 12:00:00','2022-12-01 12:00:00'),
(2,'company_name','FOSSBilling demo',0,NULL,NULL,'2022-12-01 12:00:00','2022-12-01 12:00:00'),
(3,'company_email','demo@fossbilling.org',0,NULL,NULL,'2022-12-01 12:00:00','2022-12-01 12:00:00'),
(4,'company_signature','FOSSBilling.org - Client Management, Invoice and Support Software',0,NULL,NULL,'2022-12-01 12:00:00','2022-12-01 12:00:00'),
diff --git a/src/install/sql/structure.sql b/src/install/sql/structure.sql
index f1f736b69..7551cead8 100644
--- a/src/install/sql/structure.sql
+++ b/src/install/sql/structure.sql
@@ -613,12 +613,12 @@ CREATE TABLE `invoice_item` (
/*!40101 SET character_set_client = @saved_cs_client */;
--
--- Table structure for table `kb_article`
+-- Table structure for table `support_kb_article`
--
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
-CREATE TABLE `kb_article` (
+CREATE TABLE `support_kb_article` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`kb_article_category_id` bigint(20) DEFAULT NULL,
`views` int(11) DEFAULT '0',
@@ -635,12 +635,12 @@ CREATE TABLE `kb_article` (
/*!40101 SET character_set_client = @saved_cs_client */;
--
--- Table structure for table `kb_article_category`
+-- Table structure for table `support_kb_article_category`
--
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
-CREATE TABLE `kb_article_category` (
+CREATE TABLE `support_kb_article_category` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`title` varchar(100) DEFAULT NULL,
`description` text,
diff --git a/src/library/FOSSBilling/UpdatePatcher.php b/src/library/FOSSBilling/UpdatePatcher.php
index 6746a1cd6..158046cc5 100644
--- a/src/library/FOSSBilling/UpdatePatcher.php
+++ b/src/library/FOSSBilling/UpdatePatcher.php
@@ -306,6 +306,34 @@ class UpdatePatcher implements InjectionAwareInterface
$q = "ALTER TABLE session ADD created_at int(11);";
$this->executeSql($q);
},
+ 36 => function () {
+ // Patch to complete merging the Kb and Support modules.
+ // @see https://github.com/FOSSBilling/FOSSBilling/pull/1180
+
+ // Renames the "kb_article" and "kb_article_category" tables to "support_kb_article" and "support_kb_article_category", respectively.
+ $q = "RENAME TABLE kb_article TO support_kb_article, kb_article_category TO support_kb_article_category;";
+ $this->executeSql($q);
+
+ // If the Kb extension is currently active, set enabled in Support settings.
+ $ext_service = $this->di['mod_service']('extension');
+ if ($ext_service->isExtensionActive('mod', 'kb')) {
+ $support_ext_config = $ext_service->getConfig('mod_support');
+ $support_ext_config['kb_enable'] ?: 'on';
+ $ext_service->setConfig($support_ext_config);
+ }
+
+ // If the Kb extension exists, uninstall it.
+ $kb_ext = $ext_service->findExtension('mod', 'kb');
+ if ($kb_ext instanceof \Model_Extension) {
+ $ext_service->uninstall($kb_ext);
+ }
+
+ // Finally, remove old Kb extension files/folders.
+ $fileActions = [
+ PATH_MODS . DIRECTORY_SEPARATOR . 'Kb' => 'unlink',
+ ];
+ $this->executeFileActions($fileActions);
+ },
];
ksort($patches, SORT_NATURAL);
diff --git a/src/library/Model/KbArticle.php b/src/library/Model/SupportKbArticle.php
similarity index 84%
rename from src/library/Model/KbArticle.php
rename to src/library/Model/SupportKbArticle.php
index ae0e00ec3..8d1058f33 100644
--- a/src/library/Model/KbArticle.php
+++ b/src/library/Model/SupportKbArticle.php
@@ -8,7 +8,7 @@
* @license http://www.apache.org/licenses/LICENSE-2.0 Apache-2.0
*/
-class Model_KbArticle extends \RedBeanPHP\SimpleModel
+class Model_SupportKbArticle extends \RedBeanPHP\SimpleModel
{
public const ACTIVE = 'active';
public const DRAFT = 'draft';
diff --git a/src/library/Model/KbArticleCategory.php b/src/library/Model/SupportKbArticleCategory.php
similarity index 78%
rename from src/library/Model/KbArticleCategory.php
rename to src/library/Model/SupportKbArticleCategory.php
index 7f8c210e7..be6b5802d 100644
--- a/src/library/Model/KbArticleCategory.php
+++ b/src/library/Model/SupportKbArticleCategory.php
@@ -8,7 +8,6 @@
* @license http://www.apache.org/licenses/LICENSE-2.0 Apache-2.0
*/
-class Model_KbArticleCategory extends \RedBeanPHP\SimpleModel
+class Model_SupportKbArticleCategory extends \RedBeanPHP\SimpleModel
{
-
}
diff --git a/src/modules/Kb/Api/Admin.php b/src/modules/Kb/Api/Admin.php
deleted file mode 100644
index ad72f0e86..000000000
--- a/src/modules/Kb/Api/Admin.php
+++ /dev/null
@@ -1,256 +0,0 @@
-getService()->searchArticles($status, $search, $cat);
-
- foreach ($pager['list'] as $key => $item) {
- $article = $this->di['db']->getExistingModelById('KbArticle', $item['id'], 'KB Article not found');
- $pager['list'][$key] = $this->getService()->toApiArray($article);
- }
-
- return $pager;
- }
-
- /**
- * Get knowledge base article.
- *
- * @return array
- */
- public function article_get($data)
- {
- $required = [
- 'id' => 'Article id not passed',
- ];
- $this->di['validator']->checkRequiredParamsForArray($required, $data);
-
- $model = $this->di['db']->findOne('KbArticle', 'id = ?', [$data['id']]);
-
- if (!$model instanceof \Model_KbArticle) {
- throw new \FOSSBilling\Exception('Article not found');
- }
-
- return $this->getService()->toApiArray($model, true, $this->getIdentity());
- }
-
- /**
- * Create new knowledge base article.
- *
- * @optional string $status - knowledge base article status
- * @optional string $content - knowledge base article content
- *
- * @return array
- */
- public function article_create($data)
- {
- $required = [
- 'kb_article_category_id' => 'Article category id not passed',
- 'title' => 'Article title not passed',
- ];
- $this->di['validator']->checkRequiredParamsForArray($required, $data);
-
- $articleCategoryId = $data['kb_article_category_id'];
- $title = $data['title'];
- $status = $data['status'] ?? \Model_KbArticle::DRAFT;
- $content = $data['content'] ?? null;
-
- return $this->getService()->createArticle($articleCategoryId, $title, $status, $content);
- }
-
- /**
- * Update knowledge base article.
- *
- * @optional string $title - knowledge base article title
- * @optional int $kb_article_category_id - knowledge base category ID
- * @optional string $slug - knowledge base article slug
- * @optional string $status - knowledge base article status
- * @optional string $content - knowledge base article content
- * @optional int $views - knowledge base article views counter
- *
- * @return bool
- */
- public function article_update($data)
- {
- $required = [
- 'id' => 'Article ID not passed',
- ];
- $this->di['validator']->checkRequiredParamsForArray($required, $data);
-
- $articleCategoryId = $data['kb_article_category_id'] ?? null;
- $title = $data['title'] ?? null;
- $slug = $data['slug'] ?? null;
- $status = $data['status'] ?? null;
- $content = $data['content'] ?? null;
- $views = $data['views'] ?? null;
-
- return $this->getService()->updateArticle($data['id'], $articleCategoryId, $title, $slug, $status, $content, $views);
- }
-
- /**
- * Delete knowledge base article.
- *
- * @return bool
- */
- public function article_delete($data)
- {
- $required = [
- 'id' => 'Article ID not passed',
- ];
- $this->di['validator']->checkRequiredParamsForArray($required, $data);
-
- $model = $this->di['db']->findOne('KbArticle', 'id = ?', [$data['id']]);
-
- if (!$model instanceof \Model_KbArticle) {
- throw new \FOSSBilling\Exception('Article not found');
- }
-
- $this->getService()->rm($model);
-
- return true;
- }
-
- /**
- * Get paginated list of knowledge base categories.
- *
- * @return array
- */
- public function category_get_list($data)
- {
- [$sql, $bindings] = $this->getService()->categoryGetSearchQuery($data);
- $per_page = $data['per_page'] ?? $this->di['pager']->getPer_page();
- $pager = $this->di['pager']->getAdvancedResultSet($sql, $bindings, $per_page);
-
- foreach ($pager['list'] as $key => $item) {
- $category = $this->di['db']->getExistingModelById('KbArticleCategory', $item['id'], 'KB Article not found');
- $pager['list'][$key] = $this->getService()->categoryToApiArray($category, $this->getIdentity());
- }
-
- return $pager;
- }
-
- /**
- * Get knowledge base category.
- *
- * @return array
- */
- public function category_get($data)
- {
- $required = [
- 'id' => 'Category ID not passed',
- ];
- $this->di['validator']->checkRequiredParamsForArray($required, $data);
-
- $model = $this->di['db']->findOne('KbArticleCategory', 'id = ?', [$data['id']]);
-
- if (!$model instanceof \Model_KbArticleCategory) {
- throw new \FOSSBilling\Exception('Article Category not found');
- }
-
- return $this->getService()->categoryToApiArray($model);
- }
-
- /**
- * Create new knowledge base category.
- *
- * @optional string $description - knowledge base category description
- *
- * @return array
- */
- public function category_create($data)
- {
- $required = [
- 'title' => 'Category title not passed',
- ];
- $this->di['validator']->checkRequiredParamsForArray($required, $data);
-
- $title = $data['title'];
- $description = $data['description'] ?? null;
-
- return $this->getService()->createCategory($title, $description);
- }
-
- /**
- * Update knowledge base category.
- *
- * @optional string $title - knowledge base category title
- * @optional string $slug - knowledge base category slug
- * @optional string $description - knowledge base category description
- *
- * @return array
- */
- public function category_update($data)
- {
- $required = [
- 'id' => 'Category ID not passed',
- ];
- $this->di['validator']->checkRequiredParamsForArray($required, $data);
-
- $model = $this->di['db']->findOne('KbArticleCategory', 'id = ?', [$data['id']]);
-
- if (!$model instanceof \Model_KbArticleCategory) {
- throw new \FOSSBilling\Exception('Article Category not found');
- }
-
- $title = $data['title'] ?? null;
- $slug = $data['slug'] ?? null;
- $description = $data['description'] ?? null;
-
- return $this->getService()->updateCategory($model, $title, $slug, $description);
- }
-
- /**
- * Delete knowledge base category.
- *
- * @return bool
- */
- public function category_delete($data)
- {
- $required = [
- 'id' => 'Category ID not passed',
- ];
- $this->di['validator']->checkRequiredParamsForArray($required, $data);
-
- $model = $this->di['db']->findOne('KbArticleCategory', 'id = ?', [$data['id']]);
-
- if (!$model instanceof \Model_KbArticleCategory) {
- throw new \FOSSBilling\Exception('Category not found');
- }
-
- return $this->getService()->categoryRm($model);
- }
-
- /**
- * Get knowledge base categories id, title pairs.
- *
- * @return array
- */
- public function category_get_pairs($data)
- {
- return $this->getService()->categoryGetPairs();
- }
-}
diff --git a/src/modules/Kb/Api/Guest.php b/src/modules/Kb/Api/Guest.php
deleted file mode 100644
index 4ea1eb152..000000000
--- a/src/modules/Kb/Api/Guest.php
+++ /dev/null
@@ -1,134 +0,0 @@
-di['pager']->getPer_page();
- $page = $data['page'] ?? null;
-
- $pager = $this->getService()->searchArticles($status, $search, $cat, $per_page, $page);
-
- foreach ($pager['list'] as $key => $item) {
- $article = $this->di['db']->getExistingModelById('KbArticle', $item['id'], 'KB Article not found');
- $pager['list'][$key] = $this->getService()->toApiArray($article);
- }
-
- return $pager;
- }
-
- /**
- * Get active knowledge base article.
- *
- * @return array
- */
- public function article_get($data)
- {
- if (!isset($data['id']) && !isset($data['slug'])) {
- throw new \FOSSBilling\Exception('ID or slug is missing');
- }
-
- $id = $data['id'] ?? null;
- $slug = $data['slug'] ?? null;
-
- $model = false;
- if ($id) {
- $model = $this->getService()->findActiveArticleById($id);
- } else {
- $model = $this->getService()->findActiveArticleBySlug($slug);
- }
-
- if (!$model instanceof \Model_KbArticle) {
- throw new \FOSSBilling\Exception('Article item not found');
- }
- $this->getService()->hitView($model);
-
- return $this->getService()->toApiArray($model, true, $this->getIdentity());
- }
-
- /**
- * Get paginated list of knowledge base categories.
- *
- * @return array
- */
- public function category_get_list($data)
- {
- $data['article_status'] = \Model_KbArticle::ACTIVE;
- [$query, $bindings] = $this->getService()->categoryGetSearchQuery($data);
-
- $per_page = $data['per_page'] ?? $this->di['pager']->getPer_page();
- $pager = $this->di['pager']->getAdvancedResultSet($query, $bindings, $per_page);
-
- $q = $data['q'] ?? null;
-
- foreach ($pager['list'] as $key => $item) {
- $category = $this->di['db']->getExistingModelById('KbArticleCategory', $item['id'], 'KB Article not found');
- $pager['list'][$key] = $this->getService()->categoryToApiArray($category, $this->getIdentity(), $q);
- }
-
- return $pager;
- }
-
- /**
- * Get knowledge base categories id, title pairs.
- *
- * @return array
- */
- public function category_get_pairs($data)
- {
- return $this->getService()->categoryGetPairs();
- }
-
- /**
- * Get knowledge base category by ID or SLUG.
- *
- * @return array
- */
- public function category_get($data)
- {
- if (!isset($data['id']) && !isset($data['slug'])) {
- throw new \FOSSBilling\Exception('Category ID or slug is missing');
- }
-
- $id = $data['id'] ?? null;
- $slug = $data['slug'] ?? null;
-
- $model = false;
- if ($id) {
- $model = $this->getService()->findCategoryById($id);
- } else {
- $model = $this->getService()->findCategoryBySlug($slug);
- }
-
- if (!$model instanceof \Model_KbArticleCategory) {
- throw new \FOSSBilling\Exception('Knowledge base category not found');
- }
-
- return $this->getService()->categoryToApiArray($model, $this->getIdentity());
- }
-}
diff --git a/src/modules/Kb/Controller/Admin.php b/src/modules/Kb/Controller/Admin.php
deleted file mode 100644
index d577711af..000000000
--- a/src/modules/Kb/Controller/Admin.php
+++ /dev/null
@@ -1,79 +0,0 @@
-di = $di;
- }
-
- public function getDi(): ?\Pimple\Container
- {
- return $this->di;
- }
-
- public function fetchNavigation()
- {
- return [
- 'group' => [
- 'index' => 501,
- 'location' => 'kb',
- 'label' => __trans('Knowledge base'),
- 'uri' => $this->di['url']->adminLink('kb'),
- 'class' => 'info',
- 'sprite_class' => 'dark-sprite-icon sprite-docs',
- ],
- 'subpages' => [
- [
- 'location' => 'kb',
- 'index' => 800,
- 'label' => __trans('Knowledge base'),
- 'uri' => $this->di['url']->adminLink('kb'),
- 'class' => '',
- ],
- ],
- ];
- }
-
- public function register(\Box_App &$app)
- {
- $app->get('/kb', 'get_index', [], static::class);
- $app->get('/kb/article/:id', 'get_post', ['id' => '[0-9]+'], static::class);
- $app->get('/kb/category/:id', 'get_cat', ['id' => '[0-9]+'], static::class);
- }
-
- public function get_index(\Box_App $app)
- {
- $this->di['is_admin_logged'];
-
- return $app->render('mod_kb_index');
- }
-
- public function get_post(\Box_App $app, $id)
- {
- $api = $this->di['api_admin'];
- $post = $api->kb_article_get(['id' => $id]);
-
- return $app->render('mod_kb_article', ['post' => $post]);
- }
-
- public function get_cat(\Box_App $app, $id)
- {
- $api = $this->di['api_admin'];
- $cat = $api->kb_category_get(['id' => $id]);
-
- return $app->render('mod_kb_category', ['category' => $cat]);
- }
-}
diff --git a/src/modules/Kb/Controller/Client.php b/src/modules/Kb/Controller/Client.php
deleted file mode 100644
index ade394238..000000000
--- a/src/modules/Kb/Controller/Client.php
+++ /dev/null
@@ -1,56 +0,0 @@
-di = $di;
- }
-
- public function getDi(): ?\Pimple\Container
- {
- return $this->di;
- }
-
- public function register(\Box_App &$app)
- {
- $app->get('/kb', 'get_kb', [], static::class);
- $app->get('/kb/:category', 'get_kb_category', ['category' => '[a-z0-9-]+'], static::class);
- $app->get('/kb/:category/:slug', 'get_kb_article', ['category' => '[a-z0-9-]+', 'slug' => '[a-z0-9-]+'], static::class);
- }
-
- public function get_kb(\Box_App $app)
- {
- return $app->render('mod_kb_index');
- }
-
- public function get_kb_category(\Box_App $app, $category)
- {
- $api = $this->di['api_guest'];
- $data = ['slug' => $category];
- $model = $api->kb_category_get($data);
-
- return $app->render('mod_kb_category', ['category' => $model]);
- }
-
- public function get_kb_article(\Box_App $app, $category, $slug)
- {
- $api = $this->di['api_guest'];
- $data = ['slug' => $slug];
- $article = $api->kb_article_get($data);
-
- return $app->render('mod_kb_article', ['article' => $article]);
- }
-}
diff --git a/src/modules/Kb/Service.php b/src/modules/Kb/Service.php
deleted file mode 100644
index 4c627e754..000000000
--- a/src/modules/Kb/Service.php
+++ /dev/null
@@ -1,340 +0,0 @@
-di = $di;
- }
-
- public function searchArticles($status = null, $search = null, $cat = null, $per_page = 100, $page = null)
- {
- $filter = [];
-
- $sql = '
- SELECT *
- FROM kb_article
- WHERE 1
- ';
-
- if ($cat) {
- $sql .= ' AND kb_article_category_id = :cid';
- $filter[':cid'] = $cat;
- }
-
- if ($status) {
- $sql .= ' AND status = :status';
- $filter[':status'] = $status;
- }
-
- if ($search) {
- $sql .= ' AND title LIKE :q OR content LIKE :q';
- $filter[':q'] = "%$search%";
- }
-
- $sql .= ' ORDER BY kb_article_category_id DESC, views DESC';
-
- return $this->di['pager']->getSimpleResultSet($sql, $filter, $per_page, $page);
- }
-
- public function findActiveArticleById($id)
- {
- $bindings = [
- ':id' => $id,
- ':status' => \Model_KbArticle::ACTIVE,
- ];
-
- return $this->di['db']->findOne('KbArticle', 'id = :id AND status=:status', $bindings);
- }
-
- public function findActiveArticleBySlug($slug)
- {
- $bindings = [
- ':slug' => $slug,
- ':status' => \Model_KbArticle::ACTIVE,
- ];
-
- return $this->di['db']->findOne('KbArticle', 'slug = :slug AND status=:status', $bindings);
- }
-
- public function findActive()
- {
- return $this->di['db']->find('KbArticle', 'status=:status', [':status' => \Model_KbArticle::ACTIVE]);
- }
-
- public function hitView(\Model_KbArticle $model)
- {
- ++$model->views;
- $this->di['db']->store($model);
- }
-
- public function rm(\Model_KbArticle $model)
- {
- $id = $model->id;
- $this->di['db']->trash($model);
- $this->di['logger']->info('Deleted knowledge base article #%s', $id);
- }
-
- public function toApiArray(\Model_KbArticle $model, $deep = false, $identity = null)
- {
- $data = [
- 'id' => $model->id,
- 'slug' => $model->slug,
- 'title' => $model->title,
- 'views' => $model->views,
- 'created_at' => $model->created_at,
- 'status' => $model->status,
- 'updated_at' => $model->updated_at,
- ];
-
- $cat = $this->di['db']->getExistingModelById('KbArticleCategory', $model->kb_article_category_id, 'Knowledge base category not found');
- $data['category'] = [
- 'id' => $cat->id,
- 'slug' => $cat->slug,
- 'title' => $cat->title,
- ];
-
- if ($deep) {
- $data['content'] = $model->content;
- }
-
- if ($identity instanceof \Model_Admin) {
- $data['status'] = $model->status;
- $data['kb_article_category_id'] = $model->kb_article_category_id;
- }
-
- return $data;
- }
-
- public function createArticle($articleCategoryId, $title, $status = null, $content = null)
- {
- if (!isset($status)) {
- $status = \Model_KbArticle::DRAFT;
- }
-
- $model = $this->di['db']->dispense('KbArticle');
- $model->kb_article_category_id = $articleCategoryId;
- $model->title = $title;
- $model->slug = $this->di['tools']->slug($title);
- $model->status = $status;
- $model->content = $content;
- $model->updated_at = date('Y-m-d H:i:s');
- $model->created_at = date('Y-m-d H:i:s');
- $id = $this->di['db']->store($model);
-
- $this->di['logger']->info('Created new knowledge base article #%s', $id);
-
- return $id;
- }
-
- public function updateArticle($id, $articleCategoryId = null, $title = null, $slug = null, $status = null, $content = null, $views = null)
- {
- $model = $this->di['db']->findOne('KbArticle', 'id = ?', [$id]);
-
- if (!$model instanceof \Model_KbArticle) {
- throw new \FOSSBilling\Exception('Article not found');
- }
-
- if (isset($articleCategoryId)) {
- $model->kb_article_category_id = $articleCategoryId;
- }
-
- if (isset($title)) {
- $model->title = $title;
- }
-
- if (isset($slug)) {
- $model->slug = $slug;
- }
-
- if (isset($status)) {
- $model->status = $status;
- }
-
- if (isset($content)) {
- $model->content = $content;
- }
-
- if (isset($views)) {
- $model->views = $views;
- }
- $model->updated_at = date('Y-m-d H:i:s');
-
- $this->di['db']->store($model);
-
- $this->di['logger']->info('Updated knowledge base article #%s', $id);
-
- return true;
- }
-
- public function categoryGetSearchQuery($data)
- {
- $sql = '
- SELECT kac.*
- FROM kb_article_category kac
- LEFT JOIN kb_article ka ON kac.id = ka.kb_article_category_id';
-
- $article_status = $data['article_status'] ?? null;
- $query = $data['q'] ?? null;
-
- $where = [];
- $bindings = [];
- if ($article_status) {
- $where[] = 'ka.status = :status';
-
- $bindings[':status'] = $article_status;
- }
-
- if ($query) {
- $where[] = '(ka.title LIKE :title OR ka.content LIKE :content)';
-
- $bindings[':title'] = "%$query%";
- $bindings[':content'] = "%$query%";
- }
-
- if (!empty($where)) {
- $sql = $sql . ' WHERE ' . implode(' AND ', $where);
- }
-
- $sql .= ' GROUP BY kac.id ORDER BY kac.id DESC';
-
- return [$sql, $bindings];
- }
-
- public function categoryFindAll()
- {
- $sql = 'SELECT kac.*, a.*
- FROM kb_article_category kac
- LEFT JOIN kb_article ka
- ON kac.id = ka.kb_article_category_id
- ';
-
- return $this->di['db']->getAll($sql);
- }
-
- public function categoryGetPairs()
- {
- $sql = 'SELECT id, title FROM kb_article_category';
- $pairs = $this->di['db']->getAssoc($sql);
-
- return $pairs;
- }
-
- public function categoryRm(\Model_KbArticleCategory $model)
- {
- $bindings = [
- ':kb_article_category_id' => $model->id,
- ];
-
- $articlesCount = $this->di['db']->getCell('SELECT count(*) as cnt FROM kb_article WHERE kb_article_category_id = :kb_article_category_id', $bindings);
-
- if ($articlesCount > 0) {
- throw new \FOSSBilling\InformationException('Can not remove category which has articles');
- }
-
- $id = $model->id;
-
- $this->di['db']->trash($model);
-
- $this->di['logger']->info('Deleted knowledge base category #%s', $id);
-
- return true;
- }
-
- public function categoryToApiArray(\Model_KbArticleCategory $model, $identity = null, $query = null)
- {
- $data = $this->di['db']->toArray($model);
-
- $sql = 'kb_article_category_id = :category_id';
- $bindings = [
- ':category_id' => $model->id,
- ];
-
- if (!$identity instanceof \Model_Admin) {
- $sql .= " AND status = 'active'";
- }
-
- if ($query) {
- $sql .= 'AND (title LIKE :title OR content LIKE :content)';
- $query = "%$query%";
- $bindings[':content'] = $query;
- $bindings[':title'] = $query;
- }
-
- $articles = $this->di['db']->find('KbArticle', $sql, $bindings);
-
- foreach ($articles as $article) {
- $data['articles'][] = $this->toApiArray($article, false, $identity);
- }
-
- return $data;
- }
-
- public function createCategory($title, $description = null)
- {
- $systemService = $this->di['mod_service']('system');
- $systemService->checkLimits('Model_KbArticleCategory', 2);
-
- $model = $this->di['db']->dispense('KbArticleCategory');
- $model->title = $title;
- $model->description = $description;
- $model->slug = $this->di['tools']->slug($title);
- $model->updated_at = date('Y-m-d H:i:s');
- $model->created_at = date('Y-m-d H:i:s');
-
- $id = $this->di['db']->store($model);
-
- $this->di['logger']->info('Created new knowledge base category #%s', $id);
-
- return $id;
- }
-
- public function updateCategory(\Model_KbArticleCategory $model, $title = null, $slug = null, $description = null)
- {
- if (isset($title)) {
- $model->title = $title;
- }
-
- if (isset($slug)) {
- $model->slug = $slug;
- }
-
- if (isset($description)) {
- $model->description = $description;
- }
-
- $model->updated_at = date('Y-m-d H:i:s');
-
- $this->di['db']->store($model);
-
- $this->di['logger']->info('Updated knowledge base category #%s', $model->id);
-
- return true;
- }
-
- public function findCategoryById($id)
- {
- return $this->di['db']->getExistingModelById('KbArticleCategory', $id, 'Knowledge base category not found');
- }
-
- public function findCategoryBySlug($slug)
- {
- $bindings = [
- ':slug' => $slug,
- ];
-
- return $this->di['db']->findOne('KbArticleCategory', 'slug = :slug', $bindings);
- }
-}
diff --git a/src/modules/Kb/icon.svg b/src/modules/Kb/icon.svg
deleted file mode 100644
index c3ffbd28d..000000000
--- a/src/modules/Kb/icon.svg
+++ /dev/null
@@ -1 +0,0 @@
-
\ No newline at end of file
diff --git a/src/modules/Kb/manifest.json b/src/modules/Kb/manifest.json
deleted file mode 100644
index 7b83e8ad3..000000000
--- a/src/modules/Kb/manifest.json
+++ /dev/null
@@ -1,12 +0,0 @@
-{
- "id": "kb",
- "type": "mod",
- "name": "Knowledge Base",
- "description": "Knowledge base module for FOSSBilling",
- "homepage_url": "https://github.com/FOSSBilling",
- "icon_url": "icon.svg",
- "author": "FOSSBilling",
- "author_url": "http://extensions.fossbilling.org/",
- "license": "https://github.com/FOSSBilling/FOSSBilling/blob/main/LICENSE",
- "version": "1.0.0"
-}
diff --git a/src/modules/Page/html_client/mod_page_sitemap.xml b/src/modules/Page/html_client/mod_page_sitemap.xml
index 66f1f215f..3914e1e7f 100644
--- a/src/modules/Page/html_client/mod_page_sitemap.xml
+++ b/src/modules/Page/html_client/mod_page_sitemap.xml
@@ -23,14 +23,14 @@
{% endif %}
{# knowledge base items #}
-{% if guest.extension_is_on({"mod":'kb'}) %}
-{% for i, article in guest.kb_article_get_list({"per_page":50}).list %}
+{% if if guest.support_kb_enabled() %}
+{% for i, article in guest.support_kb_article_get_list({"per_page":50}).list %}