Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion apps/Core/Components/Devtools/Modules/ModulesComponent.php
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,7 @@ public function viewAction()
if ($module['module_details']['module_type'] === 'components') {
$moduleLocation = 'apps/' . ucfirst($module['module_details']['app_type']) . '/Components/';
if ($module['module_details']['menu']) {
$this->view->moduleMenu = $this->helper->encode($this->helper->decode($module['module_details']['menu'], true));
$this->view->moduleMenu = $this->helper->encode($module['module_details']['menu']);
$this->view->menuBaseStructure = $this->basepackages->menus->getMenusForAppType($module['module_details']['app_type']);
} else {
$this->view->moduleMenu = false;
Expand Down
11 changes: 9 additions & 2 deletions apps/Core/Components/Errors/ErrorsComponent.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,16 @@ public function controllerNotFoundAction()
$this->addResponse('Component Not Found', 1);
}

public function controllerDependencyErrorAction()
public function controllerPackageDependencyErrorAction()
{
$this->view->pick('common/errors/controllerdependencyerror');
$this->view->pick('errors/controllerdependencyerror');

$this->addResponse('Component Dependency Error', 1);
}

public function controllerViewDependencyErrorAction()
{
$this->view->pick('errors/controllerdependencyerror');

$this->addResponse('Component Dependency Error', 1);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,9 @@ public function viewAction()
}

if (isset($api['used_by']) && $api['used_by'] !== '') {
$api['used_by'] = $this->helper->decode($api['used_by'], true);
if (is_string($api['used_by'])) {
$api['used_by'] = $this->helper->decode($api['used_by'], true);
}
$api['used_by'] = implode(', ', $api['used_by']);
} else if (isset($api['used_by']) && $api['used_by'] === '') {
$api['used_by'] = '-';
Expand Down Expand Up @@ -138,7 +140,9 @@ protected function replaceColumns($dataArr)
$data['category'] = ucfirst($data['category']);

if (isset($data['used_by']) && $data['used_by'] !== '') {
$data['used_by'] = $this->helper->decode($data['used_by'], true);
if (is_string($data['used_by'])) {
$data['used_by'] = $this->helper->decode($data['used_by'], true);
}
$data['used_by'] = implode(', ', $data['used_by']);
} else if (isset($data['used_by']) && $data['used_by'] === '') {
$data['used_by'] = '-';
Expand Down
4 changes: 3 additions & 1 deletion apps/Core/Components/System/Email/Queue/QueueComponent.php
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,9 @@ protected function formatSentOn($rowId, $data)

protected function formatToAddresses($rowId, $data)
{
$data['to_addresses'] = $this->helper->decode($data['to_addresses'], true);
if (is_string($data['to_addresses'])) {
$data['to_addresses'] = $this->helper->decode($data['to_addresses'], true);
}

$data['to_addresses'] = implode(',', $data['to_addresses']);

Expand Down
29 changes: 15 additions & 14 deletions apps/Core/Components/System/Filters/FiltersComponent.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
namespace Apps\Core\Components\System\Filters;

use Apps\Core\Packages\Adminltetags\Traits\DynamicTable;
use Apps\Core\Packages\Hrms\Employees\Employees;
use System\Base\BaseComponent;

class FiltersComponent extends BaseComponent
Expand All @@ -22,6 +21,20 @@ public function initialize()
*/
public function viewAction()
{
if ($this->request->isGet()) {
if ($this->app['id'] == 1) {
$components = $this->modules->components->components;
} else {
$components = $this->modules->components->getComponentsForAppType($this->app['app_type']);
}

foreach ($components as $key => $component) {
$components[$key]['name'] = $component['name'] . ' (' . $component['category'] . ')';
}

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

if (isset($this->getData()['id'])) {
if ($this->getData()['id'] != 0) {
$filter = $this->filters->getById($this->getData()['id']);
Expand All @@ -36,18 +49,6 @@ public function viewAction()
$this->view->pick('filters/view');

return;
} else {
if ($this->app['id'] == 1) {
$components = $this->modules->components->components;
} else {
$components = $this->modules->components->getComponentsForAppType($this->app['app_type']);
}

foreach ($components as $key => $component) {
$components[$key]['name'] = $component['name'] . ' (' . $component['category'] . ')';
}

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

if ($this->request->isPost()) {
Expand Down Expand Up @@ -206,4 +207,4 @@ public function getdefaultfilterAction()
$this->filters->packagesData->responseCode
);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ protected function packageLinks()

foreach ($this->modules->packages->packages as $packageKey => $package) {
if ($package['settings'] && $package['settings'] !== '' && $package['settings'] !== '[]') {
if (!is_array($package['settings'])) {
if (is_string($package['settings'])) {
$package['settings'] = $this->helper->decode($package['settings'], true);
}
if (isset($package['settings']['componentRoute'])) {
Expand Down
12 changes: 9 additions & 3 deletions apps/Core/Components/System/Storages/StoragesComponent.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,15 @@ public function viewAction()
return $this->throwIdNotFound();
}

$storage['allowed_image_mime_types'] = $this->helper->decode($storage['allowed_image_mime_types']);
$storage['allowed_image_sizes'] = $this->helper->decode($storage['allowed_image_sizes']);
$storage['allowed_file_mime_types'] = $this->helper->decode($storage['allowed_file_mime_types']);
if (is_string($storage['allowed_image_mime_types'])) {
$storage['allowed_image_mime_types'] = $this->helper->decode($storage['allowed_image_mime_types']);
}
if (is_string($storage['allowed_image_sizes'])) {
$storage['allowed_image_sizes'] = $this->helper->decode($storage['allowed_image_sizes']);
}
if (is_string($storage['allowed_file_mime_types'])) {
$storage['allowed_file_mime_types'] = $this->helper->decode($storage['allowed_file_mime_types']);
}

$this->view->storage = $storage;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,19 +50,32 @@ public function viewAction()
$this->view->filters = $componentData['filters'];
}

$importexport['fields'] = $this->helper->decode($importexport['fields'], true);
if (is_string($importexport['fields'])) {
$importexport['fields'] = $this->helper->decode($importexport['fields'], true);
}

if (is_string($importexport['email_to'])) {
$importexport['email_to'] = $this->helper->decode($importexport['email_to'], true);
}

$importexport['email_to'] = implode(',', $this->helper->decode($importexport['email_to'], true));
$importexport['email_to'] = implode(',', $importexport['email_to']);

if ($importexport['file'] && $importexport['file'] !== '') {
$importexport['file'] = $this->links->url('system/storages/q/uuid/' . $importexport['file']);
}
} else if ($importexport['type'] === 'import' && isset($importexport['component_id'])) {
$importexport['email_to'] = implode(',', $this->helper->decode($importexport['email_to'], true));
if (is_string($importexport['email_to'])) {
$importexport['email_to'] = $this->helper->decode($importexport['email_to'], true);
}

$importexport['email_to'] = implode(',', $importexport['email_to']);

if ($importexport['file'] && $importexport['file'] !== '') {
try {
$importexport['file'] = $this->helper->decode($importexport['file'], true);
if (is_string($importexport['file'])) {
$importexport['file'] = $this->helper->decode($importexport['file'], true);
}

$importexport['file'] = $importexport['file'][0];

$this->view->file = $this->basepackages->storages->getFileInfo($importexport['file']);
Expand Down Expand Up @@ -167,8 +180,10 @@ protected function replaceColumns($dataArr)
$data['account_id'] = 'System (' . $data['account_id'] . ')';
}

if ($data['email_to'] && $data['email_to'] !== '') {
$data['email_to'] = $this->helper->decode($data['email_to'], true);
if ($data['email_to']) {
if (is_string($data['email_to']) && $data['email_to'] !== '') {
$data['email_to'] = $this->helper->decode($data['email_to'], true);
}

$data['email_to'] = implode(',', $data['email_to']);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ protected function getProfilesData($data, $rowId = null)
}

if ($profilePackage) {
if (!is_array($profilePackage['settings'])) {
if (is_string($profilePackage['settings'])) {
$profilePackage['settings'] = $this->helper->decode($profilePackage['settings'], true);
}
if (isset($profilePackage['settings']['componentRoute'])) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,9 @@ public function viewAction()
return $this->throwIdNotFound();
}

$schedule['schedule'] = $this->helper->decode($schedule['schedule'], true);
if (is_string($schedule['schedule'])) {
$schedule['schedule'] = $this->helper->decode($schedule['schedule'], true);
}

if ($schedule['schedule']['type'] === 'everyxseconds') {
$schedule['schedule']['params']['seconds'] = implode(',', $schedule['schedule']['params']['seconds']);
Expand Down
2 changes: 1 addition & 1 deletion apps/Core/Middlewares/Acl/Acl.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ public function process($data)
}

if ($this->account) {
if (!is_array($this->account['security']['permissions'])) {
if (is_string($this->account['security']['permissions'])) {
$this->account['security']['permissions'] = $this->helper->decode($this->account['security']['permissions'], true);
}

Expand Down
Loading