diff --git a/.gitmodules b/.gitmodules index d08773eac..a262d99ef 100644 --- a/.gitmodules +++ b/.gitmodules @@ -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 diff --git a/apps/Core/Components/Dashboards/DashboardsComponent.php b/apps/Core/Components/Dashboards/DashboardsComponent.php index b465948f1..db53ef1a3 100644 --- a/apps/Core/Components/Dashboards/DashboardsComponent.php +++ b/apps/Core/Components/Dashboards/DashboardsComponent.php @@ -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(); @@ -80,9 +185,6 @@ public function addWidgetToDashboardAction() ); } - /** - * @acl(name=update) - */ public function updateWidgetToDashboardAction() { $this->requestIsPost(); @@ -95,9 +197,6 @@ public function updateWidgetToDashboardAction() ); } - /** - * @acl(name=remove) - */ public function removeWidgetFromDashboardAction() { $this->requestIsPost(); @@ -110,11 +209,11 @@ 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, @@ -122,4 +221,56 @@ public function getWidgetContentAction() $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); + } + } } \ No newline at end of file diff --git a/apps/Core/Components/Devtools/Extractgeodata/ExtractgeodataComponent.php b/apps/Core/Components/Devtools/Extractgeodata/ExtractgeodataComponent.php index ac13d2ce5..6d8fae27b 100644 --- a/apps/Core/Components/Devtools/Extractgeodata/ExtractgeodataComponent.php +++ b/apps/Core/Components/Devtools/Extractgeodata/ExtractgeodataComponent.php @@ -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') { @@ -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, @@ -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); diff --git a/apps/Core/Components/Errors/ErrorsComponent.php b/apps/Core/Components/Errors/ErrorsComponent.php index c8ea55a64..d040582f4 100644 --- a/apps/Core/Components/Errors/ErrorsComponent.php +++ b/apps/Core/Components/Errors/ErrorsComponent.php @@ -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'); diff --git a/apps/Core/Components/Modules/ModulesComponent.php b/apps/Core/Components/Modules/ModulesComponent.php index cb3d844c5..e8e6cc2f0 100644 --- a/apps/Core/Components/Modules/ModulesComponent.php +++ b/apps/Core/Components/Modules/ModulesComponent.php @@ -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(); diff --git a/apps/Core/Components/System/Geo/Timezones/Install/component.json b/apps/Core/Components/System/Geo/Timezones/Install/component.json index 821dcc28e..d91fc8612 100644 --- a/apps/Core/Components/System/Geo/Timezones/Install/component.json +++ b/apps/Core/Components/System/Geo/Timezones/Install/component.json @@ -50,371 +50,8 @@ "name" : "World Clock", "method" : "worldClock", "multiple" : true, - "max_multiple" : 5, - "settings" : { - "clocks" : { - "gmt" : { - "id" : "gmt", - "name" : "GMT", - "offset": 0, - "region": "Greenwich" - }, - "vancouver" : { - "id" : "vancouver", - "name" : "Vancouver", - "offset": -8, - "region": "NAmerica" - }, - "sanfrancisco" : { - "id" : "sanfrancisco", - "name" : "San Francisco", - "offset": -8, - "region": "NAmerica" - }, - "seattle" : { - "id" : "seattle", - "name" : "Seattle", - "offset": -8, - "region": "NAmerica" - }, - "losangeles" : { - "id" : "losangeles", - "name" : "Los Angeles", - "offset": -8, - "region": "NAmerica" - }, - "denver" : { - "id" : "denver", - "name" : "Denver", - "offset": -7, - "region": "NAmerica" - }, - "mexicocity" : { - "id" : "mexicocity", - "name" : "Mexico City", - "offset": -6, - "region": "NAmerica" - }, - "houston" : { - "id" : "houston", - "name" : "Houston", - "offset": -6, - "region": "NAmerica" - }, - "minneapolis" : { - "id" : "minneapolis", - "name" : "Minneapolis", - "offset": -6, - "region": "NAmerica" - }, - "neworleans" : { - "id" : "neworleans", - "name" : "New Orleans", - "offset": -6, - "region": "NAmerica" - }, - "chicago" : { - "id" : "chicago", - "name" : "Chicago", - "offset": -6, - "region": "NAmerica" - }, - "montgomery" : { - "id" : "montgomery", - "name" : "Montgomery", - "offset": -6, - "region": "NAmerica" - }, - "indianapolis" : { - "id" : "indianapolis", - "name" : "Indianapolis", - "offset": -5, - "region": "NAmerica" - }, - "atlanta" : { - "id" : "atlanta", - "name" : "Atlanta", - "offset": -5, - "region": "NAmerica" - }, - "detroit" : { - "id" : "detroit", - "name" : "Detroit", - "offset": -5, - "region": "NAmerica" - }, - "miami" : { - "id" : "miami", - "name" : "Miami", - "offset": -5, - "region": "NAmerica" - }, - "washingtondc" : { - "id" : "washingtondc", - "name" : "Washington DC", - "offset": -5, - "region": "NAmerica" - }, - "philadelphia" : { - "id" : "philadelphia", - "name" : "Philadelphia", - "offset": -5, - "region": "NAmerica" - }, - "newyork" : { - "id" : "newyork", - "name" : "NewYork", - "offset": -5, - "region": "NAmerica" - }, - "montreal" : { - "id" : "montreal", - "name" : "Montreal", - "offset": -5, - "region": "NAmerica" - }, - "boston" : { - "id" : "boston", - "name" : "Boston", - "offset": -5, - "region": "NAmerica" - }, - "buenosaires" : { - "id" : "buenosaires", - "name" : "Buenos Aires", - "offset": -3, - "region": "BuenosAires" - }, - "saopaulo" : { - "id" : "saopaulo", - "name" : "Sao Paulo", - "offset": -3, - "region": "SAmerica" - }, - "riodejaneiro" : { - "id" : "riodejaneiro", - "name" : "Rio DeJaneiro", - "offset": -3, - "region": "SAmerica" - }, - "lisbon" : { - "id" : "lisbon", - "name" : "Lisbon", - "offset": 0, - "region": "Europe" - }, - "dublin" : { - "id" : "dublin", - "name" : "Dublin", - "offset": 0, - "region": "Europe" - }, - "london" : { - "id" : "london", - "name" : "London", - "offset": 0, - "region": "Europe" - }, - "madrid" : { - "id" : "madrid", - "name" : "Madrid", - "offset": 1, - "region": "Europe" - }, - "barcelona" : { - "id" : "barcelona", - "name" : "Barcelona", - "offset": 1, - "region": "Europe" - }, - "paris" : { - "id" : "paris", - "name" : "Paris", - "offset": 1, - "region": "Europe" - }, - "brussels" : { - "id" : "brussels", - "name" : "Brussels", - "offset": 1, - "region": "Europe" - }, - "amsterdam" : { - "id" : "amsterdam", - "name" : "Amsterdam", - "offset": 1, - "region": "Europe" - }, - "frankfurt" : { - "id" : "frankfurt", - "name" : "Frankfurt", - "offset": 1, - "region": "Europe" - }, - "rome" : { - "id" : "rome", - "name" : "Rome", - "offset": 1, - "region": "Europe" - }, - "berlin" : { - "id" : "berlin", - "name" : "Berlin", - "offset": 1, - "region": "Europe" - }, - "prague" : { - "id" : "prague", - "name" : "Prague", - "offset": 1, - "region": "Europe" - }, - "vienna" : { - "id" : "vienna", - "name" : "Vienna", - "offset": 1, - "region": "Europe" - }, - "stockholm" : { - "id" : "stockholm", - "name" : "Stockholm", - "offset": 1, - "region": "Europe" - }, - "athens" : { - "id" : "athens", - "name" : "Athens", - "offset": 2, - "region": "Europe" - }, - "helsinki" : { - "id" : "helsinki", - "name" : "Helsinki", - "offset": 2, - "region": "Europe" - }, - "minsk" : { - "id" : "minsk", - "name" : "Minsk", - "offset": 2, - "region": "Europe" - }, - "istanbul" : { - "id" : "istanbul", - "name" : "Istanbul", - "offset": 2, - "region": "Europe" - }, - "cairo" : { - "id" : "cairo", - "name" : "Cairo", - "offset": 2, - "region": "Cairo" - }, - "jerusalem" : { - "id" : "jerusalem", - "name" : "Jerusalem", - "offset": 2, - "region": "Israel" - }, - "beirut" : { - "id" : "beirut", - "name" : "Beirut", - "offset": 2, - "region": "Beirut" - }, - "moscow" : { - "id" : "moscow", - "name" : "Moscow", - "offset": 3, - "region": "Europe" - }, - "baghdad" : { - "id" : "baghdad", - "name" : "Baghdad", - "offset": 3, - "region": "Baghdad" - }, - "dubai" : { - "id" : "dubai", - "name" : "Dubai", - "offset": 4, - "region": "Dubai" - }, - "bangkok" : { - "id" : "bangkok", - "name" : "Bangkok", - "offset": 7, - "region": "Bangkok" - }, - "jakarta" : { - "id" : "jakarta", - "name" : "Jakarta", - "offset": 7, - "region": "Jakarta" - }, - "hongkong" : { - "id" : "hongkong", - "name" : "HongKong", - "offset": 8, - "region": "HongKong" - }, - "beijing" : { - "id" : "beijing", - "name" : "Beijing", - "offset": 8, - "region": "Beijing" - }, - "shanghai" : { - "id" : "shanghai", - "name" : "Shanghai", - "offset": 8, - "region": "Shanghai" - }, - "seoul" : { - "id" : "seoul", - "name" : "Seoul", - "offset": 9, - "region": "Seoul" - }, - "tokyo" : { - "id" : "tokyo", - "name" : "Tokyo", - "offset": 9, - "region": "Tokyo" - }, - "melbourne" : { - "id" : "melbourne", - "name" : "Melbourne", - "offset": 10, - "region": "Australia" - }, - "sydney" : { - "id" : "sydney", - "name" : "Sydney", - "offset": 10, - "region": "Australia" - }, - "brisbane" : { - "id" : "brisbane", - "name" : "Brisbane", - "offset": 10, - "region": "Brisbane" - }, - "vladivostok" : { - "id" : "vladivostok", - "name" : "Vladivostok", - "offset": 10, - "region": "Europe" - }, - "kamchatka" : { - "id" : "kamchatka", - "name" : "Kamchatka", - "offset": 12, - "region": "Europe" - } - } - } + "max_multiple" : 2, + "settings" : {} } ] } \ No newline at end of file diff --git a/apps/Core/Components/System/Geo/Timezones/TimezonesComponent.php b/apps/Core/Components/System/Geo/Timezones/TimezonesComponent.php index 01f1c8da2..ea5eb52b2 100644 --- a/apps/Core/Components/System/Geo/Timezones/TimezonesComponent.php +++ b/apps/Core/Components/System/Geo/Timezones/TimezonesComponent.php @@ -75,9 +75,9 @@ public function viewAction() $this->geoTimezones, 'system/geo/timezones/view', null, - ['zone_name', 'tz_name', 'gmt_offset', 'gmt_offset_name', 'gmt_offset_dst', 'gmt_offset_name_dst', 'abbreviation'], + ['zone_name', 'tz_name', 'gmt_offset', 'gmt_offset_name', 'abbreviation', 'gmt_offset_dst', 'gmt_offset_name_dst', 'abbreviation_dst'], true, - ['zone_name', 'tz_name', 'gmt_offset', 'gmt_offset_name', 'gmt_offset_dst', 'gmt_offset_name_dst', 'abbreviation'], + ['zone_name', 'tz_name', 'gmt_offset', 'gmt_offset_name', 'abbreviation', 'gmt_offset_dst', 'gmt_offset_name_dst', 'abbreviation_dst'], $controlActions, ['gmt_offset'=>'gmt offset (secs)','gmt_offset_dst'=>'gmt offset DST (secs)','tz_name'=>'time zone name'], $replaceColumns, diff --git a/apps/Core/Components/System/Geo/Timezones/Widgets.php b/apps/Core/Components/System/Geo/Timezones/Widgets.php index 45eb98753..88c8ed925 100644 --- a/apps/Core/Components/System/Geo/Timezones/Widgets.php +++ b/apps/Core/Components/System/Geo/Timezones/Widgets.php @@ -2,12 +2,37 @@ namespace Apps\Core\Components\System\Geo\Timezones; +use Carbon\Carbon; use System\Base\Providers\ModulesServiceProvider\Modules\Components\ComponentsWidgets; class Widgets extends ComponentsWidgets { public function worldClock($widget, $dashboardWidget) { + $timezonesArr = $this->componentObj->getDi()->getShared('basepackages')->geoTimezones->getAll()->geoTimezones; + $timezones = []; + + foreach ($timezonesArr as $timezone) { + $tzId = strtolower(str_replace('/', '', $timezone['zone_name'])); + + $tzname = &$timezones[$tzId]; + $tzname['id'] = $tzId; + $tzname['name'] = $timezone['zone_name']; + $tzname['gmt_offset'] = $timezone['gmt_offset']; + $tzname['gmt_offset_dst'] = $timezone['gmt_offset_dst']; + $tzname['abbreviation'] = $timezone['abbreviation']; + + $tzname['isDST'] = false; + $tzname['abbreviation_dst'] = '-'; + + if ($timezone['gmt_offset'] != $timezone['gmt_offset_dst']) { + $tzname['isDST'] = Carbon::now($timezone['zone_name'])->isDST(); + $tzname['abbreviation_dst'] = $timezone['abbreviation_dst']; + } + } + + $widget['settings']['clocks'] = $timezones; + return $this->getWidgetContent($widget, $dashboardWidget); } } \ No newline at end of file diff --git a/apps/Core/Components/System/Tools/Backuprestore/BackuprestoreComponent.php b/apps/Core/Components/System/Tools/Backuprestore/BackuprestoreComponent.php index 1f9d823b8..aced6f136 100644 --- a/apps/Core/Components/System/Tools/Backuprestore/BackuprestoreComponent.php +++ b/apps/Core/Components/System/Tools/Backuprestore/BackuprestoreComponent.php @@ -19,7 +19,7 @@ public function viewAction() $this->getNewToken(); if (isset($this->getData()['analyse']) && $this->getData()['analyse'] == 'info') { - $backupInfoFile = $this->basepackages->backuprestore->analyseBackinfoFile($this->getData()['id']); + $backupInfoFile = $this->basepackages->backuprestore->init('analyse')->analyseBackinfoFile($this->getData()['id']); if ($backupInfoFile) { return $this->view->getPartial('backuprestore/analyse/analysis', ['backupInfoFile' => $backupInfoFile]); @@ -38,13 +38,13 @@ public function viewAction() [ 'uuidLocation' => '.backups/', 'storagesId' => $storage['id'], - 'orphan' => 0 + 'orphan' => false ] ]; } else { $params = [ - 'conditions' => [['uuid_location', '=', '.backups/'], ['storages_id', '=', $storage['id']], ['orphan', '=', 0]] + 'conditions' => [['uuid_location', '=', '.backups/'], ['storages_id', '=', $storage['id']], ['orphan', '=', false]] ]; } diff --git a/apps/Core/Packages/Adminltetags/Tags/Modal.php b/apps/Core/Packages/Adminltetags/Tags/Modal.php index 7f5a64653..335ab4ea5 100644 --- a/apps/Core/Packages/Adminltetags/Tags/Modal.php +++ b/apps/Core/Packages/Adminltetags/Tags/Modal.php @@ -150,6 +150,10 @@ protected function generateContent() $this->params['modalEscClose'] : 'false'; + if ($this->modalParams['modalEscClose'] === true) { + $this->modalParams['modalEscClose'] = 'true'; + } + $this->modalParams['modalType'] = isset($this->params['modalType']) ? $this->params['modalType'] : diff --git a/apps/Core/Packages/Devtools/GeoExtractData/Data b/apps/Core/Packages/Devtools/GeoExtractData/Data index 45cf436fc..ef904824b 160000 --- a/apps/Core/Packages/Devtools/GeoExtractData/Data +++ b/apps/Core/Packages/Devtools/GeoExtractData/Data @@ -1 +1 @@ -Subproject commit 45cf436fcec404fd4bd97f4701983e2ff8d8543b +Subproject commit ef904824bd7591cb6120a707920f313590f30e8f diff --git a/apps/Core/Packages/Devtools/GeoExtractData/DevtoolsGeoExtractData.php b/apps/Core/Packages/Devtools/GeoExtractData/DevtoolsGeoExtractData.php index c72509d14..ed676bc3a 100644 --- a/apps/Core/Packages/Devtools/GeoExtractData/DevtoolsGeoExtractData.php +++ b/apps/Core/Packages/Devtools/GeoExtractData/DevtoolsGeoExtractData.php @@ -2,6 +2,7 @@ namespace Apps\Core\Packages\Devtools\GeoExtractData; +use Carbon\Carbon; use League\Csv\Reader; use League\Csv\Statement; use League\Flysystem\FilesystemException; @@ -21,6 +22,8 @@ class DevtoolsGeoExtractData extends BasePackage protected $zip; + protected $gmtOffsets = []; + public function onConstruct() { if (!is_dir(base_path($this->sourceDir))) { @@ -71,7 +74,7 @@ protected function downloadGeoData() $this->method = 'downloadGeoData'; return $this->downloadData( - 'https://raw.githubusercontent.com/dr5hn/countries-states-cities-database/master/countries%2Bstates%2Bcities.json', + 'https://raw.githubusercontent.com/dr5hn/countries-states-cities-database/master/json/countries%2Bstates%2Bcities.json', base_path('apps/Core/Packages/Devtools/GeoExtractData/Data/countries+states+cities.json') ); } @@ -194,33 +197,37 @@ protected function processTimezoneData() if ($table[0] && $table[0]->children) { foreach ($table[0]->children as $tr) { - if (isset($tr->children[4]) && trim($tr->children[4]->plaintext) === 'Canonical') { - $zoneName = trim($tr->children[2]->plaintext); + if (isset($tr->children[3]) && strtolower(trim($tr->children[3]->plaintext)) === 'canonical') { + $zoneName = trim($tr->children[1]->plaintext); + $zoneKey = strtolower(str_replace('/', '', $zoneName)); - $wikiTz[$zoneKey]['zoneName'] = trim($tr->children[2]->plaintext); - $wikiTz[$zoneKey]['gmtOffsetName'] = 'UTC' . trim($tr->children[5]->plaintext); - $wikiTz[$zoneKey]['gmtOffset'] = $this->getGMTOffset(trim($tr->children[5]->plaintext)); - $wikiTz[$zoneKey]['gmtOffsetNameDST'] = 'UTC' . trim($tr->children[6]->plaintext); - $wikiTz[$zoneKey]['gmtOffsetDST'] = $this->getGMTOffset(trim($tr->children[6]->plaintext)); + $wikiTz[$zoneKey]['zoneName'] = trim($tr->children[1]->plaintext); + $wikiTz[$zoneKey]['tzName'] = trim($tr->children[2]->plaintext); + if ($wikiTz[$zoneKey]['tzName'] === '') { + $wikiTz[$zoneKey]['tzName'] = $wikiTz[$zoneKey]['zoneName']; + } + //Wikipedia article does not have a minus sign instead it has '−' + $gmtOffset = str_replace('−', '-', trim($tr->children[4]->plaintext)); + $gmtOffsetDST = str_replace('−', '-', trim($tr->children[5]->plaintext)); + $wikiTz[$zoneKey]['gmtOffsetName'] = 'UTC' . $gmtOffset; + $wikiTz[$zoneKey]['gmtOffset'] = $this->getGMTOffset($gmtOffset); + $wikiTz[$zoneKey]['abbreviation'] = trim($tr->children[6]->plaintext); + $wikiTz[$zoneKey]['gmtOffsetNameDST'] = 'UTC' . $gmtOffsetDST; + $wikiTz[$zoneKey]['gmtOffsetDST'] = $this->getGMTOffset($gmtOffsetDST); + if (count($tr->children) === 10) { + $wikiTz[$zoneKey]['abbreviationDST'] = trim($tr->children[7]->plaintext); + } else { + $wikiTz[$zoneKey]['abbreviationDST'] = '-'; + } } } } - $allCountries = $this->helper->decode($this->localContent->read($this->sourceDir . 'AllCountries.json'), true); - - foreach ($allCountries as $country) { - if (isset($country['timezones']) && count($country['timezones']) > 0) { - foreach ($country['timezones'] as $tzKey => $tz) { - $tzName = strtolower(str_replace('/', '', $tz['zoneName'])); + if (count($wikiTz) === 0) { + $this->addResponse('Not able to extract tz data.', 1); - if (isset($wikiTz[$tzName])) { - $wikiTz[$tzName] = array_replace($tz, $wikiTz[$tzName]); - } else { - $wikiTz[$tzName] = $tz; - } - } - } + return false; } try { @@ -229,6 +236,8 @@ protected function processTimezoneData() throw $e; } + $this->addResponse('Downloaded and extract Tz data'); + return true; } @@ -360,18 +369,17 @@ protected function mergeGeoIpData() protected function getGMTOffset($gmtOffset) { - $gmtOffset = str_replace('-', '', str_replace('+', '', $gmtOffset)); - - $gmtOffset = explode(':', $gmtOffset); + if (str_contains($gmtOffset, '00:00')) { + return 0; + } - if (count($gmtOffset) === 2) { - $hours = (int) $gmtOffset[0] * 3600;//seconds - $mins = (int) $gmtOffset[1] * 60; + if (isset($this->gmtOffsets[$gmtOffset])) { + return $this->gmtOffsets[$gmtOffset]; + } - $time = $hours + $mins; + $this->gmtOffsets[$gmtOffset] = Carbon::now($gmtOffset)->utcOffset(); - return $time; - } + return $this->gmtOffsets[$gmtOffset]; } protected function downloadData($url, $sink) diff --git a/apps/Core/Packages/Devtools/Modules/DevtoolsModules.php b/apps/Core/Packages/Devtools/Modules/DevtoolsModules.php index af5d9f23d..52bc27ffc 100644 --- a/apps/Core/Packages/Devtools/Modules/DevtoolsModules.php +++ b/apps/Core/Packages/Devtools/Modules/DevtoolsModules.php @@ -485,6 +485,9 @@ protected function addUpdateAppTypeFiles($appType) if (!$dirExists) {//addGitkeep $this->localContent->write($path . '/.gitkeep', ''); } + + $file = $this->localContent->read('apps/Core/Packages/Devtools/Modules/Files/ApptypesGitignore.txt'); + $this->localContent->write('apps/' . ucfirst($appType['app_type']) . '/.gitignore', $file); } catch (FilesystemException | UnableToCheckExistence | UnableToWriteFile $exception) { $this->addResponse('Unable to write json content to file: .gitkeep for apptypes'); @@ -2950,13 +2953,15 @@ public function generateModuleRepoUrl($data) $name = preg_split('/(?=[A-Z])/', $name); if ($data['module_type'] !== 'bundles') { - if (isset($baseView) && isset($baseView['name'])) { - $name = strtolower($baseView['name'] . '-' . implode('', $name)); - } else { - $name = strtolower(implode('', $name)); - } + if ($name[0] !== 'core') { + if (isset($baseView) && isset($baseView['name'])) { + $name = strtolower($baseView['name'] . '-' . implode('', $name)); + } else { + $name = strtolower(implode('', $name)); + } - $url .= '/' . $data['app_type'] . '-' . $data['module_type'] . '-' . $data['category'] . '-' . $name; + $url .= '/' . $data['app_type'] . '-' . $data['module_type'] . '-' . $data['category'] . '-' . $name; + } } else { $url .= '/' . $data['app_type'] . '-' . $data['module_type'] . '-' . strtolower(implode('', $name)); } diff --git a/apps/Core/Packages/Devtools/Modules/Files/ApptypesGitignore.txt b/apps/Core/Packages/Devtools/Modules/Files/ApptypesGitignore.txt new file mode 100644 index 000000000..a61ddb138 --- /dev/null +++ b/apps/Core/Packages/Devtools/Modules/Files/ApptypesGitignore.txt @@ -0,0 +1,4 @@ +Components/* +Middlewares/* +Packages/* +Views/* \ No newline at end of file diff --git a/apps/Core/Views/Default/html/common/errors/forbidden.html b/apps/Core/Views/Default/html/common/errors/forbidden.html deleted file mode 100644 index 22e7c243d..000000000 --- a/apps/Core/Views/Default/html/common/errors/forbidden.html +++ /dev/null @@ -1,30 +0,0 @@ -{% set sectionId = '403' %} - \ No newline at end of file diff --git a/apps/Core/Views/Default/html/common/errors/permissiondenied.html b/apps/Core/Views/Default/html/common/errors/permissiondenied.html new file mode 100644 index 000000000..923b3e8b1 --- /dev/null +++ b/apps/Core/Views/Default/html/common/errors/permissiondenied.html @@ -0,0 +1,27 @@ +{% set sectionId = '403' %} +
+
+
+
+

+ Permission Denied! (Error:403) +

+

Not allowed to access this resource.

+ + Try Again + +
+
+
+
+
+

What happened?

+

A 403 error status implies that you do not have access to this resource.

+
+
+

What can I do?

+

Nothing you can do at the moment. If you need immediate assistance, please + contact us.

+
+
+
\ No newline at end of file diff --git a/apps/Core/Views/Default/html/dashboards/dashboards.html b/apps/Core/Views/Default/html/dashboards/dashboards.html index 8e3df1395..4296b35be 100644 --- a/apps/Core/Views/Default/html/dashboards/dashboards.html +++ b/apps/Core/Views/Default/html/dashboards/dashboards.html @@ -20,7 +20,7 @@
No widgets added to this d
-
+
@@ -60,24 +60,8 @@
No widgets added to this d ] )}}
-
- {{adminltetags.useTag('modal', - [ - 'component' : component, - 'componentName' : componentName, - 'componentId' : componentId, - 'sectionId' : sectionId, - 'modalId' : 'share-modal', - 'modalBodyInclude' : 'dashboards/dashboards/share', - 'modalSize' : 'lg', - 'modalHeader' : true, - 'modalFooter' : true, - 'modalTitle' : ' SHARE DASHBOARD' - ] - )}} -
\ No newline at end of file diff --git a/apps/Core/Views/Default/html/dashboards/dashboards/dashboard.html b/apps/Core/Views/Default/html/dashboards/dashboards/dashboard.html new file mode 100644 index 000000000..69ece22a4 --- /dev/null +++ b/apps/Core/Views/Default/html/dashboards/dashboards/dashboard.html @@ -0,0 +1,34 @@ +{% if dashboard['id'] is defined %} + {% set dashboardId = dashboard['id'] %} + {% set title = 'Dashboard (' ~ dashboard['name'] ~ ')' %} +{% else %} + {% set dashboardId = '' %} + {% set title = 'New Dashboard' %} +{% endif %} +{{adminltetags.useTag('content', + [ + 'component' : component, + 'componentName' : componentName, + 'componentId' : componentId, + 'parentComponentId' : parent, + 'sectionId' : 'main', + 'contentType' : 'sectionWithForm', + 'cardHeader' : true, + 'cardFooter' : true, + 'cardType' : 'primary', + 'cardIcon' : 'dashboard', + 'cardTitle' : title, + 'cardAdditionalClass' : 'rounded-0', + 'cardBodyInclude' : 'dashboards/dashboards/form', + 'formButtons' : + [ + 'updateButtonId' : dashboardId, + 'addActionUrl' : 'dashboards/add', + 'addSuccessRedirectUrl' : 'dashboards', + 'updateActionUrl' : 'dashboards/update', + 'updateSuccessRedirectUrl' : 'dashboards', + 'cancelActionUrl' : 'dashboards', + 'closeActionUrl' : 'dashboards' + ] + ] +)}} \ No newline at end of file diff --git a/apps/Core/Views/Default/html/dashboards/dashboards/form.html b/apps/Core/Views/Default/html/dashboards/dashboards/form.html new file mode 100644 index 000000000..7a9e8e303 --- /dev/null +++ b/apps/Core/Views/Default/html/dashboards/dashboards/form.html @@ -0,0 +1,225 @@ +{% set defaultDisabled = false %} +{% set defaultChecked = false %} +{% set appDefaultChecked = false %} +{% if dashboard['id'] is defined %} + {% set dashboardId = dashboard['id'] %} + {% set dashboardName = dashboard['name'] %} + {% if dashboard['is_default'] is defined and dashboard['is_default'] == true %} + {% set defaultChecked = true %} + {% endif %} + {% if dashboard['is_app_default'] is defined and dashboard['is_app_default'] == true %} + {% set appDefaultChecked = true %} + {% set defaultDisabled = true %} + {% endif %} + {% set dashboardShared = dashboard['shared'] %} +{% else %} + {% set dashboardId = '' %} + {% set dashboardName = '' %} + {% set dashboardShared = [] %} +{% endif %} +
+
+
+ {{adminltetags.useTag('fields', + [ + 'component' : component, + 'componentName' : componentName, + 'componentId' : componentId, + 'sectionId' : sectionId, + 'fieldId' : 'id', + 'fieldLabel' : 'Dashboard ID', + 'fieldType' : 'input', + 'fieldHelp' : true, + 'fieldHelpTooltipContent' : 'Dashboard ID', + 'fieldRequired' : true, + 'fieldBazScan' : true, + 'fieldBazPostOnCreate' : false, + 'fieldBazPostOnUpdate' : true, + 'fieldHidden' : true, + 'fieldDisabled' : true, + 'fieldValue' : dashboardId + ] + )}} +
+
+
+
+ {{adminltetags.useTag('fields', + [ + 'component' : component, + 'componentName' : componentName, + 'componentId' : componentId, + 'sectionId' : sectionId, + 'fieldId' : 'name', + 'fieldLabel' : 'Dashboard Name', + 'fieldType' : 'input', + 'fieldHelp' : true, + 'fieldHelpTooltipContent' : 'Dashboard Name', + 'fieldRequired' : true, + 'fieldBazScan' : true, + 'fieldBazJstreeSearch' : true, + 'fieldBazPostOnCreate' : true, + 'fieldBazPostOnUpdate' : true, + 'fieldDataInputMinLength' : 1, + 'fieldDataInputMaxLength' : 50, + 'fieldValue' : dashboardName + ] + )}} +
+
+ {{adminltetags.useTag('fields', + [ + 'component' : component, + 'componentName' : componentName, + 'componentId' : componentId, + 'sectionId' : sectionId, + 'fieldId' : 'is_default', + 'fieldLabel' : 'Dashboard is default?', + 'fieldHelp' : true, + 'fieldHelpTooltipContent' : 'Check to make the dashboard default dashboard.', + 'fieldType' : 'checkbox', + 'fieldDisabled' : defaultDisabled, + 'fieldCheckboxType' : 'info', + 'fieldCheckboxChecked' : defaultChecked, + 'fieldCheckboxAdditionClass' : 'text-sm text-uppercase', + 'fieldBazPostOnCreate' : true, + 'fieldBazPostOnUpdate' : true, + 'fieldBazJstreeSearch' : true, + 'fieldBazScan' : true + ] + )}} +
+
+ {{adminltetags.useTag('fields', + [ + 'component' : component, + 'componentName' : componentName, + 'componentId' : componentId, + 'sectionId' : sectionId, + 'fieldId' : 'is_app_default', + 'fieldLabel' : 'Dashboard is App default?', + 'fieldHelp' : true, + 'fieldHelpTooltipContent' : 'Check to make the dashboard default dashboard.', + 'fieldType' : 'checkbox', + 'fieldDisabled' : true, + 'fieldCheckboxType' : 'success', + 'fieldCheckboxChecked' : appDefaultChecked, + 'fieldCheckboxAdditionClass' : 'text-sm text-uppercase', + 'fieldBazPostOnCreate' : false, + 'fieldBazPostOnUpdate' : false, + 'fieldBazJstreeSearch' : true, + 'fieldBazScan' : true + ] + )}} +
+
+
+
+ {{adminltetags.useTag('fields', + [ + 'component' : component, + 'componentName' : componentName, + 'componentId' : componentId, + 'sectionId' : sectionId, + 'fieldId' : 'shared', + 'fieldLabel' : 'Shared', + 'fieldType' : 'select2', + 'fieldHelp' : true, + 'fieldHelpTooltipContent' : 'Select Accounts to share dashboard with', + 'fieldBazScan' : true, + 'fieldRequired' : false, + 'fieldBazPostOnCreate' : true, + 'fieldBazPostOnUpdate' : true, + 'fieldDataSelect2Options' : sharedAccounts, + 'fieldDataSelect2Multiple' : true, + 'fieldDataSelect2OptionsKey' : 'id', + 'fieldDataSelect2OptionsValue' : 'email', + 'fieldDataSelect2OptionsArray' : true, + 'fieldDataSelect2OptionsSelected': dashboardShared + ] + )}} +
+
+
+ \ No newline at end of file diff --git a/apps/Core/Views/Default/html/dashboards/dashboards/list.html b/apps/Core/Views/Default/html/dashboards/dashboards/list.html index da0175aa6..6ead99d1d 100644 --- a/apps/Core/Views/Default/html/dashboards/dashboards/list.html +++ b/apps/Core/Views/Default/html/dashboards/dashboards/list.html @@ -12,32 +12,21 @@ 'fieldGroupPreAddonIcon' : 'dashboard', 'fieldGroupPostAddonButtons' : [ - 'sync' : [ - 'title' : false, - 'type' : 'primary', - 'tooltipTitle' : 'Share', - 'icon' : 'share', - 'noMargin' : true, - 'disabled' : true, - 'buttonAdditionalClass' : 'rounded-0', - 'position' : 'right' - ], 'edit' : [ 'title' : false, 'type' : 'warning', 'icon' : 'edit', 'noMargin' : true, - 'disabled' : true, - 'url' : links.url('dashboards/q/id/0'), - 'buttonAdditionalClass' : 'rounded-0 text-white contentAjaxLink disabled', + 'url' : links.url('dashboards/q/id/'), + 'buttonAdditionalClass' : 'rounded-0 text-white contentAjaxLink', 'position' : 'right' ], - 'delete' : [ + 'remove' : [ 'title' : false, 'type' : 'danger', 'icon' : 'trash', 'noMargin' : true, - 'disabled' : true, + 'url' : links.url('dashboards'), 'buttonAdditionalClass' : 'rounded-0', 'position' : 'right' ], @@ -58,10 +47,7 @@ 'fieldDataSelectOptionsKey' : 'id', 'fieldDataSelectOptionsValue' : 'name', 'fieldDataSelectOptionsSelected' : dashboard['id'], - 'fieldDataSelectOptionsZero' : true, + 'fieldDataSelectOptionsZero' : false, 'fieldDataSelectOptionsZeroTitle' : 'Select dashboard' ] -)}} - \ No newline at end of file +)}} \ No newline at end of file diff --git a/apps/Core/Views/Default/html/dashboards/dashboards/share.html b/apps/Core/Views/Default/html/dashboards/dashboards/share.html deleted file mode 100644 index e69de29bb..000000000 diff --git a/apps/Core/Views/Default/html/dashboards/widgets/buttons.html b/apps/Core/Views/Default/html/dashboards/widgets/buttons.html index 0dc1ef915..65841ddaa 100644 --- a/apps/Core/Views/Default/html/dashboards/widgets/buttons.html +++ b/apps/Core/Views/Default/html/dashboards/widgets/buttons.html @@ -4,10 +4,12 @@ {% set saveHidden = true %} {% set addDisabled = true %} {% set addHidden = true %} +{% set isOwner = false %} {% if access.auth.account() %} {% if dashboard['created_by'] == access.auth.account()['id'] %} {% set addDisabled = false %} {% set addHidden = false %} + {% set isOwner = true %} {% endif %} {% endif %}
diff --git a/apps/Core/Views/Default/html/devtools/modules/module.html b/apps/Core/Views/Default/html/devtools/modules/module.html index f8b142c45..b805585c4 100644 --- a/apps/Core/Views/Default/html/devtools/modules/module.html +++ b/apps/Core/Views/Default/html/devtools/modules/module.html @@ -1295,9 +1295,14 @@ onSubmitResponse: function(response) { if (response.responseData && response.responseData.newRepo && $('#repo-details').length > 0) { $('#path').html(BazHelpers.capitalizeFirstLetter($('#{{componentId}}-{{sectionId}}-app_type').val())); + var devLink = '/src/branch/dev'; + + if (response.responseData.newRepo.html_url.includes('github')) { + devLink = '/tree/dev'; + } $('#repo_url').html(response.responseData.newRepo.clone_url); $('#repo_url_dev').html(response.responseData.newRepo.html_url); - $('#repo_url_dev_a').attr('href', response.responseData.newRepo.html_url + '/src/branch/dev'); + $('#repo_url_dev_a').attr('href', response.responseData.newRepo.html_url + devLink); $('#repo-details').attr('hidden', false); $('#module-details').attr('hidden', true); @@ -3071,14 +3076,14 @@ var found = false; if (label === 'core') { dataCollectionSectionForm['vars']['moduleDependencies'][label] = { }; - dataCollectionSectionForm['vars']['moduleDependencies'][label]['name'] = moduleData['name']; - dataCollectionSectionForm['vars']['moduleDependencies'][label]['version'] = moduleData['version']; - dataCollectionSectionForm['vars']['moduleDependencies'][label]['repo'] = moduleData['repo']; + dataCollectionSectionForm['vars']['moduleDependencies'][label]['name'] = $('#{{componentId}}-{{sectionId}}-dependencies-modulename').val(); + dataCollectionSectionForm['vars']['moduleDependencies'][label]['version'] = $('#{{componentId}}-{{sectionId}}-dependencies-moduleversion').val(); + dataCollectionSectionForm['vars']['moduleDependencies'][label]['repo'] = $('#{{componentId}}-{{sectionId}}-dependencies-modulerepo').val(); } else if (label === 'apptypes') { dataCollectionSectionForm['vars']['moduleDependencies']['apptype'] = { }; - dataCollectionSectionForm['vars']['moduleDependencies']['apptype']['name'] = moduleData['name']; - dataCollectionSectionForm['vars']['moduleDependencies']['apptype']['version'] = moduleData['version']; - dataCollectionSectionForm['vars']['moduleDependencies']['apptype']['repo'] = moduleData['repo']; + dataCollectionSectionForm['vars']['moduleDependencies']['apptype']['name'] = $('#{{componentId}}-{{sectionId}}-dependencies-modulename').val(); + dataCollectionSectionForm['vars']['moduleDependencies']['apptype']['version'] = $('#{{componentId}}-{{sectionId}}-dependencies-moduleversion').val(); + dataCollectionSectionForm['vars']['moduleDependencies']['apptype']['repo'] = $('#{{componentId}}-{{sectionId}}-dependencies-modulerepo').val(); } else if (label === 'external') { if (dataCollectionSectionForm['vars']['module_type'] === 'core') { if (!dataCollectionSectionForm['vars']['moduleDependencies']['composer']) { diff --git a/apps/Core/Views/Default/html/devtools/modules/repodetails.html b/apps/Core/Views/Default/html/devtools/modules/repodetails.html index 564b1065a..eeb4799b0 100644 --- a/apps/Core/Views/Default/html/devtools/modules/repodetails.html +++ b/apps/Core/Views/Default/html/devtools/modules/repodetails.html @@ -16,7 +16,7 @@
New repository created at remote location

git remote add origin

git pull

git checkout dev

-

git add *

+

git add --all

git commit -m "Initial Commit"

git push -u origin dev

@@ -30,7 +30,7 @@
New repository created at remote location

git remote add origin

git pull

git checkout dev

-

git add *

+

git add --all

git commit -m "Initial Commit"

git push -u origin dev

diff --git a/apps/Core/Views/Default/html/errors/permissionDenied.html b/apps/Core/Views/Default/html/errors/permissionDenied.html new file mode 100644 index 000000000..fa5706d10 --- /dev/null +++ b/apps/Core/Views/Default/html/errors/permissionDenied.html @@ -0,0 +1 @@ +Placeholder file. Do not remove \ No newline at end of file diff --git a/apps/Core/Views/Default/html/modules/analyse.html b/apps/Core/Views/Default/html/modules/analyse.html index cc90af274..23ae10323 100644 --- a/apps/Core/Views/Default/html/modules/analyse.html +++ b/apps/Core/Views/Default/html/modules/analyse.html @@ -1,4 +1,4 @@ - + {% set queueTasksCounterInstall = 0 %} {% set queueTasksCounterUpdate = 0 %} {% set queueTasksCounterUninstall = 0 %} @@ -15,6 +15,30 @@ {% if queue['tasks_count']['remove'] is defined %} {% set queueTasksCounterRemove = queue['tasks_count']['remove'] %} {% endif %} +
+
+ {{adminltetags.useTag('buttons', + [ + 'component' : component, + 'componentName' : componentName, + 'componentId' : componentId, + 'parentComponentId' : parent, + 'sectionId' : sectionId, + 'buttonType' : 'button', + 'buttons' : + [ + 'queue-settings' : [ + 'title' : 'Queue Settings', + 'size' : 'xs', + 'type' : 'primary', + 'position' : 'right', + 'icon' : 'cogs' + ] + ] + ] + )}} +
+
{{adminltetags.useTag('fields', @@ -114,7 +138,7 @@ {% endif %} {% endfor %} {% endif %} -{% if moduleHtml !== '' %} +{% if moduleHtml != '' %}
@@ -174,6 +198,69 @@ dataCollectionSectionForm['vars'] = { }; dataCollectionSectionForm['vars']['queue'] = JSON.parse('{{queue}}'); dataCollectionSectionForm['funcs'] = { }; +dataCollectionSectionForm['funcs']['init'] = function() { + BazProgress.buildProgressBar($('#installer-progress'), false, false, true); + + if ($.fn.DataTable && !$.fn.DataTable.isDataTable('#{{componentId}}-{{sectionId}}-queue-table')) { + $('#{{componentId}}-{{sectionId}}-queue-table').DataTable({ + columns: [ + null, + null, + null, + null, + null, + { orderable: false } + ], + lengthMenu: [ + [25, 50, 100, -1], + [25, 50, 100, 'All'] + ] + }); + } +} + +dataCollectionSectionForm['funcs']['saveSettings'] = function() { + $('#{{componentId}}-{{sectionId}}-modal-button-save').attr('disabled', true); + $('#{{componentId}}-{{sectionId}}-modal-button-save').children('i').attr('hidden', false); + + var postData = { }; + postData[$('#security-token').attr('name')] = $('#security-token').val(); + postData['id'] = dataCollectionSectionForm['vars']['queue']['id']; + postData['settings'] = { }; + postData['settings']['backupSettings'] = { }; + postData['settings']['backupSettings']['apps_dir'] = $('#{{componentId}}-{{sectionId}}-apps_dir')[0].checked; + postData['settings']['backupSettings']['systems_dir'] = $('#{{componentId}}-{{sectionId}}-systems_dir')[0].checked; + postData['settings']['backupSettings']['public_dir'] = $('#{{componentId}}-{{sectionId}}-public_dir')[0].checked; + postData['settings']['backupSettings']['private_dir'] = $('#{{componentId}}-{{sectionId}}-private_dir')[0].checked; + postData['settings']['backupSettings']['html_compiled_dir'] = $('#{{componentId}}-{{sectionId}}-html_compiled_dir')[0].checked; + postData['settings']['backupSettings']['var_dir'] = $('#{{componentId}}-{{sectionId}}-var_dir')[0].checked; + postData['settings']['backupSettings']['external_dir'] = $('#{{componentId}}-{{sectionId}}-external_dir')[0].checked; + postData['settings']['backupSettings']['external_vendor_dir'] = $('#{{componentId}}-{{sectionId}}-external_vendor_dir')[0].checked; + postData['settings']['backupSettings']['old_backups_dir'] = $('#{{componentId}}-{{sectionId}}-old_backups_dir')[0].checked; + postData['settings']['backupSettings']['database'] = $('#{{componentId}}-{{sectionId}}-database')[0].checked; + postData['settings']['backupSettings']['keys'] = $('#{{componentId}}-{{sectionId}}-keys')[0].checked; + postData['settings']['backupSettings']['password_protect'] = $('#{{componentId}}-{{sectionId}}-password_protect').val().trim(); + postData['settings']['backupSettings']['notes'] = $('#{{componentId}}-{{sectionId}}-notes').val().trim(); + postData['settings']['emailReport'] = $('#{{componentId}}-{{sectionId}}-email_report').val().trim(); + postData['settings']['rsync'] = { }; + postData['settings']['rsync']['deleteDestinationFiles'] = $('#{{componentId}}-{{sectionId}}-delete_destination_files')[0].checked; + + $.post('{{links.url("modules/saveQueueSettings")}}', postData, function(response) { + if (response.tokenKey && response.token) { + $('#security-token').attr('name', response.tokenKey); + $('#security-token').val(response.token); + } + + if (response.responseCode == 0) { + paginatedPNotify('success', {text : response.responseMessage}); + } else { + paginatedPNotify('error', {text : response.responseMessage}); + } + + $('#{{componentId}}-{{sectionId}}-modal-button-save').attr('disabled', false); + $('#{{componentId}}-{{sectionId}}-modal-button-save').children('i').attr('hidden', true); + }, 'json'); +} dataCollectionSectionForm['funcs']['processQueue'] = function(task = 'precheck') { if (task === 'precheck') { @@ -323,6 +410,20 @@ dataCollectionSectionForm['funcs']['processQueue']('process'); }); + $('#{{componentId}}-{{sectionId}}-queue-settings').off(); + $('#{{componentId}}-{{sectionId}}-queue-settings').click(function(e) { + e.preventDefault(); + + $('#{{componentId}}-{{sectionId}}-queue-settings-modal').modal('show'); + + $('#{{componentId}}-{{sectionId}}-modal-button-save').off(); + $('#{{componentId}}-{{sectionId}}-modal-button-save').click(function(e) { + e.preventDefault(); + + dataCollectionSectionForm['funcs']['saveSettings'](); + }); + }); + $('.viewLogs').off(); $('.viewLogs').click(function(e) { e.preventDefault(); @@ -355,6 +456,11 @@ if (object === 'analyse_logs' || object === 'precheck_logs' || object === 'result_logs') { if (logObject[object] !== '-') { + if ($(this).data()['moduletype'] !== 'external') { + logObject[object] = JSON.parse(logObject[object]); + logObject[object] = BazHelpers.createHtmlList({'obj': logObject[object]}); + } + logObject[object] = '
' + logObject[object] + '
'; } } @@ -368,52 +474,129 @@ }); } +dataCollectionSection = + $.extend(dataCollectionSection, { + '{{componentId}}-{{sectionId}}-apps_dir' : { }, + '{{componentId}}-{{sectionId}}-systems_dir' : { + afterInit : function() { + $('#{{componentId}}-{{sectionId}}-systems_dir').click(function() { + if ($(this)[0].checked === true) { + $('#{{componentId}}-{{sectionId}}-keys').attr('disabled', true); + $('#{{componentId}}-{{sectionId}}-keys')[0].checked = true; + } else { + $('#{{componentId}}-{{sectionId}}-keys').attr('disabled', false); + } + }); + } + }, + '{{componentId}}-{{sectionId}}-public_dir' : { }, + '{{componentId}}-{{sectionId}}-private_dir' : { }, + '{{componentId}}-{{sectionId}}-external_dir' : { }, + '{{componentId}}-{{sectionId}}-html_compiled_dir' : { }, + '{{componentId}}-{{sectionId}}-var_dir' : { }, + '{{componentId}}-{{sectionId}}-external_vendor_dir' : { + afterInit : function() { + $('#{{componentId}}-{{sectionId}}-external_vendor_dir').click(function() { + if ($(this)[0].checked === true) { + $('#{{componentId}}-{{sectionId}}-external_dir')[0].checked = true; + $('#{{componentId}}-{{sectionId}}-external_dir').attr('disabled', true); + } else { + $('#{{componentId}}-{{sectionId}}-external_dir').attr('disabled', false); + } + }); + } + }, + '{{componentId}}-{{sectionId}}-old_backups_dir' : { }, + '{{componentId}}-{{sectionId}}-database' : { + afterInit : function() { + $('#{{componentId}}-{{sectionId}}-database').click(function() { + if ($(this)[0].checked === true) { + $('#{{componentId}}-{{sectionId}}-keys').attr('disabled', true); + $('#{{componentId}}-{{sectionId}}-keys')[0].checked = true; + } else { + if ($('#{{componentId}}-{{sectionId}}-systems_dir')[0].checked === false) { + $('#{{componentId}}-{{sectionId}}-keys').attr('disabled', false); + } + } + }); + } + }, + '{{componentId}}-{{sectionId}}-keys' : { + afterInit : function() { + $('#{{componentId}}-{{sectionId}}-keys').click(function() { + if ($(this)[0].checked === true) { + $('#{{componentId}}-{{sectionId}}-systems_dir').attr('disabled', true); + $('#{{componentId}}-{{sectionId}}-systems_dir')[0].checked = true; + } else { + $('#{{componentId}}-{{sectionId}}-systems_dir').attr('disabled', false); + } + }); + } + }, + '{{componentId}}-{{sectionId}}-password_protect' : { }, + '{{componentId}}-{{sectionId}}-notes' : { }, + '{{componentId}}-{{sectionId}}-email_report' : { }, + '{{componentId}}-{{sectionId}}-delete_destination_files' : { }, + '{{componentId}}-{{sectionId}}-form' : $.extend(dataCollectionSectionForm, { + rules: { + }, + messages: { + }, + onSubmit : function() { + return true; + } + }) + }); + $(document).ready(function() { dataCollectionSectionForm['vars']['hasAnalysisError'] = BazHelpers.stringToBoolean("{{hasAnalysisError}}"); dataCollectionSectionForm['funcs']['initQueueButtons'](); - BazProgress.buildProgressBar($('#installer-progress'), false, false, true); - - if ($.fn.DataTable && !$.fn.DataTable.isDataTable('#{{componentId}}-{{sectionId}}-queue-table')) { - $('#{{componentId}}-{{sectionId}}-queue-table').DataTable({ - columns: [ - null, - null, - null, - null, - null, - { orderable: false } - ], - lengthMenu: [ - [25, 50, 100, -1], - [25, 50, 100, 'All'] - ] - }); - } + dataCollectionSectionForm['funcs']['init'](); }); $(window).on('load', function() { - BazProgress.buildProgressBar($('#installer-progress'), false, false, true); - - if ($.fn.DataTable && !$.fn.DataTable.isDataTable('#{{componentId}}-{{sectionId}}-queue-table')) { - $('#{{componentId}}-{{sectionId}}-queue-table').DataTable({ - columns: [ - null, - null, - null, - null, - null, - { orderable: false } - ], - lengthMenu: [ - [25, 50, 100, -1], - [25, 50, 100, 'All'] - ] - }); - } + dataCollectionSectionForm['funcs']['init'](); }); +
+ {{adminltetags.useTag('modal', + [ + 'component' : component, + 'componentName' : componentName, + 'componentId' : componentId, + 'sectionId' : sectionId, + 'modalId' : 'queue-settings-modal', + 'modalBodyInclude' : 'modules/settings', + 'modalSize' : 'xl', + 'modalHeader' : true, + 'modalFooter' : true, + 'modalHeaderCloseButton' : true, + 'modalEscClose' : true, + 'modalTitle' : ' QUEUE SETTINGS', + 'modalFooterButtons' : + [ + 'component' : component, + 'componentName' : componentName, + 'componentId' : componentId, + 'parentComponentId' : parent, + 'sectionId' : sectionId, + 'buttonType' : 'button', + 'buttons' : + [ + 'modal-button-save' : [ + 'title' : 'save', + 'type' : 'primary', + 'position' : 'right', + 'icon' : 'cog fa-spin', + 'iconHidden' : true + ] + ] + ] + ] + )}} +
{{adminltetags.useTag('modal', [ @@ -426,7 +609,10 @@ 'modalSize' : 'xl', 'modalHeader' : true, 'modalFooter' : true, + 'modalHeaderCloseButton' : true, + 'modalEscClose' : true, 'modalTitle' : ' LOGS' ] )}}
+ \ No newline at end of file diff --git a/apps/Core/Views/Default/html/modules/settings.html b/apps/Core/Views/Default/html/modules/settings.html new file mode 100644 index 000000000..f8b348c4f --- /dev/null +++ b/apps/Core/Views/Default/html/modules/settings.html @@ -0,0 +1,487 @@ +{% set settingsBackupSettingsAppsDirChecked = false %} +{% set settingsBackupSettingsSystemsDirChecked = false %} +{% set settingsBackupSettingsPublicDirChecked = false %} +{% set settingsBackupSettingsPrivateDirChecked = false %} +{% set settingsBackupSettingsExternalDirChecked = false %} +{% set settingsBackupSettingsHTMLCompiledDirChecked = false %} +{% set settingsBackupSettingsVarDirChecked = false %} +{% set settingsBackupSettingsExternalVendorDirChecked = false %} +{% set settingsBackupSettingsOldBackupsDirChecked = false %} +{% set settingsBackupSettingsDatabaseChecked = false %} +{% set settingsBackupSettingsKeysChecked = false %} +{% if queue['settings']['backupSettings']['apps_dir'] == 'true' %} + {% set settingsBackupSettingsAppsDirChecked = true %} +{% endif %} +{% if queue['settings']['backupSettings']['systems_dir'] == 'true' %} + {% set settingsBackupSettingsSystemsDirChecked = true %} +{% endif %} +{% if queue['settings']['backupSettings']['public_dir'] == 'true' %} + {% set settingsBackupSettingsPublicDirChecked = true %} +{% endif %} +{% if queue['settings']['backupSettings']['private_dir'] == 'true' %} + {% set settingsBackupSettingsPrivateDirChecked = true %} +{% endif %} +{% if queue['settings']['backupSettings']['external_dir'] == 'true' %} + {% set settingsBackupSettingsExternalDirChecked = true %} +{% endif %} +{% if queue['settings']['backupSettings']['html_compiled_dir'] == 'true' %} + {% set settingsBackupSettingsHTMLCompiledDirChecked = true %} +{% endif %} +{% if queue['settings']['backupSettings']['var_dir'] == 'true' %} + {% set settingsBackupSettingsVarDirChecked = true %} +{% endif %} +{% if queue['settings']['backupSettings']['external_vendor_dir'] == 'true' %} + {% set settingsBackupSettingsExternalVendorDirChecked = true %} +{% endif %} +{% if queue['settings']['backupSettings']['old_backups_dir'] == 'true' %} + {% set settingsBackupSettingsOldBackupsDirChecked = true %} +{% endif %} +{% if queue['settings']['backupSettings']['database'] == 'true' %} + {% set settingsBackupSettingsDatabaseChecked = true %} +{% endif %} +{% if queue['settings']['backupSettings']['keys'] == 'true' %} + {% set settingsBackupSettingsKeysChecked = true %} +{% endif %} +{% set settingsRSyncDeleteDestinationFilesChecked = false %} +{% if queue['settings']['rsync']['deleteDestinationFiles'] == 'true' %} + {% set settingsRSyncDeleteDestinationFilesChecked = true %} +{% endif %} +
+
+
+
+
+ {{adminltetags.useTag('fields', + [ + 'component' : component, + 'componentName' : componentName, + 'componentId' : componentId, + 'sectionId' : sectionId, + 'fieldId' : 'backup_settings', + 'fieldLabel' : 'BACKUP SETTINGS', + 'fieldLabelLegend' : true, + 'fieldHidden' : false, + 'fieldType' : 'html', + 'fieldBazScan' : false, + 'fieldBazPostOnCreate' : false, + 'fieldBazPostOnUpdate' : false, + 'fieldBazJstreeSearch' : true, + 'fieldHtmlContent' : '' + ] + )}} +
+
+
+
+ {{adminltetags.useTag('fields', + [ + 'component' : component, + 'componentName' : componentName, + 'componentId' : componentId, + 'sectionId' : sectionId, + 'fieldId' : 'apps_dir', + 'fieldLabel' : false, + 'fieldHelp' : true, + 'fieldHelpTooltipContent' : 'Backup apps directory?', + 'fieldRequired' : false, + 'fieldType' : 'checkbox', + 'fieldCheckboxType' : 'success', + 'fieldCheckboxLabel' : 'APPS DIRECTORY', + 'fieldCheckboxChecked' : settingsBackupSettingsAppsDirChecked, + 'fieldBazJstreeSearch' : true, + 'fieldBazPostOnCreate' : false, + 'fieldBazPostOnUpdate' : false, + 'fieldBazScan' : true + ] + )}} +
+
+ {{adminltetags.useTag('fields', + [ + 'component' : component, + 'componentName' : componentName, + 'componentId' : componentId, + 'sectionId' : sectionId, + 'fieldId' : 'systems_dir', + 'fieldLabel' : false, + 'fieldHelp' : true, + 'fieldHelpTooltipContent' : 'Backup systems directory?', + 'fieldRequired' : false, + 'fieldType' : 'checkbox', + 'fieldCheckboxType' : 'success', + 'fieldCheckboxLabel' : 'SYSTEMS DIRECTORY', + 'fieldCheckboxChecked' : settingsBackupSettingsSystemsDirChecked, + 'fieldBazJstreeSearch' : true, + 'fieldBazPostOnCreate' : false, + 'fieldBazPostOnUpdate' : false, + 'fieldBazScan' : true + ] + )}} +
+
+
+
+ {{adminltetags.useTag('fields', + [ + 'component' : component, + 'componentName' : componentName, + 'componentId' : componentId, + 'sectionId' : sectionId, + 'fieldId' : 'public_dir', + 'fieldLabel' : false, + 'fieldHelp' : true, + 'fieldHelpTooltipContent' : 'Backup public directory?', + 'fieldRequired' : false, + 'fieldType' : 'checkbox', + 'fieldCheckboxType' : 'success', + 'fieldCheckboxLabel' : 'PUBLIC DIRECTORY', + 'fieldCheckboxChecked' : settingsBackupSettingsPublicDirChecked, + 'fieldBazJstreeSearch' : true, + 'fieldBazPostOnCreate' : false, + 'fieldBazPostOnUpdate' : false, + 'fieldBazScan' : true + ] + )}} +
+
+ {{adminltetags.useTag('fields', + [ + 'component' : component, + 'componentName' : componentName, + 'componentId' : componentId, + 'sectionId' : sectionId, + 'fieldId' : 'private_dir', + 'fieldLabel' : false, + 'fieldHelp' : true, + 'fieldHelpTooltipContent' : 'Backup private directory?', + 'fieldRequired' : false, + 'fieldType' : 'checkbox', + 'fieldCheckboxType' : 'success', + 'fieldCheckboxLabel' : 'PRIVATE DIRECTORY', + 'fieldCheckboxChecked' : settingsBackupSettingsPrivateDirChecked, + 'fieldBazJstreeSearch' : true, + 'fieldBazPostOnCreate' : false, + 'fieldBazPostOnUpdate' : false, + 'fieldBazScan' : true + ] + )}} +
+
+
+
+ {{adminltetags.useTag('fields', + [ + 'component' : component, + 'componentName' : componentName, + 'componentId' : componentId, + 'sectionId' : sectionId, + 'fieldId' : 'external_dir', + 'fieldLabel' : false, + 'fieldHelp' : true, + 'fieldHelpTooltipContent' : 'Backup external (third party) directory? It includes only composer files. If you want to backup whole vendor folder, select Backup External Vendor Directory option as well.', + 'fieldRequired' : false, + 'fieldType' : 'checkbox', + 'fieldCheckboxType' : 'success', + 'fieldCheckboxLabel' : 'EXTERNAL DIRECTORY', + 'fieldCheckboxChecked' : settingsBackupSettingsExternalDirChecked, + 'fieldBazJstreeSearch' : true, + 'fieldBazPostOnCreate' : false, + 'fieldBazPostOnUpdate' : false, + 'fieldBazScan' : true + ] + )}} +
+
+ {{adminltetags.useTag('fields', + [ + 'component' : component, + 'componentName' : componentName, + 'componentId' : componentId, + 'sectionId' : sectionId, + 'fieldId' : 'html_compiled_dir', + 'fieldLabel' : false, + 'fieldHelp' : true, + 'fieldHelpTooltipContent' : 'Compiled Templates Directory? Note: This can be regenerated.', + 'fieldRequired' : false, + 'fieldType' : 'checkbox', + 'fieldCheckboxType' : 'warning', + 'fieldCheckboxChecked' : settingsBackupSettingsHTMLCompiledDirChecked, + 'fieldCheckboxLabel' : 'COMPILED HTML DIRECTORY', + 'fieldBazJstreeSearch' : true, + 'fieldBazPostOnCreate' : false, + 'fieldBazPostOnUpdate' : false, + 'fieldBazScan' : true + ] + )}} +
+
+
+
+ {{adminltetags.useTag('fields', + [ + 'component' : component, + 'componentName' : componentName, + 'componentId' : componentId, + 'sectionId' : sectionId, + 'fieldId' : 'var_dir', + 'fieldLabel' : false, + 'fieldHelp' : true, + 'fieldHelpTooltipContent' : 'Backup var (variable) directory? This directory contains logs, cache, session information. Information that will be regenerated by the system again.', + 'fieldRequired' : false, + 'fieldType' : 'checkbox', + 'fieldCheckboxType' : 'warning', + 'fieldCheckboxChecked' : settingsBackupSettingsVarDirChecked, + 'fieldCheckboxLabel' : 'VAR DIRECTORY', + 'fieldBazJstreeSearch' : true, + 'fieldBazPostOnCreate' : false, + 'fieldBazPostOnUpdate' : false, + 'fieldBazScan' : true + ] + )}} +
+
+ {{adminltetags.useTag('fields', + [ + 'component' : component, + 'componentName' : componentName, + 'componentId' : componentId, + 'sectionId' : sectionId, + 'fieldId' : 'external_vendor_dir', + 'fieldLabel' : false, + 'fieldHelp' : true, + 'fieldHelpTooltipContent' : 'Backup external (third party) vendor directory? Note: External code can be restored using composer.', + 'fieldRequired' : false, + 'fieldType' : 'checkbox', + 'fieldCheckboxType' : 'warning', + 'fieldCheckboxLabel' : 'EXTERNAL VENDOR DIRECTORY', + 'fieldCheckboxChecked' : settingsBackupSettingsExternalVendorDirChecked, + 'fieldBazJstreeSearch' : true, + 'fieldBazPostOnCreate' : false, + 'fieldBazPostOnUpdate' : false, + 'fieldBazScan' : true + ] + )}} +
+
+
+
+ {{adminltetags.useTag('fields', + [ + 'component' : component, + 'componentName' : componentName, + 'componentId' : componentId, + 'sectionId' : sectionId, + 'fieldId' : 'old_backups_dir', + 'fieldLabel' : false, + 'fieldHelp' : true, + 'fieldHelpTooltipContent' : 'Old backup files? This will increase the total size of the backup depending on how many backups you have taken before.', + 'fieldRequired' : false, + 'fieldType' : 'checkbox', + 'fieldCheckboxType' : 'danger', + 'fieldCheckboxChecked' : settingsBackupSettingsOldBackupsDirChecked, + 'fieldCheckboxLabel' : 'OLD BACKUP FILES DIRECTORY', + 'fieldBazJstreeSearch' : true, + 'fieldBazPostOnCreate' : false, + 'fieldBazPostOnUpdate' : false, + 'fieldBazScan' : true + ] + )}} +
+
+ {{adminltetags.useTag('fields', + [ + 'component' : component, + 'componentName' : componentName, + 'componentId' : componentId, + 'sectionId' : sectionId, + 'fieldId' : 'database', + 'fieldLabel' : false, + 'fieldHelp' : true, + 'fieldHelpTooltipContent' : 'Backup database?', + 'fieldRequired' : false, + 'fieldType' : 'checkbox', + 'fieldCheckboxType' : 'success', + 'fieldCheckboxChecked' : settingsBackupSettingsDatabaseChecked, + 'fieldCheckboxLabel' : 'DATABASE', + 'fieldBazJstreeSearch' : true, + 'fieldBazPostOnCreate' : false, + 'fieldBazPostOnUpdate' : false, + 'fieldBazScan' : true + ] + )}} +
+
+
+
+ {{adminltetags.useTag('fields', + [ + 'component' : component, + 'componentName' : componentName, + 'componentId' : componentId, + 'sectionId' : sectionId, + 'fieldId' : 'keys', + 'fieldLabel' : false, + 'fieldHelp' : true, + 'fieldHelpTooltipContent' : 'Security and DB keys?', + 'fieldRequired' : false, + 'fieldType' : 'checkbox', + 'fieldCheckboxType' : 'danger', + 'fieldCheckboxChecked' : settingsBackupSettingsKeysChecked, + 'fieldDisabled' : true, + 'fieldCheckboxLabel' : 'SECURITY AND DB KEYS', + 'fieldBazJstreeSearch' : true, + 'fieldBazPostOnCreate' : false, + 'fieldBazPostOnUpdate' : false, + 'fieldBazScan' : true + ] + )}} +
+
+ {{adminltetags.useTag('fields', + [ + 'component' : component, + 'componentName' : componentName, + 'componentId' : componentId, + 'sectionId' : sectionId, + 'fieldId' : 'password_protect', + 'fieldLabel' : 'Password Protect', + 'fieldType' : 'input', + 'fieldInputType' : 'password', + 'fieldInputPasswordToggleVisibility' : true, + 'fieldInputPasswordGenerate' : true, + 'fieldInputPasswordStrengthMeter' : true, + 'fieldHelp' : true, + 'fieldHelpTooltipContent' : 'We will password protect the zip file if password is provided. Password protection is a must in case of Security and DB keys (if not provided, a new password will be auto generated). During restore, you need to enter this password, else restore will fail. Please keep this password safe.', + 'fieldRequired' : false, + 'fieldBazScan' : true, + 'fieldBazPostOnCreate' : false, + 'fieldBazPostOnUpdate' : false, + 'fieldAdditionalClass' : 'mb-0', + 'fieldValue' : queue['settings']['backupSettings']['password_protect'] + ] + )}} +
+
+
+
+ {{adminltetags.useTag('fields', + [ + 'component' : component, + 'componentName' : componentName, + 'componentId' : componentId, + 'sectionId' : sectionId, + 'fieldId' : 'notes', + 'fieldLabel' : 'Notes', + 'fieldType' : 'textarea', + 'fieldDataMaxLength' : 2048, + 'fieldHelp' : true, + 'fieldHelpTooltipContent' : 'Backup Notes', + 'fieldRequired' : false, + 'fieldBazScan' : true, + 'fieldBazJstreeSearch' : true, + 'fieldBazPostOnCreate' : false, + 'fieldBazPostOnUpdate' : false, + 'fieldDataInputMaxLength' : 2048, + 'fieldTextareaRows' : 2, + 'fieldValue' : queue['settings']['backupSettings']['notes'] + ] + )}} +
+
+
+
+
+ {{adminltetags.useTag('fields', + [ + 'component' : component, + 'componentName' : componentName, + 'componentId' : componentId, + 'sectionId' : sectionId, + 'fieldId' : 'report_settings', + 'fieldLabel' : 'REPORT SETTINGS', + 'fieldLabelLegend' : true, + 'fieldHidden' : false, + 'fieldType' : 'html', + 'fieldBazScan' : false, + 'fieldBazPostOnCreate' : false, + 'fieldBazPostOnUpdate' : false, + 'fieldBazJstreeSearch' : true, + 'fieldHtmlContent' : '' + ] + )}} +
+
+
+
+ {{adminltetags.useTag('fields', + [ + 'component' : component, + 'componentName' : componentName, + 'componentId' : componentId, + 'sectionId' : sectionId, + 'fieldId' : 'email_report', + 'fieldLabel' : 'Email Report', + 'fieldType' : 'input', + 'fieldHelp' : true, + 'fieldHelpTooltipContent' : 'Email report to the email addresses. Enter comma separated email addresses.', + 'fieldRequired' : false, + 'fieldBazScan' : true, + 'fieldBazPostOnCreate' : false, + 'fieldBazPostOnUpdate' : false, + 'fieldAdditionalClass' : 'mb-0', + 'fieldValue' : queue['settings']['emailReport'] + ] + )}} +
+
+
+
+
+ {{adminltetags.useTag('fields', + [ + 'component' : component, + 'componentName' : componentName, + 'componentId' : componentId, + 'sectionId' : sectionId, + 'fieldId' : 'rsync_settings', + 'fieldLabel' : 'RSYNC SETTINGS', + 'fieldLabelLegend' : true, + 'fieldHidden' : false, + 'fieldType' : 'html', + 'fieldBazScan' : false, + 'fieldBazPostOnCreate' : false, + 'fieldBazPostOnUpdate' : false, + 'fieldBazJstreeSearch' : true, + 'fieldHtmlContent' : '' + ] + )}} +
+
+
+
+ {{adminltetags.useTag('fields', + [ + 'component' : component, + 'componentName' : componentName, + 'componentId' : componentId, + 'sectionId' : sectionId, + 'fieldId' : 'delete_destination_files', + 'fieldLabel' : false, + 'fieldHelp' : true, + 'fieldHelpTooltipContent' : 'RSync delete destination files? Disable if you have any custom code installed, else RSync will delete the files that are not found in the source.', + 'fieldRequired' : false, + 'fieldType' : 'checkbox', + 'fieldCheckboxType' : 'danger', + 'fieldCheckboxChecked' : settingsRSyncDeleteDestinationFilesChecked, + 'fieldCheckboxLabel' : 'RSYNC DELETE DESTINATION FILES?', + 'fieldBazJstreeSearch' : true, + 'fieldBazPostOnCreate' : false, + 'fieldBazPostOnUpdate' : false, + 'fieldBazScan' : true + ] + )}} +
+
+
+
+
\ No newline at end of file diff --git a/apps/Core/Views/Default/html/modules/view.html b/apps/Core/Views/Default/html/modules/view.html index 79b5bcab9..ed2a1d5d5 100644 --- a/apps/Core/Views/Default/html/modules/view.html +++ b/apps/Core/Views/Default/html/modules/view.html @@ -6,6 +6,7 @@ {% if queue['status'] == 1 %} {% set precheckHidden = false %} {% set precheckTitle = 'Re-Perform Precheck' %} + {% set processHidden = false %} {% elseif queue['status'] == 2 %} {% set precheckHidden = true %} {% set analyseHidden = true %} @@ -40,8 +41,7 @@ 'type' : 'primary', 'icon' : 'cog fa-spin', 'iconHidden' : true, - 'hidden' : processHidden, - 'disabled' : true + 'hidden' : processHidden ], 'cancel' : [ 'title' : 'Cancel', diff --git a/apps/Core/Views/Default/html/system/api/client/services/apis/repos/generic/form.html b/apps/Core/Views/Default/html/system/api/client/services/apis/repos/generic/form.html deleted file mode 100644 index 57604e56e..000000000 --- a/apps/Core/Views/Default/html/system/api/client/services/apis/repos/generic/form.html +++ /dev/null @@ -1,296 +0,0 @@ -{% if api['id'] is defined %} - {% set apiId = api['id'] %} - {% set apiSetup = api['setup'] %} - {% set apiName = api['name'] %} - {% set apiInUse = api['in_use'] %} - {% set apiUsedBy = api['used_by'] %} - {% set apiDescription = api['description'] %} - {% set apiApiUrl = api['api_url'] %} - {% set apiAuthType = api['auth_type'] %} - {% set apiUsername = api['username'] %} - {% set apiPassword = api['password'] %} - {% set apiToken = api['token'] %} - {% set apiAuthorization = api['authorization'] %} -{% else %} - {% set apiId = '' %} - {% set apiSetup = '' %} - {% set apiName = '' %} - {% set apiInUse = '0' %} - {% set apiUsedBy = '' %} - {% set apiDescription = '' %} - {% set apiApiUrl = '' %} - {% set apiAuthType = 'none' %} - {% set apiUsername = '' %} - {% set apiPassword = '' %} - {% set apiToken = '' %} - {% set apiAuthorization = '' %} -{% endif %} -{% if apiAuthType === 'auth' %} - {% set authDisabled = false %} - {% set authoDisabled = true %} - {% set tokenDisabled = true %} -{% elseif apiAuthType === 'token' %} - {% set authDisabled = true %} - {% set authoDisabled = true %} - {% set tokenDisabled = false %} -{% elseif apiAuthType === 'autho' %} - {% set authDisabled = true %} - {% set authoDisabled = false %} - {% set tokenDisabled = true %} -{% else %} - {% set authDisabled = true %} - {% set authoDisabled = true %} - {% set tokenDisabled = true %} -{% endif %} - -
- {% include 'services/apis/common.html' %} -
-
- {{adminltetags.useTag('fields', - [ - 'component' : component, - 'componentName' : componentName, - 'componentId' : componentId, - 'sectionId' : sectionId, - 'fieldId' : 'api_url', - 'fieldLabel' : 'API Url', - 'fieldType' : 'input', - 'fieldHelp' : true, - 'fieldHelpTooltipContent' : 'API URL', - 'fieldRequired' : true, - 'fieldBazScan' : true, - 'fieldBazPostOnCreate' : true, - 'fieldBazPostOnUpdate' : true, - 'fieldDataInputMinLength' : 1, - 'fieldDataInputMaxLength' : 1024, - 'fieldValue' : apiApiUrl - ] - )}} -
-
-
-
-
- {{adminltetags.useTag('fields', - [ - 'component' : component, - 'componentName' : componentName, - 'componentId' : componentId, - 'sectionId' : sectionId, - 'fieldId' : 'auth_type', - 'fieldLabel' : 'Auth/Token/Authorization?', - 'fieldType' : 'radio', - 'fieldHelp' : true, - 'fieldHelpTooltipContent' : 'Select either basic user authentication is used or user token/authorization is used.', - 'fieldRequired' : true, - 'fieldBazPostOnCreate' : true, - 'fieldBazPostOnUpdate' : true, - 'fieldBazScan' : true, - 'fieldRadioButtons' : - [ - 'none' : - [ - 'title' : 'None', - 'type' : 'secondary', - 'dataValue' : 'none' - ], - 'auth' : - [ - 'title' : 'Auth', - 'type' : 'primary', - 'dataValue' : 'auth' - ], - 'token' : - [ - 'title' : 'Token', - 'type' : 'primary', - 'dataValue' : 'token' - ], - 'autho' : - [ - 'title' : 'Authorization', - 'type' : 'primary', - 'dataValue' : 'autho' - ] - ], - 'fieldRadioChecked' : apiAuthType - ] - )}} -
-
-
-
- {{adminltetags.useTag('fields', - [ - 'component' : component, - 'componentName' : componentName, - 'componentId' : componentId, - 'sectionId' : sectionId, - 'fieldId' : 'username', - 'fieldLabel' : 'Username', - 'fieldType' : 'input', - 'fieldRequired' : true, - 'fieldHelp' : true, - 'fieldHelpTooltipContent' : 'Username', - 'fieldBazPostOnCreate' : true, - 'fieldBazPostOnUpdate' : true, - 'fieldBazScan' : true, - 'fieldDataInputMinLength' : 1, - 'fieldDataInputMaxLength' : 50, - 'fieldDisabled' : authDisabled, - 'fieldValue' : apiUsername - ] - )}} -
-
- {{adminltetags.useTag('fields', - [ - 'component' : component, - 'componentName' : componentName, - 'componentId' : componentId, - 'sectionId' : sectionId, - 'fieldId' : 'password', - 'fieldLabel' : 'Password', - 'fieldType' : 'input', - 'fieldInputType' : 'password', - 'fieldHelp' : true, - 'fieldHelpTooltipContent' : 'Password', - 'fieldRequired' : true, - 'fieldBazScan' : true, - 'fieldBazPostOnCreate' : true, - 'fieldBazPostOnUpdate' : true, - 'fieldDisabled' : authDisabled, - 'fieldValue' : apiPassword - ] - )}} -
-
-
-
- {{adminltetags.useTag('fields', - [ - 'component' : component, - 'componentName' : componentName, - 'componentId' : componentId, - 'sectionId' : sectionId, - 'fieldId' : 'token', - 'fieldLabel' : 'Token', - 'fieldType' : 'input', - 'fieldInputType' : 'password', - 'fieldHelp' : true, - 'fieldHelpTooltipContent' : 'Token', - 'fieldRequired' : true, - 'fieldBazScan' : true, - 'fieldBazPostOnCreate' : true, - 'fieldBazPostOnUpdate' : true, - 'fieldDisabled' : tokenDisabled, - 'fieldValue' : apiToken - ] - )}} -
-
-
-
- {{adminltetags.useTag('fields', - [ - 'component' : component, - 'componentName' : componentName, - 'componentId' : componentId, - 'sectionId' : sectionId, - 'fieldId' : 'authorization', - 'fieldLabel' : 'Authorization Code', - 'fieldType' : 'textarea', - 'fieldHelp' : true, - 'fieldHelpTooltipContent' : 'Authorization Code', - 'fieldRequired' : true, - 'fieldBazScan' : true, - 'fieldBazPostOnCreate' : true, - 'fieldBazPostOnUpdate' : true, - 'fieldDisabled' : authoDisabled, - 'fieldValue' : apiAuthorization - ] - )}} -
-
-
-
-
- - \ No newline at end of file diff --git a/apps/Core/Views/Default/html/system/api/client/services/apis/repos/generic/view.html b/apps/Core/Views/Default/html/system/api/client/services/apis/repos/generic/view.html deleted file mode 100644 index a160eb78d..000000000 --- a/apps/Core/Views/Default/html/system/api/client/services/apis/repos/generic/view.html +++ /dev/null @@ -1,27 +0,0 @@ -{{adminltetags.useTag('content', - [ - 'component' : component, - 'componentName' : componentName, - 'componentId' : componentId, - 'parentComponentId' : parent, - 'sectionId' : 'main', - 'contentType' : 'sectionWithForm', - 'cardHeader' : true, - 'cardFooter' : true, - 'cardType' : 'primary', - 'cardIcon' : 'exchange-alt', - 'cardTitle' : title, - 'cardAdditionalClass' : 'rounded-0', - 'cardBodyInclude' : 'services/apis/repo/gitea/form', - 'formButtons' : - [ - 'updateButtonId' : apiId, - 'addActionUrl' : 'system/api/client/services/add', - 'addSuccessRedirectUrl' : 'system/api/client/services', - 'updateActionUrl' : 'system/api/client/services/update', - 'updateSuccessRedirectUrl' : 'system/api/client/services', - 'cancelActionUrl' : 'system/api/client/services', - 'closeActionUrl' : 'system/api/client/services' - ] - ] -)}} \ No newline at end of file diff --git a/apps/Core/Views/Default/html/system/api/client/services/apis/repos/gitea/form.html b/apps/Core/Views/Default/html/system/api/client/services/apis/repos/gitea/form.html index 6e90b0c84..b42603d05 100644 --- a/apps/Core/Views/Default/html/system/api/client/services/apis/repos/gitea/form.html +++ b/apps/Core/Views/Default/html/system/api/client/services/apis/repos/gitea/form.html @@ -118,10 +118,10 @@ 'componentId' : componentId, 'sectionId' : sectionId, 'fieldId' : 'repo_url', - 'fieldLabel' : 'API Repo Url', + 'fieldLabel' : 'Org/User/Repo Url', 'fieldType' : 'input', 'fieldHelp' : true, - 'fieldHelpTooltipContent' : 'API Repo URL', + 'fieldHelpTooltipContent' : 'Org/User/Repo Url', 'fieldRequired' : true, 'fieldBazScan' : true, 'fieldBazPostOnCreate' : true, @@ -140,10 +140,10 @@ 'componentId' : componentId, 'sectionId' : sectionId, 'fieldId' : 'branch', - 'fieldLabel' : 'API Repo Branch', + 'fieldLabel' : 'Repo Branch', 'fieldType' : 'input', 'fieldHelp' : true, - 'fieldHelpTooltipContent' : 'API Repo Branch', + 'fieldHelpTooltipContent' : 'Repo Branch', 'fieldRequired' : true, 'fieldBazScan' : true, 'fieldBazPostOnCreate' : true, @@ -350,8 +350,8 @@ '{{componentId}}-{{sectionId}}-description' : { }, '{{componentId}}-{{sectionId}}-api_url' : { }, '{{componentId}}-{{sectionId}}-org_user' : { }, - '{{componentId}}-{{sectionId}}-branch' : { }, '{{componentId}}-{{sectionId}}-repo_url' : { }, + '{{componentId}}-{{sectionId}}-branch' : { }, '{{componentId}}-{{sectionId}}-auth_type' : { afterInit : function() { $('#{{componentId}}-{{sectionId}}-auth_type').click(function() { @@ -379,8 +379,10 @@ '{{componentId}}-{{sectionId}}-name' : 'required', '{{componentId}}-{{sectionId}}-category' : 'required', '{{componentId}}-{{sectionId}}-location' : 'required', + '{{componentId}}-{{sectionId}}-api_url' : 'required', + '{{componentId}}-{{sectionId}}-org_user' : 'required', '{{componentId}}-{{sectionId}}-repo_url' : 'required', - '{{componentId}}-{{sectionId}}-site_url' : 'required', + '{{componentId}}-{{sectionId}}-branch' : 'required', '{{componentId}}-{{sectionId}}-username' : 'required', '{{componentId}}-{{sectionId}}-password' : 'required', '{{componentId}}-{{sectionId}}-access_token' : 'required', @@ -390,8 +392,10 @@ '{{componentId}}-{{sectionId}}-name' : 'Please enter api name', '{{componentId}}-{{sectionId}}-category' : 'Please enter api category', '{{componentId}}-{{sectionId}}-location' : 'Please enter api location', + '{{componentId}}-{{sectionId}}-api_url' : 'Please enter repo url', + '{{componentId}}-{{sectionId}}-org_user' : 'Please enter org name or username', '{{componentId}}-{{sectionId}}-repo_url' : 'Please enter repo url', - '{{componentId}}-{{sectionId}}-site_url' : 'Please enter site url', + '{{componentId}}-{{sectionId}}-branch' : 'Please enter branch (main/dev)', '{{componentId}}-{{sectionId}}-username' : 'Please enter username', '{{componentId}}-{{sectionId}}-password' : 'Please enter password', '{{componentId}}-{{sectionId}}-access_token' : 'Please enter api access token', diff --git a/apps/Core/Views/Default/html/system/api/client/services/apis/repos/github/form.html b/apps/Core/Views/Default/html/system/api/client/services/apis/repos/github/form.html index 6e90b0c84..0471868b2 100644 --- a/apps/Core/Views/Default/html/system/api/client/services/apis/repos/github/form.html +++ b/apps/Core/Views/Default/html/system/api/client/services/apis/repos/github/form.html @@ -97,7 +97,7 @@ 'fieldLabel' : 'Org/User', 'fieldType' : 'input', 'fieldHelp' : true, - 'fieldHelpTooltipContent' : 'Org/User name', + 'fieldHelpTooltipContent' : 'Org/User name. Note: For modules, ', 'fieldRequired' : true, 'fieldBazScan' : true, 'fieldBazPostOnCreate' : true, @@ -118,10 +118,10 @@ 'componentId' : componentId, 'sectionId' : sectionId, 'fieldId' : 'repo_url', - 'fieldLabel' : 'API Repo Url', + 'fieldLabel' : 'Org/User/Repo Url', 'fieldType' : 'input', 'fieldHelp' : true, - 'fieldHelpTooltipContent' : 'API Repo URL', + 'fieldHelpTooltipContent' : 'Org/User/Repo Url', 'fieldRequired' : true, 'fieldBazScan' : true, 'fieldBazPostOnCreate' : true, @@ -140,10 +140,10 @@ 'componentId' : componentId, 'sectionId' : sectionId, 'fieldId' : 'branch', - 'fieldLabel' : 'API Repo Branch', + 'fieldLabel' : 'Repo Branch', 'fieldType' : 'input', 'fieldHelp' : true, - 'fieldHelpTooltipContent' : 'API Repo Branch', + 'fieldHelpTooltipContent' : 'Repo Branch', 'fieldRequired' : true, 'fieldBazScan' : true, 'fieldBazPostOnCreate' : true, @@ -350,8 +350,8 @@ '{{componentId}}-{{sectionId}}-description' : { }, '{{componentId}}-{{sectionId}}-api_url' : { }, '{{componentId}}-{{sectionId}}-org_user' : { }, - '{{componentId}}-{{sectionId}}-branch' : { }, '{{componentId}}-{{sectionId}}-repo_url' : { }, + '{{componentId}}-{{sectionId}}-branch' : { }, '{{componentId}}-{{sectionId}}-auth_type' : { afterInit : function() { $('#{{componentId}}-{{sectionId}}-auth_type').click(function() { @@ -379,8 +379,10 @@ '{{componentId}}-{{sectionId}}-name' : 'required', '{{componentId}}-{{sectionId}}-category' : 'required', '{{componentId}}-{{sectionId}}-location' : 'required', + '{{componentId}}-{{sectionId}}-api_url' : 'required', + '{{componentId}}-{{sectionId}}-org_user' : 'required', '{{componentId}}-{{sectionId}}-repo_url' : 'required', - '{{componentId}}-{{sectionId}}-site_url' : 'required', + '{{componentId}}-{{sectionId}}-branch' : 'required', '{{componentId}}-{{sectionId}}-username' : 'required', '{{componentId}}-{{sectionId}}-password' : 'required', '{{componentId}}-{{sectionId}}-access_token' : 'required', @@ -390,8 +392,10 @@ '{{componentId}}-{{sectionId}}-name' : 'Please enter api name', '{{componentId}}-{{sectionId}}-category' : 'Please enter api category', '{{componentId}}-{{sectionId}}-location' : 'Please enter api location', + '{{componentId}}-{{sectionId}}-api_url' : 'Please enter repo url', + '{{componentId}}-{{sectionId}}-org_user' : 'Please enter org name or username', '{{componentId}}-{{sectionId}}-repo_url' : 'Please enter repo url', - '{{componentId}}-{{sectionId}}-site_url' : 'Please enter site url', + '{{componentId}}-{{sectionId}}-branch' : 'Please enter branch (main/dev)', '{{componentId}}-{{sectionId}}-username' : 'Please enter username', '{{componentId}}-{{sectionId}}-password' : 'Please enter password', '{{componentId}}-{{sectionId}}-access_token' : 'Please enter api access token', diff --git a/apps/Core/Views/Default/html/system/api/client/services/view.html b/apps/Core/Views/Default/html/system/api/client/services/view.html index cb312ac08..4509c50a1 100644 --- a/apps/Core/Views/Default/html/system/api/client/services/view.html +++ b/apps/Core/Views/Default/html/system/api/client/services/view.html @@ -3,14 +3,6 @@ {% set title = 'API:' ~ api['category'] ~ ':' ~ api['provider'] ~ ' - ' ~ api['name'] %} {% else %} {% set apiId = '' %} - {% if api['repository'] is defined and api['repository'] === true %} - {% set title = 'New API:' ~ api['category'] %} - {% else %} - {% set title = 'New API:' ~ api['category'] ~ ':' ~ api['provider'] %} - {% endif %} + {% set title = 'New API:' ~ api['category'] ~ ':' ~ api['provider'] %} {% endif %} -{% if api['repository'] is defined and api['repository'] === true %} - {{view.getPartial('../../modules/repositories/view')}} -{% else %} - {{view.getPartial('services/apis/' ~ api['category'] ~ '/' ~ api['provider']|lower ~ '/view')}} -{% endif %} \ No newline at end of file +{{view.getPartial('services/apis/' ~ api['category'] ~ '/' ~ api['provider']|lower ~ '/view')}} \ No newline at end of file diff --git a/apps/Core/Views/Default/html/system/geo/timezones/form.html b/apps/Core/Views/Default/html/system/geo/timezones/form.html index f58af6780..252ab0f8c 100644 --- a/apps/Core/Views/Default/html/system/geo/timezones/form.html +++ b/apps/Core/Views/Default/html/system/geo/timezones/form.html @@ -5,6 +5,9 @@ {% set timezoneGmtOffset = timezone['gmt_offset'] %} {% set timezoneGmtOffsetName = timezone['gmt_offset_name'] %} {% set timezoneAbbreviation = timezone['abbreviation'] %} + {% set timezoneGmtOffsetDST = timezone['gmt_offset_dst'] %} + {% set timezoneGmtOffsetNameDST = timezone['gmt_offset_name_dst'] %} + {% set timezoneAbbreviationDST = timezone['abbreviation_dst'] %} {% else %} {% set timezoneId = '' %} {% set timezoneZoneName = '' %} @@ -12,6 +15,9 @@ {% set timezoneGmtOffset = '' %} {% set timezoneGmtOffsetName = '' %} {% set timezoneAbbreviation = '' %} + {% set timezoneGmtOffsetDST = '' %} + {% set timezoneGmtOffsetNameDST = '' %} + {% set timezoneAbbreviationDST = '' %} {% endif %}
@@ -84,6 +90,8 @@ ] )}} + +
{{adminltetags.useTag('fields', [ @@ -91,23 +99,21 @@ 'componentName' : componentName, 'componentId' : componentId, 'sectionId' : sectionId, - 'fieldId' : 'abbreviation', - 'fieldLabel' : 'Abbreviation', + 'fieldId' : 'gmt_offset', + 'fieldLabel' : 'GMT Offset (secs)', 'fieldType' : 'input', 'fieldHelp' : true, - 'fieldHelpTooltipContent' : 'Time Zone Abbreviation Example: AEST', + 'fieldHelpTooltipContent' : 'GMT offset in seconds. Example: 36000 for +10:00', 'fieldRequired' : true, 'fieldBazScan' : true, 'fieldBazPostOnCreate' : true, 'fieldBazPostOnUpdate' : true, 'fieldDataInputMinLength' : 1, - 'fieldDataInputMaxLength' : 10, - 'fieldValue' : timezoneAbbreviation + 'fieldDataInputMaxLength' : 15, + 'fieldValue' : timezoneGmtOffset ] )}}
-
-
{{adminltetags.useTag('fields', [ @@ -115,18 +121,18 @@ 'componentName' : componentName, 'componentId' : componentId, 'sectionId' : sectionId, - 'fieldId' : 'gmt_offset', - 'fieldLabel' : 'GMT Offset (secs)', + 'fieldId' : 'gmt_offset_name', + 'fieldLabel' : 'GMT Offset Name', 'fieldType' : 'input', 'fieldHelp' : true, - 'fieldHelpTooltipContent' : 'GMT offset in seconds. Example: 36000 for +10:00', + 'fieldHelpTooltipContent' : 'GMT offset name. Example: UTC+10:00', 'fieldRequired' : true, 'fieldBazScan' : true, 'fieldBazPostOnCreate' : true, 'fieldBazPostOnUpdate' : true, 'fieldDataInputMinLength' : 1, 'fieldDataInputMaxLength' : 15, - 'fieldValue' : timezoneGmtOffset + 'fieldValue' : timezoneGmtOffsetName ] )}}
@@ -137,21 +143,23 @@ 'componentName' : componentName, 'componentId' : componentId, 'sectionId' : sectionId, - 'fieldId' : 'gmt_offset_name', - 'fieldLabel' : 'GMT Offset Name', + 'fieldId' : 'abbreviation', + 'fieldLabel' : 'Abbreviation', 'fieldType' : 'input', 'fieldHelp' : true, - 'fieldHelpTooltipContent' : 'GMT offset name. Example: UTC+10:00', + 'fieldHelpTooltipContent' : 'Time Zone Abbreviation Example: AEST', 'fieldRequired' : true, 'fieldBazScan' : true, 'fieldBazPostOnCreate' : true, 'fieldBazPostOnUpdate' : true, 'fieldDataInputMinLength' : 1, - 'fieldDataInputMaxLength' : 15, - 'fieldValue' : timezoneGmtOffsetName + 'fieldDataInputMaxLength' : 10, + 'fieldValue' : timezoneAbbreviation ] )}}
+ +
{{adminltetags.useTag('fields', [ @@ -170,7 +178,7 @@ 'fieldBazPostOnUpdate' : true, 'fieldDataInputMinLength' : 1, 'fieldDataInputMaxLength' : 15, - 'fieldValue' : timezoneGmtOffset + 'fieldValue' : timezoneGmtOffsetDST ] )}}
@@ -192,7 +200,29 @@ 'fieldBazPostOnUpdate' : true, 'fieldDataInputMinLength' : 1, 'fieldDataInputMaxLength' : 15, - 'fieldValue' : timezoneGmtOffsetName + 'fieldValue' : timezoneGmtOffsetNameDST + ] + )}} +
+
+ {{adminltetags.useTag('fields', + [ + 'component' : component, + 'componentName' : componentName, + 'componentId' : componentId, + 'sectionId' : sectionId, + 'fieldId' : 'abbreviation_dst', + 'fieldLabel' : 'Abbreviation DST', + 'fieldType' : 'input', + 'fieldHelp' : true, + 'fieldHelpTooltipContent' : 'Time Zone Abbreviation Example: AEDT', + 'fieldRequired' : true, + 'fieldBazScan' : true, + 'fieldBazPostOnCreate' : true, + 'fieldBazPostOnUpdate' : true, + 'fieldDataInputMinLength' : 1, + 'fieldDataInputMaxLength' : 10, + 'fieldValue' : timezoneAbbreviationDST ] )}}
@@ -232,9 +262,10 @@ '{{componentId}}-{{sectionId}}-tz_name' : { }, '{{componentId}}-{{sectionId}}-gmt_offset' : { }, '{{componentId}}-{{sectionId}}-gmt_offset_name' : { }, + '{{componentId}}-{{sectionId}}-abbreviation' : { }, '{{componentId}}-{{sectionId}}-gmt_offset_dst' : { }, '{{componentId}}-{{sectionId}}-gmt_offset_name_dst' : { }, - '{{componentId}}-{{sectionId}}-abbreviation' : { }, + '{{componentId}}-{{sectionId}}-abbreviation_dst' : { }, '{{componentId}}-{{sectionId}}-form' : { rules: { '{{componentId}}-{{sectionId}}-zone_name' : 'required', diff --git a/apps/Core/Views/Default/html/system/geo/timezones/list.html b/apps/Core/Views/Default/html/system/geo/timezones/list.html index ef11085e8..f3724b53d 100644 --- a/apps/Core/Views/Default/html/system/geo/timezones/list.html +++ b/apps/Core/Views/Default/html/system/geo/timezones/list.html @@ -43,8 +43,8 @@ 'dtStateSave' : false, 'dtBordered' : false, 'dtHideIdColumn' : true, - 'dtNoOfColumnsToShow' : 8, + 'dtNoOfColumnsToShow' : 6, 'dtTableCompact' : true, - 'dtZeroRecords' : 'No timezones data available. Make sure timezone is installed and enabled or add city by clicking the Add new city button.' + 'dtZeroRecords' : 'No timezones data available. Add timezone by clicking the add new timezone button.' ] )}} \ No newline at end of file diff --git a/apps/Core/Views/Default/html/system/geo/timezones/widgets/worldclock/worldclock.html b/apps/Core/Views/Default/html/system/geo/timezones/widgets/worldclock/worldclock.html index 8acb0256b..71eef5a56 100644 --- a/apps/Core/Views/Default/html/system/geo/timezones/widgets/worldclock/worldclock.html +++ b/apps/Core/Views/Default/html/system/geo/timezones/widgets/worldclock/worldclock.html @@ -1,6 +1,6 @@ {% if widget['data']['settings']['clocks'] is defined %}
-
+
{% for clock in widget['data']['settings']['clocks'] %} @@ -60,7 +60,7 @@
Please edit widget and a )}} {% set widgetsData = json_encode(widget, 16) %}