employees.php
3 days ago
index.html
3 days ago
locations.php
3 days ago
locwdays.php
3 days ago
options.php
3 days ago
packages.php
3 days ago
payments.php
3 days ago
services.php
3 days ago
subscriptions.php
3 days ago
syspack.php
3 days ago
syssubscr.php
3 days ago
system.php
3 days ago
taxes.php
3 days ago
syspack.php
103 lines
| 1 | <?php |
| 2 | /** |
| 3 | * @package VikAppointments |
| 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 | * Implement the wizard step used to setup the basic |
| 16 | * settings of the packages configuration. |
| 17 | * |
| 18 | * @since 1.7.1 |
| 19 | */ |
| 20 | class VAPWizardStepSyspack extends VAPWizardStep |
| 21 | { |
| 22 | /** |
| 23 | * Returns the step title. |
| 24 | * Used as a very-short description. |
| 25 | * |
| 26 | * @return string The step title. |
| 27 | */ |
| 28 | public function getTitle() |
| 29 | { |
| 30 | return JText::translate('VAP_WIZARD_STEP_SYSPACK'); |
| 31 | } |
| 32 | |
| 33 | /** |
| 34 | * Returns the step description. |
| 35 | * |
| 36 | * @return string The step description. |
| 37 | */ |
| 38 | public function getDescription() |
| 39 | { |
| 40 | return JText::translate('VAP_WIZARD_STEP_SYSPACK_DESC'); |
| 41 | } |
| 42 | |
| 43 | /** |
| 44 | * Returns an optional step icon. |
| 45 | * |
| 46 | * @return string The step icon. |
| 47 | */ |
| 48 | public function getIcon() |
| 49 | { |
| 50 | return '<i class="fas fa-cog"></i>'; |
| 51 | } |
| 52 | |
| 53 | /** |
| 54 | * Return the group to which the step belongs. |
| 55 | * |
| 56 | * @return string The group name. |
| 57 | */ |
| 58 | public function getGroup() |
| 59 | { |
| 60 | // belongs to PACKAGES group |
| 61 | return JText::translate('VAPMENUPACKAGES'); |
| 62 | } |
| 63 | |
| 64 | /** |
| 65 | * Implements the step execution. |
| 66 | * |
| 67 | * @param JRegistry $data The request data. |
| 68 | * |
| 69 | * @return boolean |
| 70 | */ |
| 71 | protected function doExecute($data) |
| 72 | { |
| 73 | $config = VAPFactory::getConfig(); |
| 74 | |
| 75 | // update configuration with the selected values |
| 76 | $config->set('enablepackages', $data->get('enablepackages', 0)); |
| 77 | $config->set('packsmandatory', $data->get('packsmandatory', 0)); |
| 78 | |
| 79 | return true; |
| 80 | } |
| 81 | |
| 82 | /** |
| 83 | * Checks whether the specified step can be skipped. |
| 84 | * By default, all the steps are mandatory. |
| 85 | * |
| 86 | * @return boolean True if skippable, false otherwise. |
| 87 | */ |
| 88 | public function canIgnore() |
| 89 | { |
| 90 | return true; |
| 91 | } |
| 92 | |
| 93 | /** |
| 94 | * Checks whether the packages section is enabled. |
| 95 | * |
| 96 | * @return boolean |
| 97 | */ |
| 98 | public function isEnabled() |
| 99 | { |
| 100 | return VAPFactory::getConfig()->getBool('enablepackages'); |
| 101 | } |
| 102 | } |
| 103 |