| @@ -1,0 +1,77 @@ | ||
| 1 | +<?php | |
| 2 | +/** | |
| 3 | + * @package VikBooking | |
| 4 | + * @subpackage core | |
| 5 | + * @author Alessio Gaggii - E4J s.r.l. | |
| 6 | + * @copyright Copyright (C) 2022 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 | + * Helper class to support the default pax fields data collection. | |
| 16 | + * | |
| 17 | + * @since 1.15.0 (J) - 1.5.0 (WP) | |
| 18 | + * @since 1.18.10 (J) - 1.8.10 (WP) class is no longer final to allow inheritance. | |
| 19 | + */ | |
| 20 | +class VBOCheckinPaxfieldsBasic extends VBOCheckinAdapter | |
| 21 | +{ | |
| 22 | + /** | |
| 23 | + * The ID of this pax data collector class. | |
| 24 | + * | |
| 25 | + * @var string | |
| 26 | + */ | |
| 27 | + protected $collector_id = 'basic'; | |
| 28 | + | |
| 29 | + /** | |
| 30 | + * Returns the name of the current pax data driver. | |
| 31 | + * | |
| 32 | + * @return string the name of this driver. | |
| 33 | + */ | |
| 34 | + public function getName() | |
| 35 | + { | |
| 36 | + return JText::translate('VBO_CONF_CHECKIN_DATA_BASIC'); | |
| 37 | + } | |
| 38 | + | |
| 39 | + /** | |
| 40 | + * Returns the list of field labels. The count and keys | |
| 41 | + * of the labels should match with the attributes. | |
| 42 | + * | |
| 43 | + * @return array associative list of field labels. | |
| 44 | + */ | |
| 45 | + public function getLabels() | |
| 46 | + { | |
| 47 | + return [ | |
| 48 | + 'first_name' => JText::translate('VBCUSTOMERFIRSTNAME'), | |
| 49 | + 'last_name' => JText::translate('VBCUSTOMERLASTNAME'), | |
| 50 | + 'gender' => JText::translate('VBOCUSTGENDER'), | |
| 51 | + 'country' => JText::translate('VBCUSTOMERCOUNTRY'), | |
| 52 | + 'docnum' => JText::translate('VBCUSTOMERDOCNUM'), | |
| 53 | + 'extranotes' => JText::translate('VBOGUESTEXTRANOTES'), | |
| 54 | + ]; | |
| 55 | + } | |
| 56 | + | |
| 57 | + /** | |
| 58 | + * Returns the list of field attributes. The count and keys | |
| 59 | + * of the attributes should match with the labels. | |
| 60 | + * | |
| 61 | + * @return array associative list of field attributes. | |
| 62 | + */ | |
| 63 | + public function getAttributes() | |
| 64 | + { | |
| 65 | + return [ | |
| 66 | + 'first_name' => 'text', | |
| 67 | + 'last_name' => 'text', | |
| 68 | + 'gender' => [ | |
| 69 | + 'M' => JText::translate('VBOCUSTGENDERM'), | |
| 70 | + 'F' => JText::translate('VBOCUSTGENDERF'), | |
| 71 | + ], | |
| 72 | + 'country' => 'country', | |
| 73 | + 'docnum' => 'text', | |
| 74 | + 'extranotes' => 'text', | |
| 75 | + ]; | |
| 76 | + } | |
| 77 | +} | |