Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
cefbe3e
fix issue #564
oyeaussie Aug 20, 2024
e50194f
Update issue #34
oyeaussie Aug 21, 2024
b24b7e2
update issue #352
oyeaussie Aug 23, 2024
1267fe6
update #34
oyeaussie Aug 23, 2024
038ecde
update issue #484
oyeaussie Aug 24, 2024
3b491e0
update issue #352
oyeaussie Aug 24, 2024
5803e87
update #34
oyeaussie Aug 24, 2024
1e3d246
Update #568 & #569
oyeaussie Aug 30, 2024
f5bf6f0
Update #568 & #569
oyeaussie Aug 30, 2024
6542d8a
Update #568 & #569
oyeaussie Aug 31, 2024
40e5f43
Initial commit #570
oyeaussie Sep 1, 2024
3746c78
update #569
oyeaussie Sep 1, 2024
f68b3d4
fix bug with timer not being stopped after we move away from dashboar…
oyeaussie Sep 1, 2024
0ea5ba0
update #570
oyeaussie Sep 2, 2024
2d6be2c
fix issue #571
oyeaussie Sep 2, 2024
7fe3be9
update #570
oyeaussie Sep 2, 2024
d35f259
update #573 - geodata to v2.5
oyeaussie Oct 14, 2024
445d84f
!576 & !577 - Fixed.
oyeaussie Jan 14, 2025
22e19ea
cleanup #576
oyeaussie Jan 16, 2025
7299eec
update #34
oyeaussie Jan 16, 2025
cc516fb
Fix issue #580
oyeaussie Jan 16, 2025
9dc41f2
update #578
oyeaussie Jan 23, 2025
61a022a
Add queue settings #34
oyeaussie Jan 23, 2025
4f441de
Fix issue #581
oyeaussie Jan 23, 2025
3c074d1
Fix issue #582
oyeaussie Jan 23, 2025
f2b2871
update #34
oyeaussie Jan 23, 2025
221fd43
update #34
oyeaussie Jan 24, 2025
75210b4
update #34 test DB update.
oyeaussie Jan 26, 2025
a29fe9e
update #34 test DB update
oyeaussie Jan 28, 2025
c7b40bc
Initial commit for #584.
oyeaussie Jan 29, 2025
867cd58
update #584
oyeaussie Jan 30, 2025
bc94527
update #332 - Cleanup db schema and remove collation as collation is …
oyeaussie Jan 31, 2025
eb46319
update #34
oyeaussie Jan 31, 2025
7a004f8
Issue #582 Minor fixes.
oyeaussie Jan 31, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
[submodule "phpunit"]
path = phpunit
url = https://github.com/sp-framework/phpunit.git
[submodule "apps/Core/Packages/Devtools/GeoExtractData/Data"]
path = apps/Core/Packages/Devtools/GeoExtractData/Data
url = https://github.com/sp-framework/geodata.git
[submodule "docker"]
path = docker
url = https://github.com/sp-framework/docker-sp-core.git
[submodule "apps/Core/Packages/Devtools/GeoExtractData/Data"]
path = apps/Core/Packages/Devtools/GeoExtractData/Data
url = https://github.com/sp-framework/geodata.git
213 changes: 182 additions & 31 deletions apps/Core/Components/Dashboards/DashboardsComponent.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,61 +12,166 @@ class DashboardsComponent extends BaseComponent
public function viewAction()
{
if (isset($this->getData()['widgets'])) {
$this->getNewToken();

if ($this->getData()['widgets'] == 'info') {
$this->getNewToken();
return $this->basepackages->widgets->getWidget($this->getData()['id'], 'info')['info'];
} else if ($this->getData()['widgets'] == 'content') {
} else if ($this->getData()['widgets'] == 'content') {//This is when we add the widget via list of widgets in dashboard.
$dashboardWidget = $this->basepackages->dashboards->getDashboardWidgetById($this->getData()['id'], $this->getData()['did']);

$dashboardWidget['getWidgetData'] = true;

$this->getNewToken();
return $this->basepackages->widgets->getWidget($this->getData()['wid'], 'content', $dashboardWidget)['content'];
}
} else {
if (is_string($this->app['settings'])) {
$this->app['settings'] = $this->helper->decode($this->app['settings'], true);
}

if (isset($this->getData()['id'])) {
$dashboardId = $this->getData()['id'];
} else {
$app = $this->apps->getAppInfo();
$this->view->sharedAccounts = [];

if ($this->getData()['id'] != 0) {
$dashboardId = $this->getData()['id'];

$dashboard = $this->basepackages->dashboards->getDashboardById($dashboardId, true, false);
$dashboard['is_app_default'] = false;

if (isset($this->app['settings']['defaultDashboard'])) {
if ($this->app['settings']['defaultDashboard'] == $dashboard['id']) {
$dashboard['is_app_default'] = true;
}

$this->view->isAppDefault = true;
}

if (isset($dashboard['shared']) && is_string($dashboard['shared'])) {
$dashboard['shared'] = $this->helper->decode($dashboard['shared'], true);
}

if ($dashboard['shared'] && count($dashboard['shared']) > 0) {
$sharedAccounts = [];

if (is_string($app['settings'])) {
$app['settings'] = $this->helper->decode($app['settings'], true);
foreach ($dashboard['shared'] as $accountId) {
$account = $this->basepackages->accounts->getAccountById($accountId);

if ($account) {
$sharedAccounts[] =
['id' => $account['id'], 'email' => $account['email']];
}
}

$this->view->sharedAccounts = $sharedAccounts;
} else {
$dashboard['shared'] = [];
}

$this->view->dashboard = $dashboard;
}

if (isset($app['settings']['defaultDashboard'])) {
$dashboardId = $app['settings']['defaultDashboard'];
$this->view->pick('dashboards/dashboards/dashboard');

return;
} else {
if (isset($this->app['settings']['defaultDashboard'])) {
$dashboardId = $this->app['settings']['defaultDashboard'];
}
}
}

$dashboard = $this->basepackages->dashboards->getDashboardById($dashboardId, true, false);
$dashboards = $this->basepackages->dashboards->dashboards;
$dashboards = msort($dashboards, 'is_default');

if ($this->access->auth->account()) {
foreach ($dashboards as $dashboardKey => &$dashboard) {
//Check app default dashboard
if ($dashboard['id'] == $dashboardId) {
$dashboard['name'] = $dashboard['name'] . ' (App Default)';

continue;
}

//Check shared
$isShared = false;
if ($dashboard['shared']) {
if (is_string($dashboard['shared'])) {
$dashboard['shared'] = $this->helper->decode($dashboard['shared'], true);
}

$this->view->setViewsDir($this->modules->views->getPhalconViewPath() . $this->getURI());
if (in_array($this->access->auth->account()['id'], $dashboard['shared'])) {
$dashboard['name'] = $dashboard['name'] . ' (Shared By ' . $this->basepackages->accounts->getAccountById($dashboard['created_by'])['email'] . ')';
$isShared = true;
}
}

$this->view->dashboard = $dashboard;
//Check Creator
if ($dashboard['created_by'] != $this->access->auth->account()['id'] &&
!$isShared
) {
unset($dashboards[$dashboardKey]);
}

$this->view->dashboards = $this->basepackages->dashboards->dashboards;
//Default
if ($dashboard['is_default'] && !$isShared) {
$dashboardId = $dashboard['id'];

$this->view->widgetsTree = $this->basepackages->widgets->getWidgetsTree();
$dashboard['name'] = $dashboard['name'] . ' (User Default)';
}
}
}

$this->view->dashboard = $this->basepackages->dashboards->getDashboardById($dashboardId, true, false);

$this->view->dashboards = $dashboards;

$this->view->widgetsTree = $this->basepackages->widgets->getWidgetsTree();
}
}
}

/**
* @acl(name=add)
*/
public function addAction()
{
return;
$this->requestIsPost();

$this->basepackages->dashboards->addDashboard($this->postData());

$this->addResponse(
$this->basepackages->dashboards->packagesData->responseMessage,
$this->basepackages->dashboards->packagesData->responseCode
);
}

/**
* @acl(name=update)
*/
public function updateAction()
{
return;
$this->requestIsPost();

$this->basepackages->dashboards->updateDashboard($this->postData());

$this->addResponse(
$this->basepackages->dashboards->packagesData->responseMessage,
$this->basepackages->dashboards->packagesData->responseCode
);
}

/**
* @acl(name=remove)
*/
public function removeAction()
{
return;
$this->requestIsPost();

$this->basepackages->dashboards->removeDashboard($this->postData());

$this->addResponse(
$this->basepackages->dashboards->packagesData->responseMessage,
$this->basepackages->dashboards->packagesData->responseCode
);
}

/**
* @acl(name=add)
*/
public function addWidgetToDashboardAction()
{
$this->requestIsPost();
Expand All @@ -80,9 +185,6 @@ public function addWidgetToDashboardAction()
);
}

/**
* @acl(name=update)
*/
public function updateWidgetToDashboardAction()
{
$this->requestIsPost();
Expand All @@ -95,9 +197,6 @@ public function updateWidgetToDashboardAction()
);
}

/**
* @acl(name=remove)
*/
public function removeWidgetFromDashboardAction()
{
$this->requestIsPost();
Expand All @@ -110,16 +209,68 @@ public function removeWidgetFromDashboardAction()
);
}

public function getWidgetContentAction()
public function getDashboardWidgetsAction()
{
$this->requestIsPost();

$this->basepackages->dashboards->getWidgetContent($this->postData());
$this->basepackages->dashboards->getDashboardWidgets($this->postData());

$this->addResponse(
$this->basepackages->dashboards->packagesData->responseMessage,
$this->basepackages->dashboards->packagesData->responseCode,
$this->basepackages->dashboards->packagesData->responseData
);
}

public function searchAccountAction()
{
$this->requestIsPost();

if ($this->postData()['search']) {
$searchQuery = $this->postData()['search'];

if (strlen($searchQuery) < 3) {
return;
}

$searchAccounts = $this->basepackages->accounts->searchAccountInternal($searchQuery);

if ($searchAccounts) {
$currentAccount = $this->access->auth->account();

if ($currentAccount) {
foreach ($searchAccounts as $accountKey => &$account) {
if ($account['id'] == $currentAccount['id']) {
unset($accounts[$accountKey]);
continue;
}

$profile = $this->basepackages->profiles->getProfile($account['id']);

$account['name'] = $profile['full_name'];
}

$this->addResponse(
$this->basepackages->accounts->packagesData->responseMessage,
$this->basepackages->accounts->packagesData->responseCode,
['accounts' => $searchAccounts]
);
} else {
$this->addResponse(
$this->basepackages->accounts->packagesData->responseMessage,
$this->basepackages->accounts->packagesData->responseCode,
['accounts' => $searchAccounts]
);
}
} else {
$this->addResponse(
$this->basepackages->accounts->packagesData->responseMessage,
$this->basepackages->accounts->packagesData->responseCode,
['accounts' => []]
);
}
} else {
$this->addResponse('search query missing', 1);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,11 @@ public function processAction()
}

try {
$success = false;

if (isset($this->postData()['geo']) && $this->postData()['geo'] == 'true') {
$this->geoExtractDataPackage->downloadGeoData();
$this->geoExtractDataPackage->processGeoData();
$success = $this->geoExtractDataPackage->downloadGeoData();
$success = $this->geoExtractDataPackage->processGeoData();
}

if (isset($this->postData()['timezone']) && $this->postData()['timezone'] == 'true') {
Expand All @@ -49,16 +51,18 @@ public function processAction()
}

if (isset($this->postData()['ip']) && $this->postData()['ip'] == 'true') {
$this->geoExtractDataPackage->downloadGeoIpv4Data();
$this->geoExtractDataPackage->unzipGeoIpv4Data();
$this->geoExtractDataPackage->processGeoIpv4Data();
$this->geoExtractDataPackage->downloadGeoIpv6Data();
$this->geoExtractDataPackage->unzipGeoIpv6Data();
$this->geoExtractDataPackage->processGeoIpv6Data();
$this->geoExtractDataPackage->mergeGeoIpData();
$success = $this->geoExtractDataPackage->downloadGeoIpv4Data();
$success = $this->geoExtractDataPackage->unzipGeoIpv4Data();
$success = $this->geoExtractDataPackage->processGeoIpv4Data();
$success = $this->geoExtractDataPackage->downloadGeoIpv6Data();
$success = $this->geoExtractDataPackage->unzipGeoIpv6Data();
$success = $this->geoExtractDataPackage->processGeoIpv6Data();
$success = $this->geoExtractDataPackage->mergeGeoIpData();
}

$this->geoExtractDataPackage->zipData();
if ($success) {
$this->geoExtractDataPackage->zipData();
}

$this->addResponse(
$this->geoExtractDataPackage->packagesData->responseMessage,
Expand Down Expand Up @@ -150,14 +154,18 @@ protected function registerProgressMethods()
return false;
}

$methods = array_merge($methods,
[
if ((isset($this->postData()['geo']) && $this->postData()['geo'] == 'true') ||
(isset($this->postData()['geo']) && $this->postData()['geo'] == 'true')
) {
$methods = array_merge($methods,
[
'method' => 'zipData',
'text' => 'Zip Geo Location Data...',
[
'method' => 'zipData',
'text' => 'Zip Geo Location Data...',
]
]
]
);
);
}

$this->basepackages->progress->registerMethods($methods);

Expand Down
7 changes: 7 additions & 0 deletions apps/Core/Components/Errors/ErrorsComponent.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,13 @@ public function idNotFoundAction()
$this->addResponse('Id Not Found', 1);
}

public function permissionDeniedAction()
{
$this->view->pick('common/errors/permissiondenied');

$this->addResponse('Permission denied, contact administrator!', 1);
}

public function serverErrorAction()
{
$this->view->pick('common/errors/servererror');
Expand Down
13 changes: 13 additions & 0 deletions apps/Core/Components/Modules/ModulesComponent.php
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,19 @@ public function processQueueAction()
}
}

public function saveQueueSettingsAction()
{
$this->requestIsPost();

$this->modules->queues->saveQueueSettings($this->postData());

$this->addResponse(
$this->modules->queues->packagesData->responseMessage,
$this->modules->queues->packagesData->responseCode,
$this->modules->queues->packagesData->responseData ?? []
);
}

public function saveModuleSettingsAction()
{
$this->requestIsPost();
Expand Down
Loading