Merge Kb and Support modules (#1180)

* Merge Kb and Support modules

Merge the Kb and Support modules as they contain related functionality.

* General improvements to Support module UI

Update Support module copy and navigation to be more consistent, and other general improvements.

* This was missed.. and now it's not 😉

---------

Co-authored-by: Belle Aerni <belleaerni@gmail.com>
This commit is contained in:
Adam DaleyandBelle Aerni authored and GitHub committed 2023-11-06 04:10:09 +00:00
1 parent 0aa91b0c03
commit b35b2efc52
54 files changed
+2889 -2956

No files matched your search

+32
View File
@@ -30,6 +30,12 @@ class Client implements \FOSSBilling\InjectionAwareInterface
$app->get('/support/ticket/:id', 'get_ticket', [], static::class);
$app->get('/support/contact-us', 'get_contact_us', [], static::class);
$app->get('/support/contact-us/conversation/:hash', 'get_contact_us_conversation', ['hash' => '[a-z0-9]+'], static::class);
if ($this->di['mod']('support')->getService()->kbEnabled()) {
$app->get('/support/kb', 'get_kb_index', [], static::class);
$app->get('/support/kb/:category', 'get_kb_category', ['category' => '[a-z0-9-]+'], static::class);
$app->get('/support/kb/:category/:slug', 'get_kb_article', ['category' => '[a-z0-9-]+', 'slug' => '[a-z0-9-]+'], static::class);
}
}
public function get_tickets(\Box_App $app)
@@ -62,4 +68,30 @@ class Client implements \FOSSBilling\InjectionAwareInterface
return $app->render('mod_support_contact_us_conversation', ['ticket' => $array]);
}
/*
* Support Knowledge Base.
*/
public function get_kb_index(\Box_App $app)
{
return $app->render('mod_support_kb_index');
}
public function get_kb_category(\Box_App $app, $category)
{
$api = $this->di['api_guest'];
$data = ['slug' => $category];
$model = $api->support_kb_category_get($data);
return $app->render('mod_support_kb_category', ['category' => $model]);
}
public function get_kb_article(\Box_App $app, $category, $slug)
{
$api = $this->di['api_guest'];
$data = ['slug' => $slug];
$article = $api->support_kb_article_get($data);
return $app->render('mod_support_kb_article', ['article' => $article]);
}
}