| 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 custom pax fields data collection types for Spain. |
| 16 |
* |
| 17 |
* @since 1.15.2 (J) - 1.5.5 (WP) |
| 18 |
*/ |
| 19 |
final class VBOCheckinPaxfieldsSpain extends VBOCheckinAdapter |
| 20 |
{ |
| 21 |
/** |
| 22 |
* The ID of this pax data collector class. |
| 23 |
* |
| 24 |
* @var string |
| 25 |
*/ |
| 26 |
protected $collector_id = 'spain'; |
| 27 |
|
| 28 |
/** |
| 29 |
* Returns the name of the current pax data driver. |
| 30 |
* |
| 31 |
* @return string the name of this driver. |
| 32 |
*/ |
| 33 |
public function getName() |
| 34 |
{ |
| 35 |
return '"España"'; |
| 36 |
} |
| 37 |
|
| 38 |
/** |
| 39 |
* Returns the list of field labels. The count and keys |
| 40 |
* of the labels should match with the attributes. |
| 41 |
* |
| 42 |
* @return array associative list of field labels. |
| 43 |
*/ |
| 44 |
public function getLabels() |
| 45 |
{ |
| 46 |
return [ |
| 47 |
'first_name' => JText::translate('VBCUSTOMERFIRSTNAME'), |
| 48 |
'last_name' => JText::translate('VBCUSTOMERLASTNAME'), |
| 49 |
'gender' => JText::translate('VBOCUSTGENDER'), |
| 50 |
'date_birth' => JText::translate('ORDER_DBIRTH'), |
| 51 |
'country' => JText::translate('VBCUSTOMERCOUNTRY'), |
| 52 |
'doctype' => JText::translate('VBCUSTOMERDOCTYPE'), |
| 53 |
'docnum' => JText::translate('VBCUSTOMERDOCNUM'), |
| 54 |
'docissuedt' => JText::translate('VBCUSTOMERDOCISSUE'), |
| 55 |
'extranotes' => JText::translate('VBOGUESTEXTRANOTES'), |
| 56 |
]; |
| 57 |
} |
| 58 |
|
| 59 |
/** |
| 60 |
* Returns the list of field attributes. The count and keys |
| 61 |
* of the attributes should match with the labels. |
| 62 |
* |
| 63 |
* @return array associative list of field attributes. |
| 64 |
*/ |
| 65 |
public function getAttributes() |
| 66 |
{ |
| 67 |
return [ |
| 68 |
'first_name' => 'text', |
| 69 |
'last_name' => 'text', |
| 70 |
'gender' => 'spain_gender', |
| 71 |
'date_birth' => 'calendar', |
| 72 |
'country' => 'country', |
| 73 |
'doctype' => 'spain_doctype', |
| 74 |
'docnum' => 'text', |
| 75 |
'docissuedt' => 'calendar', |
| 76 |
'extranotes' => 'textarea', |
| 77 |
]; |
| 78 |
} |
| 79 |
|
| 80 |
/** |
| 81 |
* Returns the associative list of ID types for Spain. |
| 82 |
* |
| 83 |
* @return array associative list of doc types. |
| 84 |
*/ |
| 85 |
public function loadDocumenti() |
| 86 |
{ |
| 87 |
return [ |
| 88 |
"D" => "Documento Nacional de Identidad", |
| 89 |
"P" => "Pasaporte", |
| 90 |
"C" => "Permiso de Conducir", |
| 91 |
"I" => "Carta o Documento de Identidad", |
| 92 |
"N" => "Permiso de Residencia Español", |
| 93 |
"X" => "Permiso de Residencia de otro Estado Miembro de la Unión Europea", |
| 94 |
]; |
| 95 |
} |
| 96 |
} |
| 97 |
|