mirror of
https://github.com/Karaka-Management/oms-Exchange.git
synced 2026-02-14 16:58:42 +00:00
doc fixes
This commit is contained in:
parent
0628ff57c0
commit
85112ac46d
|
|
@ -29,14 +29,6 @@ final class Exporter extends ExporterAbstract
|
||||||
{
|
{
|
||||||
use ExchangeTrait;
|
use ExchangeTrait;
|
||||||
|
|
||||||
/**
|
|
||||||
* Account
|
|
||||||
*
|
|
||||||
* @var int
|
|
||||||
* @since 1.0.0
|
|
||||||
*/
|
|
||||||
private int $account = 1;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Export all data in time span
|
* Export all data in time span
|
||||||
*
|
*
|
||||||
|
|
|
||||||
|
|
@ -29,14 +29,6 @@ final class Importer extends ImporterAbstract
|
||||||
{
|
{
|
||||||
use ExchangeTrait;
|
use ExchangeTrait;
|
||||||
|
|
||||||
/**
|
|
||||||
* Account
|
|
||||||
*
|
|
||||||
* @var int
|
|
||||||
* @since 1.0.0
|
|
||||||
*/
|
|
||||||
private int $account = 1;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Import all data in time span
|
* Import all data in time span
|
||||||
*
|
*
|
||||||
|
|
|
||||||
|
|
@ -24,7 +24,6 @@ return [
|
||||||
'Type' => 'Type',
|
'Type' => 'Type',
|
||||||
'Field' => 'Field',
|
'Field' => 'Field',
|
||||||
'Protocol' => 'Protocol',
|
'Protocol' => 'Protocol',
|
||||||
'Settings' => 'Settings',
|
|
||||||
'Import' => 'Import',
|
'Import' => 'Import',
|
||||||
'Export' => 'Export',
|
'Export' => 'Export',
|
||||||
'Connection' => 'Connection',
|
'Connection' => 'Connection',
|
||||||
|
|
|
||||||
|
|
@ -15,6 +15,7 @@ declare(strict_types=1);
|
||||||
namespace Modules\Exchange\Admin;
|
namespace Modules\Exchange\Admin;
|
||||||
|
|
||||||
use Modules\Exchange\Models\InterfaceManager;
|
use Modules\Exchange\Models\InterfaceManager;
|
||||||
|
use Modules\Exchange\Models\NullInterfaceManager;
|
||||||
use phpOMS\Application\ApplicationAbstract;
|
use phpOMS\Application\ApplicationAbstract;
|
||||||
use phpOMS\Config\SettingsInterface;
|
use phpOMS\Config\SettingsInterface;
|
||||||
use phpOMS\Message\Http\HttpRequest;
|
use phpOMS\Message\Http\HttpRequest;
|
||||||
|
|
@ -49,6 +50,10 @@ final class Installer extends InstallerAbstract
|
||||||
parent::install($app, $info, $cfgHandler);
|
parent::install($app, $info, $cfgHandler);
|
||||||
|
|
||||||
$interfaces = \scandir(__DIR__ . '/Install/Interfaces');
|
$interfaces = \scandir(__DIR__ . '/Install/Interfaces');
|
||||||
|
if ($interfaces === false) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
foreach ($interfaces as $interface) {
|
foreach ($interfaces as $interface) {
|
||||||
if (!\is_dir(__DIR__ . '/Install/Interfaces/' . $interface)
|
if (!\is_dir(__DIR__ . '/Install/Interfaces/' . $interface)
|
||||||
|| $interface === '.'
|
|| $interface === '.'
|
||||||
|
|
@ -79,7 +84,15 @@ final class Installer extends InstallerAbstract
|
||||||
$response = new HttpResponse();
|
$response = new HttpResponse();
|
||||||
$request = new HttpRequest(new HttpUri(''));
|
$request = new HttpRequest(new HttpUri(''));
|
||||||
|
|
||||||
$data = \json_decode(\file_get_contents($path . '/interface.json'), true);
|
$contents = \file_get_contents($path . '/interface.json');
|
||||||
|
if ($contents === false) {
|
||||||
|
return new NullInterfaceManager();
|
||||||
|
}
|
||||||
|
|
||||||
|
$data = \json_decode($contents, true);
|
||||||
|
if (!\is_array($data)) {
|
||||||
|
return new NullInterfaceManager();
|
||||||
|
}
|
||||||
|
|
||||||
$request->header->account = 1;
|
$request->header->account = 1;
|
||||||
$request->setData('title', $data['name']);
|
$request->setData('title', $data['name']);
|
||||||
|
|
@ -92,6 +105,10 @@ final class Installer extends InstallerAbstract
|
||||||
}
|
}
|
||||||
|
|
||||||
$exchangeFiles = \scandir($path);
|
$exchangeFiles = \scandir($path);
|
||||||
|
if ($exchangeFiles === false) {
|
||||||
|
return new NullInterfaceManager();
|
||||||
|
}
|
||||||
|
|
||||||
foreach ($exchangeFiles as $filePath) {
|
foreach ($exchangeFiles as $filePath) {
|
||||||
if ($filePath === '..' || $filePath === '.') {
|
if ($filePath === '..' || $filePath === '.') {
|
||||||
continue;
|
continue;
|
||||||
|
|
@ -99,6 +116,10 @@ final class Installer extends InstallerAbstract
|
||||||
|
|
||||||
if (\is_dir($path . '/' . $filePath)) {
|
if (\is_dir($path . '/' . $filePath)) {
|
||||||
$subdir = \scandir($path . '/' . $filePath);
|
$subdir = \scandir($path . '/' . $filePath);
|
||||||
|
if ($subdir === false) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
foreach ($subdir as $subPath) {
|
foreach ($subdir as $subPath) {
|
||||||
if (!\is_file($path . '/' . $filePath . '/' . $subPath)) {
|
if (!\is_file($path . '/' . $filePath . '/' . $subPath)) {
|
||||||
continue;
|
continue;
|
||||||
|
|
|
||||||
|
|
@ -16,7 +16,7 @@ Generally, the development philosophy is result orientated. This means that anyo
|
||||||
|
|
||||||
Developers are encouraged to pick open tasks with high priorities according to their own skill level. Senior developers may directly assign tasks to developers based on their importance. New developers may find it easier to start with a task that has a low priority as they often also have a lower difficulty.
|
Developers are encouraged to pick open tasks with high priorities according to their own skill level. Senior developers may directly assign tasks to developers based on their importance. New developers may find it easier to start with a task that has a low priority as they often also have a lower difficulty.
|
||||||
|
|
||||||
Open tasks can be found in the project overview: [PROJECT.md](../Project/PROJECT.md)
|
Open tasks can be found in the project overview: [PROJECT.md](https://github.com/Karaka-Management/Organization-Guide/blob/master/Project/PROJECT.md)
|
||||||
|
|
||||||
Tasks currently in development are prefixed in the priority column with an asterisk `*` and a name tag in the task description of the developer who is working on the task.
|
Tasks currently in development are prefixed in the priority column with an asterisk `*` and a name tag in the task description of the developer who is working on the task.
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -60,7 +60,7 @@ final class ApiController extends Controller
|
||||||
*
|
*
|
||||||
* @since 1.0.0
|
* @since 1.0.0
|
||||||
*/
|
*/
|
||||||
public function apiExchangeImport(RequestAbstract $request, ResponseAbstract $response, $data = null) : void
|
public function apiExchangeImport(RequestAbstract $request, ResponseAbstract $response, mixed $data = null) : void
|
||||||
{
|
{
|
||||||
$import = $this->importDataFromRequest($request);
|
$import = $this->importDataFromRequest($request);
|
||||||
$status = NotificationLevel::ERROR;
|
$status = NotificationLevel::ERROR;
|
||||||
|
|
@ -93,6 +93,8 @@ final class ApiController extends Controller
|
||||||
*/
|
*/
|
||||||
private function importDataFromRequest(RequestAbstract $request) : array
|
private function importDataFromRequest(RequestAbstract $request) : array
|
||||||
{
|
{
|
||||||
|
$importer = null;
|
||||||
|
|
||||||
/** @var \Modules\Exchange\Models\InterfaceManager $interface */
|
/** @var \Modules\Exchange\Models\InterfaceManager $interface */
|
||||||
$interface = InterfaceManagerMapper::get()
|
$interface = InterfaceManagerMapper::get()
|
||||||
->with('source')
|
->with('source')
|
||||||
|
|
@ -131,7 +133,7 @@ final class ApiController extends Controller
|
||||||
}
|
}
|
||||||
|
|
||||||
/** @var \Modules\Exchange\Models\ImporterAbstract $importer */
|
/** @var \Modules\Exchange\Models\ImporterAbstract $importer */
|
||||||
return $importer->importFromRequest($request);
|
return $importer === null ? [] : $importer->importFromRequest($request);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -168,7 +170,7 @@ final class ApiController extends Controller
|
||||||
*
|
*
|
||||||
* @since 1.0.0
|
* @since 1.0.0
|
||||||
*/
|
*/
|
||||||
public function apiInterfaceInstall(RequestAbstract $request, ResponseAbstract $response, $data = null) : void
|
public function apiInterfaceInstall(RequestAbstract $request, ResponseAbstract $response, mixed $data = null) : void
|
||||||
{
|
{
|
||||||
$uploadedFiles = $request->getFiles();
|
$uploadedFiles = $request->getFiles();
|
||||||
$files = [];
|
$files = [];
|
||||||
|
|
@ -276,7 +278,7 @@ final class ApiController extends Controller
|
||||||
*
|
*
|
||||||
* @since 1.0.0
|
* @since 1.0.0
|
||||||
*/
|
*/
|
||||||
public function apiExchangeExport(RequestAbstract $request, HttpResponse $response, $data = null) : void
|
public function apiExchangeExport(RequestAbstract $request, HttpResponse $response, mixed $data = null) : void
|
||||||
{
|
{
|
||||||
$export = $this->exportDataFromRequest($request);
|
$export = $this->exportDataFromRequest($request);
|
||||||
|
|
||||||
|
|
@ -329,6 +331,8 @@ final class ApiController extends Controller
|
||||||
*/
|
*/
|
||||||
private function exportDataFromRequest(RequestAbstract $request) : array
|
private function exportDataFromRequest(RequestAbstract $request) : array
|
||||||
{
|
{
|
||||||
|
$exporter = null;
|
||||||
|
|
||||||
/** @var \Modules\Exchange\Models\InterfaceManager $interface */
|
/** @var \Modules\Exchange\Models\InterfaceManager $interface */
|
||||||
$interface = InterfaceManagerMapper::get()
|
$interface = InterfaceManagerMapper::get()
|
||||||
->with('source')
|
->with('source')
|
||||||
|
|
@ -354,7 +358,7 @@ final class ApiController extends Controller
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return $exporter->exportFromRequest($request);
|
return $exporter === null ? [] : $exporter->exportFromRequest($request);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -370,7 +374,7 @@ final class ApiController extends Controller
|
||||||
*
|
*
|
||||||
* @since 1.0.0
|
* @since 1.0.0
|
||||||
*/
|
*/
|
||||||
public function apiExchangeSettingCreate(RequestAbstract $request, HttpResponse $response, $data = null) : void
|
public function apiExchangeSettingCreate(RequestAbstract $request, HttpResponse $response, mixed $data = null) : void
|
||||||
{
|
{
|
||||||
if (!empty($val = $this->validateSettingCreate($request))) {
|
if (!empty($val = $this->validateSettingCreate($request))) {
|
||||||
$response->set('setting_create', new FormValidation($val));
|
$response->set('setting_create', new FormValidation($val));
|
||||||
|
|
|
||||||
|
|
@ -44,7 +44,7 @@ final class BackendController extends Controller
|
||||||
* @since 1.0.0
|
* @since 1.0.0
|
||||||
* @codeCoverageIgnore
|
* @codeCoverageIgnore
|
||||||
*/
|
*/
|
||||||
public function viewExchangeLogList(RequestAbstract $request, ResponseAbstract $response, $data = null) : RenderableInterface
|
public function viewExchangeLogList(RequestAbstract $request, ResponseAbstract $response, mixed $data = null) : RenderableInterface
|
||||||
{
|
{
|
||||||
$view = new View($this->app->l11nManager, $request, $response);
|
$view = new View($this->app->l11nManager, $request, $response);
|
||||||
$view->setTemplate('/Modules/Exchange/Theme/Backend/exchange-log-list');
|
$view->setTemplate('/Modules/Exchange/Theme/Backend/exchange-log-list');
|
||||||
|
|
@ -79,7 +79,7 @@ final class BackendController extends Controller
|
||||||
* @since 1.0.0
|
* @since 1.0.0
|
||||||
* @codeCoverageIgnore
|
* @codeCoverageIgnore
|
||||||
*/
|
*/
|
||||||
public function viewExchangeLog(RequestAbstract $request, ResponseAbstract $response, $data = null) : RenderableInterface
|
public function viewExchangeLog(RequestAbstract $request, ResponseAbstract $response, mixed $data = null) : RenderableInterface
|
||||||
{
|
{
|
||||||
$view = new View($this->app->l11nManager, $request, $response);
|
$view = new View($this->app->l11nManager, $request, $response);
|
||||||
$view->setTemplate('/Modules/Exchange/Theme/Backend/exchange-log');
|
$view->setTemplate('/Modules/Exchange/Theme/Backend/exchange-log');
|
||||||
|
|
@ -103,7 +103,7 @@ final class BackendController extends Controller
|
||||||
* @since 1.0.0
|
* @since 1.0.0
|
||||||
* @codeCoverageIgnore
|
* @codeCoverageIgnore
|
||||||
*/
|
*/
|
||||||
public function viewExchangeExportList(RequestAbstract $request, ResponseAbstract $response, $data = null) : RenderableInterface
|
public function viewExchangeExportList(RequestAbstract $request, ResponseAbstract $response, mixed $data = null) : RenderableInterface
|
||||||
{
|
{
|
||||||
$view = new View($this->app->l11nManager, $request, $response);
|
$view = new View($this->app->l11nManager, $request, $response);
|
||||||
$view->setTemplate('/Modules/Exchange/Theme/Backend/exchange-export-list');
|
$view->setTemplate('/Modules/Exchange/Theme/Backend/exchange-export-list');
|
||||||
|
|
@ -136,7 +136,7 @@ final class BackendController extends Controller
|
||||||
* @since 1.0.0
|
* @since 1.0.0
|
||||||
* @codeCoverageIgnore
|
* @codeCoverageIgnore
|
||||||
*/
|
*/
|
||||||
public function viewExchangeImportList(RequestAbstract $request, ResponseAbstract $response, $data = null) : RenderableInterface
|
public function viewExchangeImportList(RequestAbstract $request, ResponseAbstract $response, mixed $data = null) : RenderableInterface
|
||||||
{
|
{
|
||||||
$view = new View($this->app->l11nManager, $request, $response);
|
$view = new View($this->app->l11nManager, $request, $response);
|
||||||
$view->setTemplate('/Modules/Exchange/Theme/Backend/exchange-import-list');
|
$view->setTemplate('/Modules/Exchange/Theme/Backend/exchange-import-list');
|
||||||
|
|
@ -169,7 +169,7 @@ final class BackendController extends Controller
|
||||||
* @since 1.0.0
|
* @since 1.0.0
|
||||||
* @codeCoverageIgnore
|
* @codeCoverageIgnore
|
||||||
*/
|
*/
|
||||||
public function viewExchangeExport(RequestAbstract $request, ResponseAbstract $response, $data = null) : RenderableInterface
|
public function viewExchangeExport(RequestAbstract $request, ResponseAbstract $response, mixed $data = null) : RenderableInterface
|
||||||
{
|
{
|
||||||
$view = new View($this->app->l11nManager, $request, $response);
|
$view = new View($this->app->l11nManager, $request, $response);
|
||||||
$view->setTemplate('/Modules/Exchange/Theme/Backend/exchange-export');
|
$view->setTemplate('/Modules/Exchange/Theme/Backend/exchange-export');
|
||||||
|
|
@ -206,7 +206,7 @@ final class BackendController extends Controller
|
||||||
* @since 1.0.0
|
* @since 1.0.0
|
||||||
* @codeCoverageIgnore
|
* @codeCoverageIgnore
|
||||||
*/
|
*/
|
||||||
public function viewExchangeImport(RequestAbstract $request, ResponseAbstract $response, $data = null) : RenderableInterface
|
public function viewExchangeImport(RequestAbstract $request, ResponseAbstract $response, mixed $data = null) : RenderableInterface
|
||||||
{
|
{
|
||||||
$view = new View($this->app->l11nManager, $request, $response);
|
$view = new View($this->app->l11nManager, $request, $response);
|
||||||
$view->setTemplate('/Modules/Exchange/Theme/Backend/exchange-import');
|
$view->setTemplate('/Modules/Exchange/Theme/Backend/exchange-import');
|
||||||
|
|
|
||||||
|
|
@ -71,7 +71,7 @@ final class ExchangeLogMapper extends DataMapperFactory
|
||||||
/**
|
/**
|
||||||
* Belongs to.
|
* Belongs to.
|
||||||
*
|
*
|
||||||
* @var array<string, array{mapper:string, external:string}>
|
* @var array<string, array{mapper:string, external:string, column?:string, by?:string}>
|
||||||
* @since 1.0.0
|
* @since 1.0.0
|
||||||
*/
|
*/
|
||||||
public const BELONGS_TO = [
|
public const BELONGS_TO = [
|
||||||
|
|
|
||||||
|
|
@ -81,7 +81,7 @@ class ExchangeSetting implements \JsonSerializable
|
||||||
/**
|
/**
|
||||||
* Set data.
|
* Set data.
|
||||||
*
|
*
|
||||||
* @param int $data Data
|
* @param array $data Data
|
||||||
*
|
*
|
||||||
* @return void
|
* @return void
|
||||||
*
|
*
|
||||||
|
|
|
||||||
|
|
@ -106,7 +106,7 @@ class InterfaceManager
|
||||||
/**
|
/**
|
||||||
* Settings.
|
* Settings.
|
||||||
*
|
*
|
||||||
* @var ExchangeSettings[]
|
* @var ExchangeSetting[]
|
||||||
* @since 1.0.0
|
* @since 1.0.0
|
||||||
*/
|
*/
|
||||||
protected array $settings = [];
|
protected array $settings = [];
|
||||||
|
|
|
||||||
|
|
@ -65,7 +65,7 @@ final class InterfaceManagerMapper extends DataMapperFactory
|
||||||
/**
|
/**
|
||||||
* Belongs to.
|
* Belongs to.
|
||||||
*
|
*
|
||||||
* @var array<string, array{mapper:string, external:string}>
|
* @var array<string, array{mapper:string, external:string, column?:string, by?:string}>
|
||||||
* @since 1.0.0
|
* @since 1.0.0
|
||||||
*/
|
*/
|
||||||
public const BELONGS_TO = [
|
public const BELONGS_TO = [
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user