| 1 |
<?php |
| 2 |
/** |
| 3 |
* @package VikBooking |
| 4 |
* @subpackage core |
| 5 |
* @author E4J s.r.l. |
| 6 |
* @copyright Copyright (C) 2021 E4J s.r.l. All Rights Reserved. |
| 7 |
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL |
| 8 |
* @link https://vikwp.com |
| 9 |
*/ |
| 10 |
|
| 11 |
// No direct access |
| 12 |
defined('ABSPATH') or die('No script kiddies please!'); |
| 13 |
|
| 14 |
/** |
| 15 |
* Wizard report ISPAT help instruction. |
| 16 |
* |
| 17 |
* @since 1.18.2 (J) - 1.8.2 (WP) |
| 18 |
*/ |
| 19 |
class VBOHelpWizardDriverReportsItalyIspat extends VBOHelpWizardInstructionaware |
| 20 |
{ |
| 21 |
use VBOHelpWizardTraitReportConfigurable; |
| 22 |
|
| 23 |
/** |
| 24 |
* Class contructor. |
| 25 |
*/ |
| 26 |
public function __construct() |
| 27 |
{ |
| 28 |
/** |
| 29 |
* @see VBOHelpWizardTraitReportConfigurable::$reportId |
| 30 |
*/ |
| 31 |
$this->reportId = 'istat_ispat'; |
| 32 |
|
| 33 |
/** |
| 34 |
* @see VBOHelpWizardTraitReportConfigurable::$autoExportFormat |
| 35 |
*/ |
| 36 |
$this->autoExportFormat = 'uploadC59Full'; |
| 37 |
|
| 38 |
/** |
| 39 |
* @see VBOHelpWizardTraitReportConfigurable::$autoExportPayload |
| 40 |
*/ |
| 41 |
$this->autoExportPayload = [ |
| 42 |
'fromdate' => '{Y-m-d -1 day}', |
| 43 |
'listings' => [], |
| 44 |
'_reportAction' => 'uploadC59Full', |
| 45 |
]; |
| 46 |
} |
| 47 |
|
| 48 |
/** |
| 49 |
* @inheritDoc |
| 50 |
*/ |
| 51 |
public function getID() |
| 52 |
{ |
| 53 |
return 'reports.italy.ispat'; |
| 54 |
} |
| 55 |
|
| 56 |
/** |
| 57 |
* @inheritDoc |
| 58 |
*/ |
| 59 |
public function getTitle() |
| 60 |
{ |
| 61 |
return 'Istituto di statistica della Provincia di Trento (ISPAT)'; |
| 62 |
} |
| 63 |
|
| 64 |
/** |
| 65 |
* @inheritDoc |
| 66 |
*/ |
| 67 |
public function getIcon() |
| 68 |
{ |
| 69 |
return VikBookingIcons::i('id-card'); |
| 70 |
} |
| 71 |
|
| 72 |
/** |
| 73 |
* @inheritDoc |
| 74 |
*/ |
| 75 |
public function getPriority() |
| 76 |
{ |
| 77 |
return 998; |
| 78 |
} |
| 79 |
|
| 80 |
/** |
| 81 |
* @inheritDoc |
| 82 |
*/ |
| 83 |
public function isSupported() |
| 84 |
{ |
| 85 |
$config = VBOFactory::getConfig(); |
| 86 |
|
| 87 |
// check whether the main country is Italy and the main province is Trento |
| 88 |
return $config->get('maincountry') === 'IT' && $config->get('mainstate') === 'TN'; |
| 89 |
} |
| 90 |
|
| 91 |
/** |
| 92 |
* @inheritDoc |
| 93 |
* |
| 94 |
* @see VBOHelpWizardTraitReportConfigurable::checkSettingsConfigured() |
| 95 |
*/ |
| 96 |
protected function checkSettingsConfigured() |
| 97 |
{ |
| 98 |
$settings = VBOFactory::getConfig()->getArray('report_settings_istat_ispat', []); |
| 99 |
|
| 100 |
return !empty($settings['propertyid']) && !empty($settings['user']) && !empty($settings['pwd']); |
| 101 |
} |
| 102 |
} |
| 103 |
|