From d85980274c25cf8775de79109715431e654981d5 Mon Sep 17 00:00:00 2001 From: Praesidiarius Date: Sat, 1 Feb 2020 18:43:41 +0100 Subject: [PATCH] correct version --- composer.json | 2 +- .../src/Controller/CoreEntityController.php | 6 + .../src/Controller/CoreExportController.php | 19 +- .../src/Controller/CoreSearchController.php | 2 + module/Application/src/Module.php | 4 +- .../view/layout/layout-ablepro.phtml | 318 ------------------ .../view/layout/layout-default.phtml | 2 +- module/Application/view/partial/nav.phtml | 3 + public/js/listener.js | 4 +- 9 files changed, 29 insertions(+), 331 deletions(-) delete mode 100644 module/Application/view/layout/layout-ablepro.phtml diff --git a/composer.json b/composer.json index 7b5d9f3..b080697 100644 --- a/composer.json +++ b/composer.json @@ -2,7 +2,7 @@ "name": "oneplace/oneplace-core", "description": "onePlace Core Application", "type": "project", - "version": "1.0.7", + "version": "1.0.8", "license": "BSD-3-Clause", "keywords": [ "laminas", diff --git a/module/Application/src/Controller/CoreEntityController.php b/module/Application/src/Controller/CoreEntityController.php index 28295a6..a8d9a11 100644 --- a/module/Application/src/Controller/CoreEntityController.php +++ b/module/Application/src/Controller/CoreEntityController.php @@ -135,6 +135,9 @@ protected function generateAddView($sKey,$sSingleForm = '') { # Save Multiselect $this->updateMultiSelectFields($_REQUEST,$oSkeletonBasedObject,$sKey.'-single'); + # Add XP for creating a new entity + CoreController::$oSession->oUser->addXP($sKey.'-add'); + # Log Performance in DB $aMeasureEnd = getrusage(); $this->logPerfomance($sKey.'-save',$this->rutime($aMeasureEnd,CoreController::$aPerfomanceLogStart,"utime"),$this->rutime($aMeasureEnd,CoreController::$aPerfomanceLogStart,"stime")); @@ -257,6 +260,9 @@ public function generateEditView($sKey,$sSingleForm = '') { # Save Multiselect $this->updateMultiSelectFields($aFormData,$oSkeleton,$sKey.'-single'); + # Add XP for creating a new entity + CoreController::$oSession->oUser->addXP($sKey.'-edit'); + # Log Performance in DB $aMeasureEnd = getrusage(); $this->logPerfomance($sKey.'-save',$this->rutime($aMeasureEnd,CoreController::$aPerfomanceLogStart,"utime"),$this->rutime($aMeasureEnd,CoreController::$aPerfomanceLogStart,"stime")); diff --git a/module/Application/src/Controller/CoreExportController.php b/module/Application/src/Controller/CoreExportController.php index 0e57e3b..0376c3b 100644 --- a/module/Application/src/Controller/CoreExportController.php +++ b/module/Application/src/Controller/CoreExportController.php @@ -60,7 +60,7 @@ public function __construct(AdapterInterface $oDbAdapter,$oTableGateway,$oServic * @return array * @since 1.0.5 */ - public function exportSkeletonBasedData($sTitle,$sKey) { + public function exportData($sTitle,$sKey) { $this->sSingleForm = $sKey.'-single'; # set dump export mode @@ -69,13 +69,13 @@ public function exportSkeletonBasedData($sTitle,$sKey) { # Set document properties $spreadsheet->getProperties() - ->setCreator('Maarten Balliauw') - ->setLastModifiedBy('Maarten Balliauw') + ->setCreator(CoreController::$oSession->oUser->getLabel()) + ->setLastModifiedBy(CoreController::$oSession->oUser->getLabel()) ->setTitle($sTitle) - ->setSubject('Export of all Skeleton Data') - ->setDescription('This file contains all data of module article and its entities') - ->setKeywords('skeleton export') - ->setCategory('Skeleton Export'); + ->setSubject('Export of all '.$sTitle.' Data') + ->setDescription('This file contains all data of module '.$sTitle) + ->setKeywords($sKey.' export') + ->setCategory($sTitle.' Export'); # Add some data $spreadsheet->setActiveSheetIndex(0); @@ -200,10 +200,13 @@ public function exportSkeletonBasedData($sTitle,$sKey) { $writer = new Xlsx($spreadsheet); $writer->save($sPath); + # Add XP for creating an export + CoreController::$oSession->oUser->addXP($sKey.'-export'); + sleep(1); return [ - 'href'=>'/data/skeleton/export/test.xlsx', + 'href'=>'/data/'.$sKey.'/export/test-core.xlsx', 'label'=>'Download Excel File', 'icon'=>'fas fa-download', 'class'=>'btn-primary', diff --git a/module/Application/src/Controller/CoreSearchController.php b/module/Application/src/Controller/CoreSearchController.php index 03e959d..6a51de8 100644 --- a/module/Application/src/Controller/CoreSearchController.php +++ b/module/Application/src/Controller/CoreSearchController.php @@ -66,6 +66,8 @@ public function __construct(AdapterInterface $oDbAdapter,$oTableGateway,$oServic * @since 1.0.5 */ public function generateSearchView($sKey) { + $this->sSingleForm = $sKey.'-single'; + # Set Layout based on users theme $this->setThemeBasedLayout($sKey); diff --git a/module/Application/src/Module.php b/module/Application/src/Module.php index 9449346..2403465 100644 --- a/module/Application/src/Module.php +++ b/module/Application/src/Module.php @@ -24,9 +24,9 @@ class Module { /** * Module Version * - * @since 1.0.7 + * @since 1.0.8 */ - const VERSION = '1.0.7'; + const VERSION = '1.0.8'; public function getConfig() : array { return include __DIR__ . '/../config/module.config.php'; diff --git a/module/Application/view/layout/layout-ablepro.phtml b/module/Application/view/layout/layout-ablepro.phtml deleted file mode 100644 index 8cc854c..0000000 --- a/module/Application/view/layout/layout-ablepro.phtml +++ /dev/null @@ -1,318 +0,0 @@ - - - - - - - headTitle('onePlace X - RC 1')->setSeparator(' - ')->setAutoEscape(false) ?> - - headMeta() - ->appendName('viewport', 'width=device-width, initial-scale=1.0') - ->appendHttpEquiv('X-UA-Compatible', 'IE=edge') - ?> - - - headLink(['rel' => 'shortcut icon', 'type' => 'image/vnd.microsoft.icon', 'href' => $this->basePath() . '/img/favicon.ico']) - ->prependStylesheet($this->basePath('themes/ablepro/css/style.css')) - ->prependStylesheet($this->basePath('vendor/select2/css/select2.min.css')) - ->prependStylesheet($this->basePath('vendor/fontawesome/css/all.min.css')) - ?> - - - - - - - inlineScript() - ->prependFile($this->basePath('vendor/select2/js/select2.full.min.js')) - ->prependFile($this->basePath('js/jquery-3.4.1.min.js')) - ?> - - - -
-
-
-
-
- - - - - - - - - - - -
-
- - - - -
-
-
- content ?> -
-
-
- -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/module/Application/view/layout/layout-default.phtml b/module/Application/view/layout/layout-default.phtml index 2683187..976eed3 100644 --- a/module/Application/view/layout/layout-default.phtml +++ b/module/Application/view/layout/layout-default.phtml @@ -19,6 +19,7 @@ use Application\Controller\CoreController; ->prependStylesheet($this->basePath('css/style.css')) ->prependStylesheet($this->basePath('vendor/summernote/summernote-bs4.min.css')) ->prependStylesheet($this->basePath('vendor/fontawesome/css/all.min.css')) + ->prependStylesheet($this->basePath('vendor/filepond/filepond-plugin-image-preview.min.css')) ->prependStylesheet($this->basePath('vendor/filepond/filepond.css')) ->prependStylesheet($this->basePath('vendor/apexcharts/css/apexcharts.css')) ->prependStylesheet($this->basePath('vendor/select2/css/select2.min.css')) @@ -26,7 +27,6 @@ use Application\Controller\CoreController; ->prependStylesheet($this->basePath('css/bootstrap.min.css')) ?> - inlineScript() diff --git a/module/Application/view/partial/nav.phtml b/module/Application/view/partial/nav.phtml index 8f6d2bf..9582565 100644 --- a/module/Application/view/partial/nav.phtml +++ b/module/Application/view/partial/nav.phtml @@ -14,6 +14,9 @@ if(is_object(CoreController::$oSession->oUser)) { if(count($aInfo) == 0) { $aInfo = ['index'=>(object)['nav_label'=>'Home','nav_href'=>'/']]; } + if($aInfo['index']->show_in_menu != 1) { + continue; + } # check if we are on active node $sActive = ('/'.strtolower($this->sRouteName) == strtolower($aInfo['index']->nav_href)) ? ' active' : ''; # home is special case .. diff --git a/public/js/listener.js b/public/js/listener.js index 38ff337..2cec0d9 100644 --- a/public/js/listener.js +++ b/public/js/listener.js @@ -17,7 +17,9 @@ $(function () { showConfirmButton: false }); - $.post('/skeleton/export/dump',{},function(retVal) { + var modBase = $(this).attr('href'); + + $.post(modBase+'/export/dump',{},function(retVal) { Swal.close(); Swal.fire({ icon: 'success',