diff --git a/interface/modules/zend_modules/module/Installer/src/Installer/Controller/InstallerController.php b/interface/modules/zend_modules/module/Installer/src/Installer/Controller/InstallerController.php index 88b94900be5..4b5dccd19ae 100644 --- a/interface/modules/zend_modules/module/Installer/src/Installer/Controller/InstallerController.php +++ b/interface/modules/zend_modules/module/Installer/src/Installer/Controller/InstallerController.php @@ -96,9 +96,10 @@ private function scanAndRegisterCustomModules(): void $baseModuleDir = $GLOBALS['baseModDir']; $customDir = $GLOBALS['customModDir']; $zendModDir = $GLOBALS['zendModDir']; + $coreModules = ['Application', 'Acl', 'Installer', 'FHIR', 'PatientFlowBoard']; + $allModules = array(); $result = $this->getInstallerTable()->allModules(); - $allModules = array(); foreach ($result as $dataArray) { $mod = new InstModule(); $mod->exchangeArray($dataArray); @@ -107,34 +108,44 @@ private function scanAndRegisterCustomModules(): void $allModules[] = $mod; } - $dpath = $GLOBALS['srcdir'] . "/../$baseModuleDir$customDir/"; - $dp = opendir($dpath); - $inDir = array(); - for ($i = 0; false != ($fname = readdir($dp)); $i++) { - if ($fname != "." && $fname != ".." && $fname != "Application" && is_dir($dpath . $fname)) { - $inDir[$i] = $fname; + $dir_path = $GLOBALS['srcdir'] . "/../$baseModuleDir$customDir/"; + $dp = opendir($dir_path); + $inDirCustom = array(); + for ($i = 0; false != ($file_name = readdir($dp)); $i++) { + if ($file_name != "." && $file_name != ".." && $file_name != "Application" && is_dir($dir_path . $file_name)) { + $inDirCustom[$i] = $file_name; + } + } + /* Laminas directory Unregistered scan */ + $dir_path = $GLOBALS['srcdir'] . "/../$baseModuleDir$zendModDir/module"; + $dp = opendir($dir_path); + $inDirLaminas = array(); + for ($i = 0; false != ($file_name = readdir($dp)); $i++) { + if ($file_name != "." && $file_name != ".." && (!in_array($file_name, $coreModules)) && is_dir($dir_path . "/" . $file_name)) { + $inDirLaminas[$i] = $file_name; } } // do not show registered modules in the unregistered list if (sizeof($allModules) > 0) { foreach ($allModules as $modules) { - $key = array_search($modules->modDirectory, $inDir); + $key = array_search($modules->modDirectory, $inDirLaminas); if ($key !== false) { - unset($inDir[$key]); + unset($inDirLaminas[$key]); + continue; + } + $key = array_search($modules->modDirectory, $inDirCustom); + if ($key !== false) { + unset($inDirCustom[$key]); } } } - foreach ($inDir as $fname) { - $form_title_file = @file($GLOBALS['srcdir'] . "/../$baseModuleDir$customDir/$fname/info.txt"); - if ($form_title_file) { - $form_title = trim($form_title_file[0]); - } else { - $form_title = $fname; - } - $rel_path = $fname . "/index.php"; - if ($this->getInstallerTable()->register($fname, $rel_path)) { - $status = true; - } + foreach ($inDirLaminas as $file_name) { + $rel_path = $file_name . "/index.php"; + $status = $this->getInstallerTable()->register($file_name, $rel_path, 0, $zendModDir); + } + foreach ($inDirCustom as $file_name) { + $rel_path = $file_name . "/index.php"; + $status = $this->getInstallerTable()->register($file_name, $rel_path); } } diff --git a/interface/modules/zend_modules/module/Installer/view/installer/installer/configure.phtml b/interface/modules/zend_modules/module/Installer/view/installer/installer/configure.phtml index 2038d2a9505..4b0d390da2d 100644 --- a/interface/modules/zend_modules/module/Installer/view/installer/installer/configure.phtml +++ b/interface/modules/zend_modules/module/Installer/view/installer/installer/configure.phtml @@ -15,7 +15,7 @@ // Warning : PoC code // TBD - Must handle modules in external namespaces -Use OpenEMR\Modules; +use OpenEMR\Modules; $listener = $this->listenerObject; $hangers = $this->hangers; @@ -199,11 +199,9 @@ if (count($TabSettings ?? []) > 0) { ?> // TBD : clsOeModule $rs_mod = sqlQuery('select * from modules where `mod_id` = ?', [$mod_id]); $fConfig = dirname(realpath('.')) . '/custom_modules/' . $rs_mod['mod_directory'] . '/moduleConfig.php'; - if (($rs_mod['type'] == 0) && file_exists($fConfig)) { - ?> + if (($rs_mod['type'] == 0) && file_exists($fConfig)) { ?>
-
0) { ?>
z_xlt('No Configuration Defined for this Module'); ?>
- coreModules ?? []; table { font-family: Arial, Helvetica, sans-serif; - font-size: 1rem; } .fa-2x { @@ -65,7 +64,7 @@ $coreModules = $this->coreModules ?? []; padding: 5px; text-align: center; cursor: pointer; - margin: 5px 5px 0px 0px; + margin: 5px 5px 0 0; color: gray; width: 97%; } @@ -76,7 +75,7 @@ $coreModules = $this->coreModules ?? []; border: 1px solid #c9c6c6; padding: 5px; width: 95%; - border-top: 0px; + border-top: 0; } .modal { @@ -112,58 +111,7 @@ $coreModules = $this->coreModules ?? []; 0) { - foreach ($InstallersExisting as $modules) { - $key = ""; - $key = array_search($modules->modDirectory, $inDir); /* returns integer or FALSE */ - if ($key !== false) - unset($inDir[$key]); - } - } - foreach ($inDir as $fname) { - $slno++; ?> - - escapeHtml($slno); ?> - - escapeHtml($listener->z_xlt($form_title)); - ?> - - -- - -- - -- - - z_xlt('Laminas'); ?> - - -- - - - - -- - - coreModules ?? []; sqlRun == 0) { ?> - z_xlt('Not Installed'); ?> + z_xlt('Registered'); ?> modActive == 1) { ?> z_xlt('Active'); ?> @@ -296,8 +244,7 @@ $coreModules = $this->coreModules ?? []; sqlRun == 0) { - ?> + if ($moduleResult->sqlRun == 0) { ?>