SettingsService.php 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  1. <?php
  2. namespace Core\App\Service;
  3. class SettingsService
  4. {
  5. protected $settingsRepository;
  6. public function __construct(
  7. \Core\App\Repository\Marketplace\SettingsInterface $settingsRepository
  8. )
  9. {
  10. $this->settingsRepository = $settingsRepository;
  11. }
  12. public function getSyncDataTypes()
  13. {
  14. return $this->settingsRepository->getSyncDataTypes();
  15. }
  16. public function getPdlGestiuni(\Core\App\Repository\Facturis\StockInterface $facturisStockRepository)
  17. {
  18. return $facturisStockRepository->getPdlGestiuni();
  19. }
  20. public function getPdls(\Core\App\Repository\Facturis\StockInterface $facturisStockRepository)
  21. {
  22. return $facturisStockRepository->getPdls();
  23. }
  24. public function getOptions()
  25. {
  26. return $this->settingsRepository->getSyncOptions();
  27. }
  28. public function getAuth()
  29. {
  30. return $this->settingsRepository->getSyncAuth();
  31. }
  32. public function testAuth(\Core\App\Repository\Facturis\StockInterface $facturisStockRepository)
  33. {
  34. $facturisStockRepository->testAuth();
  35. }
  36. public function getVersionLink()
  37. {
  38. return $this->settingsRepository->getVersionLink();
  39. }
  40. public function getVersion()
  41. {
  42. return $this->settingsRepository->getVersion();
  43. }
  44. public function getSyncOrdersAs()
  45. {
  46. return $this->settingsRepository->getSyncOrdersAs();
  47. }
  48. public function getAutoSyncOptions()
  49. {
  50. return $this->settingsRepository->getAutoSyncOptions();
  51. }
  52. public function getDocUpdOptions()
  53. {
  54. return $this->settingsRepository->getDocUpdOptions();
  55. }
  56. public function getShowObsOptions()
  57. {
  58. return $this->settingsRepository->getShowObsOptions();
  59. }
  60. public function checkLatestVersion($language)
  61. {
  62. $this->settingsRepository->checkLatestVersion($language);
  63. }
  64. public function getEnabledDisabledOptions()
  65. {
  66. return $this->settingsRepository->getEnabledDisabledOptions();
  67. }
  68. public function showTutorial()
  69. {
  70. $authData = $this->settingsRepository->getSyncAuth();
  71. if(
  72. empty($authData['fsync_auth_apikey']) ||
  73. empty($authData['fsync_auth_username']) ||
  74. empty($authData['fsync_auth_password']) ||
  75. empty($authData['fsync_auth_fiscalcode'])
  76. )
  77. {
  78. return true;
  79. }
  80. else
  81. {
  82. return false;
  83. }
  84. }
  85. }