|
@@ -220,6 +220,38 @@ class FormController
|
|
|
echo $result;
|
|
|
}
|
|
|
|
|
|
+ public function getPdls($db, $language)
|
|
|
+ {
|
|
|
+ $settingsRepository = new \MarketplaceRepository\SettingsRepository($db);
|
|
|
+ $settingsService = new \Core\App\Service\SettingsService(
|
|
|
+ $settingsRepository
|
|
|
+ );
|
|
|
+
|
|
|
+ $remoteStockRepository = new \Core\FacturisRepository\StockRepository(
|
|
|
+ $settingsRepository->getAuthApiKey(),
|
|
|
+ $settingsRepository->getAuthUsername(),
|
|
|
+ $settingsRepository->getAuthPassword(),
|
|
|
+ $settingsRepository->getAuthFiscalCode()
|
|
|
+ );
|
|
|
+
|
|
|
+ $pdl_gestiuni = $settingsService->getPdls($remoteStockRepository);
|
|
|
+
|
|
|
+ $result = '';
|
|
|
+ $result .= '<option value=""';
|
|
|
+ $result .= (isset($_GET['fsync_option_pdls']) && $_GET['fsync_option_pdls'] == '') ? ' selected="selected" ' : '';
|
|
|
+ $result .= ' >' . $language->get('filter_pdls_all') . '</option>';
|
|
|
+
|
|
|
+ if (!empty($pdl_gestiuni)) {
|
|
|
+ foreach ($pdl_gestiuni as $pdl_gestiune) {
|
|
|
+ $result .= '<option value=' . $pdl_gestiune['id'] . ' ';
|
|
|
+ $result .= (isset($_GET['fsync_option_pdls']) && $_GET['fsync_option_pdls'] == $pdl_gestiune['id']) ? ' selected="selected" ' : '';
|
|
|
+ $result .= ' >' . $pdl_gestiune['name'] . '</option>';
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ echo $result;
|
|
|
+ }
|
|
|
+
|
|
|
public function checkLatestVersion($db, $language)
|
|
|
{
|
|
|
$settingsRepository = new \MarketplaceRepository\SettingsRepository($db);
|