Ydral_Correos - Version 2.0.2

Version Notes

- Corregido bug de visualización de múltiples páginas con múltiples etiquetas.
- Corregido bug de mostrar método de envío en la información de pedido con html.
- Corregido bug en tiendas con https
- Corregido bug en librería js
- Actualizada la opción de envío en el backend
- Cambios generales

Download this release

Release Info

Developer Ydral
Extension Ydral_Correos
Version 2.0.2
Comparing to
See all releases


Code changes from version 1.0.3 to 2.0.2

Files changed (130) hide show
  1. app/code/local/Ydral/Correos/Block/Adminhtml/Sales/Order/Create/Shipping/Method/Form.php +19 -0
  2. app/code/local/Ydral/Correos/Block/Adminhtml/Sales/Order/Grid.php +22 -0
  3. app/code/local/Ydral/Correos/Block/Adminhtml/Sales/Order/View/Tab/Info.php +105 -0
  4. app/code/local/Ydral/Correos/Block/Adminhtml/Shipping/Carrier/Tablerate/Grid.php +139 -0
  5. app/code/local/Ydral/Correos/Block/Onepage/Progress.php +18 -0
  6. app/code/local/Ydral/Correos/Block/Onepage/Shipping/Method/Available.php +0 -29
  7. app/code/local/Ydral/Correos/Block/Onepage/Tax.php +18 -0
  8. app/code/local/Ydral/Correos/Block/Onestepcheckout.php +75 -0
  9. app/code/local/Ydral/Correos/Block/Order/Info.php +3 -1
  10. app/code/local/Ydral/Correos/Block/Order/Shipment.php +3 -1
  11. app/code/local/Ydral/Correos/Block/Order/View.php +3 -1
  12. app/code/local/Ydral/Correos/Block/System/Config/About.php +20 -0
  13. app/code/local/Ydral/Correos/Block/System/Config/Infosender.php +26 -0
  14. app/code/local/Ydral/Correos/Block/System/Export/Envio.php +8 -5
  15. app/code/local/Ydral/Correos/Block/System/Export/Internacional.php +26 -0
  16. app/code/local/Ydral/Correos/Block/System/Export/Recoger.php +8 -5
  17. app/code/local/Ydral/Correos/Helper/Data.php +126 -36
  18. app/code/local/Ydral/Correos/Helper/Etiqueta.php +33 -0
  19. app/code/local/Ydral/Correos/Helper/Preregistro.php +95 -0
  20. app/code/local/Ydral/Correos/Helper/Seguimiento.php +57 -0
  21. app/code/local/Ydral/Correos/Model/Correos.php +3 -0
  22. app/code/local/Ydral/Correos/Model/Mysql4/Carrier/Correos/Collection.php +0 -49
  23. app/code/local/Ydral/Correos/Model/Mysql4/Correos.php +0 -9
  24. app/code/local/Ydral/Correos/Model/Mysql4/Correos/Collection.php +0 -9
  25. app/code/local/Ydral/Correos/Model/Observer.php +148 -0
  26. app/code/local/Ydral/Correos/Model/Oficinas.php +151 -0
  27. app/code/local/Ydral/Correos/Model/Pdfmerger.php +197 -0
  28. app/code/local/Ydral/Correos/Model/Recoger.php +33 -0
  29. app/code/local/Ydral/Correos/Model/Remitente.php +17 -0
  30. app/code/local/Ydral/Correos/Model/{Mysql4 → Resource}/Carrier/Correos.php +99 -70
  31. app/code/local/Ydral/Correos/Model/Resource/Carrier/Correos/Collection.php +68 -0
  32. app/code/local/Ydral/Correos/Model/Resource/Recoger.php +13 -0
  33. app/code/local/Ydral/Correos/Model/Resource/Recoger/Collection.php +12 -0
  34. app/code/local/Ydral/Correos/Model/Resource/Remitente.php +302 -0
  35. app/code/local/Ydral/Correos/Model/Resource/Remitente/Collection.php +12 -0
  36. app/code/local/Ydral/Correos/Model/Seguimiento.php +179 -0
  37. app/code/local/Ydral/Correos/Model/System/Config/Backend/Shipping/Correos.php +5 -1
  38. app/code/local/Ydral/Correos/Model/System/Config/Backend/Shipping/Internacional.php +12 -0
  39. app/code/local/Ydral/Correos/Model/System/Config/Backend/Shipping/Multiremitente.php +12 -0
  40. app/code/local/Ydral/Correos/Model/System/Config/Backend/Shipping/Recoger.php +1 -1
  41. app/code/local/Ydral/Correos/Model/{Pesos.php → System/Config/Source/Pesos.php} +5 -1
  42. app/code/local/Ydral/Correos/Model/Type/Onepage.php +8 -24
  43. app/code/local/Ydral/Correos/Model/Ydral/Correos.php +109 -49
  44. app/code/local/Ydral/Correos/Model/Ydral/Correosinter.php +241 -0
  45. app/code/local/Ydral/Correos/Model/Ydral/Recogeroficina.php +117 -261
  46. app/code/local/Ydral/Correos/Model/Ydral/Shipment.php +594 -444
  47. app/code/local/Ydral/Correos/controllers/Adminhtml/DownloadController.php +127 -0
  48. app/code/local/Ydral/Correos/controllers/Adminhtml/ExportController.php +39 -0
  49. app/code/local/Ydral/Correos/controllers/Adminhtml/PdfController.php +246 -0
  50. app/code/local/Ydral/Correos/controllers/CheckoutController.php +113 -0
  51. app/code/local/Ydral/Correos/controllers/IndexController.php +7 -37
  52. app/code/local/Ydral/Correos/etc/config.xml +112 -41
  53. app/code/local/Ydral/Correos/etc/system.xml +369 -120
  54. app/code/local/Ydral/Correos/log.txt +0 -13
  55. app/code/local/Ydral/Correos/sql/correos_setup/mysql4-upgrade-0.3.0-0.4.0.php +2 -0
  56. app/code/local/Ydral/Correos/sql/correos_setup/mysql4-upgrade-0.4.0-1.5.0.php +9 -0
  57. app/code/local/Ydral/Correos/sql/correos_setup/mysql4-upgrade-1.5.0-2.0.0.php +28 -0
  58. app/design/adminhtml/default/default/layout/correos.xml +27 -8
  59. app/design/adminhtml/default/default/template/correos/head.phtml +12 -0
  60. app/design/adminhtml/default/default/template/correos/sales_order_shipment_create_items.phtml +165 -0
  61. app/design/adminhtml/default/default/template/correos/tab_info.phtml +5 -2
  62. app/design/frontend/base/default/layout/correos.xml +12 -1
  63. app/design/frontend/base/default/template/correos/available.phtml +99 -0
  64. app/design/frontend/base/default/template/correos/head.phtml +11 -2
  65. app/design/frontend/base/default/template/correos/order_info.phtml +4 -4
  66. app/design/frontend/base/default/template/correos/popup.phtml +2 -2
  67. app/locale/es_ES/Ydral_Correos.csv +84 -0
  68. js/correos/correos.js +296 -0
  69. js/correos/proj4js-compressed.js +180 -0
  70. lib/fpdf/font/courier.php +7 -0
  71. lib/fpdf/font/desktop.ini +4 -0
  72. lib/fpdf/font/helvetica.php +15 -0
  73. lib/fpdf/font/helveticab.php +15 -0
  74. lib/fpdf/font/helveticabi.php +15 -0
  75. lib/fpdf/font/helveticai.php +15 -0
  76. lib/fpdf/font/makefont/cp1250.map +251 -0
  77. lib/fpdf/font/makefont/cp1251.map +255 -0
  78. lib/fpdf/font/makefont/cp1252.map +251 -0
  79. lib/fpdf/font/makefont/cp1253.map +239 -0
  80. lib/fpdf/font/makefont/cp1254.map +249 -0
  81. lib/fpdf/font/makefont/cp1255.map +233 -0
  82. lib/fpdf/font/makefont/cp1257.map +244 -0
  83. lib/fpdf/font/makefont/cp1258.map +247 -0
  84. lib/fpdf/font/makefont/cp874.map +225 -0
  85. lib/fpdf/font/makefont/iso-8859-1.map +256 -0
  86. lib/fpdf/font/makefont/iso-8859-11.map +248 -0
  87. lib/fpdf/font/makefont/iso-8859-15.map +256 -0
  88. lib/fpdf/font/makefont/iso-8859-16.map +256 -0
  89. lib/fpdf/font/makefont/iso-8859-2.map +256 -0
  90. lib/fpdf/font/makefont/iso-8859-4.map +256 -0
  91. lib/fpdf/font/makefont/iso-8859-5.map +256 -0
  92. lib/fpdf/font/makefont/iso-8859-7.map +250 -0
  93. lib/fpdf/font/makefont/iso-8859-9.map +256 -0
  94. lib/fpdf/font/makefont/koi8-r.map +256 -0
  95. lib/fpdf/font/makefont/koi8-u.map +256 -0
  96. lib/fpdf/font/makefont/makefont.php +419 -0
  97. lib/fpdf/font/symbol.php +15 -0
  98. lib/fpdf/font/times.php +15 -0
  99. lib/fpdf/font/timesb.php +15 -0
  100. lib/fpdf/font/timesbi.php +15 -0
  101. lib/fpdf/font/timesi.php +15 -0
  102. lib/fpdf/font/zapfdingbats.php +15 -0
  103. lib/fpdf/fpdf.css +21 -0
  104. lib/fpdf/fpdf.php +1736 -0
  105. lib/fpdf/license.txt +6 -0
  106. lib/fpdi/filters/FilterASCII85.php +98 -0
  107. lib/fpdi/filters/FilterASCII85_FPDI.php +33 -0
  108. lib/fpdi/filters/FilterLZW.php +154 -0
  109. lib/fpdi/filters/FilterLZW_FPDI.php +33 -0
  110. lib/fpdi/fpdf_tpl.php +410 -0
  111. lib/fpdi/fpdi.php +521 -0
  112. lib/fpdi/fpdi2tcpdf_bridge.php +171 -0
  113. lib/fpdi/fpdi_pdf_parser.php +384 -0
  114. lib/fpdi/pdf_context.php +97 -0
  115. lib/fpdi/pdf_parser.php +706 -0
  116. package.xml +10 -5
  117. skin/adminhtml/default/default/correos.css +4 -1
  118. skin/adminhtml/default/default/images/correos/correos.png +0 -0
  119. skin/frontend/base/default/css/correos.css +4 -1
  120. skin/frontend/base/default/js/correos.js +0 -161
  121. skin/frontend/default/default/css/correos.css +4 -1
  122. skin/frontend/default/default/images/correos/correos.png +0 -0
  123. skin/frontend/default/default/images/correos/correos.psd +0 -0
  124. skin/frontend/default/default/images/correos/correos2.psd +0 -0
  125. skin/frontend/default/default/images/correos/globo.png +0 -0
  126. skin/frontend/default/default/images/correos/globosombra.png +0 -0
  127. skin/frontend/default/default/images/correos/logo_entregadomicilio.jpg +0 -0
  128. skin/frontend/default/default/images/correos/logo_recogeroficina.jpg +0 -0
  129. skin/frontend/default/default/images/correos/red-rounded01.psd +0 -0
  130. skin/frontend/default/default/js/correos.js +0 -162
app/code/local/Ydral/Correos/Block/Adminhtml/Sales/Order/Create/Shipping/Method/Form.php ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ *
5
+ */
6
+ class Ydral_Correos_Block_Adminhtml_Sales_Order_Create_Shipping_Method_Form
7
+ extends Mage_Adminhtml_Block_Sales_Order_Create_Shipping_Method_Form
8
+ {
9
+
10
+ public function __construct()
11
+ {
12
+ parent::__construct();
13
+ }
14
+
15
+ public function escapeHtml($data, $allowedTags = null)
16
+ {
17
+ return $data;
18
+ }
19
+ }
app/code/local/Ydral/Correos/Block/Adminhtml/Sales/Order/Grid.php ADDED
@@ -0,0 +1,22 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ *
5
+ */
6
+ class Ydral_Correos_Block_Adminhtml_Sales_Order_Grid extends Mage_Adminhtml_Block_Sales_Order_Grid
7
+ {
8
+
9
+ /**
10
+ *
11
+ */
12
+ protected function _prepareMassaction()
13
+ {
14
+ parent::_prepareMassaction();
15
+ $this->getMassactionBlock()->addItem('print_preregistro', array(
16
+ 'label'=> Mage::helper('correos')->__('Imprimir preregistro'),
17
+ 'url' => $this->getUrl('*/adminhtml_pdf/multiplePrint'),
18
+ ));
19
+ return $this;
20
+ }
21
+
22
+ }
app/code/local/Ydral/Correos/Block/Adminhtml/Sales/Order/View/Tab/Info.php ADDED
@@ -0,0 +1,105 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ *
5
+ */
6
+ class Ydral_Correos_Block_Adminhtml_Sales_Order_View_Tab_Info extends Mage_Adminhtml_Block_Sales_Order_View_Tab_Info
7
+ {
8
+
9
+ /**
10
+ *
11
+ */
12
+ public function getGiftOptionsHtml()
13
+ {
14
+
15
+ $html = '';
16
+ $_order = $this->getSource();
17
+ $_envioCorreos = false;
18
+
19
+ if (in_array($_order->getShippingMethod(), Mage::helper('correos')->getAllowedMethods()))
20
+ {
21
+ $_envioCorreos = true;
22
+ }
23
+
24
+ if ($_envioCorreos)
25
+ {
26
+
27
+ $htmlTmp = '';
28
+ $html .= '<div id="customer_comment" class="giftmessage-whole-order-container"><div class="entry-edit">';
29
+ $html .= '<div class="entry-edit-head"><h4>'.$this->helper('correos')->__('Información del envío con Correos').'</h4></div>';
30
+ $html .= '<fieldset>';
31
+
32
+
33
+ // Informacion de la oficina / metodo
34
+ if ($_order->getShippingMethod() == 'recogeroficina_recogeroficina')
35
+ {
36
+ $_dataRecogida = Mage::getModel('correos/recoger')->getCheckoutData('order', $_order->getRealOrderId());
37
+
38
+ if (count($_dataRecogida))
39
+ {
40
+
41
+ $_data = $_dataRecogida->getFirstItem();
42
+ if ($_data->getCorreosOficina() == '')
43
+ {
44
+ $codPostalRecogida = $_order->getShippingAddress()->getPostcode();
45
+ } else {
46
+ $codPostalRecogida = $_data->getCorreosOficina();
47
+ }
48
+
49
+ $_dataOficina = Mage::getModel('correos/oficinas')->dataOficinas($_data->getCorreosRecogida(), $codPostalRecogida);
50
+ if (is_array($_dataOficina))
51
+ {
52
+ $htmlTmp .= $this->helper('correos')->__('Envío a la oficina: %s', '');
53
+ $htmlTmp .= $this->helper('correos')->__('Oficina <strong>%s</strong> - %s-%s (%s)', $_dataOficina['nombre'], $_dataOficina['direccion'], $_dataOficina['localidad'], $_dataOficina['cp']);
54
+ } else {
55
+ $htmlTmp .= $this->helper('correos')->__('Envío a la oficina: %s', $_data->getCorreosRecogida());
56
+ }
57
+
58
+ }
59
+
60
+ } elseif ($_order->getShippingMethod() == 'envio4872_envio4872') {
61
+ $htmlTmp .= $this->helper('correos')->__('Env&iacute;o a domicilio - Correos 48/72');
62
+ } elseif ($_order->getShippingMethod() == 'correosinter_correosinter') {
63
+ $htmlTmp .= $this->helper('correos')->__('Paquete Postal Internacional Prioritario');
64
+ }
65
+
66
+
67
+ // tracking
68
+ $tracks = $_order->getTracksCollection();
69
+ $tracksValidos = array ('Correos', 'envio4872', 'recogeroficina', 'correosinter');
70
+ foreach ($tracks as $track)
71
+ {
72
+ if (in_array($track->getCarrierCode(), $tracksValidos))
73
+ {
74
+ $htmlTmp .= '<br /><a href="' . Mage::helper("adminhtml")->getUrl("*/adminhtml_download/downloadEtiqueta", array('order' => $_order->getId(), 'etiqueta' => $track['number'])) . '">' . $this->helper('correos')->__('Imprimir etiqueta de envío.') . '</a>';
75
+ $htmlTmp .= '<br /><b>' . $this->helper('correos')->__('Estado del env&iacute;o:') . '</b>' . Mage::getModel('correos/seguimiento')->localizarEnvioUltimo($track['number']);
76
+ }
77
+ }
78
+
79
+
80
+ //
81
+ if ($_order->getTracksCollection()->count())
82
+ {
83
+ $htmlTmp .= '<br /><a href="#" id="linkId" onclick="popWin(\'' . $this->helper('correos')->getTrackingPopupUrlBySalesModel($_order) . '\',\'trackorder\',\'width=800,height=600,resizable=yes,scrollbars=yes\')" title="' . $this->helper('correos')->__('Track Order') . '">' . $this->helper('correos')->__('Track Order') . '</a>';
84
+ }
85
+
86
+
87
+ if (empty($htmlTmp))
88
+ {
89
+ $htmlTmp = $this->helper('correos')->__('A&uacute;n no hay informaci&oacute;n disponible');
90
+ }
91
+
92
+
93
+ $html .= $htmlTmp;
94
+ $html .= '</fieldset>';
95
+ $html .= '</div></div><br />';
96
+
97
+ }
98
+
99
+ $giftHtml = parent::getGiftOptionsHtml();
100
+
101
+ return $html . $giftHtml;
102
+
103
+ }
104
+
105
+ }
app/code/local/Ydral/Correos/Block/Adminhtml/Shipping/Carrier/Tablerate/Grid.php ADDED
@@ -0,0 +1,139 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ *
5
+ */
6
+ class Ydral_Correos_Block_Adminhtml_Shipping_Carrier_Tablerate_Grid extends Mage_Adminhtml_Block_Widget_Grid
7
+ {
8
+
9
+ protected $_websiteId;
10
+ protected $_conditionName;
11
+ protected $_methodName;
12
+
13
+
14
+ /**
15
+ * Define grid properties
16
+ *
17
+ * @return void
18
+ */
19
+ public function __construct()
20
+ {
21
+ parent::__construct();
22
+ $this->setId('shippingTablerateGrid');
23
+ $this->_exportPageSize = 10000;
24
+ }
25
+
26
+ /**
27
+ *
28
+ */
29
+ public function setWebsiteId($websiteId)
30
+ {
31
+ $this->_websiteId = Mage::app()->getWebsite($websiteId)->getId();
32
+ return $this;
33
+ }
34
+
35
+ /**
36
+ *
37
+ */
38
+ public function getWebsiteId()
39
+ {
40
+ if (is_null($this->_websiteId)) {
41
+ $this->_websiteId = Mage::app()->getWebsite()->getId();
42
+ }
43
+ return $this->_websiteId;
44
+ }
45
+
46
+ /**
47
+ *
48
+ */
49
+ public function setConditionName($name)
50
+ {
51
+ $this->_conditionName = $name;
52
+ return $this;
53
+ }
54
+
55
+ /**
56
+ *
57
+ */
58
+ public function getConditionName()
59
+ {
60
+ return $this->_conditionName;
61
+ }
62
+
63
+ /**
64
+ *
65
+ */
66
+ public function setMethodName($name)
67
+ {
68
+ $this->_methodName = $name;
69
+ return $this;
70
+ }
71
+
72
+ /**
73
+ *
74
+ */
75
+ public function getMethodName()
76
+ {
77
+ return $this->_methodName;
78
+ }
79
+
80
+
81
+ /**
82
+ * Prepare shipping table rate collection
83
+ *
84
+ * @return Mage_Adminhtml_Block_Shipping_Carrier_Tablerate_Grid
85
+ */
86
+ protected function _prepareCollection()
87
+ {
88
+ /** @var $collection Ydral_Correos_Model_Resource_Carrier_Correos_Collection */
89
+ $collection = Mage::getResourceModel('correos/carrier_correos_collection');
90
+ $collection->setConditionFilter($this->getConditionName())
91
+ ->setWebsiteFilter($this->getWebsiteId())
92
+ ->setMethodFilter($this->getMethodName());
93
+
94
+ $this->setCollection($collection);
95
+
96
+ return parent::_prepareCollection();
97
+ }
98
+
99
+ /**
100
+ * Prepare table columns
101
+ *
102
+ * @return Mage_Adminhtml_Block_Widget_Grid
103
+ */
104
+ protected function _prepareColumns()
105
+ {
106
+ $this->addColumn('dest_country', array(
107
+ 'header' => Mage::helper('adminhtml')->__('Country'),
108
+ 'index' => 'dest_country',
109
+ 'default' => '*',
110
+ ));
111
+
112
+ $this->addColumn('dest_region', array(
113
+ 'header' => Mage::helper('adminhtml')->__('Region/State'),
114
+ 'index' => 'dest_region',
115
+ 'default' => '*',
116
+ ));
117
+
118
+ $this->addColumn('dest_zip', array(
119
+ 'header' => Mage::helper('adminhtml')->__('Zip/Postal Code'),
120
+ 'index' => 'dest_zip',
121
+ 'default' => '*',
122
+ ));
123
+
124
+ $label = Mage::getSingleton('shipping/carrier_tablerate')
125
+ ->getCode('condition_name_short', $this->getConditionName());
126
+ $this->addColumn('condition_value', array(
127
+ 'header' => $label,
128
+ 'index' => 'condition_value',
129
+ ));
130
+
131
+ $this->addColumn('price', array(
132
+ 'header' => Mage::helper('adminhtml')->__('Shipping Price'),
133
+ 'index' => 'price',
134
+ ));
135
+
136
+ return parent::_prepareColumns();
137
+ }
138
+
139
+ }
app/code/local/Ydral/Correos/Block/Onepage/Progress.php ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ *
5
+ */
6
+ class Ydral_Correos_Block_Onepage_Progress extends Mage_Checkout_Block_Onepage_Progress
7
+ {
8
+
9
+ public function escapeHtml($data, $allowedTags = null)
10
+ {
11
+ if (version_compare(Mage::getVersion(), '1.7.0', '>=')) {
12
+ return $data;
13
+ } else {
14
+ return parent::escapeHtml($data, $allowedTags);
15
+ }
16
+ }
17
+
18
+ }
app/code/local/Ydral/Correos/Block/Onepage/Shipping/Method/Available.php CHANGED
@@ -1,36 +1,7 @@
1
  <?php
2
- /**
3
- * Magento
4
- *
5
- * NOTICE OF LICENSE
6
- *
7
- * This source file is subject to the Open Software License (OSL 3.0)
8
- * that is bundled with this package in the file LICENSE.txt.
9
- * It is also available through the world-wide-web at this URL:
10
- * http://opensource.org/licenses/osl-3.0.php
11
- * If you did not receive a copy of the license and are unable to
12
- * obtain it through the world-wide-web, please send an email
13
- * to license@magentocommerce.com so we can send you a copy immediately.
14
- *
15
- * DISCLAIMER
16
- *
17
- * Do not edit or add to this file if you wish to upgrade Magento to newer
18
- * versions in the future. If you wish to customize Magento for your
19
- * needs please refer to http://www.magentocommerce.com for more information.
20
- *
21
- * @category Mage
22
- * @package Mage_Checkout
23
- * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com)
24
- * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
- */
26
 
27
  /**
28
- * One page checkout status
29
  *
30
- * @category Mage
31
- * @category Mage
32
- * @package Mage_Checkout
33
- * @author Magento Core Team <core@magentocommerce.com>
34
  */
35
  class Ydral_Correos_Block_Onepage_Shipping_Method_Available extends Mage_Checkout_Block_Onepage_Shipping_Method_Available
36
  {
1
  <?php
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2
 
3
  /**
 
4
  *
 
 
 
 
5
  */
6
  class Ydral_Correos_Block_Onepage_Shipping_Method_Available extends Mage_Checkout_Block_Onepage_Shipping_Method_Available
7
  {
app/code/local/Ydral/Correos/Block/Onepage/Tax.php ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ *
5
+ */
6
+ class Ydral_Correos_Block_Onepage_Tax extends Mage_Tax_Block_Checkout_Shipping
7
+ {
8
+
9
+ public function escapeHtml($data, $allowedTags = null)
10
+ {
11
+ if (version_compare(Mage::getVersion(), '1.7.0', '>=')) {
12
+ return $data;
13
+ } else {
14
+ return parent::escapeHtml($data, $allowedTags);
15
+ }
16
+ }
17
+
18
+ }
app/code/local/Ydral/Correos/Block/Onestepcheckout.php ADDED
@@ -0,0 +1,75 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Ydral_Correos_Block_Onestepcheckout extends Idev_OneStepCheckout_Block_Checkout
4
+ {
5
+
6
+ /*
7
+ protected function _saveOrder()
8
+ {
9
+ Mage::helper('correos')->setOficinaCorreosRecogidaOrder();
10
+ parent::_saveOrder();
11
+ }
12
+ */
13
+
14
+ public function _handlePostData()
15
+ {
16
+
17
+ $checkoutHelper = Mage::helper('onestepcheckout/checkout');
18
+
19
+ $post = $this->getRequest()->getPost();
20
+ if(!$post) return;
21
+
22
+ $billing_data = $this->getRequest()->getPost('billing', array());
23
+ $shipping_data = $this->getRequest()->getPost('shipping', array());
24
+ $_cp = Mage::app()->getRequest()->getPost('oficinas_correos_content_select');
25
+ $shippingMethod = Mage::app()->getRequest()->getPost('shipping_method');
26
+ $shipping_data = $checkoutHelper->load_exclude_data($shipping_data);
27
+
28
+
29
+ if ( ($shippingMethod == 'recogeroficina_recogeroficina') && (empty($_cp)) )
30
+ {
31
+ $this->formErrors['unknown_source_error'] = Mage::helper('correos')->__('No se ha especificado una oficina de recogida.');
32
+ return;
33
+ }
34
+
35
+
36
+ $address = $this->getOnepage()->getQuote()->getShippingAddress();
37
+ if(!isset($billing_data['use_for_shipping']) || $billing_data['use_for_shipping'] != '1')
38
+ {
39
+ $customerAddressId = $this->getRequest()->getPost('shipping_address_id', false);
40
+ } else {
41
+ $customerAddressId = $this->getRequest()->getPost('billing_address_id', false);
42
+ }
43
+ if (!empty($customerAddressId)) {
44
+ $customerAddress = Mage::getModel('customer/address')->load($customerAddressId);
45
+ if ($customerAddress->getId()) {
46
+ if ($customerAddress->getCustomerId() != $this->getOnepage()->getQuote()->getCustomerId()) {
47
+ return array('error' => 1,
48
+ 'message' => Mage::helper('checkout')->__('Customer Address is not valid.')
49
+ );
50
+ }
51
+ $address->importCustomerAddress($customerAddress);
52
+ }
53
+ }
54
+
55
+ if (!isset($post['phone_correos']) || $post['phone_correos'] == '')
56
+ {
57
+ $_phone = $address->getTelephone();
58
+ } else {
59
+ $_phone = $post['phone_correos'];
60
+ }
61
+ if ( ($shippingMethod == 'recogeroficina_recogeroficina') && (empty($_phone)) )
62
+ {
63
+ $this->formErrors['unknown_source_error'] = Mage::helper('correos')->__('Debe indicar un tel&eacute;fono m&oacute;vil para poder realizar la entrega del env&iacute;o.');
64
+ return;
65
+ } elseif ( ($shippingMethod == 'recogeroficina_recogeroficina') && (!Mage::helper('correos')->validarMovil($_phone)) ) {
66
+ $this->formErrors['unknown_source_error'] = Mage::helper('correos')->__('N&uacute;mero de tel&eacute;fono m&oacute;vil no v&aacute;lido.');
67
+ return;
68
+ }
69
+
70
+ parent::_handlePostData();
71
+
72
+
73
+ }
74
+
75
+ }
app/code/local/Ydral/Correos/Block/Order/Info.php CHANGED
@@ -5,7 +5,9 @@ class Ydral_Correos_Block_Order_Info extends Mage_Sales_Block_Order_Info
5
  protected function _construct()
6
  {
7
  parent::_construct();
8
- if (($this->getOrder()->getShippingMethod() == 'recogeroficina_recogeroficina') || ($this->getOrder()->getShippingMethod() == 'envio4872_envio4872'))
 
 
9
  {
10
  $this->setTemplate('correos/order_info.phtml');
11
  }
5
  protected function _construct()
6
  {
7
  parent::_construct();
8
+ if (($this->getOrder()->getShippingMethod() == 'recogeroficina_recogeroficina')
9
+ || ($this->getOrder()->getShippingMethod() == 'envio4872_envio4872')
10
+ || ($this->getOrder()->getShippingMethod() == 'correosinter_correosinter'))
11
  {
12
  $this->setTemplate('correos/order_info.phtml');
13
  }
app/code/local/Ydral/Correos/Block/Order/Shipment.php CHANGED
@@ -5,7 +5,9 @@ class Ydral_Correos_Block_Order_Shipment extends Mage_Sales_Block_Order_Shipment
5
  protected function _construct()
6
  {
7
  parent::_construct();
8
- if (($this->getOrder()->getShippingMethod() == 'recogeroficina_recogeroficina') || ($this->getOrder()->getShippingMethod() == 'envio4872_envio4872'))
 
 
9
  {
10
  $this->setTemplate('correos/order_shipment.phtml');
11
  }
5
  protected function _construct()
6
  {
7
  parent::_construct();
8
+ if (($this->getOrder()->getShippingMethod() == 'recogeroficina_recogeroficina')
9
+ || ($this->getOrder()->getShippingMethod() == 'envio4872_envio4872')
10
+ || ($this->getOrder()->getShippingMethod() == 'correosinter_correosinter'))
11
  {
12
  $this->setTemplate('correos/order_shipment.phtml');
13
  }
app/code/local/Ydral/Correos/Block/Order/View.php CHANGED
@@ -5,7 +5,9 @@ class Ydral_Correos_Block_Order_View extends Mage_Sales_Block_Order_View
5
  protected function _construct()
6
  {
7
  parent::_construct();
8
- if (($this->getOrder()->getShippingMethod() == 'recogeroficina_recogeroficina') || ($this->getOrder()->getShippingMethod() == 'envio4872_envio4872'))
 
 
9
  {
10
  $this->setTemplate('correos/order_view.phtml');
11
  }
5
  protected function _construct()
6
  {
7
  parent::_construct();
8
+ if (($this->getOrder()->getShippingMethod() == 'recogeroficina_recogeroficina')
9
+ || ($this->getOrder()->getShippingMethod() == 'envio4872_envio4872')
10
+ || ($this->getOrder()->getShippingMethod() == 'correosinter_correosinter'))
11
  {
12
  $this->setTemplate('correos/order_view.phtml');
13
  }
app/code/local/Ydral/Correos/Block/System/Config/About.php ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Ydral_Correos_Block_System_Config_About
4
+ extends Mage_Adminhtml_Block_Abstract
5
+ implements Varien_Data_Form_Element_Renderer_Interface
6
+ {
7
+
8
+ public function render(Varien_Data_Form_Element_Abstract $element)
9
+ {
10
+
11
+ $_version = Mage::helper('correos')->getExtensionVersion();
12
+
13
+ $html = '<div style="margin-bottom:20px; padding:10px 5px 5px 5px; ">
14
+ <strong>' . Mage::helper('correos')->__('Versión del modulo: %s', $_version) . '</strong>
15
+ </div>';
16
+
17
+ return $html;
18
+
19
+ }
20
+ }
app/code/local/Ydral/Correos/Block/System/Config/Infosender.php ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Ydral_Correos_Block_System_Config_Infosender
4
+ extends Mage_Adminhtml_Block_Abstract
5
+ implements Varien_Data_Form_Element_Renderer_Interface
6
+ {
7
+
8
+ public function render(Varien_Data_Form_Element_Abstract $element)
9
+ {
10
+
11
+ $html = '<div style="margin-bottom:20px; padding:10px 5px 5px 5px; ">' .
12
+ Mage::helper('correos')->__('El sistema de multiremitente le permite, durante el proceso de envío, seleccionar el remitente de su paquete de Correos.') .
13
+ '<br />' .
14
+ Mage::helper('correos')->__('Si solo va a utilizar un único remitente, no seleccione la opción de multiremitente y rellene los datos generales de remitente.') .
15
+ '<br />' .
16
+ Mage::helper('correos')->__('Si va a utilizar el sistema multiremitente debe subir un fichero en formato CSV con la siguiente estructura:') .
17
+ '<br />' .
18
+ '<i>' . Mage::helper('correos')->__('Nombre,Apellidos,DNI,Empresa,Persona_de_contacto,País,Provincia,CP,Localidad,Dirección,Teléfono,Email,Teléfono_Móvil') . '</i>' .
19
+ '<br />' .
20
+ Mage::helper('correos')->__('Cada línea del fichero corresponde con una dirección de remitente.') .
21
+ '</div>';
22
+
23
+ return $html;
24
+
25
+ }
26
+ }
app/code/local/Ydral/Correos/Block/System/Export/Envio.php CHANGED
@@ -1,20 +1,23 @@
1
  <?php
2
 
 
 
 
3
  class Ydral_Correos_Block_System_Export_Envio extends Mage_Adminhtml_Block_System_Config_Form_Field
4
  {
5
 
6
  protected function _getElementHtml(Varien_Data_Form_Element_Abstract $element)
7
  {
8
- $this->setElement($element);
9
-
10
- $url = $this->getUrl('catalog/product'); //
 
11
 
12
  $html = $this->getLayout()->createBlock('adminhtml/widget_button')
13
  ->setType('button')
14
  ->setClass('scalable')
15
  ->setLabel('Exportar CSV')
16
- ->setOnClick("setLocation('$url')")
17
- ->setOnClick('setLocation(\''.Mage::helper('adminhtml')->getUrl("*/*/exportTablerates", $params) . 'conditionName/\' + $(\'carriers_envio4872_condition_name\').value + \'/tablerates.csv\' )')
18
  ->toHtml();
19
 
20
  return $html;
1
  <?php
2
 
3
+ /**
4
+ *
5
+ */
6
  class Ydral_Correos_Block_System_Export_Envio extends Mage_Adminhtml_Block_System_Config_Form_Field
7
  {
8
 
9
  protected function _getElementHtml(Varien_Data_Form_Element_Abstract $element)
10
  {
11
+ $this->setElement($element);
12
+ $params = array(
13
+ 'website' => $this->getRequest()->getParam('website')
14
+ );
15
 
16
  $html = $this->getLayout()->createBlock('adminhtml/widget_button')
17
  ->setType('button')
18
  ->setClass('scalable')
19
  ->setLabel('Exportar CSV')
20
+ ->setOnClick('setLocation(\''.Mage::helper('adminhtml')->getUrl("*/adminhtml_export/exportTablerates", $params) . 'method/envio4872/conditionName/\' + $(\'carriers_envio4872_condition_name\').value + \'/tablerates.csv\' )')
 
21
  ->toHtml();
22
 
23
  return $html;
app/code/local/Ydral/Correos/Block/System/Export/Internacional.php ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ *
5
+ */
6
+ class Ydral_Correos_Block_System_Export_Internacional extends Mage_Adminhtml_Block_System_Config_Form_Field
7
+ {
8
+
9
+ protected function _getElementHtml(Varien_Data_Form_Element_Abstract $element)
10
+ {
11
+ $this->setElement($element);
12
+ $params = array(
13
+ 'website' => $this->getRequest()->getParam('website')
14
+ );
15
+
16
+ $html = $this->getLayout()->createBlock('adminhtml/widget_button')
17
+ ->setType('button')
18
+ ->setClass('scalable')
19
+ ->setLabel('Exportar CSV')
20
+ ->setOnClick('setLocation(\''.Mage::helper('adminhtml')->getUrl("*/adminhtml_export/exportTablerates", $params) . 'method/correosinter/conditionName/\' + $(\'carriers_correosinter_condition_name\').value + \'/tablerates.csv\' )')
21
+ ->toHtml();
22
+
23
+ return $html;
24
+ }
25
+
26
+ }
app/code/local/Ydral/Correos/Block/System/Export/Recoger.php CHANGED
@@ -1,20 +1,23 @@
1
  <?php
2
 
 
 
 
3
  class Ydral_Correos_Block_System_Export_Recoger extends Mage_Adminhtml_Block_System_Config_Form_Field
4
  {
5
 
6
  protected function _getElementHtml(Varien_Data_Form_Element_Abstract $element)
7
  {
8
- $this->setElement($element);
9
-
10
- $url = $this->getUrl('catalog/product'); //
 
11
 
12
  $html = $this->getLayout()->createBlock('adminhtml/widget_button')
13
  ->setType('button')
14
  ->setClass('scalable')
15
  ->setLabel('Exportar CSV')
16
- ->setOnClick("setLocation('$url')")
17
- ->setOnClick('setLocation(\''.Mage::helper('adminhtml')->getUrl("*/*/exportTablerates", $params) . 'conditionName/\' + $(\'carriers_recogeroficina_condition_name\').value + \'/tablerates.csv\' )')
18
  ->toHtml();
19
 
20
  return $html;
1
  <?php
2
 
3
+ /**
4
+ *
5
+ */
6
  class Ydral_Correos_Block_System_Export_Recoger extends Mage_Adminhtml_Block_System_Config_Form_Field
7
  {
8
 
9
  protected function _getElementHtml(Varien_Data_Form_Element_Abstract $element)
10
  {
11
+ $this->setElement($element);
12
+ $params = array(
13
+ 'website' => $this->getRequest()->getParam('website')
14
+ );
15
 
16
  $html = $this->getLayout()->createBlock('adminhtml/widget_button')
17
  ->setType('button')
18
  ->setClass('scalable')
19
  ->setLabel('Exportar CSV')
20
+ ->setOnClick('setLocation(\''.Mage::helper('adminhtml')->getUrl("*/adminhtml_export/exportTablerates", $params) . 'method/recogeroficina/conditionName/\' + $(\'carriers_recogeroficina_condition_name\').value + \'/tablerates.csv\' )')
 
21
  ->toHtml();
22
 
23
  return $html;
app/code/local/Ydral/Correos/Helper/Data.php CHANGED
@@ -1,57 +1,147 @@
1
  <?php
2
 
 
 
 
3
  class Ydral_Correos_Helper_Data extends Mage_Core_Helper_Abstract
4
  {
5
 
6
- public function setOficinaCorreosRecogida($observer)
7
- {
8
-
9
- $idQuote = Mage::getSingleton('checkout/session')->getQuoteId();
10
- $idSelector = trim(strip_tags($this->_getRequest()->getPost('oficinas_correos_content_select')));
11
- $cpField = trim(strip_tags($this->_getRequest()->getPost('cp_search')));
 
 
 
 
 
 
 
 
 
12
 
13
- if (!empty($idSelector))
 
 
 
 
 
 
 
14
  {
15
-
16
- Mage::getModel('correos/ydral_recogeroficina')->saveCheckoutData('quote', $idQuote, $idSelector, $cpField);
17
- return $this;
18
-
19
- }
20
-
 
 
 
 
 
 
 
 
 
 
21
  }
22
 
23
 
24
- public function setOficinaCorreosRecogidaOrder($observer)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
25
  {
26
-
27
- $idQuote = Mage::getSingleton('checkout/session')->getLastQuoteId();
28
- $idOrder = Mage::getSingleton('checkout/session')->getLastRealOrderId();
29
-
30
- $_checkoutData = Mage::getModel('correos/ydral_recogeroficina')->readCheckoutData('quote', $idQuote);
 
31
 
32
- if ($_checkoutData)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
33
  {
34
- Mage::getModel('correos/ydral_recogeroficina')->saveCheckoutData('order', $idOrder, $_checkoutData['correos_recogida'], $_checkoutData['correos_oficina']);
35
  } else {
36
-
37
- $idSelector = trim(strip_tags($this->_getRequest()->getPost('oficinas_correos_content_select')));
38
- $cpField = trim(strip_tags($this->_getRequest()->getPost('cp_search')));
39
-
40
- if (!empty($idSelector))
41
- {
42
-
43
- Mage::getModel('correos/ydral_recogeroficina')->saveCheckoutData('quote', $idQuote, $idSelector, $cpField);
44
- $_checkoutData = Mage::getModel('correos/ydral_recogeroficina')->readCheckoutData('quote', $idQuote);
45
- if ($_checkoutData)
46
- {
47
- Mage::getModel('correos/ydral_recogeroficina')->saveCheckoutData('order', $idOrder, $_checkoutData['correos_recogida'], $_checkoutData['correos_oficina']);
48
- }
49
- }
50
-
51
  }
52
  }
53
 
54
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
55
  public function getCorreosError ($errorCode)
56
  {
57
 
1
  <?php
2
 
3
+ /**
4
+ *
5
+ */
6
  class Ydral_Correos_Helper_Data extends Mage_Core_Helper_Abstract
7
  {
8
 
9
+ protected $_allowedMethods = array (
10
+ 'recogeroficina_recogeroficina',
11
+ 'envio4872_envio4872',
12
+ 'correoscontrare_correoscontrare',
13
+ 'correosinter_correosinter',
14
+ );
15
+
16
+ /**
17
+ *
18
+ */
19
+ public function getExtensionVersion()
20
+ {
21
+ return (string) Mage::getConfig()->getNode()->modules->Ydral_Correos->version;
22
+ }
23
+
24
 
25
+ /**
26
+ *
27
+ */
28
+ public function validarMovil ($phone)
29
+ {
30
+ if(strlen(trim($phone)) == 0) return false;
31
+ $tmp = substr($phone, 0, 1);
32
+ if($tmp == 6 || $tmp == 7)
33
  {
34
+ if(preg_match('/^[0-9]{9}$/', $phone))
35
+ return true;
36
+ else
37
+ return false;
38
+ } else {
39
+ return false;
40
+ }
41
+ }
42
+
43
+
44
+ /**
45
+ *
46
+ */
47
+ public function getValueConfig ($data, $section)
48
+ {
49
+ return Mage::getStoreConfig('correos/' . $section . '/' . $data);
50
  }
51
 
52
 
53
+ /**
54
+ *
55
+ */
56
+ public function getCarrierConfig ($data, $module)
57
+ {
58
+ return Mage::getStoreConfig('carriers/' . $module . '/' . $data);
59
+ }
60
+
61
+
62
+ /**
63
+ *
64
+ */
65
+ public function _logger ($msg)
66
+ {
67
+ if ($this->getValueConfig('savelog', 'opciones'))
68
+ {
69
+ Mage::log($msg, null, 'correos.log');
70
+ }
71
+ }
72
+
73
+
74
+ /**
75
+ * comprueba que el xml sea correcto
76
+ */
77
+ public function is_valid_xml ($xml)
78
  {
79
+ libxml_use_internal_errors(true);
80
+ $doc = new DOMDocument('1.0', 'utf-8');
81
+ $doc->loadXML($xml);
82
+
83
+ $errors = libxml_get_errors();
84
+ Mage::helper('correos')->_logger($errors);
85
 
86
+ return empty($errors);
87
+ }
88
+
89
+
90
+ /**
91
+ *
92
+ */
93
+ public function getAllowedMethods()
94
+ {
95
+ return $this->_allowedMethods;
96
+ }
97
+
98
+
99
+ /**
100
+ *
101
+ */
102
+ public function checkAuthLoginResponse($html)
103
+ {
104
+ preg_match_all ("/<title>(.*)<\/title>/", $html, $title);
105
+ if (isset($title[1][0]) && $title[1][0] == '401 Authorization Required')
106
  {
107
+ return false;
108
  } else {
109
+ return true;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
110
  }
111
  }
112
 
113
 
114
+
115
+
116
+
117
+
118
+
119
+
120
+
121
+
122
+
123
+
124
+
125
+
126
+
127
+
128
+
129
+
130
+
131
+
132
+
133
+
134
+
135
+
136
+
137
+
138
+
139
+
140
+
141
+
142
+
143
+
144
+
145
  public function getCorreosError ($errorCode)
146
  {
147
 
app/code/local/Ydral/Correos/Helper/Etiqueta.php ADDED
@@ -0,0 +1,33 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ *
5
+ */
6
+ class Ydral_Correos_Helper_Etiqueta extends Mage_Core_Helper_Abstract
7
+ {
8
+
9
+ public function getXmlEtiqueta(array $data)
10
+ {
11
+
12
+ if (empty($data)) return false;
13
+
14
+ $xmlSend = <<<XML
15
+ <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns="http://www.correos.es/iris6/services/preregistroetiquetas">
16
+ <soapenv:Header/>
17
+ <soapenv:Body>
18
+ <SolicitudEtiqueta>
19
+ <fechaOperacion>{$data['fechaOperacion']}</fechaOperacion>
20
+ {$data['dataAuth']}
21
+ <CodEnvio>{$data['codEnvio']}</CodEnvio>
22
+ <Care>000000</Care>
23
+ <ModDevEtiqueta>2</ModDevEtiqueta>
24
+ </SolicitudEtiqueta>
25
+ </soapenv:Body>
26
+ </soapenv:Envelope>
27
+ XML;
28
+
29
+ return $xmlSend;
30
+
31
+ }
32
+
33
+ }
app/code/local/Ydral/Correos/Helper/Preregistro.php ADDED
@@ -0,0 +1,95 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ *
5
+ */
6
+ class Ydral_Correos_Helper_Preregistro extends Mage_Core_Helper_Abstract
7
+ {
8
+
9
+ public function getXmlPreregistro(array $data)
10
+ {
11
+
12
+ if (empty($data)) return false;
13
+
14
+ $xmlSend = <<<XML
15
+ <?xml version="1.0" encoding="utf-8"?>
16
+ <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns="http://www.correos.es/iris6/services/preregistroetiquetas">
17
+ <soapenv:Header/>
18
+ <soapenv:Body>
19
+ <PreregistroEnvio>
20
+ <fechaOperacion>{$data['fechaOperacion']}</fechaOperacion>
21
+ {$data['dataAuth']}
22
+ <Care>000000</Care>
23
+ <TotalBultos>1</TotalBultos>
24
+ <ModDevEtiqueta>2</ModDevEtiqueta>
25
+ <Remitente>
26
+ <Identificacion>
27
+ <Nombre><![CDATA[{$data['datosRemitente']['Nombre']}]]></Nombre>
28
+ <Apellido1><![CDATA[{$data['datosRemitente']['Apellidos']}]]></Apellido1>
29
+ <Nif><![CDATA[{$data['datosRemitente']['Nif']}]]></Nif>
30
+ <Empresa><![CDATA[{$data['datosRemitente']['Empresa']}]]></Empresa>
31
+ <PersonaContacto><![CDATA[{$data['datosRemitente']['Personacontacto']}]]></PersonaContacto>
32
+ </Identificacion>
33
+ <DatosDireccion>
34
+ <Direccion><![CDATA[{$data['datosRemitente']['Direccion']}]]></Direccion>
35
+ <Localidad><![CDATA[{$data['datosRemitente']['Localidad']}]]></Localidad>
36
+ <Provincia><![CDATA[{$data['datosRemitente']['Provincia']}]]></Provincia>
37
+ </DatosDireccion>
38
+ <CP><![CDATA[{$data['datosRemitente']['CP']}]]></CP>
39
+ <Telefonocontacto><![CDATA[{$data['datosRemitente']['Telefono']}]]></Telefonocontacto>
40
+ <Email><![CDATA[{$data['datosRemitente']['Email']}]]></Email>
41
+ <DatosSMS>
42
+ <NumeroSMS><![CDATA[{$data['datosRemitente']['Sms']}]]></NumeroSMS>
43
+ <Idioma>1</Idioma>
44
+ </DatosSMS>
45
+ </Remitente>
46
+ <Destinatario>
47
+ <Identificacion>
48
+ <Nombre><![CDATA[{$data['DatosDestinatario']['Nombre']}]]></Nombre>
49
+ <Apellido1><![CDATA[{$data['DatosDestinatario']['Apellidos']}]]></Apellido1>
50
+ </Identificacion>
51
+ <DatosDireccion>
52
+ <Direccion><![CDATA[{$data['DatosDestinatario']['Direccion']}]]></Direccion>
53
+ <Localidad><![CDATA[{$data['DatosDestinatario']['Localidad']}]]></Localidad>
54
+ <Provincia><![CDATA[{$data['DatosDestinatario']['Provincia']}]]></Provincia>
55
+ </DatosDireccion>
56
+ <CP><![CDATA[{$data['DatosDestinatario']['CP']}]]></CP>
57
+ <ZIP><![CDATA[{$data['DatosDestinatario']['ZIP']}]]></ZIP>
58
+ <Pais><![CDATA[{$data['DatosDestinatario']['Pais']}]]></Pais>
59
+ <Telefonocontacto><![CDATA[{$data['DatosDestinatario']['Telefono']}]]></Telefonocontacto>
60
+ <Email><![CDATA[{$data['DatosDestinatario']['Email']}]]></Email>
61
+ <DatosSMS>
62
+ <NumeroSMS><![CDATA[{$data['DatosDestinatario']['Sms']}]]></NumeroSMS>
63
+ <Idioma>1</Idioma>
64
+ </DatosSMS>
65
+ </Destinatario>
66
+ <Envio>
67
+ <CodProducto>{$data['DatosEnvio']['CodProducto']}</CodProducto>
68
+ <ReferenciaCliente>{$data['DatosEnvio']['ReferenciaCliente']}</ReferenciaCliente>
69
+ <TipoFranqueo>{$data['DatosEnvio']['TipoFranqueo']}</TipoFranqueo>
70
+ <ModalidadEntrega>{$data['DatosEnvio']['ModalidadEntrega']}</ModalidadEntrega>
71
+ {$data['DatosEnvio']['OficinaElegida']}
72
+ <Pesos>
73
+ <Peso>
74
+ <TipoPeso>{$data['DatosEnvio']['Peso_Tipo']}</TipoPeso>
75
+ <Valor>{$data['DatosEnvio']['Peso_Valor']}</Valor>
76
+ </Peso>
77
+ </Pesos>
78
+ <ValoresAnadidos>
79
+ {$data['DatosEnvio']['ValoresAnadidos']['ImporteSeguro']}
80
+ {$data['DatosEnvio']['ValoresAnadidos']['Reembolso']}
81
+ {$data['DatosEnvio']['ValoresAnadidos']['EntregaExclusivaDestinatario']}
82
+ </ValoresAnadidos>
83
+ {$data['DatosEnvio']['InstruccionesDevolucion']}
84
+ {$data['DatosEnvio']['Aduana']['tipoAduana']}
85
+ </Envio>
86
+ </PreregistroEnvio>
87
+ </soapenv:Body>
88
+ </soapenv:Envelope>
89
+ XML;
90
+
91
+ return $xmlSend;
92
+
93
+ }
94
+
95
+ }
app/code/local/Ydral/Correos/Helper/Seguimiento.php ADDED
@@ -0,0 +1,57 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ *
5
+ */
6
+ class Ydral_Correos_Helper_Seguimiento extends Mage_Core_Helper_Abstract
7
+ {
8
+
9
+ /**
10
+ *
11
+ */
12
+ public function getXmlSeguimientoMasivo($xml)
13
+ {
14
+
15
+ if (empty($xml)) return false;
16
+
17
+ $xmlSend = <<<XML
18
+ <?xml version="1.0" encoding="utf-8"?>
19
+ <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
20
+ <soap:Body>
21
+ <ConsultaLocalizacionEnviosFasesMasivo xmlns="ServiciosWebLocalizacionMI/">
22
+ <XMLin><![CDATA[{$xml}]]></XMLin>
23
+ </ConsultaLocalizacionEnviosFasesMasivo>
24
+ </soap:Body>
25
+ </soap:Envelope>
26
+ XML;
27
+
28
+ return $xmlSend;
29
+
30
+ }
31
+
32
+
33
+ /**
34
+ *
35
+ */
36
+ public function getXmlSeguimientoFases($xml)
37
+ {
38
+
39
+ if (empty($xml)) return false;
40
+
41
+ $xmlSend = <<<XML
42
+ <?xml version="1.0" encoding="utf-8"?>
43
+ <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
44
+ <soap:Body>
45
+ <ConsultaLocalizacionEnviosFases xmlns="ServiciosWebLocalizacionMI/">
46
+ <XMLin><![CDATA[{$xml}]]></XMLin>
47
+ </ConsultaLocalizacionEnviosFases>
48
+ </soap:Body>
49
+ </soap:Envelope>
50
+ XML;
51
+
52
+ return $xmlSend;
53
+
54
+ }
55
+
56
+
57
+ }
app/code/local/Ydral/Correos/Model/Correos.php CHANGED
@@ -1,5 +1,8 @@
1
  <?php
2
 
 
 
 
3
  class Ydral_Correos_Model_Correos extends Mage_Core_Model_Abstract
4
  {
5
  protected function _construct()
1
  <?php
2
 
3
+ /**
4
+ *
5
+ */
6
  class Ydral_Correos_Model_Correos extends Mage_Core_Model_Abstract
7
  {
8
  protected function _construct()
app/code/local/Ydral/Correos/Model/Mysql4/Carrier/Correos/Collection.php DELETED
@@ -1,49 +0,0 @@
1
- <?php
2
-
3
- class Ydral_Correos_Model_Mysql4_Carrier_Correos_Collection extends Varien_Data_Collection_Db
4
- {
5
- protected $_shipTable;
6
- protected $_countryTable;
7
- protected $_regionTable;
8
-
9
- public function __construct()
10
- {
11
- parent::__construct(Mage::getSingleton('core/resource')->getConnection('shipping_read'));
12
-
13
- $this->_shipTable = Mage::getSingleton('core/resource')->getTableName('correos_shipping/multipletablerates');
14
-
15
- $this->_countryTable = Mage::getSingleton('core/resource')->getTableName('directory/country');
16
-
17
- $this->_regionTable = Mage::getSingleton('core/resource')->getTableName('directory/country_region');
18
-
19
- $this->_select->from(array("s" => $this->_shipTable))
20
- ->joinLeft(array("c" => $this->_countryTable), 'c.country_id = s.dest_country_id', 'iso3_code AS dest_country')
21
- ->joinLeft(array("r" => $this->_regionTable), 'r.region_id = s.dest_region_id', 'code AS dest_region')
22
- ->order(array("dest_country", "dest_region", "dest_zip"));
23
-
24
- $this->_setIdFieldName('pk');
25
-
26
- return $this;
27
- }
28
-
29
- public function setWebsiteFilter($websiteId)
30
- {
31
- $this->_select->where("website_id = ?", $websiteId);
32
-
33
- return $this;
34
- }
35
-
36
- public function setConditionFilter($conditionName)
37
- {
38
- $this->_select->where("condition_name = ?", $conditionName);
39
-
40
- return $this;
41
- }
42
-
43
- public function setCountryFilter($countryId)
44
- {
45
- $this->_select->where("dest_country_id = ?", $countryId);
46
-
47
- return $this;
48
- }
49
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/local/Ydral/Correos/Model/Mysql4/Correos.php DELETED
@@ -1,9 +0,0 @@
1
- <?php
2
-
3
- class Ydral_Correos_Model_Mysql4_Correos extends Mage_Core_Model_Mysql4_Abstract
4
- {
5
- protected function _construct()
6
- {
7
- $this->_init('correos/correos', 'correos_id');
8
- }
9
- }
 
 
 
 
 
 
 
 
 
app/code/local/Ydral/Correos/Model/Mysql4/Correos/Collection.php DELETED
@@ -1,9 +0,0 @@
1
- <?php
2
-
3
- class Ydral_Correos_Model_Mysql4_Correos_Collection extends Mage_Core_Model_Mysql4_Abstract
4
- {
5
- protected function _construct()
6
- {
7
- $this->_init('correos/correos');
8
- }
9
- }
 
 
 
 
 
 
 
 
 
app/code/local/Ydral/Correos/Model/Observer.php ADDED
@@ -0,0 +1,148 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ *
5
+ */
6
+ class Ydral_Correos_Model_Observer
7
+ {
8
+
9
+ /**
10
+ * Guarda la oficina en el proceso de checkout
11
+ */
12
+ public function setOficinaCorreosRecogida($observer)
13
+ {
14
+
15
+ $params = Mage::app()->getFrontController()->getRequest();
16
+
17
+ $idQuote = Mage::getSingleton('checkout/session')->getQuoteId();
18
+ $idSelector = trim(strip_tags($params->getPost('oficinas_correos_content_select')));
19
+ $cpField = addslashes(trim(strip_tags($params->getPost('cp_search'))));
20
+ $phoneField = addslashes(trim(strip_tags($params->getPost('phone_correos'))));
21
+
22
+
23
+ $_dataSave = array(
24
+ 'entity_type' => 'quote',
25
+ 'checkout_id' => $idQuote,
26
+ 'correos_recogida' => $idSelector,
27
+ 'correos_oficina' => $cpField,
28
+ 'movil_asociado' => $phoneField,
29
+ );
30
+
31
+ $_dataTransaction = Mage::getModel('correos/recoger')
32
+ ->getCheckoutData('quote', $idQuote);
33
+
34
+ if (count($_dataTransaction) == 0)
35
+ {
36
+
37
+ $quoteTransaction = Mage::getModel('correos/recoger')->setData($_dataSave);
38
+ $quoteTransaction->save();
39
+
40
+ } else {
41
+
42
+ $_data = $_dataTransaction->getFirstItem();
43
+ $idTransaction = $_data->getId();
44
+ $quoteTransaction = Mage::getModel('correos/recoger')->load($idTransaction);
45
+ $quoteTransaction->setCorreosRecogida($idSelector);
46
+ $quoteTransaction->setCorreosOficina($cpField);
47
+ $quoteTransaction->setMovilAsociado($phoneField);
48
+ $quoteTransaction->save();
49
+
50
+ }
51
+
52
+ return $this;
53
+
54
+ }
55
+
56
+
57
+ /**
58
+ * Asocia la oficina elegida al pedido creado
59
+ */
60
+ public function setOficinaCorreosRecogidaOrder($observer = null)
61
+ {
62
+
63
+ $idQuote = Mage::getSingleton('checkout/session')->getLastQuoteId();
64
+ $idOrder = Mage::getSingleton('checkout/session')->getLastRealOrderId();
65
+ $params = Mage::app()->getFrontController()->getRequest();
66
+
67
+ $idSelector = trim(strip_tags($params->getPost('oficinas_correos_content_select')));
68
+ $cpField = addslashes(trim(strip_tags($params->getPost('cp_search'))));
69
+ $phoneField = addslashes(trim(strip_tags($params->getPost('phone_correos'))));
70
+
71
+
72
+ $_dataTransaction = Mage::getModel('correos/recoger')
73
+ ->getCheckoutData('quote', $idQuote);
74
+
75
+ if (count($_dataTransaction) == 0)
76
+ {
77
+
78
+ $_dataSave = array(
79
+ 'entity_type' => 'order',
80
+ 'checkout_id' => $idOrder,
81
+ 'correos_recogida' => $idSelector,
82
+ 'correos_oficina' => $cpField,
83
+ 'movil_asociado' => $phoneField,
84
+ );
85
+
86
+ $quoteTransaction = Mage::getModel('correos/recoger')->setData($_dataSave);
87
+ $quoteTransaction->save();
88
+
89
+ } else {
90
+
91
+ $_data = $_dataTransaction->getFirstItem();
92
+ $idTransaction = $_data->getId();
93
+ $quoteTransaction = Mage::getModel('correos/recoger')->load($idTransaction);
94
+ $quoteTransaction->setEntityType('order');
95
+ $quoteTransaction->setCheckoutId($idOrder);
96
+ $quoteTransaction->save();
97
+
98
+ }
99
+
100
+ }
101
+
102
+
103
+ /**
104
+ *
105
+ */
106
+ public function setOficinaCorreosRecogidaOrderAdminhtml($observer)
107
+ {
108
+
109
+ $order = $observer->getOrder();
110
+ $idQuote = $order->getQuoteId();
111
+ $idOrder = $order->getIncrementId();
112
+ $params = Mage::app()->getFrontController()->getRequest();
113
+
114
+
115
+ $idSelector = trim(strip_tags($params->getPost('oficinas_correos_content_select')));
116
+ $cpField = addslashes(trim(strip_tags($params->getPost('cp_search'))));
117
+ $phoneField = addslashes(trim(strip_tags($params->getPost('phone_correos'))));
118
+
119
+ $_dataTransaction = Mage::getModel('correos/recoger')
120
+ ->getCheckoutData('quote', $idQuote);
121
+
122
+ if (count($_dataTransaction) == 0)
123
+ {
124
+
125
+ $_dataSave = array(
126
+ 'entity_type' => 'order',
127
+ 'checkout_id' => $idOrder,
128
+ 'correos_recogida' => $idSelector,
129
+ 'correos_oficina' => $cpField,
130
+ 'movil_asociado' => $phoneField,
131
+ );
132
+
133
+ $quoteTransaction = Mage::getModel('correos/recoger')->setData($_dataSave);
134
+ $quoteTransaction->save();
135
+
136
+ } else {
137
+
138
+ $_data = $_dataTransaction->getFirstItem();
139
+ $idTransaction = $_data->getId();
140
+ $quoteTransaction = Mage::getModel('correos/recoger')->load($idTransaction);
141
+ $quoteTransaction->setEntityType('order');
142
+ $quoteTransaction->setCheckoutId($idOrder);
143
+ $quoteTransaction->save();
144
+
145
+ }
146
+
147
+ }
148
+ }
app/code/local/Ydral/Correos/Model/Oficinas.php ADDED
@@ -0,0 +1,151 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ *
5
+ */
6
+ class Ydral_Correos_Model_Oficinas extends Mage_Core_Model_Abstract
7
+ {
8
+
9
+ /**
10
+ * prepara el selector de oficinas en el checkout
11
+ *
12
+ * @param int $codpostal
13
+ * @return array|false
14
+ */
15
+ public function getHtmlOficinas ($codpostal)
16
+ {
17
+ return $this->pedirOficinas($codpostal);
18
+ }
19
+
20
+
21
+ /**
22
+ * llama a correos para comprobar las oficinas relativas al codigo postal
23
+ *
24
+ */
25
+ protected function pedirOficinas ($codpostal)
26
+ {
27
+
28
+ if (!is_numeric($codpostal)) { return false; }
29
+ if (!Mage::getStoreConfig('correos/general/active')) return false;
30
+
31
+
32
+ /**
33
+ * cadena de peticion
34
+ */
35
+ $xml = '<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ejb="http://ejb.mauo.correos.es"><soapenv:Header/><soapenv:Body><ejb:localizadorConsulta><ejb:codigoPostal>'.$codpostal.'</ejb:codigoPostal></ejb:localizadorConsulta></soapenv:Body></soapenv:Envelope>';
36
+ $urlPeticion = Mage::getStoreConfig('carriers/recogeroficina/gateway_recoger');
37
+ Mage::helper('correos')->_logger('Peticion oficina: ' . $xml);
38
+
39
+
40
+ /**
41
+ * peticion
42
+ */
43
+ try
44
+ {
45
+
46
+ $curl = new Varien_Http_Adapter_Curl();
47
+ $curl->addOption('CURLOPT_FORBID_REUSE', true);
48
+ $curl->addOption('CURLOPT_FRESH_CONNECT', true);
49
+ $curl->setConfig(array('timeout' => 8, 'header' => false));
50
+ $curl->write('POST', $urlPeticion, '1.1', array("Content-Type: text/xml"), $xml);
51
+ $xmlResponse = $curl->read();
52
+ $curl->close();
53
+
54
+ $debugData['result'] = $xmlResponse;
55
+ if ($curl->getError())
56
+ {
57
+ $debugData['error'] = $curl->getError();
58
+ return false;
59
+ }
60
+
61
+ } catch (Exception $e) {
62
+
63
+ $debugData['result'] = array('error' => $e->getMessage(), 'code' => $e->getCode());
64
+ $xmlResponse = '';
65
+
66
+ }
67
+ Mage::helper('correos')->_logger($debugData);
68
+ Mage::helper('correos')->_logger($xmlResponse);
69
+
70
+ return $this->_parseXmlResponse($xmlResponse);
71
+
72
+ }
73
+
74
+
75
+ /**
76
+ *
77
+ * @param mixed $response
78
+ */
79
+ protected function _parseXmlResponse($xmlResponse)
80
+ {
81
+
82
+ if ( (strlen(trim($xmlResponse)) > 0) && Mage::helper('correos')->is_valid_xml($xmlResponse) )
83
+ {
84
+ $dataXml = simplexml_load_string($xmlResponse, NULL, NULL, "http://schemas.xmlsoap.org/soap/envelope/");
85
+ $dataXml->registerXPathNamespace('ns-980841924', 'http://ejb.mauo.correos.es');
86
+ $dataItems = $dataXml->xpath('//item');
87
+
88
+ $indice = 0;
89
+ foreach($dataItems as $item)
90
+ {
91
+
92
+ $_tmpData = array();
93
+ $_tmpData['unidad'] = $item->xpath('//item/ns-980841924:unidad');
94
+ $_tmpData['nombre'] = $item->xpath('//item/ns-980841924:nombre');
95
+ $_tmpData['direccion'] = $item->xpath('//item/ns-980841924:direccion');
96
+ $_tmpData['localidad'] = $item->xpath('//item/ns-980841924:descLocalidad');
97
+ $_tmpData['cp'] = $item->xpath('//item/ns-980841924:cp');
98
+ $_tmpData['telefono'] = $item->xpath('//item/ns-980841924:telefono');
99
+ $_tmpData['horariolv'] = $item->xpath('//item/ns-980841924:horarioLV');
100
+ $_tmpData['horarios'] = $item->xpath('//item/ns-980841924:horarioS');
101
+ $_tmpData['horariof'] = $item->xpath('//item/ns-980841924:horarioF');
102
+ $_tmpData['coorx'] = $item->xpath('//item/ns-980841924:coorXWGS84');
103
+ $_tmpData['coory'] = $item->xpath('//item/ns-980841924:coorYWGS84');
104
+
105
+ foreach($_tmpData as $_data => $_value)
106
+ {
107
+ $_oficinas[$indice][$_data] = (string) $_value[$indice];
108
+ }
109
+ $indice++;
110
+
111
+ }
112
+
113
+ if (empty($_oficinas)) return false;
114
+ else return $_oficinas;
115
+
116
+
117
+ }
118
+
119
+ return false;
120
+
121
+ }
122
+
123
+
124
+ /**
125
+ * devuelve los datos de la oficina cuando se pide por codigo de oficina interno
126
+ */
127
+ public function dataOficinas($codOficina, $codPostal)
128
+ {
129
+
130
+ $_oficinas = $this->pedirOficinas($codPostal);
131
+
132
+ if (!$_oficinas)
133
+ {
134
+ return false;
135
+ } else {
136
+
137
+ foreach ($_oficinas as $oficina)
138
+ {
139
+ if ($oficina['unidad'] == $codOficina)
140
+ {
141
+ return $oficina;
142
+ }
143
+ }
144
+
145
+ return $codOficina;
146
+
147
+ }
148
+
149
+ }
150
+
151
+ }
app/code/local/Ydral/Correos/Model/Pdfmerger.php ADDED
@@ -0,0 +1,197 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * PDFMerger created by Jarrod Nettles December 2009
4
+ * jarrod@squarecrow.com
5
+ *
6
+ * v1.0
7
+ *
8
+ * Class for easily merging PDFs (or specific pages of PDFs) together into one. Output to a file, browser, download, or return as a string.
9
+ * Unfortunately, this class does not preserve many of the enhancements your original PDF might contain. It treats
10
+ * your PDF page as an image and then concatenates them all together.
11
+ *
12
+ * Note that your PDFs are merged in the order that you provide them using the addPDF function, same as the pages.
13
+ * If you put pages 12-14 before 1-5 then 12-15 will be placed first in the output.
14
+ *
15
+ *
16
+ * Uses FPDI 1.3.1 from Setasign
17
+ * Uses FPDF 1.6 by Olivier Plathey with FPDF_TPL extension 1.1.3 by Setasign
18
+ *
19
+ * Both of these packages are free and open source software, bundled with this class for ease of use.
20
+ * They are not modified in any way. PDFMerger has all the limitations of the FPDI package - essentially, it cannot import dynamic content
21
+ * such as form fields, links or page annotations (anything not a part of the page content stream).
22
+ *
23
+ */
24
+ class Ydral_Correos_Model_Pdfmerger
25
+ {
26
+
27
+ private $_files; //['form.pdf'] ["1,2,4, 5-19"]
28
+ private $_fpdi;
29
+
30
+
31
+ /**
32
+ * Merge PDFs.
33
+ * @return void
34
+ */
35
+ public function __construct()
36
+ {
37
+ require_once(Mage::getBaseDir('lib') . '/fpdf/fpdf.php');
38
+ require_once(Mage::getBaseDir('lib') . '/fpdi/fpdi.php');
39
+ }
40
+
41
+ /**
42
+ * Add a PDF for inclusion in the merge with a valid file path. Pages should be formatted: 1,3,6, 12-16.
43
+ * @param $filepath
44
+ * @param $pages
45
+ * @return void
46
+ */
47
+ public function addPDF($filepath, $pages = 'all')
48
+ {
49
+ if(file_exists($filepath))
50
+ {
51
+ if(strtolower($pages) != 'all')
52
+ {
53
+ $pages = $this->_rewritepages($pages);
54
+ }
55
+
56
+ $this->_files[] = array($filepath, $pages);
57
+ }
58
+ else
59
+ {
60
+ throw new exception("Could not locate PDF on '$filepath'");
61
+ }
62
+
63
+ return $this;
64
+ }
65
+
66
+ /**
67
+ * Merges your provided PDFs and outputs to specified location.
68
+ * @param $outputmode
69
+ * @param $outputname
70
+ * @return PDF
71
+ */
72
+ public function merge($outputmode = 'browser', $outputpath = 'newfile.pdf')
73
+ {
74
+ if(!isset($this->_files) || !is_array($this->_files)): throw new exception("No PDFs to merge."); endif;
75
+
76
+ $fpdi = new FPDI;
77
+
78
+ //merger operations
79
+ $label = 1;
80
+ $fpdi->AddPage('P', array("280", "200"));
81
+ foreach($this->_files as $file)
82
+ {
83
+
84
+ if ($label % 5 === 0)
85
+ {
86
+ $fpdi->AddPage('P', array("280", "200"));
87
+ $label = 1;
88
+ }
89
+
90
+ $filename = $file[0];
91
+ $filepages = $file[1];
92
+
93
+ $count = $fpdi->setSourceFile($filename);
94
+
95
+
96
+ //add the pages
97
+ if($filepages == 'all')
98
+ {
99
+
100
+ for($i=1; $i<=$count; $i++)
101
+ {
102
+
103
+ $template = $fpdi->importPage("1", $label);
104
+ $fpdi->useTemplate($template);
105
+ }
106
+ }
107
+
108
+
109
+ $label++;
110
+ }
111
+
112
+ //output operations
113
+ $mode = $this->_switchmode($outputmode);
114
+
115
+ if($mode == 'S')
116
+ {
117
+ return $fpdi->Output($outputpath, 'S');
118
+ }
119
+ else
120
+ {
121
+ if($fpdi->Output($outputpath, $mode))
122
+ {
123
+ return true;
124
+ }
125
+ else
126
+ {
127
+ //this gives fatal error..
128
+ //throw new exception("Error outputting PDF to '$outputmode'.");
129
+ return false;
130
+ }
131
+ }
132
+
133
+
134
+ }
135
+
136
+ /**
137
+ * FPDI uses single characters for specifying the output location. Change our more descriptive string into proper format.
138
+ * @param $mode
139
+ * @return Character
140
+ */
141
+ private function _switchmode($mode)
142
+ {
143
+ switch(strtolower($mode))
144
+ {
145
+ case 'download':
146
+ return 'D';
147
+ break;
148
+ case 'browser':
149
+ return 'I';
150
+ break;
151
+ case 'file':
152
+ return 'F';
153
+ break;
154
+ case 'string':
155
+ return 'S';
156
+ break;
157
+ default:
158
+ return 'I';
159
+ break;
160
+ }
161
+ }
162
+
163
+ /**
164
+ * Takes our provided pages in the form of 1,3,4,16-50 and creates an array of all pages
165
+ * @param $pages
166
+ * @return unknown_type
167
+ */
168
+ private function _rewritepages($pages)
169
+ {
170
+ $pages = str_replace(' ', '', $pages);
171
+ $part = explode(',', $pages);
172
+
173
+ //parse hyphens
174
+ foreach($part as $i)
175
+ {
176
+ $ind = explode('-', $i);
177
+
178
+ if(count($ind) == 2)
179
+ {
180
+ $x = $ind[0]; //start page
181
+ $y = $ind[1]; //end page
182
+
183
+ if($x > $y): throw new exception("Starting page, '$x' is greater than ending page '$y'."); return false; endif;
184
+
185
+ //add middle pages
186
+ while($x <= $y): $newpages[] = (int) $x; $x++; endwhile;
187
+ }
188
+ else
189
+ {
190
+ $newpages[] = (int) $ind[0];
191
+ }
192
+ }
193
+
194
+ return $newpages;
195
+ }
196
+
197
+ }
app/code/local/Ydral/Correos/Model/Recoger.php ADDED
@@ -0,0 +1,33 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ *
5
+ */
6
+ class Ydral_Correos_Model_Recoger extends Mage_Core_Model_Abstract
7
+ {
8
+
9
+ /**
10
+ *
11
+ */
12
+ protected function _construct()
13
+ {
14
+ $this->_init('correos/recoger');
15
+ }
16
+
17
+
18
+ /**
19
+ *
20
+ */
21
+ public function getCheckoutData($entityType, $checkoutId)
22
+ {
23
+
24
+ $_dataTransaction = $this->getCollection()
25
+ ->addFieldToFilter('entity_type', $entityType)
26
+ ->addFieldToFilter('checkout_id', $checkoutId);
27
+ $_dataTransaction->getSelect()->limit(1);
28
+
29
+ return $_dataTransaction;
30
+
31
+ }
32
+
33
+ }
app/code/local/Ydral/Correos/Model/Remitente.php ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ *
5
+ */
6
+ class Ydral_Correos_Model_Remitente extends Mage_Core_Model_Abstract
7
+ {
8
+
9
+ /**
10
+ *
11
+ */
12
+ protected function _construct()
13
+ {
14
+ $this->_init('correos/remitente');
15
+ }
16
+
17
+ }
app/code/local/Ydral/Correos/Model/{Mysql4 → Resource}/Carrier/Correos.php RENAMED
@@ -1,79 +1,105 @@
1
  <?php
2
- class Ydral_Correos_Model_Mysql4_Carrier_Correos extends Mage_Core_Model_Mysql4_Abstract
 
 
 
 
3
  {
 
 
 
 
 
4
  protected function _construct()
5
  {
6
- $this->_init('shipping/correos', 'pk');
 
7
  }
8
 
 
 
 
 
 
 
 
9
  public function getRate(Mage_Shipping_Model_Rate_Request $request)
10
  {
11
- $read = $this->_getReadAdapter();
12
-
13
- $table = Mage::getSingleton('core/resource')->getTableName('correos_shipping/correos');
14
-
15
- $select = $read->select()->from($table);
16
-
17
- $select->where(
18
- $read->quoteInto(" (dest_country_id=? ", $request->getDestCountryId()).
19
- $read->quoteInto(" AND dest_region_id=? ", $request->getDestRegionId()).
20
- $read->quoteInto(" AND dest_zip=?) ", $request->getDestPostcode()).
21
-
22
- $read->quoteInto(" OR (dest_country_id=? ", $request->getDestCountryId()).
23
- $read->quoteInto(" AND dest_region_id=? AND dest_zip='') ", $request->getDestRegionId()).
24
-
25
- $read->quoteInto(" OR (dest_country_id=? AND dest_region_id='0' AND dest_zip='') ", $request->getDestCountryId()).
26
-
27
- $read->quoteInto(" OR (dest_country_id=? AND dest_region_id='0' ", $request->getDestCountryId()).
28
- $read->quoteInto(" AND dest_zip=?) ", $request->getDestPostcode()).
29
-
30
- " OR (dest_country_id='0' AND dest_region_id='0' AND dest_zip='')"
31
  );
32
-
33
- if (is_array($request->getConditionName()))
34
- {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
35
  $i = 0;
36
-
37
- foreach ($request->getConditionName() as $conditionName)
38
- {
39
- if ($i == 0)
40
- {
41
- $select->where('condition_name=?', $conditionName);
42
- }
43
- else
44
- {
45
- $select->orWhere('condition_name=?', $conditionName);
46
- }
47
-
48
- $select->where('condition_value<=?', $request->getData($conditionName));
49
  $i++;
50
  }
51
- }
52
- else
53
- {
54
- $select->where('condition_name=?', $request->getConditionName());
55
- $select->where('condition_value<=?', $request->getData($request->getConditionName()));
 
 
 
 
 
56
  $select->where('method_code=?', $request->getMethodCode());
57
  }
 
 
 
58
 
59
- $select->where('website_id=?', $request->getWebsiteId());
60
-
61
- //$select->group('dest_zip');
62
- //$select->group('dest_region_id');
63
- //$select->group('dest_country_id');
64
-
65
- $select->order('dest_zip DESC');
66
- $select->order('dest_region_id DESC');
67
- $select->order('dest_country_id DESC');
68
 
69
- $select->order('condition_value DESC');
70
- $select->limit(1);
71
- #Mage::log($select->__toString());
72
-
73
- $rows = $read->fetchRow($select);
74
-
75
-
76
- return $rows;
 
 
 
 
77
  }
78
 
79
 
@@ -84,27 +110,22 @@ class Ydral_Correos_Model_Mysql4_Carrier_Correos extends Mage_Core_Model_Mysql4_
84
  {
85
 
86
  $csvFile = $_FILES["groups"]["tmp_name"][$methodCode]["fields"]["import"]["value"];
87
-
88
 
89
  if (!empty($csvFile))
90
  {
91
  $csv = trim(file_get_contents($csvFile));
92
-
93
- $table = Mage::getSingleton('core/resource')->getTableName('correos_shipping/correos');
94
-
95
  $websiteId = $object->getScopeId();
96
 
97
-
98
- /**
99
- * 0.2.0
100
- */
101
- if ($object->getData('groups/'.$methodCode.'/fields/condition_name/inherit') == '1') {
102
  $conditionName = (string)Mage::getConfig()->getNode('default/carriers/'.$methodCode.'/condition_name');
103
  } else {
104
  $conditionName = $object->getData('groups/'.$methodCode.'/fields/condition_name/value');
105
  }
106
 
107
- $conditionFullName = Mage::getModel('correos_shipping/ydral_correos')->getCode('condition_name_short', $conditionName);
108
 
109
  if (!empty($csv))
110
  {
@@ -294,6 +315,10 @@ class Ydral_Correos_Model_Mysql4_Carrier_Correos extends Mage_Core_Model_Mysql4_
294
  }
295
  }
296
 
 
 
 
 
297
  protected function _getCsvValues($string, $separator=",")
298
  {
299
  $elements = explode($separator, trim($string));
@@ -328,6 +353,10 @@ class Ydral_Correos_Model_Mysql4_Carrier_Correos extends Mage_Core_Model_Mysql4_
328
  return $elements;
329
  }
330
 
 
 
 
 
331
  protected function _isPositiveDecimalNumber($n)
332
  {
333
  return preg_match ("/^[0-9]+(\.[0-9]*)?$/", $n);
1
  <?php
2
+
3
+ /**
4
+ *
5
+ */
6
+ class Ydral_Correos_Model_Resource_Carrier_Correos extends Mage_Core_Model_Resource_Db_Abstract
7
  {
8
+
9
+ /**
10
+ *
11
+ * @return void
12
+ */
13
  protected function _construct()
14
  {
15
+ //$this->_init('shipping/correos', 'pk');
16
+ $this->_init('correos/correos', 'pk');
17
  }
18
 
19
+
20
+ /**
21
+ * Devuelve la tabla de tramos de envio o false
22
+ *
23
+ * @param Mage_Shipping_Model_Rate_Request $request
24
+ * @return array|boolean
25
+ */
26
  public function getRate(Mage_Shipping_Model_Rate_Request $request)
27
  {
28
+
29
+ $adapter = $this->_getReadAdapter();
30
+ $bind = array(
31
+ ':website_id' => (int) $request->getWebsiteId(),
32
+ ':country_id' => $request->getDestCountryId(),
33
+ ':region_id' => (int) $request->getDestRegionId(),
34
+ ':postcode' => $request->getDestPostcode()
 
 
 
 
 
 
 
 
 
 
 
 
 
35
  );
36
+ $select = $adapter->select()
37
+ ->from(Mage::getSingleton('core/resource')->getTableName('correos/correos'))
38
+ ->where('website_id = :website_id')
39
+ ->order(array('dest_country_id DESC', 'dest_region_id DESC', 'dest_zip DESC'))
40
+ ->limit(1);
41
+
42
+ // Render destination condition
43
+ $orWhere = '(' . implode(') OR (', array(
44
+ "dest_country_id = :country_id AND dest_region_id = :region_id AND dest_zip = :postcode",
45
+ "dest_country_id = :country_id AND dest_region_id = :region_id AND dest_zip = ''",
46
+
47
+ // Handle asterix in dest_zip field
48
+ "dest_country_id = :country_id AND dest_region_id = :region_id AND dest_zip = '*'",
49
+ "dest_country_id = :country_id AND dest_region_id = 0 AND dest_zip = '*'",
50
+ "dest_country_id = '0' AND dest_region_id = :region_id AND dest_zip = '*'",
51
+ "dest_country_id = '0' AND dest_region_id = 0 AND dest_zip = '*'",
52
+
53
+ "dest_country_id = '0' AND dest_region_id = 0 AND dest_zip = ''",
54
+
55
+ "dest_country_id = :country_id AND dest_region_id = 0 AND dest_zip = ''",
56
+ "dest_country_id = :country_id AND dest_region_id = 0 AND dest_zip = :postcode",
57
+ "dest_country_id = :country_id AND dest_region_id = 0 AND dest_zip = '*'",
58
+ )) . ')';
59
+ $select->where($orWhere);
60
+
61
+
62
+ // Render condition by condition name
63
+ if (is_array($request->getConditionName())) {
64
+ $orWhere = array();
65
  $i = 0;
66
+ foreach ($request->getConditionName() as $conditionName) {
67
+ $bindNameKey = sprintf(':condition_name_%d', $i);
68
+ $bindValueKey = sprintf(':condition_value_%d', $i);
69
+ $orWhere[] = "(condition_name = {$bindNameKey} AND condition_value <= {$bindValueKey})";
70
+ $bind[$bindNameKey] = $conditionName;
71
+ $bind[$bindValueKey] = $request->getData($conditionName);
 
 
 
 
 
 
 
72
  $i++;
73
  }
74
+
75
+ if ($orWhere) {
76
+ $select->where(implode(' OR ', $orWhere));
77
+ }
78
+ } else {
79
+ $bind[':condition_name'] = $request->getConditionName();
80
+ $bind[':condition_value'] = $request->getData($request->getConditionName());
81
+
82
+ $select->where('condition_name = :condition_name');
83
+ $select->where('condition_value <= :condition_value');
84
  $select->where('method_code=?', $request->getMethodCode());
85
  }
86
+
87
+
88
+ $result = $adapter->fetchRow($select, $bind);
89
 
 
 
 
 
 
 
 
 
 
90
 
91
+ // log
92
+ Mage::helper('correos')->_logger('Consulta de petici�n de rates [' . $request->getMethodCode() . ']');
93
+ $adapter->getProfiler()->setEnabled(true); //enable profiler
94
+ Mage::helper('correos')->_logger($adapter->getProfiler()->getLastQueryProfile());
95
+
96
+
97
+ // Normalize destination zip code
98
+ if ($result && $result['dest_zip'] == '*') {
99
+ $result['dest_zip'] = '';
100
+ }
101
+ return $result;
102
+
103
  }
104
 
105
 
110
  {
111
 
112
  $csvFile = $_FILES["groups"]["tmp_name"][$methodCode]["fields"]["import"]["value"];
113
+
114
 
115
  if (!empty($csvFile))
116
  {
117
  $csv = trim(file_get_contents($csvFile));
118
+ $table = Mage::getSingleton('core/resource')->getTableName('correos/correos');
 
 
119
  $websiteId = $object->getScopeId();
120
 
121
+ if ($object->getData('groups/'.$methodCode.'/fields/condition_name/inherit') == '1')
122
+ {
 
 
 
123
  $conditionName = (string)Mage::getConfig()->getNode('default/carriers/'.$methodCode.'/condition_name');
124
  } else {
125
  $conditionName = $object->getData('groups/'.$methodCode.'/fields/condition_name/value');
126
  }
127
 
128
+ $conditionFullName = Mage::getModel('correos/ydral_correos')->getCode('condition_name_short', $conditionName);
129
 
130
  if (!empty($csv))
131
  {
315
  }
316
  }
317
 
318
+
319
+ /**
320
+ *
321
+ */
322
  protected function _getCsvValues($string, $separator=",")
323
  {
324
  $elements = explode($separator, trim($string));
353
  return $elements;
354
  }
355
 
356
+
357
+ /**
358
+ *
359
+ */
360
  protected function _isPositiveDecimalNumber($n)
361
  {
362
  return preg_match ("/^[0-9]+(\.[0-9]*)?$/", $n);
app/code/local/Ydral/Correos/Model/Resource/Carrier/Correos/Collection.php ADDED
@@ -0,0 +1,68 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ *
5
+ */
6
+ class Ydral_Correos_Model_Resource_Carrier_Correos_Collection extends Varien_Data_Collection_Db
7
+ {
8
+ protected $_shipTable;
9
+ protected $_countryTable;
10
+ protected $_regionTable;
11
+
12
+ public function __construct()
13
+ {
14
+
15
+ parent::__construct(Mage::getSingleton('core/resource')->getConnection('shipping_read'));
16
+
17
+ $this->_shipTable = Mage::getSingleton('core/resource')->getTableName('correos/correos');
18
+ $this->_countryTable = Mage::getSingleton('core/resource')->getTableName('directory/country');
19
+ $this->_regionTable = Mage::getSingleton('core/resource')->getTableName('directory/country_region');
20
+
21
+ $this->_initSelect();
22
+ $this->_setIdFieldName('pk');
23
+
24
+ return $this;
25
+
26
+ }
27
+
28
+
29
+ public function _initSelect()
30
+ {
31
+
32
+ $this->_select->from(array("main_table" => $this->_shipTable))
33
+ ->joinLeft(
34
+ array('country_table' => $this->_countryTable),
35
+ 'country_table.country_id = main_table.dest_country_id',
36
+ array('dest_country' => 'iso3_code'))
37
+ ->joinLeft(
38
+ array('region_table' => $this->_regionTable),
39
+ 'region_table.region_id = main_table.dest_region_id',
40
+ array('dest_region' => 'code'));
41
+
42
+ $this->addOrder('dest_country', self::SORT_ORDER_ASC);
43
+ $this->addOrder('dest_region', self::SORT_ORDER_ASC);
44
+ $this->addOrder('dest_zip', self::SORT_ORDER_ASC);
45
+ $this->addOrder('condition_value', self::SORT_ORDER_ASC);
46
+ }
47
+
48
+
49
+ public function setWebsiteFilter($websiteId)
50
+ {
51
+ return $this->addFieldToFilter('website_id', $websiteId);
52
+ }
53
+
54
+ public function setConditionFilter($conditionName)
55
+ {
56
+ return $this->addFieldToFilter('condition_name', $conditionName);
57
+ }
58
+
59
+ public function setCountryFilter($countryId)
60
+ {
61
+ return $this->addFieldToFilter('dest_country_id', $countryId);
62
+ }
63
+
64
+ public function setMethodFilter($methodName)
65
+ {
66
+ return $this->addFieldToFilter('method_code', $methodName);
67
+ }
68
+ }
app/code/local/Ydral/Correos/Model/Resource/Recoger.php ADDED
@@ -0,0 +1,13 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ *
5
+ */
6
+ class Ydral_Correos_Model_Resource_Recoger extends Mage_Core_Model_Mysql4_Abstract
7
+ {
8
+ protected function _construct()
9
+ {
10
+ $this->_init('correos/recoger', 'id');
11
+ }
12
+
13
+ }
app/code/local/Ydral/Correos/Model/Resource/Recoger/Collection.php ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ *
5
+ */
6
+ class Ydral_Correos_Model_Resource_Recoger_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract
7
+ {
8
+ protected function _construct()
9
+ {
10
+ $this->_init('correos/recoger');
11
+ }
12
+ }
app/code/local/Ydral/Correos/Model/Resource/Remitente.php ADDED
@@ -0,0 +1,302 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ *
5
+ */
6
+ class Ydral_Correos_Model_Resource_Remitente extends Mage_Core_Model_Mysql4_Abstract
7
+ {
8
+ protected function _construct()
9
+ {
10
+ $this->_init('correos/remitente', 'id');
11
+ }
12
+
13
+
14
+ /**
15
+ *
16
+ */
17
+
18
+
19
+
20
+ /**
21
+ *
22
+ */
23
+ public function uploadAndImport(Varien_Object $object)
24
+ {
25
+
26
+ $csvFile = $_FILES["groups"]["tmp_name"]["remitente"]["fields"]["importsender"]["value"];
27
+
28
+
29
+ if (!empty($csvFile))
30
+ {
31
+ $csv = trim(file_get_contents($csvFile));
32
+ $table = Mage::getSingleton('core/resource')->getTableName('correos/remitente');
33
+
34
+ if (!empty($csv))
35
+ {
36
+ $exceptions = array();
37
+ $csvLines = explode("\n", $csv);
38
+ $csvLine = array_shift($csvLines);
39
+ $csvLine = $this->_getCsvValues($csvLine);
40
+
41
+ if (count($csvLine) < 13)
42
+ {
43
+ $exceptions[0] = Mage::helper('correos')->__('Formato de fichero de remitentes inválido.');
44
+ }
45
+
46
+ $countryCodes = array();
47
+ $regionCodes = array();
48
+
49
+ foreach ($csvLines as $k => $csvLine)
50
+ {
51
+ $csvLine = $this->_getCsvValues($csvLine);
52
+
53
+ if (count($csvLine) > 0 && count($csvLine) < 13)
54
+ {
55
+ $exceptions[0] = Mage::helper('correos')->__('Formato de fichero de remitentes inválido.');
56
+ }
57
+ else
58
+ {
59
+ $countryCodes[] = $csvLine[5];
60
+ $regionCodes[] = $csvLine[6];
61
+ }
62
+ }
63
+
64
+ if (empty($exceptions))
65
+ {
66
+ $data = array();
67
+ $countryCodesToIds = array();
68
+ $regionCodesToIds = array();
69
+ $countryCodesIso2 = array();
70
+
71
+ $countryCollection = Mage::getResourceModel('directory/country_collection')->addCountryCodeFilter($countryCodes)->load();
72
+
73
+ foreach ($countryCollection->getItems() as $country)
74
+ {
75
+ $countryCodesToIds[$country->getData('iso3_code')] = $country->getData('country_id');
76
+ $countryCodesToIds[$country->getData('iso2_code')] = $country->getData('country_id');
77
+ $countryCodesIso2[] = $country->getData('iso2_code');
78
+ }
79
+
80
+ $regionCollection = Mage::getResourceModel('directory/region_collection')
81
+ ->addRegionCodeFilter($regionCodes)
82
+ ->addCountryFilter($countryCodesIso2)
83
+ ->load();
84
+
85
+ foreach ($regionCollection->getItems() as $region)
86
+ {
87
+ $regionCodesToIds[$countryCodesToIds[$region->getData('country_id')]][$region->getData('code')] = $region->getData('region_id');
88
+ }
89
+
90
+ foreach ($csvLines as $k => $csvLine)
91
+ {
92
+
93
+ $csvLine = $this->_getCsvValues($csvLine);
94
+
95
+ /*
96
+ * Column 1 - Nombre
97
+ */
98
+ if ($csvLine[0] == '') { $nombre = ''; }
99
+ else { $nombre = $csvLine[0]; }
100
+
101
+ /*
102
+ * Column 2 - Apellidos
103
+ */
104
+ if ($csvLine[1] == '') { $apellidos = ''; }
105
+ else { $apellidos = $csvLine[1]; }
106
+
107
+ /*
108
+ * Column 3 - NIF
109
+ */
110
+ if ($csvLine[2] == '') { $nif = ''; }
111
+ else { $nif = $csvLine[2]; }
112
+
113
+ /*
114
+ * Column 4 - Empresa
115
+ */
116
+ if ($csvLine[3] == '') { $empresa = ''; }
117
+ else { $empresa = $csvLine[3]; }
118
+
119
+ /*
120
+ * Column 4 - Persona_de_contacto
121
+ */
122
+ if ($csvLine[4] == '') { $personacontacto = ''; }
123
+ else { $personacontacto = $csvLine[4]; }
124
+
125
+ if ($empresa == '' && $nombre == '')
126
+ {
127
+ $exceptions[] = Mage::helper('correos')->__('Dede indicarse un nombre o una empresa en la dirección de la línea #%s', ($k+1));
128
+ }
129
+
130
+ /**
131
+ * Column 6 - Country
132
+ */
133
+ if (empty($countryCodesToIds) || !array_key_exists($csvLine[5], $countryCodesToIds))
134
+ {
135
+ $countryId = '0';
136
+ if ($csvLine[5] != '') { $exceptions[] = Mage::helper('shipping')->__('Invalid Country "%s" in the Row #%s', $csvLine[5], ($k+1)); }
137
+ } else {
138
+ $countryId = $countryCodesToIds[$csvLine[5]];
139
+ }
140
+
141
+ /*
142
+ * Column 7 - Region/State
143
+ */
144
+ if ($countryId == '0')
145
+ {
146
+ $regionId = '0';
147
+ } else {
148
+ if (empty($regionCodesToIds[$countryCodesToIds[$csvLine[5]]]) || !array_key_exists($csvLine[6], $regionCodesToIds[$countryCodesToIds[$csvLine[5]]]))
149
+ {
150
+ $regionId = '0';
151
+ if ($csvLine[6] != '') { $exceptions[] = Mage::helper('shipping')->__('Invalid Region/State "%s" in the Row #%s', $csvLine[6], ($k+1)); }
152
+ } else {
153
+ $regionId = $regionCodesToIds[$countryCodesToIds[$csvLine[5]]][$csvLine[6]];
154
+ }
155
+ }
156
+
157
+ /*
158
+ * Column 8 - Zip/Postal Code
159
+ */
160
+ if ($csvLine[7] == '')
161
+ {
162
+ $zip = '';
163
+ $exceptions[] = Mage::helper('correos')->__('El código postal es un campo obligatorio en la línea #%s', ($k+1));
164
+ } else { $zip = $csvLine[7]; }
165
+
166
+ /*
167
+ * Column 9 - Localidad
168
+ */
169
+ if ($csvLine[8] == '')
170
+ {
171
+ $localidad = '';
172
+ $exceptions[] = Mage::helper('correos')->__('La localidad es un campo obligatorio en la línea #%s', ($k+1));
173
+ } else { $localidad = $csvLine[8]; }
174
+
175
+ /*
176
+ * Column 10 - Dirección
177
+ */
178
+ if ($csvLine[9] == '')
179
+ {
180
+ $direccion = '';
181
+ $exceptions[] = Mage::helper('correos')->__('La dirección es un campo obligatorio en la línea #%s', ($k+1));
182
+ } else { $direccion = $csvLine[9]; }
183
+
184
+ /*
185
+ * Column 11 - Teléfono
186
+ */
187
+ if ($csvLine[10] == '') { $telefono = ''; }
188
+ else { $telefono = $csvLine[10]; }
189
+
190
+ /*
191
+ * Column 12 - Email
192
+ */
193
+ if ($csvLine[11] == '') { $email = ''; }
194
+ else { $email = $csvLine[11]; }
195
+
196
+ /*
197
+ * Column 13 - Teléfono Móvil
198
+ */
199
+ if ($csvLine[12] == '')
200
+ {
201
+ $telefonosms = '';
202
+ $exceptions[] = Mage::helper('correos')->__('El teléfono móvil es un campo obligatorio en la línea #%s', ($k+1));
203
+ } elseif (!Mage::helper('correos')->validarMovil($csvLine[12])) {
204
+ $telefonosms = '';
205
+ $exceptions[] = Mage::helper('correos')->__('El teléfono móvil es incorrecto en la línea #%s', ($k+1));
206
+ } else { $telefonosms = $csvLine[12]; }
207
+
208
+
209
+
210
+ $data[] = array(
211
+ 'nombre' => $nombre,
212
+ 'apellidos' => $apellidos,
213
+ 'dni' => $nif,
214
+ 'empresa' => $empresa,
215
+ 'persona_contacto' => $personacontacto,
216
+ 'pais' => $countryId,
217
+ 'provincia' => $regionId,
218
+ 'cp' => $zip,
219
+ 'localidad' => $localidad,
220
+ 'direccion' => $direccion,
221
+ 'telefono' => $telefono,
222
+ 'email' => $email,
223
+ 'telefono_movil' => $telefonosms,
224
+ );
225
+ }
226
+ }
227
+
228
+
229
+
230
+ if (empty($exceptions))
231
+ {
232
+ $connection = $this->_getWriteAdapter();
233
+
234
+ $condition = array(
235
+ $connection->quoteInto('nombre = ?', $nombre),
236
+ $connection->quoteInto('pais = ?', $pais),
237
+ $connection->quoteInto('direccion = ?', $direccion),
238
+ );
239
+
240
+ //$connection->delete($table, $condition);
241
+ $connection->delete($table, '');
242
+
243
+ foreach($data as $k => $dataLine)
244
+ {
245
+ try
246
+ {
247
+ $connection->insert($table, $dataLine);
248
+ }
249
+ catch (Exception $e)
250
+ {
251
+ // This should probably show the exception message too.
252
+ $exceptions[] = Mage::helper('shipping')->__('Import error: ' . $e->getMessage());
253
+ }
254
+ }
255
+ }
256
+
257
+ if (!empty($exceptions))
258
+ {
259
+ throw new Exception( "\n" . implode("\n", $exceptions) );
260
+ }
261
+ }
262
+ }
263
+ }
264
+
265
+
266
+ /**
267
+ *
268
+ */
269
+ protected function _getCsvValues($string, $separator=",")
270
+ {
271
+ $elements = explode($separator, trim($string));
272
+
273
+ for ($i = 0; $i < count($elements); $i++)
274
+ {
275
+ $nquotes = substr_count($elements[$i], '"');
276
+
277
+ if ($nquotes %2 == 1)
278
+ {
279
+ for ($j = $i+1; $j < count($elements); $j++)
280
+ {
281
+ if (substr_count($elements[$j], '"') > 0)
282
+ {
283
+ // Put the quoted string's pieces back together again
284
+ array_splice($elements, $i, $j-$i+1, implode($separator, array_slice($elements, $i, $j-$i+1)));
285
+ break;
286
+ }
287
+ }
288
+ }
289
+
290
+ if ($nquotes > 0)
291
+ {
292
+ // Remove first and last quotes, then merge pairs of quotes
293
+ $qstr =& $elements[$i];
294
+ $qstr = substr_replace($qstr, '', strpos($qstr, '"'), 1);
295
+ $qstr = substr_replace($qstr, '', strrpos($qstr, '"'), 1);
296
+ $qstr = str_replace('""', '"', $qstr);
297
+ }
298
+ $elements[$i] = trim($elements[$i]);
299
+ }
300
+ return $elements;
301
+ }
302
+ }
app/code/local/Ydral/Correos/Model/Resource/Remitente/Collection.php ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ *
5
+ */
6
+ class Ydral_Correos_Model_Resource_Remitente_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract
7
+ {
8
+ protected function _construct()
9
+ {
10
+ $this->_init('correos/remitente');
11
+ }
12
+ }
app/code/local/Ydral/Correos/Model/Seguimiento.php ADDED
@@ -0,0 +1,179 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ *
5
+ */
6
+ class Ydral_Correos_Model_Seguimiento extends Mage_Core_Model_Abstract
7
+ {
8
+
9
+ /**
10
+ *
11
+ */
12
+ public function localizarEnvioUltimo ($codEnvio)
13
+ {
14
+
15
+ $xml = '<?xml version="1.0" encoding="utf-8" ?><ConsultaXMLin Idioma="1" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><Consulta><Codigo>'.$codEnvio.'</Codigo></Consulta></ConsultaXMLin>';
16
+
17
+
18
+ try
19
+ {
20
+
21
+ /**
22
+ * xml
23
+ */
24
+ $xmlSend = Mage::helper('correos/seguimiento')->getXmlSeguimientoMasivo($xml);
25
+ $peticionCorreos = $this->sendRequestCorreos($xmlSend, 'ServiciosWebLocalizacionMI/ConsultaLocalizacionEnviosFasesMasivo');
26
+ if ($peticionCorreos == '')
27
+ {
28
+ Mage::throwException(
29
+ Mage::helper('sales')->__('No se ha podido contacto con el servidor de Correos. Respuesta vac&iacute;a.')
30
+ );
31
+ return false;
32
+ }
33
+
34
+
35
+
36
+ /**
37
+ *
38
+ */
39
+ $dataXml = simplexml_load_string($peticionCorreos);
40
+ if (!$dataXml->registerXPathNamespace('respuesta', 'ServiciosWebLocalizacionMI/'))
41
+ {
42
+ // ha devuelto un error;
43
+ Mage::throwException(
44
+ Mage::helper('correos')->__('Error en los datos devueltos por Correos.')
45
+ );
46
+ return false;
47
+ }
48
+ $_respuesta = $dataXml->xpath('//respuesta:ConsultaLocalizacionEnviosFasesMasivoResult');
49
+ $_respuestaXml = simplexml_load_string($_respuesta[0]);
50
+ $respuesta = $_respuestaXml->xpath('//Respuestas/DatosIdiomas/DatosEnvios/Datos');
51
+
52
+ $_estado = (string) $respuesta[0]->Estado;
53
+ $_fecha = (string) $respuesta[0]->Fecha;
54
+
55
+ } catch (Exception $e) {
56
+ if (!$e->getMessage())
57
+ {
58
+ Mage::throwException(
59
+ Mage::helper('correos')->__('Error en los datos devueltos por Correos. Problema de conexión o datos.')
60
+ );
61
+ } else {
62
+ Mage::throwException($e->getMessage());
63
+ }
64
+ }
65
+
66
+ return utf8_decode($_estado . " [" . $_fecha . "]");
67
+
68
+ }
69
+
70
+
71
+ /**
72
+ *
73
+ */
74
+ public function localizarEnvioFases ($codEnvio)
75
+ {
76
+
77
+ $xml = '<?xml version="1.0" encoding="utf-8" ?><ConsultaXMLin Idioma="1" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><Consulta><Codigo>'.$codEnvio.'</Codigo></Consulta></ConsultaXMLin>';
78
+
79
+
80
+ try
81
+ {
82
+
83
+ /**
84
+ * xml
85
+ */
86
+ $xmlSend = Mage::helper('correos/seguimiento')->getXmlSeguimientoFases($xml);
87
+ $peticionCorreos = $this->sendRequestCorreos($xmlSend, 'ServiciosWebLocalizacionMI/ConsultaLocalizacionEnviosFases');
88
+ if ($peticionCorreos == '')
89
+ {
90
+ Mage::throwException(
91
+ Mage::helper('sales')->__('No se ha podido contacto con el servidor de Correos. Respuesta vac&iacute;a.')
92
+ );
93
+ return false;
94
+ }
95
+
96
+
97
+ /**
98
+ *
99
+ */
100
+ $dataXml = simplexml_load_string($peticionCorreos);
101
+ if (!$dataXml->registerXPathNamespace('respuesta', 'ServiciosWebLocalizacionMI/'))
102
+ {
103
+ // ha devuelto un error;
104
+ Mage::throwException(
105
+ Mage::helper('correos')->__('Error en los datos devueltos por Correos.')
106
+ );
107
+ return false;
108
+ }
109
+ $_respuesta = $dataXml->xpath('//respuesta:ConsultaLocalizacionEnviosFasesResult');
110
+ $_respuestaXml = simplexml_load_string($_respuesta[0]);
111
+ $respuesta = $_respuestaXml->xpath('//Respuestas/DatosIdiomas/DatosEnvios/Datos');
112
+
113
+ $_estado = (string) $respuesta[0]->Estado;
114
+ $_fecha = (string) $respuesta[0]->Fecha;
115
+
116
+ } catch (Exception $e) {
117
+ if (!$e->getMessage())
118
+ {
119
+ Mage::throwException(
120
+ Mage::helper('correos')->__('Error en los datos devueltos por Correos. Problema de conexión o datos.')
121
+ );
122
+ } else {
123
+ Mage::throwException($e->getMessage());
124
+ }
125
+ }
126
+
127
+ return $respuesta;
128
+
129
+ }
130
+
131
+
132
+ /**
133
+ *
134
+ */
135
+ protected function sendRequestCorreos($xmlSend, $tipoSolicitud = '')
136
+ {
137
+
138
+ /**
139
+ * cadena de peticion
140
+ */
141
+ $urlPeticion = Mage::getStoreConfig('correos/general/gateway_localizacion');
142
+ Mage::helper('correos')->_logger('Peticion seguimiento (' . $tipoSolicitud . '): ' . $xmlSend);
143
+
144
+
145
+ /**
146
+ * peticion
147
+ */
148
+ try
149
+ {
150
+
151
+ $curl = new Varien_Http_Adapter_Curl();
152
+ $curl->addOption('CURLOPT_FORBID_REUSE', true);
153
+ $curl->addOption('CURLOPT_FRESH_CONNECT', true);
154
+ $curl->setConfig(array('timeout' => 10, 'header' => false));
155
+ $curl->write('POST', $urlPeticion, '1.1', array("Content-Type: text/xml; charset=utf-8", "SOAPAction: \"{$tipoSolicitud}\""), $xmlSend);
156
+ $xmlResponse = $curl->read();
157
+ $curl->close();
158
+
159
+ $debugData['result'] = $xmlResponse;
160
+ if ($curl->getError())
161
+ {
162
+ $debugData['error'] = $curl->getError();
163
+ return false;
164
+ }
165
+
166
+ } catch (Exception $e) {
167
+
168
+ $debugData['result'] = array('error' => $e->getMessage(), 'code' => $e->getCode());
169
+ $xmlResponse = '';
170
+
171
+ }
172
+ Mage::helper('correos')->_logger($debugData);
173
+ Mage::helper('correos')->_logger($xmlResponse);
174
+
175
+ return $xmlResponse;
176
+
177
+ }
178
+
179
+ }
app/code/local/Ydral/Correos/Model/System/Config/Backend/Shipping/Correos.php CHANGED
@@ -1,8 +1,12 @@
1
  <?php
 
 
 
 
2
  class Ydral_Correos_Model_System_Config_Backend_Shipping_Correos extends Mage_Core_Model_Config_Data
3
  {
4
  public function _afterSave()
5
  {
6
- Mage::getResourceModel('correos_shipping/carrier_correos')->uploadAndImport($this, 'envio4872');
7
  }
8
  }
1
  <?php
2
+
3
+ /**
4
+ *
5
+ */
6
  class Ydral_Correos_Model_System_Config_Backend_Shipping_Correos extends Mage_Core_Model_Config_Data
7
  {
8
  public function _afterSave()
9
  {
10
+ Mage::getResourceModel('correos/carrier_correos')->uploadAndImport($this, 'envio4872');
11
  }
12
  }
app/code/local/Ydral/Correos/Model/System/Config/Backend/Shipping/Internacional.php ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ *
5
+ */
6
+ class Ydral_Correos_Model_System_Config_Backend_Shipping_Internacional extends Mage_Core_Model_Config_Data
7
+ {
8
+ public function _afterSave()
9
+ {
10
+ Mage::getResourceModel('correos/carrier_correos')->uploadAndImport($this, 'correosinter');
11
+ }
12
+ }
app/code/local/Ydral/Correos/Model/System/Config/Backend/Shipping/Multiremitente.php ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ *
5
+ */
6
+ class Ydral_Correos_Model_System_Config_Backend_Shipping_Multiremitente extends Mage_Core_Model_Config_Data
7
+ {
8
+ public function _afterSave()
9
+ {
10
+ Mage::getResourceModel('correos/remitente')->uploadAndImport($this);
11
+ }
12
+ }
app/code/local/Ydral/Correos/Model/System/Config/Backend/Shipping/Recoger.php CHANGED
@@ -3,6 +3,6 @@ class Ydral_Correos_Model_System_Config_Backend_Shipping_Recoger extends Mage_Co
3
  {
4
  public function _afterSave()
5
  {
6
- Mage::getResourceModel('correos_shipping/carrier_correos')->uploadAndImport($this, 'recogeroficina');
7
  }
8
  }
3
  {
4
  public function _afterSave()
5
  {
6
+ Mage::getResourceModel('correos/carrier_correos')->uploadAndImport($this, 'recogeroficina');
7
  }
8
  }
app/code/local/Ydral/Correos/Model/{Pesos.php → System/Config/Source/Pesos.php} RENAMED
@@ -1,5 +1,9 @@
1
  <?php
2
- class Ydral_Correos_Model_Pesos
 
 
 
 
3
  {
4
  public function toOptionArray()
5
  {
1
  <?php
2
+
3
+ /**
4
+ *
5
+ */
6
+ class Ydral_Correos_Model_System_Config_Source_Pesos
7
  {
8
  public function toOptionArray()
9
  {
app/code/local/Ydral/Correos/Model/Type/Onepage.php CHANGED
@@ -1,28 +1,4 @@
1
  <?php
2
- /**
3
- * Magento
4
- *
5
- * NOTICE OF LICENSE
6
- *
7
- * This source file is subject to the Open Software License (OSL 3.0)
8
- * that is bundled with this package in the file LICENSE.txt.
9
- * It is also available through the world-wide-web at this URL:
10
- * http://opensource.org/licenses/osl-3.0.php
11
- * If you did not receive a copy of the license and are unable to
12
- * obtain it through the world-wide-web, please send an email
13
- * to license@magentocommerce.com so we can send you a copy immediately.
14
- *
15
- * DISCLAIMER
16
- *
17
- * Do not edit or add to this file if you wish to upgrade Magento to newer
18
- * versions in the future. If you wish to customize Magento for your
19
- * needs please refer to http://www.magentocommerce.com for more information.
20
- *
21
- * @category Mage
22
- * @package Mage_Checkout
23
- * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com)
24
- * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
- */
26
 
27
  /**
28
  * One page checkout processing model
@@ -45,6 +21,14 @@ class Ydral_Correos_Model_Type_Onepage extends Mage_Checkout_Model_Type_Onepage
45
  return array('error' => -1, 'message' => $this->_helper->__('No se ha especificado una oficina de recogida.'));
46
  }
47
 
 
 
 
 
 
 
 
 
48
  return parent::saveShippingMethod($shippingMethod);
49
 
50
  }
1
  <?php
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2
 
3
  /**
4
  * One page checkout processing model
21
  return array('error' => -1, 'message' => $this->_helper->__('No se ha especificado una oficina de recogida.'));
22
  }
23
 
24
+ $_phone = Mage::app()->getRequest()->getPost('phone_correos');
25
+ if ( ($shippingMethod == 'recogeroficina_recogeroficina') && (empty($_phone)) )
26
+ {
27
+ return array('error' => -1, 'message' => $this->_helper->__(utf8_encode('Debe indicar un tel�fono m�vil para poder realizar la entrega del env�o.')));
28
+ } elseif ( ($shippingMethod == 'recogeroficina_recogeroficina') && (!Mage::helper('correos')->validarMovil($_phone)) ) {
29
+ return array('error' => -1, 'message' => $this->_helper->__(utf8_encode('N�mero de tel�fono m�vil no v�lido.')));
30
+ }
31
+
32
  return parent::saveShippingMethod($shippingMethod);
33
 
34
  }
app/code/local/Ydral/Correos/Model/Ydral/Correos.php CHANGED
@@ -1,13 +1,20 @@
1
  <?php
 
 
 
 
2
  class Ydral_Correos_Model_Ydral_Correos extends Mage_Shipping_Model_Carrier_Abstract
3
  {
4
 
5
  protected $_code = 'envio4872';
6
- protected $_default_condition_name = 'package_weight';
7
-
8
 
9
  protected $_conditionNames = array();
10
 
 
 
 
 
11
  public function __construct()
12
  {
13
  parent::__construct();
@@ -17,28 +24,76 @@ class Ydral_Correos_Model_Ydral_Correos extends Mage_Shipping_Model_Carrier_Abst
17
  }
18
 
19
 
 
 
 
 
 
 
 
 
 
20
  /**
21
- * + visualizacion en checkout
22
- */
 
 
 
 
 
 
 
 
 
 
23
  public function collectRates(Mage_Shipping_Model_Rate_Request $request)
24
  {
25
 
 
 
 
 
26
  if (!$this->getConfigFlag('active'))
27
  {
28
  return false;
29
  }
30
 
31
 
32
- $err = null;
33
- $envio = array();
34
-
35
-
36
  /**
37
- * Free Shipping por cantidad 0.2.0
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
38
  */
39
  $freeQty = 0;
40
- if ($request->getAllItems()) {
41
- foreach ($request->getAllItems() as $item) {
 
 
42
  if ($item->getProduct()->isVirtual() || $item->getParentItem()) {
43
  continue;
44
  }
@@ -57,54 +112,59 @@ class Ydral_Correos_Model_Ydral_Correos extends Mage_Shipping_Model_Carrier_Abst
57
 
58
 
59
  /**
60
- * 0.2.0
 
 
61
  */
62
  if (!$request->getConditionName()) {
63
  $request->setConditionName($this->getConfigData('condition_name') ? $this->getConfigData('condition_name') : $this->_default_condition_name);
64
  }
65
 
66
 
67
- // Package weight and qty free shipping
68
- $oldWeight = $request->getPackageWeight();
69
- $oldQty = $request->getPackageQty();
 
 
70
 
71
 
72
  $request->setPackageWeight($request->getFreeMethodWeight());
73
  $request->setPackageQty($oldQty - $freeQty);
74
- $request->setMethodCode('envio4872');
75
 
76
  $result = Mage::getModel('shipping/rate_result');
77
- $rates = $this->getRate($request);
78
- $rate = $rates;
79
- //$rate = $this->getRate($request);
80
-
81
  $request->setPackageWeight($oldWeight);
82
  $request->setPackageQty($oldQty);
83
 
84
-
85
-
86
  /**
87
  *
88
  */
89
- if (!$request->getOrig()) {
 
90
  $request->setCountryId(Mage::getStoreConfig('shipping/origin/country_id', $request->getStore()))
91
  ->setPostcode(Mage::getStoreConfig('shipping/origin/postcode', $request->getStore()));
92
  }
93
 
94
-
95
-
96
  /**
97
- *
98
- */
 
99
  $_datosEnvio['origen'] = Mage::getStoreConfig('shipping/origin/postcode', $request->getStore());
100
 
101
  $_datosEnvio['destino'] = $request->getDestPostcode();
102
  $_datosEnvio['peso'] = $request->getPackageWeight();
103
- $_datosEnvio["bultos"] = 1;
104
- $_datosEnvio["precioProducto"] = $request->getPackageValue();
105
-
106
-
107
-
 
 
 
108
  if (!empty($rate) && $rate['price'] >= 0)
109
  {
110
  $method = Mage::getModel('shipping/rate_result_method');
@@ -113,54 +173,54 @@ class Ydral_Correos_Model_Ydral_Correos extends Mage_Shipping_Model_Carrier_Abst
113
  $method->setCarrierTitle($this->getConfigData('title'));
114
 
115
  $method->setMethod($this->_code);
116
- $method->setMethodTitle('<img src="'.Mage::getModel('core/design_package')->getSkinUrl('images/logo_entregadomicilio.jpg').'" alt="" title="" /><span class="title_correos_method">&nbsp;Entrega en domicilio</span>');
 
117
 
118
-
119
- /**
120
- * 0.2.0
121
- */
122
- if ($request->getFreeShipping() === true) {
123
  $shippingPrice = 0;
124
  } else {
 
125
  $shippingPrice = $rate['price'];
126
  }
127
-
128
  $method->setPrice($shippingPrice);
129
  $method->setCost($this->getConfigData('envio4872cost'));
130
 
131
  $result->append($method);
132
- }
133
 
134
  return $result;
 
135
  }
136
 
137
- public function isTrackingAvailable()
138
- {
139
- return true;
140
- }
141
-
142
  public function getRate(Mage_Shipping_Model_Rate_Request $request)
143
  {
144
- return Mage::getResourceModel('correos_shipping/carrier_correos')->getRate($request);
145
  }
146
 
 
 
 
 
147
  public function getCode($type, $code='')
148
  {
149
 
150
  $codes = array(
151
-
152
  'condition_name'=>array(
153
  'package_weight' => Mage::helper('shipping')->__('Weight vs. Destination'),
154
  'package_value' => Mage::helper('shipping')->__('Price vs. Destination'),
155
  'package_qty' => Mage::helper('shipping')->__('# of Items vs. Destination'),
156
  ),
157
-
158
  'condition_name_short'=>array(
159
  'package_weight' => Mage::helper('shipping')->__('Weight (and above)'),
160
  'package_value' => Mage::helper('shipping')->__('Order Subtotal (and above)'),
161
  'package_qty' => Mage::helper('shipping')->__('# of Items (and above)'),
162
  ),
163
-
164
  );
165
 
166
  if (!isset($codes[$type])) {
1
  <?php
2
+
3
+ /**
4
+ * ENVIO 48/72
5
+ */
6
  class Ydral_Correos_Model_Ydral_Correos extends Mage_Shipping_Model_Carrier_Abstract
7
  {
8
 
9
  protected $_code = 'envio4872';
10
+ protected $_default_condition_name = 'package_weight';
 
11
 
12
  protected $_conditionNames = array();
13
 
14
+
15
+ /**
16
+ *
17
+ */
18
  public function __construct()
19
  {
20
  parent::__construct();
24
  }
25
 
26
 
27
+ /**
28
+ *
29
+ */
30
+ public function isTrackingAvailable()
31
+ {
32
+ return true;
33
+ }
34
+
35
+
36
  /**
37
+ *
38
+ * @return array
39
+ */
40
+ public function getAllowedMethods()
41
+ {
42
+ return array($this->_code => $this->getConfigData('name'));
43
+ }
44
+
45
+
46
+ /**
47
+ *
48
+ */
49
  public function collectRates(Mage_Shipping_Model_Rate_Request $request)
50
  {
51
 
52
+ $err = null;
53
+ $envio = array();
54
+
55
+
56
  if (!$this->getConfigFlag('active'))
57
  {
58
  return false;
59
  }
60
 
61
 
 
 
 
 
62
  /**
63
+ * Excluye productos el precio de los productos virtuales
64
+ */
65
+ if (!$this->getConfigFlag('include_virtual_price') && $request->getAllItems())
66
+ {
67
+ foreach ($request->getAllItems() as $item)
68
+ {
69
+ if ($item->getParentItem())
70
+ {
71
+ continue;
72
+ }
73
+
74
+ if ($item->getHasChildren() && $item->isShipSeparately())
75
+ {
76
+ foreach ($item->getChildren() as $child) {
77
+ if ($child->getProduct()->isVirtual())
78
+ {
79
+ $request->setPackageValue($request->getPackageValue() - $child->getBaseRowTotal());
80
+ }
81
+ }
82
+ } elseif ($item->getProduct()->isVirtual()) {
83
+ $request->setPackageValue($request->getPackageValue() - $item->getBaseRowTotal());
84
+ }
85
+ }
86
+ }
87
+
88
+
89
+ /**
90
+ * Free Shipping
91
  */
92
  $freeQty = 0;
93
+ if ($request->getAllItems())
94
+ {
95
+ foreach ($request->getAllItems() as $item)
96
+ {
97
  if ($item->getProduct()->isVirtual() || $item->getParentItem()) {
98
  continue;
99
  }
112
 
113
 
114
  /**
115
+ * package_weight
116
+ * package_value
117
+ * package_qty
118
  */
119
  if (!$request->getConditionName()) {
120
  $request->setConditionName($this->getConfigData('condition_name') ? $this->getConfigData('condition_name') : $this->_default_condition_name);
121
  }
122
 
123
 
124
+ /**
125
+ * Peso del paqueta y cant. envio gratuito
126
+ */
127
+ $oldWeight = $request->getPackageWeight();
128
+ $oldQty = $request->getPackageQty();
129
 
130
 
131
  $request->setPackageWeight($request->getFreeMethodWeight());
132
  $request->setPackageQty($oldQty - $freeQty);
133
+ $request->setMethodCode('envio4872'); // compatibilidad
134
 
135
  $result = Mage::getModel('shipping/rate_result');
136
+ $rate = $this->getRate($request);
137
+
 
 
138
  $request->setPackageWeight($oldWeight);
139
  $request->setPackageQty($oldQty);
140
 
141
+
 
142
  /**
143
  *
144
  */
145
+ if (!$request->getOrig())
146
+ {
147
  $request->setCountryId(Mage::getStoreConfig('shipping/origin/country_id', $request->getStore()))
148
  ->setPostcode(Mage::getStoreConfig('shipping/origin/postcode', $request->getStore()));
149
  }
150
 
151
+
 
152
  /**
153
+ *
154
+ */
155
+ /*
156
  $_datosEnvio['origen'] = Mage::getStoreConfig('shipping/origin/postcode', $request->getStore());
157
 
158
  $_datosEnvio['destino'] = $request->getDestPostcode();
159
  $_datosEnvio['peso'] = $request->getPackageWeight();
160
+ $_datosEnvio['bultos'] = 1;
161
+ $_datosEnvio['precioProducto'] = $request->getPackageValue();
162
+ */
163
+
164
+
165
+ /**
166
+ *
167
+ */
168
  if (!empty($rate) && $rate['price'] >= 0)
169
  {
170
  $method = Mage::getModel('shipping/rate_result_method');
173
  $method->setCarrierTitle($this->getConfigData('title'));
174
 
175
  $method->setMethod($this->_code);
176
+ //$method->setMethodTitle($this->getConfigData('name'));
177
+ $method->setMethodTitle('<img src="'.Mage::getModel('core/design_package')->getSkinUrl('images/logo_entregadomicilio.jpg').'" alt="" title="" /><span class="title_correos_method">&nbsp;'.$this->getConfigData('name').'</span>');
178
 
179
+ if ($request->getFreeShipping() === true || ($request->getPackageQty() == $freeQty))
180
+ {
 
 
 
181
  $shippingPrice = 0;
182
  } else {
183
+ //$shippingPrice = $this->getFinalPriceWithHandlingFee($rate['price']);
184
  $shippingPrice = $rate['price'];
185
  }
186
+
187
  $method->setPrice($shippingPrice);
188
  $method->setCost($this->getConfigData('envio4872cost'));
189
 
190
  $result->append($method);
191
+ }
192
 
193
  return $result;
194
+
195
  }
196
 
197
+
198
+ /**
199
+ *
200
+ */
 
201
  public function getRate(Mage_Shipping_Model_Rate_Request $request)
202
  {
203
+ return Mage::getResourceModel('correos/carrier_correos')->getRate($request);
204
  }
205
 
206
+
207
+ /**
208
+ *
209
+ */
210
  public function getCode($type, $code='')
211
  {
212
 
213
  $codes = array(
 
214
  'condition_name'=>array(
215
  'package_weight' => Mage::helper('shipping')->__('Weight vs. Destination'),
216
  'package_value' => Mage::helper('shipping')->__('Price vs. Destination'),
217
  'package_qty' => Mage::helper('shipping')->__('# of Items vs. Destination'),
218
  ),
 
219
  'condition_name_short'=>array(
220
  'package_weight' => Mage::helper('shipping')->__('Weight (and above)'),
221
  'package_value' => Mage::helper('shipping')->__('Order Subtotal (and above)'),
222
  'package_qty' => Mage::helper('shipping')->__('# of Items (and above)'),
223
  ),
 
224
  );
225
 
226
  if (!isset($codes[$type])) {
app/code/local/Ydral/Correos/Model/Ydral/Correosinter.php ADDED
@@ -0,0 +1,241 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * ENVIO INTERNACIONAL
5
+ */
6
+ class Ydral_Correos_Model_Ydral_Correosinter extends Mage_Shipping_Model_Carrier_Abstract
7
+ {
8
+
9
+ protected $_code = 'correosinter';
10
+ protected $_default_condition_name = 'package_weight';
11
+
12
+ protected $_conditionNames = array();
13
+
14
+
15
+ /**
16
+ *
17
+ */
18
+ public function __construct()
19
+ {
20
+ parent::__construct();
21
+ foreach ($this->getCode('condition_name') as $k=>$v) {
22
+ $this->_conditionNames[] = $k;
23
+ }
24
+ }
25
+
26
+
27
+ /**
28
+ *
29
+ */
30
+ public function isTrackingAvailable()
31
+ {
32
+ return true;
33
+ }
34
+
35
+
36
+ /**
37
+ *
38
+ * @return array
39
+ */
40
+ public function getAllowedMethods()
41
+ {
42
+ return array($this->_code => $this->getConfigData('name'));
43
+ }
44
+
45
+
46
+ /**
47
+ *
48
+ */
49
+ public function collectRates(Mage_Shipping_Model_Rate_Request $request)
50
+ {
51
+
52
+ $err = null;
53
+ $envio = array();
54
+
55
+
56
+ if (!$this->getConfigFlag('active'))
57
+ {
58
+ return false;
59
+ }
60
+
61
+
62
+ /**
63
+ * Excluye productos el precio de los productos virtuales
64
+ */
65
+ if (!$this->getConfigFlag('include_virtual_price') && $request->getAllItems())
66
+ {
67
+ foreach ($request->getAllItems() as $item)
68
+ {
69
+ if ($item->getParentItem())
70
+ {
71
+ continue;
72
+ }
73
+
74
+ if ($item->getHasChildren() && $item->isShipSeparately())
75
+ {
76
+ foreach ($item->getChildren() as $child) {
77
+ if ($child->getProduct()->isVirtual())
78
+ {
79
+ $request->setPackageValue($request->getPackageValue() - $child->getBaseRowTotal());
80
+ }
81
+ }
82
+ } elseif ($item->getProduct()->isVirtual()) {
83
+ $request->setPackageValue($request->getPackageValue() - $item->getBaseRowTotal());
84
+ }
85
+ }
86
+ }
87
+
88
+
89
+ /**
90
+ * Free Shipping
91
+ */
92
+ $freeQty = 0;
93
+ if ($request->getAllItems())
94
+ {
95
+ foreach ($request->getAllItems() as $item)
96
+ {
97
+ if ($item->getProduct()->isVirtual() || $item->getParentItem()) {
98
+ continue;
99
+ }
100
+
101
+ if ($item->getHasChildren() && $item->isShipSeparately()) {
102
+ foreach ($item->getChildren() as $child) {
103
+ if ($child->getFreeShipping() && !$child->getProduct()->isVirtual()) {
104
+ $freeQty += $item->getQty() * ($child->getQty() - (is_numeric($child->getFreeShipping()) ? $child->getFreeShipping() : 0));
105
+ }
106
+ }
107
+ } elseif ($item->getFreeShipping()) {
108
+ $freeQty += ($item->getQty() - (is_numeric($item->getFreeShipping()) ? $item->getFreeShipping() : 0));
109
+ }
110
+ }
111
+ }
112
+
113
+
114
+ /**
115
+ * package_weight
116
+ * package_value
117
+ * package_qty
118
+ */
119
+ if (!$request->getConditionName()) {
120
+ $request->setConditionName($this->getConfigData('condition_name') ? $this->getConfigData('condition_name') : $this->_default_condition_name);
121
+ }
122
+
123
+
124
+ /**
125
+ * Peso del paqueta y cant. envio gratuito
126
+ */
127
+ $oldWeight = $request->getPackageWeight();
128
+ $oldQty = $request->getPackageQty();
129
+
130
+
131
+ $request->setPackageWeight($request->getFreeMethodWeight());
132
+ $request->setPackageQty($oldQty - $freeQty);
133
+ $request->setMethodCode('correosinter'); // compatibilidad
134
+
135
+ $result = Mage::getModel('shipping/rate_result');
136
+ $rate = $this->getRate($request);
137
+
138
+ $request->setPackageWeight($oldWeight);
139
+ $request->setPackageQty($oldQty);
140
+
141
+
142
+ /**
143
+ *
144
+ */
145
+ if (!$request->getOrig())
146
+ {
147
+ $request->setCountryId(Mage::getStoreConfig('shipping/origin/country_id', $request->getStore()))
148
+ ->setPostcode(Mage::getStoreConfig('shipping/origin/postcode', $request->getStore()));
149
+ }
150
+
151
+
152
+ /**
153
+ *
154
+ */
155
+ /*
156
+ $_datosEnvio['origen'] = Mage::getStoreConfig('shipping/origin/postcode', $request->getStore());
157
+
158
+ $_datosEnvio['destino'] = $request->getDestPostcode();
159
+ $_datosEnvio['peso'] = $request->getPackageWeight();
160
+ $_datosEnvio['bultos'] = 1;
161
+ $_datosEnvio['precioProducto'] = $request->getPackageValue();
162
+ */
163
+
164
+
165
+ /**
166
+ *
167
+ */
168
+ if (!empty($rate) && $rate['price'] >= 0)
169
+ {
170
+ $method = Mage::getModel('shipping/rate_result_method');
171
+
172
+ $method->setCarrier($this->_code);
173
+ $method->setCarrierTitle($this->getConfigData('title'));
174
+
175
+ $method->setMethod($this->_code);
176
+ //$method->setMethodTitle($this->getConfigData('name'));
177
+ $method->setMethodTitle('<img src="'.Mage::getModel('core/design_package')->getSkinUrl('images/logo_entregadomicilio.jpg').'" alt="" title="" /><span class="title_correos_method">&nbsp;'.$this->getConfigData('name').'</span>');
178
+
179
+ if ($request->getFreeShipping() === true || ($request->getPackageQty() == $freeQty))
180
+ {
181
+ $shippingPrice = 0;
182
+ } else {
183
+ //$shippingPrice = $this->getFinalPriceWithHandlingFee($rate['price']);
184
+ $shippingPrice = $rate['price'];
185
+ }
186
+
187
+ $method->setPrice($shippingPrice);
188
+ $method->setCost($this->getConfigData('correosintercost'));
189
+
190
+ $result->append($method);
191
+ }
192
+
193
+ return $result;
194
+
195
+ }
196
+
197
+
198
+ /**
199
+ *
200
+ */
201
+ public function getRate(Mage_Shipping_Model_Rate_Request $request)
202
+ {
203
+ return Mage::getResourceModel('correos/carrier_correos')->getRate($request);
204
+ }
205
+
206
+
207
+ /**
208
+ *
209
+ */
210
+ public function getCode($type, $code='')
211
+ {
212
+
213
+ $codes = array(
214
+ 'condition_name'=>array(
215
+ 'package_weight' => Mage::helper('shipping')->__('Weight vs. Destination'),
216
+ 'package_value' => Mage::helper('shipping')->__('Price vs. Destination'),
217
+ 'package_qty' => Mage::helper('shipping')->__('# of Items vs. Destination'),
218
+ ),
219
+ 'condition_name_short'=>array(
220
+ 'package_weight' => Mage::helper('shipping')->__('Weight (and above)'),
221
+ 'package_value' => Mage::helper('shipping')->__('Order Subtotal (and above)'),
222
+ 'package_qty' => Mage::helper('shipping')->__('# of Items (and above)'),
223
+ ),
224
+ );
225
+
226
+ if (!isset($codes[$type])) {
227
+ throw Mage::exception('Mage_Shipping', Mage::helper('shipping')->__('Invalid Tablerate Rate code type: %s', $type));
228
+ }
229
+
230
+ if (''===$code) {
231
+ return $codes[$type];
232
+ }
233
+
234
+ if (!isset($codes[$type][$code])) {
235
+ throw Mage::exception('Mage_Shipping', Mage::helper('shipping')->__('Invalid Tablerate Rate code for type %s: %s', $type, $code));
236
+ }
237
+
238
+ return $codes[$type][$code];
239
+ }
240
+
241
+ }
app/code/local/Ydral/Correos/Model/Ydral/Recogeroficina.php CHANGED
@@ -1,15 +1,21 @@
1
  <?php
 
 
 
 
2
  class Ydral_Correos_Model_Ydral_Recogeroficina extends Mage_Shipping_Model_Carrier_Abstract
3
  {
4
 
5
- protected $_code = 'recogeroficina';
6
  public $_codigoPostal = '';
7
-
8
  protected $_default_condition_name = 'package_weight';
9
 
10
-
11
  protected $_conditionNames = array();
12
 
 
 
 
 
13
  public function __construct()
14
  {
15
  parent::__construct();
@@ -17,30 +23,78 @@ class Ydral_Correos_Model_Ydral_Recogeroficina extends Mage_Shipping_Model_Carri
17
  $this->_conditionNames[] = $k;
18
  }
19
  }
20
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
21
 
22
  /**
23
- * + visualizacion en checkout
24
- */
25
  public function collectRates(Mage_Shipping_Model_Rate_Request $request)
26
  {
27
 
 
 
 
 
28
  if (!$this->getConfigFlag('active'))
29
  {
30
  return false;
31
  }
 
32
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
33
 
34
- $err = null;
35
- $envio = array();
36
-
37
 
38
  /**
39
- * Free Shipping por cantidad 0.2.0
40
  */
41
  $freeQty = 0;
42
- if ($request->getAllItems()) {
43
- foreach ($request->getAllItems() as $item) {
 
 
44
  if ($item->getProduct()->isVirtual() || $item->getParentItem()) {
45
  continue;
46
  }
@@ -56,55 +110,62 @@ class Ydral_Correos_Model_Ydral_Recogeroficina extends Mage_Shipping_Model_Carri
56
  }
57
  }
58
  }
59
-
60
-
61
  /**
62
- * 0.2.0
 
 
63
  */
64
  if (!$request->getConditionName()) {
65
  $request->setConditionName($this->getConfigData('condition_name') ? $this->getConfigData('condition_name') : $this->_default_condition_name);
66
  }
67
-
68
-
69
- // Package weight and qty free shipping
70
- $oldWeight = $request->getPackageWeight();
71
- $oldQty = $request->getPackageQty();
 
 
72
 
73
 
74
  $request->setPackageWeight($request->getFreeMethodWeight());
75
  $request->setPackageQty($oldQty - $freeQty);
76
- $request->setMethodCode('recogeroficina');
77
 
78
  $result = Mage::getModel('shipping/rate_result');
79
- $rates = $this->getRate($request);
80
- $rate = $rates;
81
- //$rate = $this->getRate($request);
82
-
83
  $request->setPackageWeight($oldWeight);
84
  $request->setPackageQty($oldQty);
85
-
86
-
87
  /**
88
  *
89
  */
90
- if (!$request->getOrig()) {
 
91
  $request->setCountryId(Mage::getStoreConfig('shipping/origin/country_id', $request->getStore()))
92
  ->setPostcode(Mage::getStoreConfig('shipping/origin/postcode', $request->getStore()));
93
  }
94
-
95
-
96
  /**
97
- *
98
- */
 
99
  $_datosEnvio['origen'] = Mage::getStoreConfig('shipping/origin/postcode', $request->getStore());
100
 
101
  $_datosEnvio['destino'] = $request->getDestPostcode();
102
  $_datosEnvio['peso'] = $request->getPackageWeight();
103
- $_datosEnvio["bultos"] = 1;
104
- $_datosEnvio["precioProducto"] = $request->getPackageValue();
105
-
106
-
107
-
 
 
 
108
  if (!empty($rate) && $rate['price'] >= 0)
109
  {
110
  $method = Mage::getModel('shipping/rate_result_method');
@@ -113,260 +174,55 @@ class Ydral_Correos_Model_Ydral_Recogeroficina extends Mage_Shipping_Model_Carri
113
  $method->setCarrierTitle($this->getConfigData('title'));
114
 
115
  $method->setMethod($this->_code);
116
- $method->setMethodTitle('<img src="'.Mage::getModel('core/design_package')->getSkinUrl('images/logo_recogeroficina.jpg').'" alt="" title="" /><span class="title_correos_method">&nbsp;Entrega en oficina elegida</span>');
 
117
 
118
- /**
119
- * 0.2.0
120
- */
121
- if ($request->getFreeShipping() === true) {
122
  $shippingPrice = 0;
123
  } else {
 
124
  $shippingPrice = $rate['price'];
125
  }
126
-
127
  $method->setPrice($shippingPrice);
128
  $method->setCost($this->getConfigData('recogeroficinacost'));
129
 
130
  $result->append($method);
131
- }
132
-
133
- $this->setCodigoPostal($request->getDestPostcode());
134
 
 
135
 
136
  return $result;
 
137
  }
138
 
 
 
 
139
  public function setCodigoPostal($codPostal)
140
  {
141
  $this->_codigoPostal = $codPostal;
142
  }
143
-
144
  public function getCodigoPostal()
145
  {
146
  return $this->_codigoPostal;
147
  }
 
148
 
149
- public function isTrackingAvailable()
150
- {
151
- return true;
152
- }
153
 
 
 
 
154
  public function getRate(Mage_Shipping_Model_Rate_Request $request)
155
  {
156
- return Mage::getResourceModel('correos_shipping/carrier_correos')->getRate($request);
157
  }
158
 
159
-
160
- /**
161
- * prepara el selector de oficinas en el checkout
162
- */
163
- public function getHtmlOficinas ($codpostal)
164
- {
165
-
166
- if (!$_oficinas = $this->pedirOficinas($codpostal))
167
- {
168
- return false;
169
- } else {
170
-
171
- $indice = 0;
172
- $data = array();
173
- foreach($_oficinas as $_data)
174
- {
175
-
176
- $unidad = $_data->xpath('//item/ns-980841924:unidad');
177
- $nombre = $_data->xpath('//item/ns-980841924:nombre');
178
- $direccion = $_data->xpath('//item/ns-980841924:direccion');
179
- $localidad = $_data->xpath('//item/ns-980841924:descLocalidad');
180
- $cp = $_data->xpath('//item/ns-980841924:cp');
181
-
182
- $horariolv = $_data->xpath('//item/ns-980841924:horarioLV');
183
- $horarios = $_data->xpath('//item/ns-980841924:horarioS');
184
- $horariof = $_data->xpath('//item/ns-980841924:horarioF');
185
-
186
- for ($i=0; $i < count($_oficinas); $i++)
187
- {
188
-
189
- $data[$i]['unidad'] = (string) $unidad[$i][0];
190
- $data[$i]['nombre'] = (string) $nombre[$i][0];
191
- $data[$i]['direccion'] = (string) $direccion[$i][0];
192
- $data[$i]['localidad'] = (string) $localidad[$i][0];
193
- $data[$i]['cp'] = (string) $cp[$i][0];
194
- $data[$i]['horariolv'] = (string) $horariolv[$i][0];
195
- $data[$i]['horarios'] = (string) $horarios[$i][0];
196
- $data[$i]['horariof'] = (string) $horariof[$i][0];
197
-
198
- }
199
-
200
- }
201
-
202
- $_returnJson = json_encode($data);
203
 
204
- return $_returnJson;
205
-
206
- }
207
- }
208
-
209
-
210
-
211
  /**
212
- * devuelve los datos de la oficina cuando se pide por codigo de oficina interno
213
- */
214
- public function dataOficinas($codOficina, $codPostal)
215
- {
216
-
217
- $_oficinas = $this->pedirOficinas($codPostal);
218
-
219
- if (!$_oficinas)
220
- {
221
- return false;
222
- } else {
223
-
224
- foreach($_oficinas as $_data)
225
- {
226
-
227
- $unidad = $_data->xpath('//item/ns-980841924:unidad');
228
- $nombre = $_data->xpath('//item/ns-980841924:nombre');
229
- $direccion = $_data->xpath('//item/ns-980841924:direccion');
230
- $localidad = $_data->xpath('//item/ns-980841924:descLocalidad');
231
- $cp = $_data->xpath('//item/ns-980841924:cp');
232
-
233
- }
234
-
235
- for ($i=0; $i < count($_oficinas); $i++)
236
- {
237
-
238
- $_unidad = (string) $unidad[$i];
239
- $_nombre = (string) $nombre[$i][0];
240
- $_direccion = (string) $direccion[$i][0];
241
- $_localidad = (string) $localidad[$i][0];
242
- $_cp = (string) $cp[$i][0];
243
-
244
- if ($_unidad == $codOficina)
245
- {
246
- return '<strong>'.$_nombre.'</strong> - '.$_direccion.'-'.$_localidad.' ('.$_cp.')';
247
- }
248
-
249
- }
250
-
251
- return "Oficina: " . $codOficina;
252
- }
253
-
254
- }
255
-
256
-
257
- /**
258
- * llama a correos para comprobar las oficinas relativas al codigo postal
259
- *
260
- */
261
- protected function pedirOficinas ($codpostal)
262
- {
263
-
264
- if (!is_numeric($codpostal)) { return false; }
265
- if (!Mage::getStoreConfig('correos/general/active')) return false;
266
-
267
- $xml = '<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ejb="http://ejb.mauo.correos.es"><soapenv:Header/><soapenv:Body><ejb:localizadorConsulta><ejb:codigoPostal>'.$codpostal.'</ejb:codigoPostal></ejb:localizadorConsulta></soapenv:Body></soapenv:Envelope>';
268
-
269
- $urlPeticion = Mage::getStoreConfig('carriers/recogeroficina/gateway_recoger');
270
-
271
-
272
-
273
- // peticion curl
274
- $ch = curl_init();
275
- curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
276
- curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
277
- curl_setopt($ch, CURLOPT_HEADER, FALSE);
278
- curl_setopt($ch, CURLOPT_FORBID_REUSE, TRUE);
279
- curl_setopt($ch, CURLOPT_FRESH_CONNECT, TRUE);
280
- curl_setopt($ch, CURLOPT_URL, $urlPeticion );
281
- curl_setopt($ch, CURLOPT_TIMEOUT, 8);
282
- curl_setopt($ch, CURLOPT_POSTFIELDS, $xml );
283
- curl_setopt($ch, CURLOPT_HTTPHEADER, Array("Content-Type: text/xml"));
284
- $data = curl_exec($ch);
285
-
286
- if (curl_errno($ch)) { print curl_error($ch); return false; }
287
- curl_close ($ch);
288
-
289
-
290
- if ($this->is_valid_xml($data))
291
- {
292
- $dataXml = simplexml_load_string($data, NULL, NULL, "http://schemas.xmlsoap.org/soap/envelope/");
293
- $dataXml->registerXPathNamespace('ns-980841924', 'http://ejb.mauo.correos.es');
294
- return $dataXml->xpath('//item');
295
- } else {
296
- return false;
297
- }
298
-
299
- }
300
-
301
-
302
- /**
303
- * comprueba que el xml sea correcto
304
- */
305
- function is_valid_xml ($xml)
306
- {
307
- libxml_use_internal_errors(true);
308
- $doc = new DOMDocument('1.0', 'utf-8');
309
- $doc->loadXML($xml);
310
-
311
- $errors = libxml_get_errors();
312
-
313
- return empty($errors);
314
- }
315
-
316
-
317
- public function saveCheckoutData($entityType, $checkoutId, $correosRecogida, $correosOficina)
318
- {
319
-
320
- $tablePrefix = (string)Mage::getConfig()->getTablePrefix();
321
-
322
- $sqlQuery = 'SELECT id FROM '.$tablePrefix.'correos_recoger_oficina WHERE entity_type = "' . $entityType . '" AND checkout_id = "' . $checkoutId . '" LIMIT 1';
323
- $dbRead = Mage::getSingleton('core/resource')->getConnection('core_read');
324
-
325
- $row = $dbRead->fetchAll($sqlQuery);
326
-
327
- if (!$row)
328
- {
329
- $sqlQuery = 'INSERT INTO '.$tablePrefix.'correos_recoger_oficina values (\'\', ?, ?, ?, ?)';
330
- $dbWrite = Mage::getSingleton('core/resource')->getConnection('core_write');
331
-
332
- $dbWrite->query($sqlQuery, array($entityType, $checkoutId, $correosRecogida, addslashes($correosOficina)));
333
-
334
- } else {
335
-
336
- $sqlQuery = 'UPDATE '.$tablePrefix.'correos_recoger_oficina SET ' .
337
- 'correos_recogida = "' . $correosRecogida . '", ' .
338
- 'correos_oficina = "' . $correosOficina . '" ' .
339
- ' WHERE checkout_id = "' . $checkoutId . '" ' .
340
- ' AND entity_type = "' . $entityType . '" LIMIT 1';
341
-
342
-
343
- $dbWrite = Mage::getSingleton('core/resource')->getConnection('core_write');
344
- $dbWrite->query($sqlQuery);
345
-
346
- }
347
-
348
- }
349
-
350
-
351
- public function readCheckoutData ($entityType, $checkoutId)
352
- {
353
-
354
- $tablePrefix = (string)Mage::getConfig()->getTablePrefix();
355
- $sqlQuery = 'SELECT * FROM '.$tablePrefix.'correos_recoger_oficina WHERE checkout_id = "'.$checkoutId.'" AND entity_type = "'.$entityType.'" ORDER BY id DESC LIMIT 1';
356
- $dbRead = Mage::getSingleton('core/resource')->getConnection('core_read');
357
-
358
- $row = $dbRead->fetchAll($sqlQuery);
359
-
360
- if (!$row)
361
- {
362
- return false;
363
- } else {
364
- return $row[0];
365
- }
366
-
367
- }
368
-
369
-
370
  public function getCode($type, $code='')
371
  {
372
  $codes = array(
1
  <?php
2
+
3
+ /**
4
+ * RECOGEROFICINA
5
+ */
6
  class Ydral_Correos_Model_Ydral_Recogeroficina extends Mage_Shipping_Model_Carrier_Abstract
7
  {
8
 
 
9
  public $_codigoPostal = '';
10
+ protected $_code = 'recogeroficina';
11
  protected $_default_condition_name = 'package_weight';
12
 
 
13
  protected $_conditionNames = array();
14
 
15
+
16
+ /**
17
+ *
18
+ */
19
  public function __construct()
20
  {
21
  parent::__construct();
23
  $this->_conditionNames[] = $k;
24
  }
25
  }
26
+
27
+
28
+ /**
29
+ *
30
+ */
31
+ public function isTrackingAvailable()
32
+ {
33
+ return true;
34
+ }
35
+
36
+
37
+ /**
38
+ *
39
+ * @return array
40
+ */
41
+ public function getAllowedMethods()
42
+ {
43
+ return array($this->_code => $this->getConfigData('name'));
44
+ }
45
+
46
 
47
  /**
48
+ *
49
+ */
50
  public function collectRates(Mage_Shipping_Model_Rate_Request $request)
51
  {
52
 
53
+ $err = null;
54
+ $envio = array();
55
+
56
+
57
  if (!$this->getConfigFlag('active'))
58
  {
59
  return false;
60
  }
61
+
62
 
63
+ /**
64
+ * Excluye productos el precio de los productos virtuales
65
+ */
66
+ if (!$this->getConfigFlag('include_virtual_price') && $request->getAllItems())
67
+ {
68
+ foreach ($request->getAllItems() as $item)
69
+ {
70
+ if ($item->getParentItem())
71
+ {
72
+ continue;
73
+ }
74
+
75
+ if ($item->getHasChildren() && $item->isShipSeparately())
76
+ {
77
+ foreach ($item->getChildren() as $child) {
78
+ if ($child->getProduct()->isVirtual())
79
+ {
80
+ $request->setPackageValue($request->getPackageValue() - $child->getBaseRowTotal());
81
+ }
82
+ }
83
+ } elseif ($item->getProduct()->isVirtual()) {
84
+ $request->setPackageValue($request->getPackageValue() - $item->getBaseRowTotal());
85
+ }
86
+ }
87
+ }
88
 
 
 
 
89
 
90
  /**
91
+ * Free Shipping
92
  */
93
  $freeQty = 0;
94
+ if ($request->getAllItems())
95
+ {
96
+ foreach ($request->getAllItems() as $item)
97
+ {
98
  if ($item->getProduct()->isVirtual() || $item->getParentItem()) {
99
  continue;
100
  }
110
  }
111
  }
112
  }
113
+
114
+
115
  /**
116
+ * package_weight
117
+ * package_value
118
+ * package_qty
119
  */
120
  if (!$request->getConditionName()) {
121
  $request->setConditionName($this->getConfigData('condition_name') ? $this->getConfigData('condition_name') : $this->_default_condition_name);
122
  }
123
+
124
+
125
+ /**
126
+ * Peso del paqueta y cant. envio gratuito
127
+ */
128
+ $oldWeight = $request->getPackageWeight();
129
+ $oldQty = $request->getPackageQty();
130
 
131
 
132
  $request->setPackageWeight($request->getFreeMethodWeight());
133
  $request->setPackageQty($oldQty - $freeQty);
134
+ $request->setMethodCode('recogeroficina'); // compatibilidad
135
 
136
  $result = Mage::getModel('shipping/rate_result');
137
+ $rate = $this->getRate($request);
138
+
 
 
139
  $request->setPackageWeight($oldWeight);
140
  $request->setPackageQty($oldQty);
141
+
142
+
143
  /**
144
  *
145
  */
146
+ if (!$request->getOrig())
147
+ {
148
  $request->setCountryId(Mage::getStoreConfig('shipping/origin/country_id', $request->getStore()))
149
  ->setPostcode(Mage::getStoreConfig('shipping/origin/postcode', $request->getStore()));
150
  }
151
+
152
+
153
  /**
154
+ *
155
+ */
156
+ /*
157
  $_datosEnvio['origen'] = Mage::getStoreConfig('shipping/origin/postcode', $request->getStore());
158
 
159
  $_datosEnvio['destino'] = $request->getDestPostcode();
160
  $_datosEnvio['peso'] = $request->getPackageWeight();
161
+ $_datosEnvio['bultos'] = 1;
162
+ $_datosEnvio['precioProducto'] = $request->getPackageValue();
163
+ */
164
+
165
+
166
+ /**
167
+ *
168
+ */
169
  if (!empty($rate) && $rate['price'] >= 0)
170
  {
171
  $method = Mage::getModel('shipping/rate_result_method');
174
  $method->setCarrierTitle($this->getConfigData('title'));
175
 
176
  $method->setMethod($this->_code);
177
+ //$method->setMethodTitle($this->getConfigData('name'));
178
+ $method->setMethodTitle('<img src="'.Mage::getModel('core/design_package')->getSkinUrl('images/logo_recogeroficina.jpg').'" alt="" title="" /><span class="title_correos_method">&nbsp;'.$this->getConfigData('name').'</span>');
179
 
180
+ if ($request->getFreeShipping() === true || ($request->getPackageQty() == $freeQty))
181
+ {
 
 
182
  $shippingPrice = 0;
183
  } else {
184
+ //$shippingPrice = $this->getFinalPriceWithHandlingFee($rate['price']);
185
  $shippingPrice = $rate['price'];
186
  }
187
+
188
  $method->setPrice($shippingPrice);
189
  $method->setCost($this->getConfigData('recogeroficinacost'));
190
 
191
  $result->append($method);
192
+ }
 
 
193
 
194
+ //$this->setCodigoPostal($request->getDestPostcode());
195
 
196
  return $result;
197
+
198
  }
199
 
200
+
201
+
202
+ /*
203
  public function setCodigoPostal($codPostal)
204
  {
205
  $this->_codigoPostal = $codPostal;
206
  }
 
207
  public function getCodigoPostal()
208
  {
209
  return $this->_codigoPostal;
210
  }
211
+ */
212
 
 
 
 
 
213
 
214
+ /**
215
+ *
216
+ */
217
  public function getRate(Mage_Shipping_Model_Rate_Request $request)
218
  {
219
+ return Mage::getResourceModel('correos/carrier_correos')->getRate($request);
220
  }
221
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
222
 
 
 
 
 
 
 
 
223
  /**
224
+ *
225
+ */
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
226
  public function getCode($type, $code='')
227
  {
228
  $codes = array(
app/code/local/Ydral/Correos/Model/Ydral/Shipment.php CHANGED
@@ -1,282 +1,516 @@
1
  <?php
 
 
 
 
2
  class Ydral_Correos_Model_Ydral_Shipment extends Mage_Sales_Model_Order_Shipment
3
  {
4
 
5
-
6
- protected function preregistroCorreos($xmlSend)
 
 
 
 
 
 
 
7
  {
8
-
9
- $URL=Mage::getStoreConfig('correos/general/gateway_preregistro');
10
-
11
- $datosAcceso = Mage::getStoreConfig('correos/general/usercorreos').":".Mage::getStoreConfig('correos/general/pwdcorreos');
12
-
13
- $ch = curl_init();
14
- curl_setopt($ch, CURLOPT_URL, $URL);
15
- curl_setopt($ch, CURLOPT_USERPWD, $datosAcceso);
16
- curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_ANY);
17
-
18
- curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
19
- curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
20
-
21
- curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
22
- curl_setopt($ch, CURLOPT_TIMEOUT, 10);
23
- curl_setopt($ch, CURLOPT_HEADER, FALSE);
24
- curl_setopt($ch, CURLOPT_POSTFIELDS, $xmlSend);
25
-
26
- curl_setopt($ch, CURLOPT_FORBID_REUSE, TRUE);
27
- curl_setopt($ch, CURLOPT_HTTPHEADER, Array("Content-Type: text/xml; charset=utf-8", "SOAPAction: \"Preregistro\""));
28
- curl_setopt($ch, CURLOPT_FRESH_CONNECT, TRUE);
29
 
 
 
 
 
 
 
 
 
 
30
 
31
- $data = curl_exec($ch);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
32
 
33
- if (curl_errno($ch)) {
 
 
34
  Mage::throwException(
35
- Mage::helper('sales')->__('No se ha podido contactar con el servidor de Correos. Error: ' . curl_errno($ch))
36
  );
37
  return false;
38
  }
39
-
40
- curl_close($ch);
 
 
41
 
42
  return $data;
43
-
44
- }
45
-
46
-
47
- public function getOficinaFromOrder ($order_id)
48
- {
49
 
50
  }
51
-
52
-
53
-
54
  /**
55
- * solicitud de peticion de datos previa a la generacion de envio
56
- */
57
- protected function _beforeSave()
58
  {
59
-
60
- $envio = array();
61
- $_order = $this->getOrder();
62
 
63
- /**
64
- * solo para correos, otros metodos siguen igual
65
- */
66
- $number = Mage::getSingleton('core/app')->getRequest()->getPost('number');
67
- $carrier = Mage::getSingleton('core/app')->getRequest()->getPost('carrier');
68
-
69
- if (
70
- ( ($_order->getShippingMethod() != 'recogeroficina_recogeroficina') && ($_order->getShippingMethod() != 'envio4872_envio4872') ) ||
71
- ( (!empty($number)) && (!empty($carrier)) )
72
- )
73
  {
74
- return parent::_beforeSave();
 
 
 
75
  }
76
 
77
-
78
- /**
79
- * informacin de recogida
80
- */
81
- $_dataRecogida = Mage::getModel('correos/ydral_recogeroficina')->readCheckoutData('order', $_order->getRealOrderId());
82
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
83
 
84
- /*
85
- if (!$_dataRecogida)
86
  {
87
  return false;
88
  }
89
- */
90
 
91
- $_fechaOperacion = date('d-m-Y H:i:s', strtotime($_order->getCreatedAt()));
92
-
93
- $_remitenteNombre = substr(Mage::getStoreConfig('correos/remitente/nombre'), 0, 50);
94
- $_remitenteApellidos = substr(Mage::getStoreConfig('correos/remitente/apellidos'), 0, 50);
95
- $_remitenteNif = substr(Mage::getStoreConfig('correos/remitente/nif'), 0, 15);
96
- $_remitenteEmpresa = substr(Mage::getStoreConfig('correos/remitente/empresa'), 0, 50);
97
- $_remitentePersonacontacto = substr(Mage::getStoreConfig('correos/remitente/personacontacto'), 0, 50);
98
- $_remitenteDireccion = substr(Mage::getStoreConfig('correos/remitente/direccion'), 0, 50);
99
- $_remitenteLocalidad = substr(Mage::getStoreConfig('correos/remitente/localidad'), 0, 25);
100
- $_remitenteProvincia = substr(Mage::getStoreConfig('correos/remitente/provincia'), 0, 40);
101
- $_remitenteSms = substr(Mage::getStoreConfig('correos/remitente/telefonosms'), 0, 12);
102
- $_remitenteCodpostal = substr(Mage::getStoreConfig('correos/remitente/codpostal'), 0, 5);
103
- $_remitenteTelefono = substr(Mage::getStoreConfig('correos/remitente/telefono'), 0, 12);
104
- $_remitenteEmail = substr(Mage::getStoreConfig('correos/remitente/email'), 0, 50);
105
-
106
-
107
- if ($_remitenteNombre == '' && $_remitenteEmpresa != '')
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
108
  {
109
- $_remitenteNombre = $_remitenteEmpresa;
 
 
 
 
110
  }
111
-
112
- if ($this->getOrder()->getShippingMethod() == 'recogeroficina_recogeroficina')
113
  {
114
- $_codProductoCorreos = 'S0133';
115
- $_modalidadEntrega = 'LS';
116
- $_correosRecogida = "<OficinaElegida>".$_dataRecogida['correos_recogida']."</OficinaElegida>";
117
- } elseif ($this->getOrder()->getShippingMethod() == 'envio4872_envio4872')
 
 
 
 
 
118
  {
119
- $_codProductoCorreos = 'S0132';
120
- $_modalidadEntrega = 'ST';
121
- $_correosRecogida = '';
122
  }
123
-
124
- if (Mage::getStoreConfig('correos/general/etiquetador') != '')
 
125
  {
126
- $_dataAuth = '<CodEtiquetador>'.trim(Mage::getStoreConfig('correos/general/etiquetador')).'</CodEtiquetador>';
127
- } elseif ( (Mage::getStoreConfig('correos/general/contrato') != '') && (Mage::getStoreConfig('correos/general/numcliente') != '') ) {
128
- $_dataAuth = '<NumContrato>'.trim(Mage::getStoreConfig('correos/general/contrato')).'</NumContrato><NumCliente>'.trim(Mage::getStoreConfig('correos/general/numcliente')).'</NumCliente>';
129
  } else {
130
- Mage::throwException(
131
- Mage::helper('sales')->__('No se han definido los datos de etiquetador o usuario/password del servicio. Error.')
132
- );
 
 
 
133
  return false;
134
  }
135
-
136
- if (Mage::getStoreConfig('correos/paquete/seguro'))
137
  {
138
- $_seguroPaquete = "<ImporteSeguro>".(Mage::getStoreConfig('correos/paquete/importeseguro')*100)."</ImporteSeguro>";
139
- } else {
140
- $_seguroPaquete = '';
141
  }
 
 
 
 
142
 
143
- /**
144
- * calculo del peso
145
- */
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
146
  $peso = 0;
147
  foreach ($this->getAllItems() as $item) {
148
- $peso+= $item->getOrderItem()->getWeight() * $item->getOrderItem()->getQtyShipped();
149
  }
150
  if (Mage::getStoreConfig('correos/paquete/peso') == 'kilos') { $peso = $peso*1000; }
151
  $peso = intval($peso);
152
  if ($peso == 0) { $peso = 1; } // peso minimo
 
 
 
153
 
154
-
 
155
 
156
- /**
157
- * validacion de datos para adaptarlos al requerido por correos
158
- */
159
- $_destinatarioNombre = substr($_order->getShippingAddress()->getFirstname(), 0, 50); // se coge por el tamano max de correos
160
- $_destinatarioApellidos = substr($_order->getShippingAddress()->getLastname(), 0, 50);
161
- $_destinatarioDireccion = substr($_order->getShippingAddress()->getStreetFull(), 0, 50);
162
- $_destinatarioLocalidad = substr($_order->getShippingAddress()->getCity(), 0, 25);
163
- $_destinatarioProvincia = substr($_order->getShippingAddress()->getRegion(), 0, 40);
164
- $_destinatarioCodpostal = substr($_order->getShippingAddress()->getPostcode(), 0, 5);
165
- $_destinatarioTelefono = substr($_order->getShippingAddress()->getTelephone(), 0, 12);
166
- $_destinatarioEmail = substr($_order->getShippingAddress()->getEmail(), 0, 50);
167
- $_destinatarioTelefono = substr($_order->getShippingAddress()->getTelephone(), 0, 12);
168
- $_destinatarioSMS = substr($_order->getShippingAddress()->getTelephone(), -9); // las ultimas 9 por si pone +,0...
169
 
170
 
 
 
 
 
 
171
 
172
-
173
- if (
174
- (strlen(trim($_destinatarioSMS)) == 0) ||
175
- ( (substr($_destinatarioSMS, 0, 1) != 6) && (substr($_destinatarioSMS, 0, 1) != 7) )
176
- )
177
  {
178
- Mage::throwException(
179
- Mage::helper('sales')->__('No se puede registrar un pedido con el n&uacute;mero de tel&eacute;fono aportado, porque no se podr&aacute; notificar a este n&uacute;mero: ' . $_destinatarioSMS)
180
- );
181
- return false;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
182
  }
 
 
 
 
 
 
 
 
 
 
 
183
 
 
 
 
184
 
 
 
 
 
 
 
 
 
 
185
 
186
- /**
187
- * xml de peticion
188
- */
189
- $xmlSend = <<<XML
190
- <?xml version="1.0" encoding="utf-8"?>
191
- <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns="http://www.correos.es/iris6/services/preregistroetiquetas">
192
- <soapenv:Header/>
193
- <soapenv:Body>
194
- <PreregistroEnvio>
195
- <fechaOperacion>{$_fechaOperacion}</fechaOperacion>
196
- {$_dataAuth}
197
- <ModDevEtiqueta>2</ModDevEtiqueta>
198
- <Care>000000</Care>
199
- <TotalBultos>1</TotalBultos>
200
- <Remitente>
201
- <Identificacion>
202
- <Nombre><![CDATA[{$_remitenteNombre}]]></Nombre>
203
- <Apellido1><![CDATA[{$_remitenteApellidos}]]></Apellido1>
204
- <Apellido2></Apellido2>
205
- <Nif><![CDATA[{$_remitenteNif}]]></Nif>
206
- </Identificacion>
207
- <DatosDireccion>
208
- <Direccion><![CDATA[{$_remitenteDireccion}]]></Direccion>
209
- <Numero></Numero>
210
- <Piso></Piso>
211
- <Puerta></Puerta>
212
- <Localidad><![CDATA[{$_remitenteLocalidad}]]></Localidad>
213
- <Provincia><![CDATA[{$_remitenteProvincia}]]></Provincia>
214
- </DatosDireccion>
215
- <CP><![CDATA[{$_remitenteCodpostal}]]></CP>
216
- <Telefonocontacto><![CDATA[{$_remitenteTelefono}]]></Telefonocontacto>
217
- <Email><![CDATA[{$_remitenteEmail}]]></Email>
218
- <DatosSMS>
219
- <NumeroSMS><![CDATA[{$_remitenteSms}]]></NumeroSMS>
220
- <Idioma>1</Idioma>
221
- </DatosSMS>
222
- </Remitente>
223
- <Destinatario>
224
- <Identificacion>
225
- <Nombre><![CDATA[{$_destinatarioNombre}]]></Nombre>
226
- <Apellido1><![CDATA[{$_destinatarioApellidos}]]></Apellido1>
227
- <Apellido2></Apellido2>
228
- </Identificacion>
229
- <DatosDireccion>
230
- <Direccion><![CDATA[{$_destinatarioDireccion}]]></Direccion>
231
- <Numero></Numero>
232
- <Piso></Piso>
233
- <Puerta></Puerta>
234
- <Localidad><![CDATA[{$_destinatarioLocalidad}]]></Localidad>
235
- <Provincia><![CDATA[{$_destinatarioProvincia}]]></Provincia>
236
- </DatosDireccion>
237
- <CP><![CDATA[{$_destinatarioCodpostal}]]></CP>
238
- <Telefonocontacto><![CDATA[{$_destinatarioTelefono}]]></Telefonocontacto>
239
- <Email><![CDATA[{$_destinatarioEmail}]]></Email>
240
- <DatosSMS>
241
- <NumeroSMS><![CDATA[{$_destinatarioSMS}]]></NumeroSMS>
242
- <Idioma>1</Idioma>
243
- </DatosSMS>
244
- </Destinatario>
245
- <Envio>
246
- <CodProducto>{$_codProductoCorreos}</CodProducto>
247
- <ReferenciaCliente>{$_order->getIncrementId()}</ReferenciaCliente>
248
- <TipoFranqueo>FP</TipoFranqueo>
249
- <ModalidadEntrega>{$_modalidadEntrega}</ModalidadEntrega>
250
- {$_correosRecogida}
251
- <Pesos>
252
- <Peso>
253
- <TipoPeso>R</TipoPeso>
254
- <Valor>{$peso}</Valor>
255
- </Peso>
256
- </Pesos>
257
- <Largo>0</Largo>
258
- <Alto>0</Alto>
259
- <Ancho>0</Ancho>
260
- <ValoresAnadidos>
261
- {$_seguroPaquete}
262
- </ValoresAnadidos>
263
- <Aduana>
264
- <TipoEnvio>2</TipoEnvio>
265
- </Aduana>
266
- </Envio>
267
- </PreregistroEnvio>
268
- </soapenv:Body>
269
- </soapenv:Envelope>
270
- XML;
271
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
272
 
 
 
 
 
 
 
 
 
273
 
274
- // peticion
275
- $peticionCorreos = $this->preregistroCorreos($xmlSend);
276
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
277
  try
278
  {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
279
 
 
 
 
 
 
 
280
  if ($peticionCorreos == '')
281
  {
282
  Mage::throwException(
@@ -284,33 +518,48 @@ XML;
284
  );
285
  return false;
286
  }
287
-
288
 
289
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
290
  $dataXml = simplexml_load_string($peticionCorreos);
291
-
292
-
293
  if (!$dataXml->registerXPathNamespace('respuesta', 'http://www.correos.es/iris6/services/preregistroetiquetas'))
294
  {
295
  // ha devuelto un error;
296
  Mage::throwException(
297
- Mage::helper('sales')->__('Error en los datos devueltos por Correos.')
298
  );
299
  return false;
300
  }
301
-
302
  $_codExpedicion = $dataXml->xpath('//respuesta:CodExpedicion');
303
  $_codEnvio = $dataXml->xpath('//respuesta:Bulto');
304
  $_codError = $dataXml->xpath('//respuesta:Resultado');
305
-
306
-
307
 
308
  if ($_codError[0] == '0')
309
  {
310
  // correcto
311
  $_datosBulto = $dataXml->xpath('//respuesta:Bulto');
312
  Mage::getSingleton('adminhtml/session')->addNotice('Se ha creado la etiqueta de env&iacute;o para Correos.');
313
- Mage::getSingleton('adminhtml/session')->addNotice('C&oacute;digo de expedici&oacute;n: ' . $_codExpedicion[0]);
 
 
 
314
  Mage::getSingleton('adminhtml/session')->addNotice('C&oacute;digo de env&iacute;o: ' . $_codEnvio[0]->CodEnvio);
315
 
316
  $track = Mage::getModel('sales/order_shipment_track')
@@ -337,268 +586,169 @@ XML;
337
  return $canSave;
338
 
339
 
 
340
  } catch (Exception $e) {
341
  if (!$e->getMessage())
342
  {
343
  Mage::throwException(
344
- Mage::helper('sales')->__('No se ha podido contactar con el servidor de Correos.')
345
  );
346
  } else {
347
  Mage::throwException($e->getMessage());
348
  }
349
  }
350
-
351
-
352
-
353
-
354
 
355
  }
356
 
357
 
358
- private function getConfigData ($indice, $mandatory = false)
359
- {
360
-
361
- if ( (Mage::getStoreConfig($indice) == '') && $mandatory)
362
- {
363
- return false;
364
- } else {
365
- return Mage::getStoreConfig($indice);
366
- }
367
-
368
- }
369
-
370
-
371
- public function getEtiquetaRemote ($order_id, $codEnvio)
372
  {
373
-
374
- $_order = Mage::getModel('sales/order')->load($order_id);
375
-
376
- $_fechaOperacion = date('d-m-Y H:i:s', strtotime($_order->getCreatedAt()));
377
-
378
- if (Mage::getStoreConfig('correos/general/etiquetador') != '')
379
- {
380
- $_dataAuth = '<CodEtiquetador>'.trim(Mage::getStoreConfig('correos/general/etiquetador')).'</CodEtiquetador>';
381
- } elseif ( (Mage::getStoreConfig('correos/general/contrato') != '') && (Mage::getStoreConfig('correos/general/numcliente') != '') ) {
382
- $_dataAuth = '<NumContrato>'.trim(Mage::getStoreConfig('correos/general/contrato')).'</NumContrato><NumCliente>'.trim(Mage::getStoreConfig('correos/general/numcliente')).'</NumCliente>';
383
- } else {
384
- Mage::throwException(
385
- Mage::helper('sales')->__('No se han definido los datos de etiquetador o usuario/password del servicio. Error.')
386
- );
387
- return false;
388
- }
389
-
390
- $xmlSend = <<<XML
391
- <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns="http://www.correos.es/iris6/services/preregistroetiquetas">
392
- <soapenv:Header/>
393
- <soapenv:Body>
394
- <SolicitudEtiqueta>
395
- <fechaOperacion>{$_fechaOperacion}</fechaOperacion>
396
- {$_dataAuth}
397
- <CodEnvio>{$codEnvio}</CodEnvio>
398
- <Care>000000</Care>
399
- <ModDevEtiqueta>2</ModDevEtiqueta>
400
- </SolicitudEtiqueta>
401
- </soapenv:Body>
402
- </soapenv:Envelope>
403
- XML;
404
 
405
-
406
- $URL=Mage::getStoreConfig('correos/general/gateway_preregistro');
407
-
408
  $datosAcceso = Mage::getStoreConfig('correos/general/usercorreos').":".Mage::getStoreConfig('correos/general/pwdcorreos');
409
 
410
- $ch = curl_init();
411
- curl_setopt($ch, CURLOPT_URL, $URL);
412
- curl_setopt($ch, CURLOPT_USERPWD, $datosAcceso);
413
- curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_ANY);
414
-
415
- curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
416
- curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
417
-
418
- curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
419
- curl_setopt($ch, CURLOPT_TIMEOUT, 10);
420
- curl_setopt($ch, CURLOPT_HEADER, FALSE);
421
- curl_setopt($ch, CURLOPT_POSTFIELDS, $xmlSend);
422
-
423
- curl_setopt($ch, CURLOPT_FORBID_REUSE, TRUE);
424
- curl_setopt($ch, CURLOPT_HTTPHEADER, Array("Content-Type: text/xml", "SOAPAction: \"SolicitudEtiquetaOp\""));
425
- curl_setopt($ch, CURLOPT_FRESH_CONNECT, TRUE);
426
-
427
-
428
-
429
- $data = curl_exec($ch);
430
-
431
- if (curl_errno($ch)) {
432
- Mage::throwException(
433
- Mage::helper('sales')->__('No se ha podido contacto con el servidor de Correos. Error: ' . curl_errno($ch))
434
- );
435
- return false;
436
- //echo curl_errno($ch);
437
- }
438
-
439
- curl_close($ch);
440
-
441
-
442
- $dataXml = simplexml_load_string($data);
443
- $dataXml->registerXPathNamespace('respuesta', 'http://www.correos.es/iris6/services/preregistroetiquetas');
444
-
445
- $_codExpedicion = $dataXml->xpath('//respuesta:CodExpedicion');
446
- $_codError = $dataXml->xpath('//respuesta:Resultado');
447
-
448
- if ($_codError[0] == '0')
449
  {
450
- // correcto
451
- $_datosBulto = $dataXml->xpath('//respuesta:Bulto');
452
- return $_datosBulto;
453
 
454
- } else {
455
- // error
456
- return false;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
457
  }
 
 
 
 
 
 
458
 
459
-
460
  }
461
 
462
 
463
  /**
464
- *
465
- */
466
- public function localizarEnvioUltimo ($codEnvio)
467
  {
468
-
469
- $xml = '<?xml version="1.0" encoding="utf-8" ?><ConsultaXMLin Idioma="1" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><Consulta><Codigo>'.$codEnvio.'</Codigo></Consulta></ConsultaXMLin>';
470
-
471
-
472
- $xmlSend = <<<XML
473
- <?xml version="1.0" encoding="utf-8"?>
474
- <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
475
- <soap:Body>
476
- <ConsultaLocalizacionEnviosFasesMasivo xmlns="ServiciosWebLocalizacionMI/">
477
- <XMLin><![CDATA[{$xml}]]></XMLin>
478
- </ConsultaLocalizacionEnviosFasesMasivo>
479
- </soap:Body>
480
- </soap:Envelope>
481
- XML;
482
-
483
- $ch = curl_init();
484
- curl_setopt($ch, CURLOPT_URL, Mage::getStoreConfig('correos/general/gateway_localizacion'));
485
- curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
486
- curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
487
-
488
- curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
489
- curl_setopt($ch, CURLOPT_TIMEOUT, 10);
490
- curl_setopt($ch, CURLOPT_HEADER, FALSE);
491
- curl_setopt($ch, CURLOPT_POSTFIELDS, $xmlSend);
492
- curl_setopt($ch, CURLOPT_HTTPHEADER, Array("Content-Type: text/xml", "SOAPAction: ServiciosWebLocalizacionMI/ConsultaLocalizacionEnviosFasesMasivo"));
493
- curl_setopt($ch, CURLOPT_FORBID_REUSE, TRUE);
494
- curl_setopt($ch, CURLOPT_FRESH_CONNECT, TRUE);
495
-
496
-
497
  try
498
  {
499
- $data = curl_exec($ch);
500
-
501
- if (curl_errno($ch)) {
 
 
 
502
  Mage::throwException(
503
- Mage::helper('sales')->__('No se ha podido contactar con el servidor de Correos. Error: ' . curl_errno($ch))
504
  );
505
  return false;
506
  }
 
 
 
 
507
 
508
- $dataXml = simplexml_load_string($data);
509
- $dataXml->registerXPathNamespace('respuesta', 'ServiciosWebLocalizacionMI/');
510
- $_respuesta = $dataXml->xpath('//respuesta:ConsultaLocalizacionEnviosFasesMasivoResult');
511
-
512
-
513
- $_respuestaXml = simplexml_load_string($_respuesta[0]);
514
- $respuesta = $_respuestaXml->xpath('//Respuestas/DatosIdiomas/DatosEnvios/Datos');
515
 
516
- $_estado = (string) $respuesta[0]->Estado;
517
- $_fecha = (string) $respuesta[0]->Fecha;
 
 
518
 
519
- } catch (Exception $e) {
520
- /*
521
- Mage::throwException(
522
- Mage::helper('sales')->__('No se ha podido contactar con el servidor de localizaci&oacute;n de Correos.')
523
- );
524
- return false;
525
- */
526
- return "Datos no disponibles temporalmente.";
527
- }
528
-
529
- return utf8_decode($_estado . " [" . $_fecha . "]");
530
-
531
- }
532
-
533
 
534
- /**
535
- *
536
- */
537
- public function localizarEnvioFases ($codEnvio)
538
- {
 
 
 
 
 
 
 
 
 
539
 
540
- $xml = '<?xml version="1.0" encoding="utf-8" ?><ConsultaXMLin Idioma="1" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><Consulta><Codigo>'.$codEnvio.'</Codigo></Consulta></ConsultaXMLin>';
541
-
542
-
543
- $xmlSend = <<<XML
544
- <?xml version="1.0" encoding="utf-8"?>
545
- <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
546
- <soap:Body>
547
- <ConsultaLocalizacionEnviosFases xmlns="ServiciosWebLocalizacionMI/">
548
- <XMLin><![CDATA[{$xml}]]></XMLin>
549
- </ConsultaLocalizacionEnviosFases>
550
- </soap:Body>
551
- </soap:Envelope>
552
- XML;
553
-
554
- $ch = curl_init();
555
- curl_setopt($ch, CURLOPT_URL, Mage::getStoreConfig('correos/general/gateway_localizacion'));
556
- curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
557
- curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
558
-
559
- curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
560
- curl_setopt($ch, CURLOPT_TIMEOUT, 10);
561
- curl_setopt($ch, CURLOPT_HEADER, FALSE);
562
- curl_setopt($ch, CURLOPT_POSTFIELDS, $xmlSend);
563
- curl_setopt($ch, CURLOPT_HTTPHEADER, Array("Content-Type: text/xml", "SOAPAction: ServiciosWebLocalizacionMI/ConsultaLocalizacionEnviosFases"));
564
- curl_setopt($ch, CURLOPT_FORBID_REUSE, TRUE);
565
- curl_setopt($ch, CURLOPT_FRESH_CONNECT, TRUE);
566
 
567
-
568
- try
569
- {
570
- $data = curl_exec($ch);
 
 
 
 
 
 
 
571
 
572
- if (curl_errno($ch)) {
 
 
 
 
 
 
573
  Mage::throwException(
574
- Mage::helper('sales')->__('No se ha podido contactar con el servidor de Correos. Error: ' . curl_errno($ch))
575
  );
576
  return false;
577
  }
578
 
579
- $dataXml = simplexml_load_string($data);
580
- $dataXml->registerXPathNamespace('respuesta', 'ServiciosWebLocalizacionMI/');
581
- $_respuesta = $dataXml->xpath('//respuesta:ConsultaLocalizacionEnviosFasesResult');
582
-
583
-
584
- $_respuestaXml = simplexml_load_string($_respuesta[0]);
585
- $respuesta = $_respuestaXml->xpath('//Respuestas/DatosIdiomas/DatosEnvios/Datos');
586
 
587
- } catch (Exception $e) {
588
- /*
589
- Mage::throwException(
590
- Mage::helper('sales')->__('No se ha podido contactar con el servidor de Correos para el seguimiento del pedido.')
591
- );
592
- return false;
593
- */
594
- return "Datos no disponibles temporalmente.";
595
- }
596
-
597
-
598
- return $respuesta;
599
-
600
- }
601
-
602
-
 
 
 
 
 
 
 
603
 
604
  }
1
  <?php
2
+
3
+ /**
4
+ * Crea el preregistro del paquete en Correos
5
+ */
6
  class Ydral_Correos_Model_Ydral_Shipment extends Mage_Sales_Model_Order_Shipment
7
  {
8
 
9
+ protected $shippingMethod = '';
10
+ protected $kahalaCountries = array ('AU', 'CN', 'KR', 'US', 'GG', 'HK', 'JP', 'JE', 'IM', 'GB',);
11
+ protected $eupeanCountries = array ('AT', 'BE', 'BG', 'CH', 'CY', 'CZ', 'DE', 'DK', 'EE', 'FI', 'FR', 'GR', 'HR', 'HU', 'IE', 'IS', 'IT', 'LI', 'LT', 'LU', 'LV', 'MT', 'NL', 'NO', 'PL', 'PT', 'RO', 'SE', 'SI', 'SK', 'TR', 'UK',);
12
+
13
+
14
+ /**
15
+ *
16
+ */
17
+ protected function getAuthXml()
18
  {
19
+ if (Mage::getStoreConfig('correos/general/etiquetador') != '')
20
+ {
21
+ $_dataAuth = '<CodEtiquetador>'.trim(Mage::getStoreConfig('correos/general/etiquetador')).'</CodEtiquetador>';
22
+ } elseif ( (Mage::getStoreConfig('correos/general/contrato') != '') && (Mage::getStoreConfig('correos/general/numcliente') != '') ) {
23
+ $_dataAuth = '<NumContrato>'.trim(Mage::getStoreConfig('correos/general/contrato')).'</NumContrato><NumCliente>'.trim(Mage::getStoreConfig('correos/general/numcliente')).'</NumCliente>';
24
+ } else {
25
+ Mage::throwException(
26
+ Mage::helper('correos')->__('No se han definido los datos de etiquetador o usuario/password del servicio. Error.')
27
+ );
28
+ return false;
29
+ }
 
 
 
 
 
 
 
 
 
 
30
 
31
+ return $_dataAuth;
32
+ }
33
+
34
+
35
+ /**
36
+ *
37
+ */
38
+ protected function getDataRemitente()
39
+ {
40
 
41
+ $_camposObligatorios = array (
42
+ 'Direccion',
43
+ 'Localidad',
44
+ 'CP',
45
+ );
46
+
47
+ // tipoIdentificacion
48
+ $data['Nombre'] = substr(Mage::getStoreConfig('correos/remitente/nombre'), 0, 50);
49
+ $data['Apellidos'] = substr(Mage::getStoreConfig('correos/remitente/apellidos'), 0, 50);
50
+ $data['Nif'] = substr(Mage::getStoreConfig('correos/remitente/nif'), 0, 15);
51
+ $data['Empresa'] = substr(Mage::getStoreConfig('correos/remitente/empresa'), 0, 50);
52
+ $data['Personacontacto'] = substr(Mage::getStoreConfig('correos/remitente/personacontacto'), 0, 50);
53
+
54
+ // tipoDireccion
55
+ $data['Direccion'] = substr(Mage::getStoreConfig('correos/remitente/direccion'), 0, 50);
56
+ $data['Localidad'] = substr(Mage::getStoreConfig('correos/remitente/localidad'), 0, 50);
57
+ $provincia = Mage::getModel('directory/region')->load(Mage::getStoreConfig('correos/remitente/region_id'))->getName();
58
+ $data['Provincia'] = substr($provincia, 0, 40);
59
+
60
+ //
61
+ $data['CP'] = substr(Mage::getStoreConfig('correos/remitente/codpostal'), 0, 5);
62
+ $data['Telefono'] = substr(Mage::getStoreConfig('correos/remitente/telefono'), 0, 12);
63
+ $data['Email'] = substr(Mage::getStoreConfig('correos/remitente/email'), 0, 50);
64
+
65
+ // tipoSMS
66
+ $data['Sms'] = substr(Mage::getStoreConfig('correos/remitente/telefonosms'), 0, 12);
67
+ if (!Mage::helper('correos')->validarMovil($data['Sms']))
68
+ {
69
+ $data['Sms'] = '';
70
+ }
71
 
72
+ // checks
73
+ if (empty($data['Nombre']) && empty($data['Empresa']))
74
+ {
75
  Mage::throwException(
76
+ Mage::helper('correos')->__('Uno de los campos de remitente Nombre o Empresa es obligatorio.')
77
  );
78
  return false;
79
  }
80
+ if (!$this->checkMandatoryFields($data, $_camposObligatorios, 'remitente'))
81
+ {
82
+ return false;
83
+ }
84
 
85
  return $data;
 
 
 
 
 
 
86
 
87
  }
88
+
89
+
 
90
  /**
91
+ *
92
+ */
93
+ protected function getDataMultiRemitente($remitente)
94
  {
 
 
 
95
 
96
+ $remitenteData = Mage::getModel('correos/remitente')->load($remitente);
97
+
98
+ if (($remitenteData->getNombre() == '') && ($remitenteData->getEmpresa() == ''))
 
 
 
 
 
 
 
99
  {
100
+ Mage::throwException(
101
+ Mage::helper('correos')->__('Uno de los campos de remitente Nombre o Empresa es obligatorio.')
102
+ );
103
+ return false;
104
  }
105
 
106
+ $_camposObligatorios = array (
107
+ 'Direccion',
108
+ 'Localidad',
109
+ 'CP',
110
+ );
111
+
112
+ // tipoIdentificacion
113
+ $data['Nombre'] = substr($remitenteData->getNombre(), 0, 50);
114
+ $data['Apellidos'] = substr($remitenteData->getApellidos(), 0, 50);
115
+ $data['Nif'] = substr($remitenteData->getDni(), 0, 15);
116
+ $data['Empresa'] = substr($remitenteData->getEmpresa(), 0, 50);
117
+ $data['Personacontacto'] = substr($remitenteData->getPersonaContacto(), 0, 50);
118
+
119
+ // tipoDireccion
120
+ $data['Direccion'] = substr($remitenteData->getDireccion(), 0, 50);
121
+ $data['Localidad'] = substr($remitenteData->getLocalidad(), 0, 50);
122
+ $provincia = Mage::getModel('directory/region')->load($remitenteData->getProvincia())->getName();
123
+ $data['Provincia'] = substr($provincia, 0, 40);
124
+
125
+ //
126
+ $data['CP'] = substr($remitenteData->getCp(), 0, 5);
127
+ $data['Telefono'] = substr($remitenteData->getTelefono(), 0, 12);
128
+ $data['Email'] = substr($remitenteData->getEmail(), 0, 50);
129
+
130
+ // tipoSMS
131
+ $data['Sms'] = substr($remitenteData->getTelefonoMovil(), 0, 12);
132
+ if (!Mage::helper('correos')->validarMovil($data['Sms']))
133
+ {
134
+ $data['Sms'] = '';
135
+ }
136
 
137
+ // checks
138
+ if (!$this->checkMandatoryFields($data, $_camposObligatorios, 'remitente'))
139
  {
140
  return false;
141
  }
 
142
 
143
+ return $data;
144
+
145
+ }
146
+
147
+
148
+ /**
149
+ *
150
+ */
151
+ protected function getDataDestinatario($order, $movil)
152
+ {
153
+
154
+ $_camposObligatorios = array (
155
+ 'Nombre',
156
+ 'Direccion',
157
+ 'Localidad',
158
+ );
159
+
160
+ // tipoIdentificacion
161
+ $data['Nombre'] = substr($order->getShippingAddress()->getFirstname(), 0, 50);
162
+ $data['Apellidos'] = substr($order->getShippingAddress()->getLastname(), 0, 50);
163
+ //$data['Nif'] = substr(Mage::getStoreConfig('correos/remitente/nif'), 0, 15);
164
+
165
+ // tipoDireccion
166
+ $data['Direccion'] = substr($order->getShippingAddress()->getStreetFull(), 0, 50);
167
+ $data['Localidad'] = substr($order->getShippingAddress()->getCity(), 0, 25);
168
+ $data['Provincia'] = substr($order->getShippingAddress()->getRegion(), 0, 40);
169
+
170
+ //
171
+ $data['CP'] = substr($order->getShippingAddress()->getPostcode(), 0, 5);
172
+ $data['ZIP'] = substr($order->getShippingAddress()->getPostcode(), 0, 10);
173
+ $data['Pais'] = substr($order->getShippingAddress()->getCountryId(), 0, 2);
174
+ $data['Telefono'] = substr($order->getShippingAddress()->getTelephone(), 0, 12);
175
+ $data['Email'] = substr($order->getShippingAddress()->getEmail(), 0, 50);
176
+
177
+ // tipoSMS
178
+ if (empty($movil))
179
  {
180
+ //$_destinatarioTelefono = substr($_order->getShippingAddress()->getTelephone(), 0, 12);
181
+ $data['Sms'] = substr($order->getShippingAddress()->getTelephone(), 0, 12); // las ultimas 9 por si pone +,0...
182
+ } else {
183
+ //$_destinatarioTelefono = substr($_dataRecogida['movil_asociado'], 0, 9);
184
+ $data['Sms'] = substr($movil, 0, 12); // las ultimas 9 por si pone +,0...
185
  }
186
+ if ($this->shippingMethod == 'recogeroficina_recogeroficina')
 
187
  {
188
+ if (!Mage::helper('correos')->validarMovil($data['Sms']))
189
+ {
190
+ Mage::throwException(
191
+ Mage::helper('correos')->__('No se puede registrar un pedido con el n&uacute;mero de tel&eacute;fono aportado (%s), porque no se podr&aacute; notificar a este n&uacute;mero.', $data['Sms'])
192
+ );
193
+ return false;
194
+ }
195
+ }
196
+ if (!Mage::helper('correos')->validarMovil($data['Sms']))
197
  {
198
+ $data['Sms'] = '';
 
 
199
  }
200
+
201
+ // checks
202
+ if (!$this->isInternationalOrder($order))
203
  {
204
+ $_camposObligatorios[] = 'CP';
 
 
205
  } else {
206
+ if (in_array($order->getShippingAddress()->getCountryId(), $this->kahalaCountries)) $_camposObligatorios[] = 'ZIP';
207
+ elseif (in_array($order->getShippingAddress()->getCountryId(), $this->eupeanCountries)) $_camposObligatorios[] = 'ZIP';
208
+ else $_camposObligatorios[] = 'Pais';
209
+ }
210
+ if (!$this->checkMandatoryFields($data, $_camposObligatorios, 'destinatario'))
211
+ {
212
  return false;
213
  }
214
+ if ($this->shippingMethod == 'recogeroficina_recogeroficina')
 
215
  {
216
+ $_camposObligatorios[] = 'Email';
217
+ $_camposObligatorios[] = 'Sms';
 
218
  }
219
+ return $data;
220
+
221
+ }
222
+
223
 
224
+ /**
225
+ *
226
+ */
227
+ protected function getDataEnvio($order, $oficina)
228
+ {
229
+
230
+ // opciones segun envio
231
+ if ($this->shippingMethod == 'recogeroficina_recogeroficina')
232
+ {
233
+ $data['CodProducto'] = 'S0133';
234
+ $data['ModalidadEntrega'] = 'LS';
235
+ $data['OficinaElegida'] = "<OficinaElegida>{$oficina}</OficinaElegida>";
236
+ } elseif ($this->shippingMethod == 'envio4872_envio4872') {
237
+ $data['CodProducto'] = 'S0132';
238
+ $data['ModalidadEntrega'] = 'ST';
239
+ $data['OficinaElegida'] = '';
240
+ } elseif ($this->shippingMethod == 'correosinter_correosinter') {
241
+ $data['CodProducto'] = 'S0030';
242
+ $data['ModalidadEntrega'] = 'ST';
243
+ $data['OficinaElegida'] = '';
244
+ }
245
+ $data['ReferenciaCliente'] = $order->getIncrementId();
246
+ $data['TipoFranqueo'] = 'FP';
247
+
248
+ // ListaTipoPeso -> tipoPeso
249
  $peso = 0;
250
  foreach ($this->getAllItems() as $item) {
251
+ $peso += $item->getOrderItem()->getWeight() * $item->getOrderItem()->getQtyShipped();
252
  }
253
  if (Mage::getStoreConfig('correos/paquete/peso') == 'kilos') { $peso = $peso*1000; }
254
  $peso = intval($peso);
255
  if ($peso == 0) { $peso = 1; } // peso minimo
256
+ $data['Peso_Tipo'] = 'R';
257
+ $data['Peso_Valor'] = $peso;
258
+ unset($peso);
259
 
260
+ // ValoresAnadidos
261
+ $data['ValoresAnadidos'] = $this->getDataAnadidos($order);
262
 
263
+ //
264
+ if ($this->isInternationalOrder($order))
265
+ {
266
+ $data['InstruccionesDevolucion'] = '<InstruccionesDevolucion>D</InstruccionesDevolucion>';
267
+ }
268
+
269
+ // TipoAduana
270
+ $data['Aduana'] = $this->getDataAduana($order);
271
+
272
+ return $data;
273
+
274
+ }
 
275
 
276
 
277
+ /**
278
+ *
279
+ */
280
+ protected function getDataAnadidos($order)
281
+ {
282
 
283
+ // Seguro
284
+ if (Mage::getStoreConfig('correos/paquete/seguro'))
 
 
 
285
  {
286
+ $data['ImporteSeguro'] = "<ImporteSeguro>".(Mage::getStoreConfig('correos/paquete/importeseguro')*100)."</ImporteSeguro>";
287
+ } else {
288
+ $data['ImporteSeguro'] = '';
289
+ }
290
+
291
+ // tipoReembolso
292
+ //if ($this->shippingMethod == 'correoscontrare_correoscontrare')
293
+ if ($order->getPayment()->getMethodInstance()->getCode() == 'cashondelivery')
294
+ {
295
+
296
+ $_total = $order->getBaseGrandTotal();
297
+ $_total = number_format($_total, 2, '.', '');
298
+ if (!$this->isInternationalOrder($order) && $_total > 1000)
299
+ {
300
+ Mage::throwException(
301
+ Mage::helper('correos')->__('El pedido a reembolsar es mayor de 1000€ y no puede enviarse bajo Correos.')
302
+ );
303
+ return false;
304
+ } else {
305
+ $_total = $_total * 100;
306
+ }
307
+
308
+ $data['Reembolso'] = '<Reembolso>';
309
+ $data['Reembolso'] .= '<TipoReembolso>RC</TipoReembolso>';
310
+ $data['Reembolso'] .= '<Importe>' . $_total . '</Importe>';
311
+ $data['Reembolso'] .= '<NumeroCuenta>' . substr(Mage::getStoreConfig('correos/paquete/cuentareembolso'), 0, 20) . '</NumeroCuenta>';
312
+ $data['Reembolso'] .= '<Transferagrupada>S</Transferagrupada>';
313
+ $data['Reembolso'] .= '</Reembolso>';
314
+ }
315
+
316
+ // Entrega
317
+ if ($this->isInternationalOrder($order)){
318
+ $data['EntregaExclusivaDestinatario'] = "";
319
+ } elseif (Mage::getStoreConfig('correos/paquete/entregaexclusiva')) {
320
+ $data['EntregaExclusivaDestinatario'] = "<EntregaExclusivaDestinatario>S</EntregaExclusivaDestinatario>";
321
+ $data['EntregaExclusivaDestinatario'] .= "<TipoPruebaEntrega><Formato>1</Formato></TipoPruebaEntrega>";
322
+ } else {
323
+ $data['EntregaExclusivaDestinatario'] = "<EntregaExclusivaDestinatario>N</EntregaExclusivaDestinatario>";
324
  }
325
+
326
+ return $data;
327
+
328
+ }
329
+
330
+
331
+ /**
332
+ *
333
+ */
334
+ protected function getDataAduana($order)
335
+ {
336
 
337
+ // tipoAduana
338
+ $_origen = trim(strtolower(Mage::getModel('directory/region')->load(Mage::getStoreConfig('correos/remitente/region_id'))->getName()));
339
+ $_destino = trim(strtolower($order->getShippingAddress()->getRegion()));
340
 
341
+ $_obligatorio = false;
342
+ if ( ($_origen == 'las palmas' || $_origen == 'santa cruz de tenerife' || $_origen == 'ceuta' || $_origen == 'melilla') && ($_origen != $_destino) )
343
+ {
344
+ $_obligatorio = true;
345
+ } elseif ($this->isInternationalOrder($order)) {
346
+ $_obligatorio = true;
347
+ } elseif ( ($_destino == 'las palmas' || $_destino == 'santa cruz de tenerife' || $_destino == 'ceuta' || $_destino == 'melilla') && ($_origen != $_destino) ) {
348
+ $_obligatorio = true;
349
+ }
350
 
351
+ if ($_obligatorio)
352
+ {
353
+ $data['tipoAduana'] = '<Aduana>';
354
+ $data['tipoAduana'].= '<TipoEnvio>2</TipoEnvio>';
355
+ $data['tipoAduana'].= '<EnvioComercial>S</EnvioComercial>';
356
+ if ($order->getBaseGrandTotal() >= 500)
357
+ {
358
+ $data['tipoAduana'].= '<FacturaSuperiora500>S</FacturaSuperiora500>';
359
+ $data['tipoAduana'].= '<DUAConCorreos>N</DUAConCorreos>';
360
+ } else {
361
+ $data['tipoAduana'].= '<FacturaSuperiora500>N</FacturaSuperiora500>';
362
+ }
363
+ if ($this->isInternationalOrder($order))
364
+ {
365
+ //
366
+ $data['tipoAduana'].= $this->getDataAduanaElements($order);
367
+ $data['tipoAduana'].= '<Factura>' . (Mage::getStoreConfig('correos/paquete/paquetefactura')?'S':'N') . '</Factura>';
368
+ $data['tipoAduana'].= '<Licencia>' . (Mage::getStoreConfig('correos/paquete/paquetelicencia')?'S':'N') . '</Licencia>';
369
+ $data['tipoAduana'].= '<Certificado>' . (Mage::getStoreConfig('correos/paquete/paquetecertificado')?'S':'N') . '</Certificado>';
370
+ }
371
+ $data['tipoAduana'].= '</Aduana>';
372
+
373
+
374
+ }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
375
 
376
+ return $data;
377
+
378
+ }
379
+
380
+
381
+ /**
382
+ *
383
+ */
384
+ protected function getDataAduanaElements($order)
385
+ {
386
+
387
+ $data = '<DescAduanera>';
388
+ foreach ($this->getAllItems() as $item)
389
+ {
390
+ $data .= '<DATOSADUANA>';
391
+ $data .= '<Cantidad>' . $item->getOrderItem()->getQtyShipped() . '</Cantidad>';
392
+ $data .= '<Descripcion>165</Descripcion>';
393
+ $data .= '<Pesoneto>' . round($item->getOrderItem()->getWeight(), 0, PHP_ROUND_HALF_UP) . '</Pesoneto>';
394
+ $data .= '<Valorneto>' . ($item->getOrderItem()->getPrice()*100) . '</Valorneto>';
395
+ $data .= '</DATOSADUANA>';
396
+ }
397
+ $data .= '</DescAduanera>';
398
+
399
+ return $data;
400
+ }
401
+
402
+
403
+ /**
404
+ *
405
+ */
406
+ protected function checkMandatoryFields($data, $mandatory, $section)
407
+ {
408
+ foreach ($mandatory as $field)
409
+ {
410
+ if (!isset($data[$field]) || empty($data[$field]))
411
+ {
412
+ Mage::throwException(
413
+ Mage::helper('correos')->__('El campo %s de la sección %s es obligatorio para registrar el envío de un paquete.', $field, $section)
414
+ );
415
+ }
416
+ }
417
+ return true;
418
+ }
419
+
420
+
421
+ /**
422
+ *
423
+ */
424
+ protected function isInternationalOrder($order)
425
+ {
426
+ if (($order->getShippingAddress()->getCountryId() != 'ES') || ($this->shippingMethod == 'correosinter_correosinter'))
427
+ {
428
+ return true;
429
+ } else {
430
+ return false;
431
+ }
432
+ }
433
+
434
 
435
+ /**
436
+ * solicitud de peticion de datos previa a la generacion de envio
437
+ */
438
+ protected function _beforeSave()
439
+ {
440
+
441
+ $envio = array();
442
+ $_order = $this->getOrder();
443
 
 
 
444
 
445
+ /**
446
+ * solo para correos, otros metodos siguen igual
447
+ */
448
+ $number = Mage::getSingleton('core/app')->getRequest()->getPost('number');
449
+ $carrier = Mage::getSingleton('core/app')->getRequest()->getPost('carrier');
450
+ $shipment = Mage::getSingleton('core/app')->getRequest()->getPost('shipment');
451
+ $remitente = (int)$shipment['remitente_select'];
452
+
453
+
454
+ $this->shippingMethod = $_order->getShippingMethod();
455
+ if (!in_array($this->shippingMethod, Mage::helper('correos')->getAllowedMethods()))
456
+ {
457
+ return parent::_beforeSave();
458
+ }
459
+
460
+ /*
461
+ if (
462
+ ( ($_order->getShippingMethod() != 'recogeroficina_recogeroficina') && ($_order->getShippingMethod() != 'envio4872_envio4872') ) ||
463
+ ( (!empty($number)) && (!empty($carrier)) )
464
+ )
465
+ {
466
+ return parent::_beforeSave();
467
+ }
468
+ */
469
+
470
+
471
  try
472
  {
473
+
474
+ /**
475
+ * informacion de recogida
476
+ */
477
+ $_dataRecogida = Mage::getModel('correos/recoger')->getCheckoutData('order', $_order->getRealOrderId())->getFirstItem();
478
+ if ($_dataRecogida->getId() == '')
479
+ {
480
+ Mage::throwException(
481
+ Mage::helper('correos')->__('No hay datos asociados a este pedido de Correos.')
482
+ );
483
+ return false;
484
+ }
485
+
486
+
487
+ /**
488
+ *
489
+ */
490
+ $_helper = Mage::helper('correos/preregistro');
491
+
492
+
493
+ /**
494
+ * datos
495
+ */
496
+ $_data['fechaOperacion'] = date('d-m-Y H:i:s', strtotime($_order->getCreatedAt()));
497
+ $_data['dataAuth'] = $this->getAuthXml();
498
+ if (Mage::helper('correos')->getValueConfig('multisender', 'remitente'))
499
+ {
500
+ $_data['datosRemitente'] = $this->getDataMultiRemitente($remitente);
501
+ } else {
502
+ $_data['datosRemitente'] = $this->getDataRemitente();
503
+ }
504
+ $_data['DatosDestinatario'] = $this->getDataDestinatario($_order, $_dataRecogida->getMovilAsociado());
505
+ $_data['DatosEnvio'] = $this->getDataEnvio($_order, $_dataRecogida->getCorreosRecogida());
506
+
507
 
508
+
509
+ /**
510
+ * xml
511
+ */
512
+ $xmlSend = $_helper->getXmlPreregistro($_data);
513
+ $peticionCorreos = $this->preregistroCorreos($xmlSend, 'Preregistro');
514
  if ($peticionCorreos == '')
515
  {
516
  Mage::throwException(
518
  );
519
  return false;
520
  }
521
+
522
 
523
+
524
+ /**
525
+ *
526
+ */
527
+ if (!Mage::helper('correos')->checkAuthLoginResponse($peticionCorreos))
528
+ {
529
+ Mage::throwException(
530
+ Mage::helper('sales')->__('La pasarela de Correos ha devuelto un error de acceso. Compruebe sus credenciales.')
531
+ );
532
+ return false;
533
+ }
534
+
535
+
536
+ /**
537
+ *
538
+ */
539
  $dataXml = simplexml_load_string($peticionCorreos);
 
 
540
  if (!$dataXml->registerXPathNamespace('respuesta', 'http://www.correos.es/iris6/services/preregistroetiquetas'))
541
  {
542
  // ha devuelto un error;
543
  Mage::throwException(
544
+ Mage::helper('correos')->__('Error en los datos devueltos por Correos.')
545
  );
546
  return false;
547
  }
548
+
549
  $_codExpedicion = $dataXml->xpath('//respuesta:CodExpedicion');
550
  $_codEnvio = $dataXml->xpath('//respuesta:Bulto');
551
  $_codError = $dataXml->xpath('//respuesta:Resultado');
552
+
 
553
 
554
  if ($_codError[0] == '0')
555
  {
556
  // correcto
557
  $_datosBulto = $dataXml->xpath('//respuesta:Bulto');
558
  Mage::getSingleton('adminhtml/session')->addNotice('Se ha creado la etiqueta de env&iacute;o para Correos.');
559
+ if (isset($_codExpedicion[0]))
560
+ {
561
+ Mage::getSingleton('adminhtml/session')->addNotice('C&oacute;digo de expedici&oacute;n: ' . $_codExpedicion[0]);
562
+ }
563
  Mage::getSingleton('adminhtml/session')->addNotice('C&oacute;digo de env&iacute;o: ' . $_codEnvio[0]->CodEnvio);
564
 
565
  $track = Mage::getModel('sales/order_shipment_track')
586
  return $canSave;
587
 
588
 
589
+
590
  } catch (Exception $e) {
591
  if (!$e->getMessage())
592
  {
593
  Mage::throwException(
594
+ Mage::helper('correos')->__('Error en los datos devueltos por Correos. Problema de conexión o datos.')
595
  );
596
  } else {
597
  Mage::throwException($e->getMessage());
598
  }
599
  }
 
 
 
 
600
 
601
  }
602
 
603
 
604
+ /**
605
+ *
606
+ */
607
+ protected function preregistroCorreos($xmlSend, $tipoSolicitud)
 
 
 
 
 
 
 
 
 
 
608
  {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
609
 
610
+ $urlPeticion = Mage::getStoreConfig('correos/general/gateway_preregistro');
 
 
611
  $datosAcceso = Mage::getStoreConfig('correos/general/usercorreos').":".Mage::getStoreConfig('correos/general/pwdcorreos');
612
 
613
+ try
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
614
  {
 
 
 
615
 
616
+ $curl = new Varien_Http_Adapter_Curl();
617
+ $curl->addOption('CURLOPT_FORBID_REUSE', true);
618
+ $curl->addOption('CURLOPT_FRESH_CONNECT', true);
619
+ $curl->addOption('CURLOPT_HTTPAUTH', CURLAUTH_ANY);
620
+ $curl->setConfig(array('timeout' => 10, 'header' => false, 'userpwd' => $datosAcceso));
621
+ $curl->write('POST', $urlPeticion, '1.1', array("Content-Type: text/xml; charset=utf-8", "SOAPAction: \"{$tipoSolicitud}\""), $xmlSend);
622
+ $xmlResponse = $curl->read();
623
+ $curl->close();
624
+
625
+ $debugData['result'] = $xmlResponse;
626
+ if ($curl->getError())
627
+ {
628
+ $debugData['error'] = $curl->getError();
629
+ return false;
630
+ }
631
+
632
+ } catch (Exception $e) {
633
+
634
+ $debugData['result'] = array('error' => $e->getMessage(), 'code' => $e->getCode());
635
+ $xmlResponse = '';
636
+
637
  }
638
+
639
+ Mage::helper('correos')->_logger('Respuesta de petición de etiqueta');
640
+ Mage::helper('correos')->_logger($debugData);
641
+ Mage::helper('correos')->_logger($xmlResponse);
642
+
643
+ return $xmlResponse;
644
 
 
645
  }
646
 
647
 
648
  /**
649
+ *
650
+ */
651
+ public function getEtiquetaRemote($order_id, $codEnvio)
652
  {
653
+
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
654
  try
655
  {
656
+ /**
657
+ * pedido
658
+ */
659
+ $_order = Mage::getModel('sales/order')->load($order_id);
660
+ if (!$_order)
661
+ {
662
  Mage::throwException(
663
+ Mage::helper('correos')->__('No hay datos asociados a este pedido de Correos.')
664
  );
665
  return false;
666
  }
667
+ if (!in_array($_order->getShippingMethod(), Mage::helper('correos')->getAllowedMethods()))
668
+ {
669
+ return false;
670
+ }
671
 
 
 
 
 
 
 
 
672
 
673
+ /**
674
+ *
675
+ */
676
+ $_helper = Mage::helper('correos/etiqueta');
677
 
678
+
679
+ /**
680
+ * datos
681
+ */
682
+ $_data['fechaOperacion'] = date('d-m-Y H:i:s', strtotime($_order->getCreatedAt()));
683
+ $_data['dataAuth'] = $this->getAuthXml();
684
+ $_data['codEnvio'] = $codEnvio;
 
 
 
 
 
 
 
685
 
686
+
687
+
688
+ /**
689
+ * xml
690
+ */
691
+ $xmlSend = $_helper->getXmlEtiqueta($_data);
692
+ $peticionCorreos = $this->preregistroCorreos($xmlSend, 'SolicitudEtiquetaOp');
693
+ if ($peticionCorreos == '')
694
+ {
695
+ Mage::throwException(
696
+ Mage::helper('sales')->__('No se ha podido contacto con el servidor de Correos. Respuesta vac&iacute;a.')
697
+ );
698
+ return false;
699
+ }
700
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
701
 
702
+ /**
703
+ *
704
+ */
705
+ if (!Mage::helper('correos')->checkAuthLoginResponse($peticionCorreos))
706
+ {
707
+ Mage::throwException(
708
+ Mage::helper('sales')->__('La pasarela de Correos ha devuelto un error de acceso. Compruebe sus credenciales.')
709
+ );
710
+ return false;
711
+ }
712
+
713
 
714
+ /**
715
+ *
716
+ */
717
+ $dataXml = simplexml_load_string($peticionCorreos);
718
+ if (!$dataXml->registerXPathNamespace('respuesta', 'http://www.correos.es/iris6/services/preregistroetiquetas'))
719
+ {
720
+ // ha devuelto un error;
721
  Mage::throwException(
722
+ Mage::helper('correos')->__('Error en los datos devueltos por Correos.')
723
  );
724
  return false;
725
  }
726
 
727
+ $_codExpedicion = $dataXml->xpath('//respuesta:CodExpedicion');
728
+ $_codError = $dataXml->xpath('//respuesta:Resultado');
 
 
 
 
 
729
 
730
+
731
+ if ($_codError[0] == '0')
732
+ {
733
+ // correcto
734
+ $_datosBulto = $dataXml->xpath('//respuesta:Bulto');
735
+ return $_datosBulto;
736
+
737
+ } else {
738
+ return false;
739
+ }
740
+
741
+ } catch (Exception $e) {
742
+ if (!$e->getMessage())
743
+ {
744
+ Mage::throwException(
745
+ Mage::helper('correos')->__('Error en los datos devueltos por Correos. Problema de conexión o datos.')
746
+ );
747
+ } else {
748
+ Mage::throwException($e->getMessage());
749
+ }
750
+ }
751
+
752
+ }
753
 
754
  }
app/code/local/Ydral/Correos/controllers/Adminhtml/DownloadController.php ADDED
@@ -0,0 +1,127 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ *
5
+ */
6
+ class Ydral_Correos_Adminhtml_DownloadController extends Mage_Adminhtml_Controller_Action
7
+ {
8
+
9
+
10
+ public function getphoneAction()
11
+ {
12
+ $this->getResponse()->setBody(Mage::getSingleton('checkout/session')->getQuote()->getShippingAddress()->getTelephone());
13
+ }
14
+
15
+
16
+ /**
17
+ *
18
+ */
19
+ public function downloadEtiquetaAction()
20
+ {
21
+
22
+ $etiquetaId = $this->getRequest()->getParam('etiqueta', false);
23
+ $orderId = $this->getRequest()->getParam('order', false);
24
+
25
+
26
+ if ($etiquetaId && $orderId)
27
+ {
28
+ $dataPdf = Mage::getModel('correos/ydral_shipment')->getEtiquetaRemote($orderId, $etiquetaId);
29
+ if (!$dataPdf)
30
+ {
31
+ $this->_getSession()->addError(Mage::helper('correos')->__('No se han encontrado pedidos para imprimir.'));
32
+ $this->_redirect("adminhtml/sales_order/view", array('order_id', $orderId));
33
+ return;
34
+ }
35
+ if (Mage::helper('correos')->getValueConfig('savepdf', 'opciones'))
36
+ {
37
+ // guardamos el local
38
+ $this->_preparePdf($dataPdf[0]->Etiqueta->Etiqueta_pdf->NombreF, base64_decode($dataPdf[0]->Etiqueta->Etiqueta_pdf->Fichero), 'application/pdf');
39
+ } else {
40
+ // peticion en real
41
+ $this->_prepareDownloadResponse($dataPdf[0]->Etiqueta->Etiqueta_pdf->NombreF, base64_decode($dataPdf[0]->Etiqueta->Etiqueta_pdf->Fichero), 'application/pdf');
42
+ }
43
+ }
44
+
45
+ }
46
+
47
+
48
+ /**
49
+ *
50
+ */
51
+ protected function _preparePdf($fileName, $content, $contentType = 'application/octet-stream', $contentLength = null)
52
+ {
53
+
54
+ /**
55
+ * check
56
+ */
57
+ $session = Mage::getSingleton('admin/session');
58
+ if ($session->isFirstPageAfterLogin()) {
59
+ $this->_redirect($session->getUser()->getStartupPageUrl());
60
+ return $this;
61
+ }
62
+
63
+ if (empty($content))
64
+ {
65
+ $this->_getSession()->addError(Mage::helper('correos')->__('El servidor de Correos ha devuelto una respuesta vacía.'));
66
+ return;
67
+ }
68
+
69
+
70
+ /**
71
+ * guardamos un fichero temporal del pdf
72
+ */
73
+ $ioAdapter = new Varien_Io_File();
74
+ $path = Mage::getBaseDir() . DS . 'var' . DS . 'pdf';
75
+ $file = $path . DS . $fileName;
76
+ if (!$ioAdapter->fileExists($file))
77
+ {
78
+ if (!file_exists($path))
79
+ {
80
+ $importReadyDirResult = $ioAdapter->mkdir($path);
81
+ if (!$importReadyDirResult)
82
+ {
83
+ Mage::throwException(Mage::helper('correos')->__('Directorio no accesible.'));
84
+ }
85
+ }
86
+
87
+ if (!$ioAdapter->write($file, $content))
88
+ {
89
+ Mage::throwException(Mage::helper('correos')->__('No se ha podido guardar el contenido del PDF en el fichero temporal.'));
90
+ }
91
+ }
92
+
93
+
94
+ /**
95
+ * salida
96
+ */
97
+ $this->getResponse()
98
+ ->setHttpResponseCode(200)
99
+ ->setHeader('Pragma', 'public', true)
100
+ ->setHeader('Cache-Control', 'must-revalidate, post-check=0, pre-check=0', true)
101
+ ->setHeader('Content-type', $contentType, true)
102
+ ->setHeader('Content-Length', strlen($content))
103
+ ->setHeader('Content-Disposition', 'attachment; filename="'.$fileName.'"')
104
+ ->setHeader('Last-Modified', date('r'));
105
+
106
+
107
+ /**
108
+ * enviamos el fichero
109
+ */
110
+ $this->getResponse()->clearBody();
111
+ $this->getResponse()->sendHeaders();
112
+ $ioAdapter->open(array('path' => $ioAdapter->dirname($file)));
113
+ $ioAdapter->streamOpen($file, 'r');
114
+ while ($buffer = $ioAdapter->streamRead()) {
115
+ print $buffer;
116
+ }
117
+ $ioAdapter->streamClose();
118
+
119
+ exit(0);
120
+
121
+
122
+ //$this->getResponse()->setBody($content);
123
+
124
+ return $this;
125
+ }
126
+
127
+ }
app/code/local/Ydral/Correos/controllers/Adminhtml/ExportController.php ADDED
@@ -0,0 +1,39 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ *
5
+ */
6
+ class Ydral_Correos_Adminhtml_ExportController extends Mage_Adminhtml_Controller_Action
7
+ {
8
+
9
+ /**
10
+ * Export shipping table rates in csv format
11
+ *
12
+ */
13
+ public function exportTableratesAction()
14
+ {
15
+
16
+ $fileName = 'tablerates.csv';
17
+
18
+ if ($this->getRequest()->getParam('method'))
19
+ {
20
+ $methodName = $this->getRequest()->getParam('method');
21
+ } else {
22
+ $methodName = '';
23
+ }
24
+ /** @var $gridBlock Ydral_Correos_Block_Adminhtml_Shipping_Carrier_Tablerate_Grid */
25
+ $gridBlock = $this->getLayout()->createBlock('correos/adminhtml_shipping_carrier_tablerate_grid');
26
+ $website = Mage::app()->getWebsite($this->getRequest()->getParam('website'));
27
+ if ($this->getRequest()->getParam('conditionName')) {
28
+ $conditionName = $this->getRequest()->getParam('conditionName');
29
+ } else {
30
+ $conditionName = $website->getConfig('carriers/tablerate/condition_name');
31
+ }
32
+ $gridBlock->setWebsiteId($website->getId())
33
+ ->setConditionName($conditionName)
34
+ ->setMethodName($methodName);
35
+ $content = $gridBlock->getCsvFile();
36
+ $this->_prepareDownloadResponse($fileName, $content);
37
+ }
38
+
39
+ }
app/code/local/Ydral/Correos/controllers/Adminhtml/PdfController.php ADDED
@@ -0,0 +1,246 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ *
5
+ */
6
+ class Ydral_Correos_Adminhtml_PdfController extends Mage_Adminhtml_Controller_Action
7
+ {
8
+
9
+ /**
10
+ * Export shipping table rates in csv format
11
+ *
12
+ */
13
+ public function multiplePrintAction()
14
+ {
15
+
16
+ $files = array();
17
+
18
+ try
19
+ {
20
+
21
+ $orderIds = $this->getRequest()->getPost('order_ids');
22
+ if (!empty($orderIds))
23
+ {
24
+
25
+ /**
26
+ *
27
+ */
28
+ $fileNameFinal = 'ordersPdf';
29
+ foreach ($orderIds as $orderId)
30
+ {
31
+ $_order = Mage::getModel('sales/order')->load($orderId);
32
+ if($_order)
33
+ {
34
+ $tracks = $_order->getTracksCollection();
35
+ $tracksValidos = array ('Correos', 'envio4872', 'recogeroficina', 'correosinter');
36
+ foreach ($tracks as $track)
37
+ {
38
+ if (in_array($track->getCarrierCode(), $tracksValidos))
39
+ {
40
+ $dataPdf = Mage::getModel('correos/ydral_shipment')->getEtiquetaRemote($_order->getId(), $track['number']);
41
+ $fileName = $dataPdf[0]->Etiqueta->Etiqueta_pdf->NombreF;
42
+ if ($this->_preparePdf($fileName, base64_decode($dataPdf[0]->Etiqueta->Etiqueta_pdf->Fichero), 'application/pdf'))
43
+ {
44
+ $fileNameFinal .= '_' . $_order->getId();
45
+ $files[] = Mage::getBaseDir() . DS . 'var' . DS . 'pdf' . DS . $fileName;
46
+ } else {
47
+ $this->_getSession()->addError(Mage::helper('correos')->__('El pedido %s no se ha podido imprimir.', $_order->getRealOrderId()));
48
+ }
49
+ }
50
+ }
51
+
52
+ }
53
+ }
54
+
55
+
56
+ /**
57
+ *
58
+ */
59
+ //$pdfFinal = new Zend_Pdf();
60
+ if (count($files) > 0)
61
+ {
62
+
63
+ $pdfFinal = Mage::getModel('correos/pdfmerger');
64
+ foreach ($files as $file)
65
+ {
66
+ $pdfFinal->addPDF($file, 'all');
67
+ }
68
+
69
+ $fileNameMerged = Mage::getBaseDir() . DS . 'var' . DS . 'pdf' . DS . $fileNameFinal . '.pdf';
70
+ $pdfFinal->merge('file', $fileNameMerged);
71
+
72
+
73
+ /**
74
+ * salida
75
+ */
76
+ $this->getResponse()
77
+ ->setHttpResponseCode(200)
78
+ ->setHeader('Pragma', 'public', true)
79
+ ->setHeader('Cache-Control', 'must-revalidate, post-check=0, pre-check=0', true)
80
+ ->setHeader('Content-type', 'application/pdf', true)
81
+ ->setHeader('Content-Disposition', 'attachment; filename="'.$fileNameFinal . '.pdf"')
82
+ ->setHeader('Last-Modified', date('r'));
83
+
84
+
85
+ /**
86
+ * enviamos el fichero
87
+ */
88
+ $ioAdapter = new Varien_Io_File();
89
+ $this->getResponse()->clearBody();
90
+ $this->getResponse()->sendHeaders();
91
+ $ioAdapter->open(array('path' => $ioAdapter->dirname($fileNameMerged)));
92
+ $ioAdapter->streamOpen($fileNameMerged, 'r');
93
+ while ($buffer = $ioAdapter->streamRead()) {
94
+ print $buffer;
95
+ }
96
+ $ioAdapter->streamClose();
97
+
98
+ exit(0);
99
+
100
+
101
+
102
+ /*
103
+
104
+ //$pdfDocs = array('path/to/your/folder/filename1.pdf', 'path/to/your/folder/filename2.pdf', 'path/to/your/folder/filename3.pdf');
105
+ foreach ($files as $file)
106
+ {
107
+ $pdf = Zend_Pdf::load($file);
108
+ $extractor = new Zend_Pdf_Resource_Extractor();
109
+
110
+ foreach($pdf->pages as $page)
111
+ {
112
+ $pdfExtract = $extractor->clonePage($page);
113
+ $pdfFinal->pages[] = $pdfExtract;
114
+ }
115
+ }
116
+
117
+ $fileNameMerged = Mage::getBaseDir() . DS . 'var' . DS . 'pdf' . DS . $fileNameFinal . '.pdf';
118
+ $pdfFinal->save($fileNameMerged);
119
+
120
+ $this->_mergePdfs($fileNameMerged);
121
+ */
122
+
123
+
124
+ } else {
125
+ $this->_getSession()->addError($this->__('No se han encontrado ficheros de PDF para imprimir.'));
126
+ }
127
+
128
+ } else {
129
+ $this->_getSession()->addError($this->__('No se han encontrado pedidos para imprimir.'));
130
+ }
131
+
132
+ } catch (Exception $e) {
133
+ Mage::throwException(
134
+ Mage::helper('correos')->__('No se han encontrado pedidos para imprimir.')
135
+ );
136
+ return false;
137
+ }
138
+
139
+
140
+ $this->_redirect("adminhtml/sales_order/index");
141
+ return;
142
+
143
+ }
144
+
145
+
146
+ /**
147
+ *
148
+ */
149
+ protected function _preparePdf($fileName, $content, $contentType = 'application/octet-stream', $contentLength = null)
150
+ {
151
+
152
+ /**
153
+ * check
154
+ */
155
+ $session = Mage::getSingleton('admin/session');
156
+ if ($session->isFirstPageAfterLogin()) {
157
+ $this->_redirect($session->getUser()->getStartupPageUrl());
158
+ return $this;
159
+ }
160
+
161
+ if (empty($content))
162
+ {
163
+ $this->_getSession()->addError(Mage::helper('correos')->__('El servidor de Correos ha devuelto una respuesta vacía.'));
164
+ return;
165
+ }
166
+
167
+
168
+ /**
169
+ * guardamos un fichero temporal del pdf
170
+ */
171
+ $ioAdapter = new Varien_Io_File();
172
+ $path = Mage::getBaseDir() . DS . 'var' . DS . 'pdf';
173
+ $file = $path . DS . $fileName;
174
+ if (!$ioAdapter->fileExists($file))
175
+ {
176
+ if (!file_exists($path))
177
+ {
178
+ $importReadyDirResult = $ioAdapter->mkdir($path);
179
+ if (!$importReadyDirResult)
180
+ {
181
+ Mage::throwException(Mage::helper('correos')->__('Directorio no accesible.'));
182
+ }
183
+ }
184
+
185
+ if (!$ioAdapter->write($file, $content))
186
+ {
187
+ Mage::throwException(Mage::helper('correos')->__('No se ha podido guardar el contenido del PDF en el fichero temporal.'));
188
+ } else {
189
+ return true;
190
+ }
191
+ } else {
192
+
193
+ // Ya existe el fichero
194
+ return true;
195
+
196
+ }
197
+
198
+ }
199
+
200
+
201
+ /**
202
+ *
203
+ */
204
+ /*
205
+ protected function _mergePdfs($fileNameMerged)
206
+ {
207
+ require_once(Mage::getBaseDir('lib') . '/fpdf/fpdf.php');
208
+ require_once(Mage::getBaseDir('lib') . '/fpdi/fpdi.php');
209
+
210
+ $pdf = new FPDI("L", "mm", "A4");
211
+ $pagecount = $pdf->setSourceFile($fileNameMerged);
212
+ $w = $pdf->w/2 - 15;
213
+ $h = 0;
214
+
215
+ $_x = $x = 10;
216
+ $_y = $y = 10;
217
+
218
+ $pdf->addPage();
219
+ for ($n = 1; $n <= $pagecount; $n++) {
220
+ $tplidx = $pdf->ImportPage($n);
221
+
222
+ $size = $pdf->useTemplate($tplidx, $x, $y, $w);
223
+ $pdf->Rect($x, $y, $size['w'], $size['h']);
224
+ $h = max($h, $size['h']);
225
+ if ($n % 2 == 0) {
226
+ $y += $h+10;
227
+ $x = $_x;
228
+ $h = 0;
229
+ } else {
230
+ $x += $w+10;
231
+ }
232
+
233
+ if ($n % 4 == 0 && $n != $pagecount) {
234
+ $pdf->AddPage();
235
+ $x = $_x;
236
+ $y = $_y;
237
+ }
238
+ }
239
+
240
+ $pdf->Output('orders.pdf', 'D');
241
+
242
+ }
243
+ */
244
+
245
+
246
+ }
app/code/local/Ydral/Correos/controllers/CheckoutController.php ADDED
@@ -0,0 +1,113 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ *
5
+ */
6
+ class Ydral_Correos_CheckoutController extends Mage_Checkout_Controller_Action
7
+ {
8
+
9
+ public function getdataAction()
10
+ {
11
+
12
+
13
+ if ($this->_expireAjax()) {
14
+ return;
15
+ }
16
+
17
+ if ($this->getRequest()->isPost())
18
+ {
19
+
20
+ /**
21
+ * comprobamos la peticion del codigo postal que se realiza
22
+ */
23
+ if ($this->getRequest()->getPost('codigoPostal') == '')
24
+ {
25
+ $codigoPostal = Mage::getSingleton('checkout/session')->getQuote()->getShippingAddress()->getPostcode();
26
+ } else {
27
+ $codigoPostal = $this->getRequest()->getPost('codigoPostal');
28
+ }
29
+
30
+ if (!empty($codigoPostal))
31
+ {
32
+ $_htmlOficinas['oficinas'] = Mage::getModel('correos/oficinas')->getHtmlOficinas($codigoPostal);
33
+ $_shippingAddress['shipping_address'] = Mage::getSingleton('checkout/session')->getQuote()->getShippingAddress()->getData();
34
+ if (!isset($_shippingAddress['shipping_address']['telephone'])) { $_shippingAddress['shipping_address']['telephone'] = ''; }
35
+
36
+ $_tmpData = json_encode(array_merge($_htmlOficinas, $_shippingAddress));
37
+
38
+ $this->getResponse()->setBody($_tmpData);
39
+ } else {
40
+ $this->getResponse()->setBody(Mage::helper('correos')->__('Introduzca un código postal para localizar su oficina más cercana.'));
41
+ }
42
+
43
+ }
44
+
45
+ }
46
+
47
+
48
+ /**
49
+ * Validate ajax request and redirect on failure
50
+ *
51
+ * @return bool
52
+ */
53
+ protected function _expireAjax()
54
+ {
55
+
56
+ if ($this->_isAdmin()) return false;
57
+
58
+ if (!$this->getOnepage()->getQuote()->hasItems()
59
+ || $this->getOnepage()->getQuote()->getHasError()
60
+ || $this->getOnepage()->getQuote()->getIsMultiShipping()) {
61
+ $this->_ajaxRedirectResponse();
62
+ return true;
63
+ }
64
+
65
+ $action = $this->getRequest()->getActionName();
66
+ if (Mage::getSingleton('checkout/session')->getCartWasUpdated(true)
67
+ && !in_array($action, array('index', 'progress'))) {
68
+ $this->_ajaxRedirectResponse();
69
+ return true;
70
+ }
71
+
72
+ return false;
73
+ }
74
+
75
+
76
+ /**
77
+ *
78
+ */
79
+ public function getOnepage()
80
+ {
81
+ return Mage::getSingleton('checkout/type_onepage');
82
+ }
83
+
84
+
85
+ /**
86
+ *
87
+ */
88
+ protected function _ajaxRedirectResponse()
89
+ {
90
+ $this->getResponse()
91
+ ->setHeader('HTTP/1.1', '403 Session Expired')
92
+ ->setHeader('Login-Required', 'true')
93
+ ->sendResponse();
94
+ return $this;
95
+ }
96
+
97
+
98
+ /**
99
+ *
100
+ */
101
+ protected function _isAdmin()
102
+ {
103
+
104
+ $urlReferer = $_SERVER["HTTP_REFERER"];
105
+ if (!strpos($urlReferer, 'admin/sales_order'))
106
+ {
107
+ return false;
108
+ }
109
+ return true;
110
+
111
+ }
112
+
113
+ }
app/code/local/Ydral/Correos/controllers/IndexController.php CHANGED
@@ -1,44 +1,14 @@
1
  <?php
2
 
3
- class Ydral_Correos_IndexController extends Mage_Core_Controller_Front_Action
 
 
 
4
  {
5
-
6
- public function getdataAction()
7
  {
8
-
9
- if ($this->getRequest()->isPost())
10
- {
11
-
12
- if ($this->getRequest()->getPost('codigoPostal') == '')
13
- {
14
- $codigoPostal = Mage::getSingleton('checkout/session')->getQuote()->getShippingAddress()->getPostcode();
15
- } else {
16
- $codigoPostal = $this->getRequest()->getPost('codigoPostal');
17
- }
18
-
19
- if (!empty($codigoPostal))
20
- {
21
- $_htmlOficinas = Mage::getModel('correos/ydral_recogeroficina')->getHtmlOficinas($codigoPostal);
22
- $this->getResponse()->setBody($_htmlOficinas);
23
- }
24
-
25
- }
26
-
27
  }
28
 
29
-
30
- public function downloadEtiquetaAction()
31
- {
32
-
33
- $etiquetaId = $this->getRequest()->getParam('etiqueta', false);
34
- $orderId = $this->getRequest()->getParam('order', false);
35
-
36
-
37
- if ($etiquetaId && $orderId)
38
- {
39
- $dataPdf = Mage::getModel('correos/ydral_shipment')->getEtiquetaRemote($orderId, $etiquetaId);
40
- $this->_prepareDownloadResponse($dataPdf[0]->Etiqueta->Etiqueta_pdf->NombreF, base64_decode($dataPdf[0]->Etiqueta->Etiqueta_pdf->Fichero), 'application/pdf');
41
- }
42
-
43
- }
44
  }
1
  <?php
2
 
3
+ /**
4
+ *
5
+ */
6
+ class Ydral_Correos_IndexController extends Mage_Adminhtml_Controller_Action
7
  {
8
+
9
+ public function getphoneAction()
10
  {
11
+ $this->getResponse()->setBody(Mage::getSingleton('checkout/session')->getQuote()->getShippingAddress()->getTelephone());
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
12
  }
13
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
14
  }
app/code/local/Ydral/Correos/etc/config.xml CHANGED
@@ -3,11 +3,10 @@
3
  <config>
4
  <modules>
5
  <Ydral_Correos>
6
- <version>0.4.0</version>
7
  </Ydral_Correos>
8
  </modules>
9
  <global>
10
-
11
  <blocks>
12
  <correos>
13
  <class>Ydral_Correos_Block</class>
@@ -19,64 +18,81 @@
19
  <order_shipment>Ydral_Correos_Block_Order_Shipment</order_shipment>
20
  </rewrite>
21
  </sales>
 
22
  <checkout>
23
  <rewrite>
24
  <onepage_shipping_method_available>Ydral_Correos_Block_Onepage_Shipping_Method_Available</onepage_shipping_method_available>
 
25
  </rewrite>
26
  </checkout>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
27
  </blocks>
28
-
29
  <helpers>
30
- <!-- Mage::helper('correos') -->
31
  <correos>
32
  <class>Ydral_Correos_Helper</class>
33
  </correos>
 
34
  <onestepcheckout>
35
  <rewrite>
36
  <checkout>Ydral_Correos_Helper_Onestepcheckout</checkout>
37
  </rewrite>
38
  </onestepcheckout>
 
39
  </helpers>
40
-
41
  <models>
42
- <!-- Mage::getModel('correos/correos') -->
43
  <correos>
44
  <class>Ydral_Correos_Model</class>
 
45
  </correos>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
46
  <sales>
47
  <rewrite>
48
- <order_shipment>Ydral_Correos_Model_Ydral_Shipment</order_shipment>
49
- <quote_address_total_shipping>Ydral_Correos_Model_Quote_Address_Total_Shipping</quote_address_total_shipping>
50
  </rewrite>
51
  </sales>
52
-
53
  <checkout>
54
  <rewrite>
55
  <type_onepage>Ydral_Correos_Model_Type_Onepage</type_onepage>
56
  </rewrite>
57
  </checkout>
58
-
59
- <correos_shipping>
60
- <class>Ydral_Correos_Model</class>
61
- <resourceModel>correos_mysql4</resourceModel>
62
- </correos_shipping>
63
-
64
- <correos_mysql4>
65
- <class>Ydral_Correos_Model_Mysql4</class>
66
- <entities>
67
- <correos>
68
- <table>correos_shipping</table>
69
- </correos>
70
- <recoger>
71
- <table>correos_recoger</table>
72
- </recoger>
73
- </entities>
74
- </correos_mysql4>
75
-
76
  </models>
77
-
78
  <resources>
79
- <!-- Mage::getResourceModel('correos/correos') or Mage::getResourceSingleton('correos/correos') -->
80
  <correos_setup>
81
  <setup>
82
  <module>Ydral_Correos</module>
@@ -96,12 +112,12 @@
96
  </connection>
97
  </correos_write>
98
  </resources>
99
-
100
-
101
-
102
  </global>
103
 
104
  <frontend>
 
 
 
105
  <routers>
106
  <correos>
107
  <use>standard</use>
@@ -113,31 +129,41 @@
113
  </routers>
114
  <layout>
115
  <updates>
116
- <Correos>
117
  <file>correos.xml</file>
118
- </Correos>
119
  </updates>
120
  </layout>
 
 
 
 
 
 
 
 
 
121
  <events>
122
  <checkout_controller_onepage_save_shipping_method>
123
  <observers>
124
  <ydral_correos_shipping_observer>
125
  <type>model</type>
126
- <class>Ydral_Correos_Helper_Data</class>
127
  <method>setOficinaCorreosRecogida</method>
128
  </ydral_correos_shipping_observer>
129
  </observers>
130
  </checkout_controller_onepage_save_shipping_method>
131
- <checkout_onepage_controller_success_action>
132
  <observers>
133
  <ydral_correos_order_observer>
134
  <type>model</type>
135
- <class>Ydral_Correos_Helper_Data</class>
136
  <method>setOficinaCorreosRecogidaOrder</method>
137
  </ydral_correos_order_observer>
138
  </observers>
139
- </checkout_onepage_controller_success_action>
140
  </events>
 
141
  </frontend>
142
  <adminhtml>
143
  <layout>
@@ -147,6 +173,17 @@
147
  </correos>
148
  </updates>
149
  </layout>
 
 
 
 
 
 
 
 
 
 
 
150
  <acl>
151
  <resources>
152
  <admin>
@@ -166,11 +203,20 @@
166
  </admin>
167
  </resources>
168
  </acl>
 
 
 
 
 
 
 
 
 
169
  </adminhtml>
170
  <admin>
171
  <routers>
172
  <correos>
173
- <use>admin</use>
174
  <args>
175
  <module>Ydral_Correos</module>
176
  <frontName>correos</frontName>
@@ -193,19 +239,44 @@
193
  <gateway_preregistro>https://preregistroenvios.correos.es/preregistroenvios</gateway_preregistro>
194
  <gateway_localizacion>https://online.correos.es/servicioswebLocalizacionMI/localizacionMI.asmx</gateway_localizacion>
195
  </general>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
196
  </correos>
197
  <carriers>
198
  <envio4872>
 
199
  <active>0</active>
200
  <title><![CDATA[Entrega en su domicilio en 2-3 d&iacute;as]]></title>
201
- <model>correos/ydral_correos</model>
202
  </envio4872>
203
  <recogeroficina>
 
204
  <active>0</active>
205
  <title><![CDATA[Recogida en la Oficina de Correos que vd. elija en 2-3 d&iacute;as]]></title>
206
- <model>correos/ydral_recogeroficina</model>
207
  <gateway_recoger>http://localizadoroficinas.correos.es/localizadoroficinas</gateway_recoger>
 
208
  </recogeroficina>
 
 
 
 
 
 
209
  </carriers>
210
  </default>
211
  </config>
3
  <config>
4
  <modules>
5
  <Ydral_Correos>
6
+ <version>2.0.2</version>
7
  </Ydral_Correos>
8
  </modules>
9
  <global>
 
10
  <blocks>
11
  <correos>
12
  <class>Ydral_Correos_Block</class>
18
  <order_shipment>Ydral_Correos_Block_Order_Shipment</order_shipment>
19
  </rewrite>
20
  </sales>
21
+ <!-- fix magento >= 1.7 escapeHtml -->
22
  <checkout>
23
  <rewrite>
24
  <onepage_shipping_method_available>Ydral_Correos_Block_Onepage_Shipping_Method_Available</onepage_shipping_method_available>
25
+ <onepage_progress>Ydral_Correos_Block_Onepage_Progress</onepage_progress>
26
  </rewrite>
27
  </checkout>
28
+ <tax>
29
+ <rewrite>
30
+ <checkout_shipping>Ydral_Correos_Block_Onepage_Tax</checkout_shipping>
31
+ </rewrite>
32
+ </tax>
33
+ <!-- end escapeHtml -->
34
+ <!--
35
+ <onestepcheckout>
36
+ <rewrite>
37
+ <checkout>Ydral_Correos_Block_Onestepcheckout</checkout>
38
+ </rewrite>
39
+ </onestepcheckout>
40
+ -->
41
+ <adminhtml>
42
+ <rewrite>
43
+ <sales_order_view_tab_info>Ydral_Correos_Block_Adminhtml_Sales_Order_View_Tab_Info</sales_order_view_tab_info><!-- box info shipping inside order info -->
44
+ <sales_order_grid>Ydral_Correos_Block_Adminhtml_Sales_Order_Grid</sales_order_grid><!-- add option to multiple print pdf -->
45
+ <sales_order_create_shipping_method_form>Ydral_Correos_Block_Adminhtml_Sales_Order_Create_Shipping_Method_Form</sales_order_create_shipping_method_form><!-- escape html -->
46
+ </rewrite>
47
+ </adminhtml>
48
  </blocks>
 
49
  <helpers>
 
50
  <correos>
51
  <class>Ydral_Correos_Helper</class>
52
  </correos>
53
+ <!--
54
  <onestepcheckout>
55
  <rewrite>
56
  <checkout>Ydral_Correos_Helper_Onestepcheckout</checkout>
57
  </rewrite>
58
  </onestepcheckout>
59
+ -->
60
  </helpers>
 
61
  <models>
 
62
  <correos>
63
  <class>Ydral_Correos_Model</class>
64
+ <resourceModel>correos_resource</resourceModel>
65
  </correos>
66
+ <correos_resource>
67
+ <class>Ydral_Correos_Model_Resource</class>
68
+ <entities>
69
+ <remitente>
70
+ <table>correos_remitente</table>
71
+ </remitente>
72
+ <correos>
73
+ <table>correos_shipping</table>
74
+ </correos>
75
+ <recoger>
76
+ <table>correos_recoger_oficina</table>
77
+ </recoger>
78
+ </entities>
79
+ </correos_resource>
80
+
81
  <sales>
82
  <rewrite>
83
+ <order_shipment>Ydral_Correos_Model_Ydral_Shipment</order_shipment> <!-- Send order from admin -->
84
+ <quote_address_total_shipping>Ydral_Correos_Model_Quote_Address_Total_Shipping</quote_address_total_shipping><!-- Save method without tags -->
85
  </rewrite>
86
  </sales>
87
+ <!-- check oficina recogida seleccionada -->
88
  <checkout>
89
  <rewrite>
90
  <type_onepage>Ydral_Correos_Model_Type_Onepage</type_onepage>
91
  </rewrite>
92
  </checkout>
93
+ <!-- end check oficina -->
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
94
  </models>
 
95
  <resources>
 
96
  <correos_setup>
97
  <setup>
98
  <module>Ydral_Correos</module>
112
  </connection>
113
  </correos_write>
114
  </resources>
 
 
 
115
  </global>
116
 
117
  <frontend>
118
+ <secure_url>
119
+ <correos>/correos</correos>
120
+ </secure_url>
121
  <routers>
122
  <correos>
123
  <use>standard</use>
129
  </routers>
130
  <layout>
131
  <updates>
132
+ <correos>
133
  <file>correos.xml</file>
134
+ </correos>
135
  </updates>
136
  </layout>
137
+ <translate>
138
+ <modules>
139
+ <correos>
140
+ <files>
141
+ <default>Ydral_Correos.csv</default>
142
+ </files>
143
+ </correos>
144
+ </modules>
145
+ </translate>
146
  <events>
147
  <checkout_controller_onepage_save_shipping_method>
148
  <observers>
149
  <ydral_correos_shipping_observer>
150
  <type>model</type>
151
+ <class>Ydral_Correos_Model_Observer</class>
152
  <method>setOficinaCorreosRecogida</method>
153
  </ydral_correos_shipping_observer>
154
  </observers>
155
  </checkout_controller_onepage_save_shipping_method>
156
+ <checkout_submit_all_after>
157
  <observers>
158
  <ydral_correos_order_observer>
159
  <type>model</type>
160
+ <class>Ydral_Correos_Model_Observer</class>
161
  <method>setOficinaCorreosRecogidaOrder</method>
162
  </ydral_correos_order_observer>
163
  </observers>
164
+ </checkout_submit_all_after>
165
  </events>
166
+
167
  </frontend>
168
  <adminhtml>
169
  <layout>
173
  </correos>
174
  </updates>
175
  </layout>
176
+ <events>
177
+ <checkout_submit_all_after>
178
+ <observers>
179
+ <ydral_correos_adminhtml_observer>
180
+ <type>model</type>
181
+ <class>Ydral_Correos_Model_Observer</class>
182
+ <method>setOficinaCorreosRecogidaOrderAdminhtml</method>
183
+ </ydral_correos_adminhtml_observer>
184
+ </observers>
185
+ </checkout_submit_all_after>
186
+ </events>
187
  <acl>
188
  <resources>
189
  <admin>
203
  </admin>
204
  </resources>
205
  </acl>
206
+ <translate>
207
+ <modules>
208
+ <correos>
209
+ <files>
210
+ <default>Ydral_Correos.csv</default>
211
+ </files>
212
+ </correos>
213
+ </modules>
214
+ </translate>
215
  </adminhtml>
216
  <admin>
217
  <routers>
218
  <correos>
219
+ <use>correos</use>
220
  <args>
221
  <module>Ydral_Correos</module>
222
  <frontName>correos</frontName>
239
  <gateway_preregistro>https://preregistroenvios.correos.es/preregistroenvios</gateway_preregistro>
240
  <gateway_localizacion>https://online.correos.es/servicioswebLocalizacionMI/localizacionMI.asmx</gateway_localizacion>
241
  </general>
242
+ <remitente>
243
+ <multisender>0</multisender>
244
+ <country_id>ES</country_id>
245
+ </remitente>
246
+ <paquete>
247
+ <seguro>0</seguro>
248
+ <entregaexclusiva>0</entregaexclusiva>
249
+ <paquetefactura>0</paquetefactura>
250
+ <paquetelicencia>0</paquetelicencia>
251
+ <paquetecertificado>0</paquetecertificado>
252
+ <peso>gramos</peso>
253
+ </paquete>
254
+ <opciones>
255
+ <logger>0</logger>
256
+ <showmap>1</showmap>
257
+ <savepdf>0</savepdf>
258
+ </opciones>
259
  </correos>
260
  <carriers>
261
  <envio4872>
262
+ <model>correos/ydral_correos</model>
263
  <active>0</active>
264
  <title><![CDATA[Entrega en su domicilio en 2-3 d&iacute;as]]></title>
265
+ <name>Correos 48/72</name> <!-- method_name -->
266
  </envio4872>
267
  <recogeroficina>
268
+ <model>correos/ydral_recogeroficina</model>
269
  <active>0</active>
270
  <title><![CDATA[Recogida en la Oficina de Correos que vd. elija en 2-3 d&iacute;as]]></title>
 
271
  <gateway_recoger>http://localizadoroficinas.correos.es/localizadoroficinas</gateway_recoger>
272
+ <name>Correos Recogida en oficina</name> <!-- method_name -->
273
  </recogeroficina>
274
+ <correosinter>
275
+ <model>correos/ydral_correosinter</model>
276
+ <active>0</active>
277
+ <title><![CDATA[Paquete Postal Internacional Prioritario]]></title>
278
+ <name>Correos Paquete Postal Internacional</name> <!-- method_name -->
279
+ </correosinter>
280
  </carriers>
281
  </default>
282
  </config>
app/code/local/Ydral/Correos/etc/system.xml CHANGED
@@ -19,78 +19,107 @@
19
  <show_in_website>1</show_in_website>
20
  <show_in_store>1</show_in_store>
21
  <fields>
 
 
 
 
 
 
 
 
 
22
  <active translate="label">
23
- <label>Enabled</label>
24
  <frontend_type>select</frontend_type>
25
  <source_model>adminhtml/system_config_source_yesno</source_model>
26
- <sort_order>1</sort_order>
27
  <show_in_default>1</show_in_default>
28
  <show_in_website>1</show_in_website>
29
  <show_in_store>1</show_in_store>
 
30
  </active>
 
 
 
 
 
 
 
 
 
 
31
  <etiquetador translate="label comment">
32
  <label><![CDATA[C&oacute;digo de etiquetador]]></label>
33
  <frontend_type>text</frontend_type>
34
- <sort_order>3</sort_order>
35
  <show_in_default>1</show_in_default>
36
  <show_in_website>1</show_in_website>
37
  <show_in_store>1</show_in_store>
 
38
  </etiquetador>
39
  <contrato translate="label comment">
40
  <label><![CDATA[N&uacute;mero de contrato]]></label>
41
  <frontend_type>text</frontend_type>
42
- <comment><![CDATA[Obligatorio si no dispone de c&oacute;digo de etiquetador]]></comment>
43
- <sort_order>4</sort_order>
44
  <show_in_default>1</show_in_default>
45
  <show_in_website>1</show_in_website>
46
  <show_in_store>1</show_in_store>
 
47
  </contrato>
48
  <numcliente translate="label comment">
49
  <label><![CDATA[N&uacute;mero de cliente]]></label>
50
- <comment><![CDATA[Obligatorio si no dispone de c&oacute;digo de etiquetador]]></comment>
51
  <frontend_type>text</frontend_type>
52
- <sort_order>5</sort_order>
53
  <show_in_default>1</show_in_default>
54
  <show_in_website>1</show_in_website>
55
  <show_in_store>1</show_in_store>
 
56
  </numcliente>
57
  <usercorreos translate="label comment">
58
  <label><![CDATA[Usuario de Correos]]></label>
59
- <comment><![CDATA[Usuario para la pasarela]]></comment>
60
  <frontend_type>text</frontend_type>
61
- <sort_order>6</sort_order>
62
  <show_in_default>1</show_in_default>
63
  <show_in_website>1</show_in_website>
64
  <show_in_store>1</show_in_store>
 
65
  </usercorreos>
66
  <pwdcorreos translate="label comment">
67
  <label><![CDATA[Password de Correos]]></label>
68
  <frontend_type>text</frontend_type>
69
- <comment><![CDATA[Password para la pasarela]]></comment>
70
- <sort_order>7</sort_order>
71
  <show_in_default>1</show_in_default>
72
  <show_in_website>1</show_in_website>
73
  <show_in_store>1</show_in_store>
 
74
  </pwdcorreos>
 
 
 
 
 
 
 
 
 
 
75
  <gateway_preregistro translate="label">
76
  <label>URL datos</label>
77
  <default></default>
78
  <frontend_type>text</frontend_type>
79
- <sort_order>60</sort_order>
80
  <show_in_default>1</show_in_default>
81
  <show_in_website>1</show_in_website>
82
  <show_in_store>1</show_in_store>
83
  <comment><![CDATA[Solo modificar si Correos lo indica]]></comment>
 
84
  </gateway_preregistro>
85
  <gateway_localizacion translate="label">
86
  <label><![CDATA[URL localizaci&oacute;n]]></label>
87
  <default></default>
88
  <frontend_type>text</frontend_type>
89
- <sort_order>70</sort_order>
90
  <show_in_default>1</show_in_default>
91
  <show_in_website>1</show_in_website>
92
  <show_in_store>1</show_in_store>
93
  <comment><![CDATA[Solo modificar si Correos lo indica]]></comment>
 
94
  </gateway_localizacion>
95
  </fields>
96
  </general>
@@ -102,102 +131,170 @@
102
  <show_in_website>1</show_in_website>
103
  <show_in_store>1</show_in_store>
104
  <fields>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
105
  <nombre translate="label">
106
  <label>Nombre del remitente</label>
107
  <frontend_type>text</frontend_type>
108
- <sort_order>1</sort_order>
109
  <show_in_default>1</show_in_default>
110
- <show_in_website>1</show_in_website>
111
  <show_in_store>1</show_in_store>
 
 
112
  </nombre>
113
  <apellidos translate="label">
114
  <label>Apellidos del remitente</label>
115
  <frontend_type>text</frontend_type>
116
- <sort_order>2</sort_order>
117
  <show_in_default>1</show_in_default>
118
- <show_in_website>1</show_in_website>
119
  <show_in_store>1</show_in_store>
 
 
120
  </apellidos>
121
  <nif translate="label">
122
  <label>DNI/NIF</label>
123
  <frontend_type>text</frontend_type>
124
- <sort_order>3</sort_order>
125
  <show_in_default>1</show_in_default>
126
- <show_in_website>1</show_in_website>
127
  <show_in_store>1</show_in_store>
 
 
128
  </nif>
129
  <empresa translate="label">
130
  <label>Empresa</label>
131
  <frontend_type>text</frontend_type>
132
- <sort_order>4</sort_order>
133
  <show_in_default>1</show_in_default>
134
- <show_in_website>1</show_in_website>
135
  <show_in_store>1</show_in_store>
 
 
136
  </empresa>
137
  <personacontacto translate="label">
138
  <label>Persona de contacto</label>
139
  <frontend_type>text</frontend_type>
140
- <sort_order>5</sort_order>
141
  <show_in_default>1</show_in_default>
142
- <show_in_website>1</show_in_website>
143
  <show_in_store>1</show_in_store>
 
 
144
  </personacontacto>
145
- <direccion translate="label">
146
- <label><![CDATA[Direcci&oacute;n]]></label>
 
 
 
 
 
 
 
 
 
 
 
147
  <frontend_type>text</frontend_type>
148
- <sort_order>6</sort_order>
149
  <show_in_default>1</show_in_default>
150
  <show_in_website>1</show_in_website>
 
 
 
 
 
 
 
 
151
  <show_in_store>1</show_in_store>
152
- </direccion>
 
 
153
  <localidad translate="label">
154
  <label>Localidad</label>
155
  <frontend_type>text</frontend_type>
156
- <sort_order>7</sort_order>
157
  <show_in_default>1</show_in_default>
158
- <show_in_website>1</show_in_website>
159
  <show_in_store>1</show_in_store>
 
 
160
  </localidad>
161
- <codpostal translate="label">
162
- <label><![CDATA[C&oacute;digo Postal]]></label>
163
  <frontend_type>text</frontend_type>
164
- <sort_order>8</sort_order>
165
  <show_in_default>1</show_in_default>
166
- <show_in_website>1</show_in_website>
167
  <show_in_store>1</show_in_store>
168
- </codpostal>
 
 
 
169
  <provincia translate="label">
170
  <label>Provincia</label>
171
- <frontend_type>text</frontend_type>
172
- <sort_order>9</sort_order>
173
  <show_in_default>1</show_in_default>
174
- <show_in_website>1</show_in_website>
175
  <show_in_store>1</show_in_store>
 
 
176
  </provincia>
 
177
  <telefono translate="label">
178
  <label><![CDATA[Tel&eacute;fono]]></label>
179
  <frontend_type>text</frontend_type>
180
- <sort_order>10</sort_order>
181
  <show_in_default>1</show_in_default>
182
- <show_in_website>1</show_in_website>
183
  <show_in_store>1</show_in_store>
 
 
184
  </telefono>
185
  <email translate="label">
186
  <label>E-mail</label>
187
  <frontend_type>text</frontend_type>
188
- <sort_order>11</sort_order>
189
  <show_in_default>1</show_in_default>
190
- <show_in_website>1</show_in_website>
191
  <show_in_store>1</show_in_store>
 
 
192
  </email>
193
  <telefonosms translate="label">
194
  <label><![CDATA[Tel&eacute;fono env&iacute;o de SMS]]></label>
195
  <frontend_type>text</frontend_type>
196
- <sort_order>12</sort_order>
197
  <show_in_default>1</show_in_default>
198
- <show_in_website>1</show_in_website>
199
  <show_in_store>1</show_in_store>
 
 
200
  </telefonosms>
 
201
  </fields>
202
  </remitente>
203
  <paquete translate="label">
@@ -212,37 +309,116 @@
212
  <label>Seguro de los paquetes</label>
213
  <frontend_type>select</frontend_type>
214
  <source_model>adminhtml/system_config_source_yesno</source_model>
215
- <sort_order>1</sort_order>
216
  <show_in_default>1</show_in_default>
217
  <show_in_website>1</show_in_website>
218
  <show_in_store>1</show_in_store>
 
219
  </seguro>
220
  <importeseguro translate="label">
221
  <label><![CDATA[Valor asegurado (hasta)]]></label>
222
  <frontend_type>text</frontend_type>
223
- <sort_order>2</sort_order>
224
  <show_in_default>1</show_in_default>
225
  <show_in_website>1</show_in_website>
226
  <show_in_store>1</show_in_store>
 
 
227
  </importeseguro>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
228
  <peso translate="label">
229
  <label><![CDATA[Configuraci&oacute;n del peso en el cat&aacute;logo]]></label>
 
230
  <frontend_type>select</frontend_type>
231
- <source_model>correos/pesos</source_model>
232
- <sort_order>3</sort_order>
233
  <show_in_default>1</show_in_default>
234
  <show_in_website>1</show_in_website>
235
  <show_in_store>1</show_in_store>
236
- <comment><![CDATA[Indicar la unidad en la que se han a&ntilde;adido el peso en los productos del cat&aacute;logo]]></comment>
237
  </peso>
238
  </fields>
239
  </paquete>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
240
  </groups>
241
- </correos>
242
-
243
-
244
-
245
-
246
 
247
  <carriers>
248
  <groups>
@@ -256,109 +432,96 @@
256
  <show_in_store>1</show_in_store>
257
  <fields>
258
  <active translate="label">
259
- <label>Activar</label>
260
  <frontend_type>select</frontend_type>
261
  <source_model>adminhtml/system_config_source_yesno</source_model>
262
- <sort_order>10</sort_order>
263
  <show_in_default>1</show_in_default>
264
  <show_in_website>1</show_in_website>
265
- <show_in_store>1</show_in_store>
 
266
  </active>
267
  <title translate="label">
268
  <label><![CDATA[T&iacute;tulo]]></label>
269
  <frontend_type>text</frontend_type>
270
- <sort_order>20</sort_order>
271
  <show_in_default>1</show_in_default>
272
  <show_in_website>1</show_in_website>
273
  <show_in_store>1</show_in_store>
 
274
  </title>
275
  <condition_name translate="label">
276
  <label><![CDATA[Tipo de condici&oacute;n]]></label>
277
  <frontend_type>select</frontend_type>
278
  <source_model>adminhtml/system_config_source_shipping_tablerate</source_model>
279
- <sort_order>25</sort_order>
280
  <show_in_default>1</show_in_default>
281
  <show_in_website>1</show_in_website>
282
  <show_in_store>0</show_in_store>
 
283
  </condition_name>
284
- <!--
285
- <export translate="label">
286
- <label>Exportar</label>
287
- <frontend_type>export</frontend_type>
288
- <sort_order>32</sort_order>
289
- <show_in_default>0</show_in_default>
290
  <show_in_website>1</show_in_website>
291
  <show_in_store>0</show_in_store>
292
- </export>
293
- -->
294
  <export translate="label">
295
- <label>Exportar</label>
296
  <frontend_type>button</frontend_type>
297
  <frontend_model>correos/system_export_envio</frontend_model>
298
- <sort_order>32</sort_order>
299
  <show_in_default>0</show_in_default>
300
  <show_in_website>1</show_in_website>
301
  <show_in_store>0</show_in_store>
 
302
  </export>
303
  <import translate="label">
304
  <label>Importar</label>
305
  <frontend_type>import</frontend_type>
306
  <backend_model>correos/system_config_backend_shipping_correos</backend_model>
307
- <sort_order>33</sort_order>
308
  <show_in_default>0</show_in_default>
309
  <show_in_website>1</show_in_website>
310
  <show_in_store>0</show_in_store>
 
311
  </import>
312
  <envio4872cost translate="label">
313
  <label><![CDATA[Costo del env&iacute;o]]></label>
314
  <frontend_type>text</frontend_type>
315
- <sort_order>40</sort_order>
316
  <show_in_default>1</show_in_default>
317
  <show_in_website>1</show_in_website>
318
  <show_in_store>1</show_in_store>
 
319
  </envio4872cost>
320
  <sallowspecific translate="label">
321
  <label><![CDATA[Env&iacute;o a pa&iacute;ses]]></label>
322
  <frontend_type>select</frontend_type>
323
- <sort_order>90</sort_order>
324
  <frontend_class>shipping-applicable-country</frontend_class>
325
  <source_model>adminhtml/system_config_source_shipping_allspecificcountries</source_model>
326
  <show_in_default>1</show_in_default>
327
  <show_in_website>1</show_in_website>
328
  <show_in_store>0</show_in_store>
 
329
  </sallowspecific>
330
  <specificcountry translate="label">
331
  <label><![CDATA[Pa&iacute;ses de env&iacute;o]]></label>
332
  <frontend_type>multiselect</frontend_type>
333
- <sort_order>91</sort_order>
334
  <source_model>adminhtml/system_config_source_country</source_model>
335
  <show_in_default>1</show_in_default>
336
  <show_in_website>1</show_in_website>
337
  <show_in_store>0</show_in_store>
338
  <can_be_empty>1</can_be_empty>
 
339
  </specificcountry>
340
- <envio4872showmethod translate="label">
341
- <label><![CDATA[Mostrar m&eacute;todo aunque no este disponible]]></label>
342
- <frontend_type>select</frontend_type>
343
- <sort_order>92</sort_order>
344
- <source_model>adminhtml/system_config_source_yesno</source_model>
345
- <show_in_default>1</show_in_default>
346
- <show_in_website>1</show_in_website>
347
- <show_in_store>0</show_in_store>
348
- </envio4872showmethod>
349
-
350
  <sort_order translate="label">
351
  <label>Orden</label>
352
  <frontend_type>text</frontend_type>
353
- <sort_order>150</sort_order>
354
  <show_in_default>1</show_in_default>
355
  <show_in_website>1</show_in_website>
356
- <show_in_store>1</show_in_store>
 
357
  </sort_order>
358
-
359
  </fields>
360
  </envio4872>
361
-
362
  <recogeroficina translate="label" module="shipping">
363
  <label><![CDATA[Correos - Recoger en oficina m&aacute;s cercana]]></label>
364
  <frontend_type>text</frontend_type>
@@ -371,116 +534,202 @@
371
  <label>Activar</label>
372
  <frontend_type>select</frontend_type>
373
  <source_model>adminhtml/system_config_source_yesno</source_model>
374
- <sort_order>10</sort_order>
375
  <show_in_default>1</show_in_default>
376
  <show_in_website>1</show_in_website>
377
  <show_in_store>1</show_in_store>
 
378
  </active>
379
  <title translate="label">
380
  <label><![CDATA[T&iacute;tulo]]></label>
381
  <frontend_type>text</frontend_type>
382
- <sort_order>20</sort_order>
383
  <show_in_default>1</show_in_default>
384
  <show_in_website>1</show_in_website>
385
  <show_in_store>1</show_in_store>
 
386
  </title>
387
  <condition_name translate="label">
388
  <label><![CDATA[Tipo de condici&oacute;n]]></label>
389
  <frontend_type>select</frontend_type>
390
  <source_model>adminhtml/system_config_source_shipping_tablerate</source_model>
391
- <sort_order>25</sort_order>
392
  <show_in_default>1</show_in_default>
393
  <show_in_website>1</show_in_website>
394
  <show_in_store>0</show_in_store>
 
395
  </condition_name>
396
- <!--
397
- <export translate="label">
398
- <label>Exportar</label>
399
- <frontend_type>export</frontend_type>
400
- <sort_order>32</sort_order>
401
- <show_in_default>0</show_in_default>
402
  <show_in_website>1</show_in_website>
403
  <show_in_store>0</show_in_store>
404
- </export>
405
- -->
406
  <export translate="label">
407
- <label>Exportar</label>
408
  <frontend_type>button</frontend_type>
409
  <frontend_model>correos/system_export_recoger</frontend_model>
410
- <sort_order>32</sort_order>
411
  <show_in_default>0</show_in_default>
412
  <show_in_website>1</show_in_website>
413
  <show_in_store>0</show_in_store>
 
414
  </export>
415
  <import translate="label">
416
  <label>Importar</label>
417
  <frontend_type>import</frontend_type>
418
  <backend_model>correos/system_config_backend_shipping_recoger</backend_model>
419
- <sort_order>33</sort_order>
420
  <show_in_default>0</show_in_default>
421
  <show_in_website>1</show_in_website>
422
  <show_in_store>0</show_in_store>
 
423
  </import>
424
  <recogeroficinacost translate="label">
425
  <label><![CDATA[Costo del env&iacute;o]]></label>
426
  <frontend_type>text</frontend_type>
427
- <sort_order>40</sort_order>
428
  <show_in_default>1</show_in_default>
429
  <show_in_website>1</show_in_website>
430
  <show_in_store>1</show_in_store>
 
431
  </recogeroficinacost>
432
  <sallowspecific translate="label">
433
  <label><![CDATA[Env&iacute;o a pa&iacute;ses]]></label>
434
  <frontend_type>select</frontend_type>
435
- <sort_order>90</sort_order>
436
  <frontend_class>shipping-applicable-country</frontend_class>
437
  <source_model>adminhtml/system_config_source_shipping_allspecificcountries</source_model>
438
  <show_in_default>1</show_in_default>
439
  <show_in_website>1</show_in_website>
440
  <show_in_store>0</show_in_store>
 
441
  </sallowspecific>
442
  <specificcountry translate="label">
443
  <label><![CDATA[Pa&iacute;ses de env&iacute;o]]></label>
444
  <frontend_type>multiselect</frontend_type>
445
- <sort_order>91</sort_order>
446
  <source_model>adminhtml/system_config_source_country</source_model>
447
  <show_in_default>1</show_in_default>
448
  <show_in_website>1</show_in_website>
449
  <show_in_store>0</show_in_store>
450
  <can_be_empty>1</can_be_empty>
451
- </specificcountry>
452
- <recogeroficinashowmethod translate="label">
453
- <label><![CDATA[Mostrar m&eacute;todo aunque no este disponible]]></label>
454
- <frontend_type>select</frontend_type>
455
- <sort_order>92</sort_order>
456
- <source_model>adminhtml/system_config_source_yesno</source_model>
457
- <show_in_default>1</show_in_default>
458
- <show_in_website>1</show_in_website>
459
- <show_in_store>0</show_in_store>
460
- </recogeroficinashowmethod>
461
-
462
  <gateway_recoger translate="label">
463
  <label>URL datos</label>
 
464
  <default></default>
465
  <frontend_type>text</frontend_type>
466
- <sort_order>60</sort_order>
467
  <show_in_default>1</show_in_default>
468
  <show_in_website>1</show_in_website>
469
  <show_in_store>1</show_in_store>
470
- <comment><![CDATA[Solo modificar si Correos lo indica]]></comment>
471
- </gateway_recoger>
472
-
473
  <sort_order translate="label">
474
  <label>Orden</label>
475
  <frontend_type>text</frontend_type>
476
- <sort_order>150</sort_order>
477
  <show_in_default>1</show_in_default>
478
  <show_in_website>1</show_in_website>
479
  <show_in_store>1</show_in_store>
 
480
  </sort_order>
481
-
482
  </fields>
483
  </recogeroficina>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
484
 
485
  </groups>
486
  </carriers>
19
  <show_in_website>1</show_in_website>
20
  <show_in_store>1</show_in_store>
21
  <fields>
22
+
23
+ <about>
24
+ <frontend_model>correos/system_config_about</frontend_model>
25
+ <show_in_default>1</show_in_default>
26
+ <show_in_website>1</show_in_website>
27
+ <show_in_store>1</show_in_store>
28
+ <sort_order>0</sort_order>
29
+ </about>
30
+
31
  <active translate="label">
32
+ <label>Activado</label>
33
  <frontend_type>select</frontend_type>
34
  <source_model>adminhtml/system_config_source_yesno</source_model>
 
35
  <show_in_default>1</show_in_default>
36
  <show_in_website>1</show_in_website>
37
  <show_in_store>1</show_in_store>
38
+ <sort_order>10</sort_order>
39
  </active>
40
+
41
+ <heading_configuration translate="label">
42
+ <label><![CDATA[Configuraci&oacute;n del modulo de Correos. Los datos le ser&aacute;n enviados por Correos.]]></label>
43
+ <frontend_model>adminhtml/system_config_form_field_heading</frontend_model>
44
+ <show_in_default>1</show_in_default>
45
+ <show_in_website>1</show_in_website>
46
+ <show_in_store>1</show_in_store>
47
+ <sort_order>15</sort_order>
48
+ </heading_configuration>
49
+
50
  <etiquetador translate="label comment">
51
  <label><![CDATA[C&oacute;digo de etiquetador]]></label>
52
  <frontend_type>text</frontend_type>
 
53
  <show_in_default>1</show_in_default>
54
  <show_in_website>1</show_in_website>
55
  <show_in_store>1</show_in_store>
56
+ <sort_order>20</sort_order>
57
  </etiquetador>
58
  <contrato translate="label comment">
59
  <label><![CDATA[N&uacute;mero de contrato]]></label>
60
  <frontend_type>text</frontend_type>
61
+ <comment><![CDATA[Obligatorio si no dispone de c&oacute;digo de etiquetador.]]></comment>
 
62
  <show_in_default>1</show_in_default>
63
  <show_in_website>1</show_in_website>
64
  <show_in_store>1</show_in_store>
65
+ <sort_order>30</sort_order>
66
  </contrato>
67
  <numcliente translate="label comment">
68
  <label><![CDATA[N&uacute;mero de cliente]]></label>
69
+ <comment><![CDATA[Obligatorio si no dispone de c&oacute;digo de etiquetador.]]></comment>
70
  <frontend_type>text</frontend_type>
 
71
  <show_in_default>1</show_in_default>
72
  <show_in_website>1</show_in_website>
73
  <show_in_store>1</show_in_store>
74
+ <sort_order>40</sort_order>
75
  </numcliente>
76
  <usercorreos translate="label comment">
77
  <label><![CDATA[Usuario de Correos]]></label>
78
+ <comment><![CDATA[Usuario para la pasarela otorgado por Correos.]]></comment>
79
  <frontend_type>text</frontend_type>
 
80
  <show_in_default>1</show_in_default>
81
  <show_in_website>1</show_in_website>
82
  <show_in_store>1</show_in_store>
83
+ <sort_order>50</sort_order>
84
  </usercorreos>
85
  <pwdcorreos translate="label comment">
86
  <label><![CDATA[Password de Correos]]></label>
87
  <frontend_type>text</frontend_type>
88
+ <comment><![CDATA[Password para la pasarela otorgado por Correos.]]></comment>
 
89
  <show_in_default>1</show_in_default>
90
  <show_in_website>1</show_in_website>
91
  <show_in_store>1</show_in_store>
92
+ <sort_order>60</sort_order>
93
  </pwdcorreos>
94
+
95
+ <heading_urls translate="label">
96
+ <label><![CDATA[Direcciones de correos.]]></label>
97
+ <frontend_model>adminhtml/system_config_form_field_heading</frontend_model>
98
+ <show_in_default>1</show_in_default>
99
+ <show_in_website>1</show_in_website>
100
+ <show_in_store>1</show_in_store>
101
+ <sort_order>65</sort_order>
102
+ </heading_urls>
103
+
104
  <gateway_preregistro translate="label">
105
  <label>URL datos</label>
106
  <default></default>
107
  <frontend_type>text</frontend_type>
 
108
  <show_in_default>1</show_in_default>
109
  <show_in_website>1</show_in_website>
110
  <show_in_store>1</show_in_store>
111
  <comment><![CDATA[Solo modificar si Correos lo indica]]></comment>
112
+ <sort_order>70</sort_order>
113
  </gateway_preregistro>
114
  <gateway_localizacion translate="label">
115
  <label><![CDATA[URL localizaci&oacute;n]]></label>
116
  <default></default>
117
  <frontend_type>text</frontend_type>
 
118
  <show_in_default>1</show_in_default>
119
  <show_in_website>1</show_in_website>
120
  <show_in_store>1</show_in_store>
121
  <comment><![CDATA[Solo modificar si Correos lo indica]]></comment>
122
+ <sort_order>80</sort_order>
123
  </gateway_localizacion>
124
  </fields>
125
  </general>
131
  <show_in_website>1</show_in_website>
132
  <show_in_store>1</show_in_store>
133
  <fields>
134
+
135
+ <info_import_sender>
136
+ <frontend_model>correos/system_config_infosender</frontend_model>
137
+ <show_in_default>1</show_in_default>
138
+ <show_in_website>0</show_in_website>
139
+ <show_in_store>1</show_in_store>
140
+ <sort_order>0</sort_order>
141
+ </info_import_sender>
142
+
143
+ <multisender translate="label" module="payment">
144
+ <label><![CDATA[Utilizar Multiremitente]]></label>
145
+ <comment><![CDATA[Permite seleccionar entre diferentes direcciones el remitente del env&iacute;o.]]></comment>
146
+ <frontend_type>select</frontend_type>
147
+ <source_model>adminhtml/system_config_source_yesno</source_model>
148
+ <show_in_default>1</show_in_default>
149
+ <show_in_website>0</show_in_website>
150
+ <show_in_store>1</show_in_store>
151
+ <sort_order>10</sort_order>
152
+ </multisender>
153
+
154
+ <importsender translate="label">
155
+ <label>Importar</label>
156
+ <frontend_type>import</frontend_type>
157
+ <backend_model>correos/system_config_backend_shipping_multiremitente</backend_model>
158
+ <show_in_default>1</show_in_default>
159
+ <show_in_website>0</show_in_website>
160
+ <show_in_store>0</show_in_store>
161
+ <sort_order>100</sort_order>
162
+ <depends><multisender>1</multisender></depends>
163
+ </importsender>
164
+
165
+
166
  <nombre translate="label">
167
  <label>Nombre del remitente</label>
168
  <frontend_type>text</frontend_type>
 
169
  <show_in_default>1</show_in_default>
170
+ <show_in_website>0</show_in_website>
171
  <show_in_store>1</show_in_store>
172
+ <sort_order>200</sort_order>
173
+ <depends><multisender>0</multisender></depends>
174
  </nombre>
175
  <apellidos translate="label">
176
  <label>Apellidos del remitente</label>
177
  <frontend_type>text</frontend_type>
 
178
  <show_in_default>1</show_in_default>
179
+ <show_in_website>0</show_in_website>
180
  <show_in_store>1</show_in_store>
181
+ <sort_order>210</sort_order>
182
+ <depends><multisender>0</multisender></depends>
183
  </apellidos>
184
  <nif translate="label">
185
  <label>DNI/NIF</label>
186
  <frontend_type>text</frontend_type>
 
187
  <show_in_default>1</show_in_default>
188
+ <show_in_website>0</show_in_website>
189
  <show_in_store>1</show_in_store>
190
+ <sort_order>220</sort_order>
191
+ <depends><multisender>0</multisender></depends>
192
  </nif>
193
  <empresa translate="label">
194
  <label>Empresa</label>
195
  <frontend_type>text</frontend_type>
 
196
  <show_in_default>1</show_in_default>
197
+ <show_in_website>0</show_in_website>
198
  <show_in_store>1</show_in_store>
199
+ <sort_order>230</sort_order>
200
+ <depends><multisender>0</multisender></depends>
201
  </empresa>
202
  <personacontacto translate="label">
203
  <label>Persona de contacto</label>
204
  <frontend_type>text</frontend_type>
 
205
  <show_in_default>1</show_in_default>
206
+ <show_in_website>0</show_in_website>
207
  <show_in_store>1</show_in_store>
208
+ <sort_order>240</sort_order>
209
+ <depends><multisender>0</multisender></depends>
210
  </personacontacto>
211
+ <country_id translate="label">
212
+ <label><![CDATA[Pa&iacute;s]]></label>
213
+ <frontend_type>select</frontend_type>
214
+ <frontend_class>countries</frontend_class>
215
+ <source_model>adminhtml/system_config_source_country</source_model>
216
+ <sort_order>250</sort_order>
217
+ <show_in_default>1</show_in_default>
218
+ <show_in_website>1</show_in_website>
219
+ <show_in_store>0</show_in_store>
220
+ <depends><multisender>0</multisender></depends>
221
+ </country_id>
222
+ <region_id translate="label">
223
+ <label>Provincia</label>
224
  <frontend_type>text</frontend_type>
225
+ <sort_order>260</sort_order>
226
  <show_in_default>1</show_in_default>
227
  <show_in_website>1</show_in_website>
228
+ <show_in_store>0</show_in_store>
229
+ <depends><multisender>0</multisender></depends>
230
+ </region_id>
231
+ <codpostal translate="label">
232
+ <label><![CDATA[C&oacute;digo Postal]]></label>
233
+ <frontend_type>text</frontend_type>
234
+ <show_in_default>1</show_in_default>
235
+ <show_in_website>0</show_in_website>
236
  <show_in_store>1</show_in_store>
237
+ <sort_order>270</sort_order>
238
+ <depends><multisender>0</multisender></depends>
239
+ </codpostal>
240
  <localidad translate="label">
241
  <label>Localidad</label>
242
  <frontend_type>text</frontend_type>
 
243
  <show_in_default>1</show_in_default>
244
+ <show_in_website>0</show_in_website>
245
  <show_in_store>1</show_in_store>
246
+ <sort_order>280</sort_order>
247
+ <depends><multisender>0</multisender></depends>
248
  </localidad>
249
+ <direccion translate="label">
250
+ <label><![CDATA[Direcci&oacute;n]]></label>
251
  <frontend_type>text</frontend_type>
 
252
  <show_in_default>1</show_in_default>
253
+ <show_in_website>0</show_in_website>
254
  <show_in_store>1</show_in_store>
255
+ <sort_order>290</sort_order>
256
+ <depends><multisender>0</multisender></depends>
257
+ </direccion>
258
+ <!--
259
  <provincia translate="label">
260
  <label>Provincia</label>
261
+ <frontend_type>select</frontend_type>
262
+ <source_model>correos/system_config_source_provincias</source_model>
263
  <show_in_default>1</show_in_default>
264
+ <show_in_website>0</show_in_website>
265
  <show_in_store>1</show_in_store>
266
+ <sort_order>280</sort_order>
267
+ <depends><multisender>0</multisender></depends>
268
  </provincia>
269
+ -->
270
  <telefono translate="label">
271
  <label><![CDATA[Tel&eacute;fono]]></label>
272
  <frontend_type>text</frontend_type>
 
273
  <show_in_default>1</show_in_default>
274
+ <show_in_website>0</show_in_website>
275
  <show_in_store>1</show_in_store>
276
+ <sort_order>300</sort_order>
277
+ <depends><multisender>0</multisender></depends>
278
  </telefono>
279
  <email translate="label">
280
  <label>E-mail</label>
281
  <frontend_type>text</frontend_type>
 
282
  <show_in_default>1</show_in_default>
283
+ <show_in_website>0</show_in_website>
284
  <show_in_store>1</show_in_store>
285
+ <sort_order>310</sort_order>
286
+ <depends><multisender>0</multisender></depends>
287
  </email>
288
  <telefonosms translate="label">
289
  <label><![CDATA[Tel&eacute;fono env&iacute;o de SMS]]></label>
290
  <frontend_type>text</frontend_type>
 
291
  <show_in_default>1</show_in_default>
292
+ <show_in_website>0</show_in_website>
293
  <show_in_store>1</show_in_store>
294
+ <sort_order>320</sort_order>
295
+ <depends><multisender>0</multisender></depends>
296
  </telefonosms>
297
+
298
  </fields>
299
  </remitente>
300
  <paquete translate="label">
309
  <label>Seguro de los paquetes</label>
310
  <frontend_type>select</frontend_type>
311
  <source_model>adminhtml/system_config_source_yesno</source_model>
 
312
  <show_in_default>1</show_in_default>
313
  <show_in_website>1</show_in_website>
314
  <show_in_store>1</show_in_store>
315
+ <sort_order>10</sort_order>
316
  </seguro>
317
  <importeseguro translate="label">
318
  <label><![CDATA[Valor asegurado (hasta)]]></label>
319
  <frontend_type>text</frontend_type>
 
320
  <show_in_default>1</show_in_default>
321
  <show_in_website>1</show_in_website>
322
  <show_in_store>1</show_in_store>
323
+ <sort_order>20</sort_order>
324
+ <depends><seguro>1</seguro></depends>
325
  </importeseguro>
326
+ <entregaexclusiva translate="label">
327
+ <label><![CDATA[Entregar exclusivamente al destinatario]]></label>
328
+ <frontend_type>select</frontend_type>
329
+ <source_model>adminhtml/system_config_source_yesno</source_model>
330
+ <show_in_default>1</show_in_default>
331
+ <show_in_website>1</show_in_website>
332
+ <show_in_store>1</show_in_store>
333
+ <sort_order>30</sort_order>
334
+ </entregaexclusiva>
335
+ <cuentareembolso>
336
+ <label><![CDATA[CCC para inegresar reembolso]]></label>
337
+ <frontend_type>text</frontend_type>
338
+ <show_in_default>1</show_in_default>
339
+ <show_in_website>1</show_in_website>
340
+ <show_in_store>1</show_in_store>
341
+ <sort_order>40</sort_order>
342
+ </cuentareembolso>
343
+ <paquetefactura translate="label">
344
+ <label><![CDATA[El paquete adjunta factura]]></label>
345
+ <frontend_type>select</frontend_type>
346
+ <source_model>adminhtml/system_config_source_yesno</source_model>
347
+ <show_in_default>1</show_in_default>
348
+ <show_in_website>1</show_in_website>
349
+ <show_in_store>1</show_in_store>
350
+ <sort_order>50</sort_order>
351
+ </paquetefactura>
352
+ <paquetelicencia translate="label">
353
+ <label><![CDATA[El paquete adjunta licencia]]></label>
354
+ <frontend_type>select</frontend_type>
355
+ <source_model>adminhtml/system_config_source_yesno</source_model>
356
+ <show_in_default>1</show_in_default>
357
+ <show_in_website>1</show_in_website>
358
+ <show_in_store>1</show_in_store>
359
+ <sort_order>60</sort_order>
360
+ </paquetelicencia>
361
+ <paquetecertificado translate="label">
362
+ <label><![CDATA[El paquete adjunta certificado]]></label>
363
+ <frontend_type>select</frontend_type>
364
+ <source_model>adminhtml/system_config_source_yesno</source_model>
365
+ <show_in_default>1</show_in_default>
366
+ <show_in_website>1</show_in_website>
367
+ <show_in_store>1</show_in_store>
368
+ <sort_order>70</sort_order>
369
+ </paquetecertificado>
370
  <peso translate="label">
371
  <label><![CDATA[Configuraci&oacute;n del peso en el cat&aacute;logo]]></label>
372
+ <comment><![CDATA[Indicar la unidad en la que se han a&ntilde;adido el peso en los productos del cat&aacute;logo]]></comment>
373
  <frontend_type>select</frontend_type>
374
+ <source_model>correos/system_config_source_pesos</source_model>
 
375
  <show_in_default>1</show_in_default>
376
  <show_in_website>1</show_in_website>
377
  <show_in_store>1</show_in_store>
378
+ <sort_order>100</sort_order>
379
  </peso>
380
  </fields>
381
  </paquete>
382
+ <opciones>
383
+ <label><![CDATA[Configuraciones adicionales]]></label>
384
+ <frontend_type>text</frontend_type>
385
+ <sort_order>40</sort_order>
386
+ <show_in_default>1</show_in_default>
387
+ <show_in_website>1</show_in_website>
388
+ <show_in_store>1</show_in_store>
389
+ <fields>
390
+ <savelog translate="label">
391
+ <label>Activar log de Correos</label>
392
+ <frontend_type>select</frontend_type>
393
+ <source_model>adminhtml/system_config_source_yesno</source_model>
394
+ <show_in_default>1</show_in_default>
395
+ <show_in_website>1</show_in_website>
396
+ <show_in_store>1</show_in_store>
397
+ <sort_order>10</sort_order>
398
+ </savelog>
399
+ <showmap translate="label">
400
+ <label>Mostrar mapa de oficinas</label>
401
+ <frontend_type>select</frontend_type>
402
+ <source_model>adminhtml/system_config_source_yesno</source_model>
403
+ <show_in_default>1</show_in_default>
404
+ <show_in_website>1</show_in_website>
405
+ <show_in_store>1</show_in_store>
406
+ <sort_order>20</sort_order>
407
+ </showmap>
408
+ <savepdf translate="label">
409
+ <label>Guardar etiqueta PDF</label>
410
+ <comment><![CDATA[Guarda la etiqueta en una carpeta local o es descargada desde el servidor de Correos en cada petici&oacute;n.]]></comment>
411
+ <frontend_type>select</frontend_type>
412
+ <source_model>adminhtml/system_config_source_yesno</source_model>
413
+ <show_in_default>1</show_in_default>
414
+ <show_in_website>1</show_in_website>
415
+ <show_in_store>1</show_in_store>
416
+ <sort_order>30</sort_order>
417
+ </savepdf>
418
+ </fields>
419
+ </opciones>
420
  </groups>
421
+ </correos>
 
 
 
 
422
 
423
  <carriers>
424
  <groups>
432
  <show_in_store>1</show_in_store>
433
  <fields>
434
  <active translate="label">
435
+ <label>Activado</label>
436
  <frontend_type>select</frontend_type>
437
  <source_model>adminhtml/system_config_source_yesno</source_model>
 
438
  <show_in_default>1</show_in_default>
439
  <show_in_website>1</show_in_website>
440
+ <show_in_store>0</show_in_store>
441
+ <sort_order>10</sort_order>
442
  </active>
443
  <title translate="label">
444
  <label><![CDATA[T&iacute;tulo]]></label>
445
  <frontend_type>text</frontend_type>
 
446
  <show_in_default>1</show_in_default>
447
  <show_in_website>1</show_in_website>
448
  <show_in_store>1</show_in_store>
449
+ <sort_order>20</sort_order>
450
  </title>
451
  <condition_name translate="label">
452
  <label><![CDATA[Tipo de condici&oacute;n]]></label>
453
  <frontend_type>select</frontend_type>
454
  <source_model>adminhtml/system_config_source_shipping_tablerate</source_model>
 
455
  <show_in_default>1</show_in_default>
456
  <show_in_website>1</show_in_website>
457
  <show_in_store>0</show_in_store>
458
+ <sort_order>30</sort_order>
459
  </condition_name>
460
+ <include_virtual_price translate="label">
461
+ <label>Include Virtual Products in Price Calculation</label>
462
+ <frontend_type>select</frontend_type>
463
+ <source_model>adminhtml/system_config_source_yesno</source_model>
464
+ <show_in_default>1</show_in_default>
 
465
  <show_in_website>1</show_in_website>
466
  <show_in_store>0</show_in_store>
467
+ <sort_order>35</sort_order>
468
+ </include_virtual_price>
469
  <export translate="label">
470
+ <label>Exportar CSV</label>
471
  <frontend_type>button</frontend_type>
472
  <frontend_model>correos/system_export_envio</frontend_model>
 
473
  <show_in_default>0</show_in_default>
474
  <show_in_website>1</show_in_website>
475
  <show_in_store>0</show_in_store>
476
+ <sort_order>40</sort_order>
477
  </export>
478
  <import translate="label">
479
  <label>Importar</label>
480
  <frontend_type>import</frontend_type>
481
  <backend_model>correos/system_config_backend_shipping_correos</backend_model>
 
482
  <show_in_default>0</show_in_default>
483
  <show_in_website>1</show_in_website>
484
  <show_in_store>0</show_in_store>
485
+ <sort_order>50</sort_order>
486
  </import>
487
  <envio4872cost translate="label">
488
  <label><![CDATA[Costo del env&iacute;o]]></label>
489
  <frontend_type>text</frontend_type>
 
490
  <show_in_default>1</show_in_default>
491
  <show_in_website>1</show_in_website>
492
  <show_in_store>1</show_in_store>
493
+ <sort_order>60</sort_order>
494
  </envio4872cost>
495
  <sallowspecific translate="label">
496
  <label><![CDATA[Env&iacute;o a pa&iacute;ses]]></label>
497
  <frontend_type>select</frontend_type>
 
498
  <frontend_class>shipping-applicable-country</frontend_class>
499
  <source_model>adminhtml/system_config_source_shipping_allspecificcountries</source_model>
500
  <show_in_default>1</show_in_default>
501
  <show_in_website>1</show_in_website>
502
  <show_in_store>0</show_in_store>
503
+ <sort_order>70</sort_order>
504
  </sallowspecific>
505
  <specificcountry translate="label">
506
  <label><![CDATA[Pa&iacute;ses de env&iacute;o]]></label>
507
  <frontend_type>multiselect</frontend_type>
 
508
  <source_model>adminhtml/system_config_source_country</source_model>
509
  <show_in_default>1</show_in_default>
510
  <show_in_website>1</show_in_website>
511
  <show_in_store>0</show_in_store>
512
  <can_be_empty>1</can_be_empty>
513
+ <sort_order>80</sort_order>
514
  </specificcountry>
 
 
 
 
 
 
 
 
 
 
515
  <sort_order translate="label">
516
  <label>Orden</label>
517
  <frontend_type>text</frontend_type>
 
518
  <show_in_default>1</show_in_default>
519
  <show_in_website>1</show_in_website>
520
+ <show_in_store>0</show_in_store>
521
+ <sort_order>100</sort_order>
522
  </sort_order>
 
523
  </fields>
524
  </envio4872>
 
525
  <recogeroficina translate="label" module="shipping">
526
  <label><![CDATA[Correos - Recoger en oficina m&aacute;s cercana]]></label>
527
  <frontend_type>text</frontend_type>
534
  <label>Activar</label>
535
  <frontend_type>select</frontend_type>
536
  <source_model>adminhtml/system_config_source_yesno</source_model>
 
537
  <show_in_default>1</show_in_default>
538
  <show_in_website>1</show_in_website>
539
  <show_in_store>1</show_in_store>
540
+ <sort_order>10</sort_order>
541
  </active>
542
  <title translate="label">
543
  <label><![CDATA[T&iacute;tulo]]></label>
544
  <frontend_type>text</frontend_type>
 
545
  <show_in_default>1</show_in_default>
546
  <show_in_website>1</show_in_website>
547
  <show_in_store>1</show_in_store>
548
+ <sort_order>20</sort_order>
549
  </title>
550
  <condition_name translate="label">
551
  <label><![CDATA[Tipo de condici&oacute;n]]></label>
552
  <frontend_type>select</frontend_type>
553
  <source_model>adminhtml/system_config_source_shipping_tablerate</source_model>
 
554
  <show_in_default>1</show_in_default>
555
  <show_in_website>1</show_in_website>
556
  <show_in_store>0</show_in_store>
557
+ <sort_order>30</sort_order>
558
  </condition_name>
559
+ <include_virtual_price translate="label">
560
+ <label>Include Virtual Products in Price Calculation</label>
561
+ <frontend_type>select</frontend_type>
562
+ <source_model>adminhtml/system_config_source_yesno</source_model>
563
+ <show_in_default>1</show_in_default>
 
564
  <show_in_website>1</show_in_website>
565
  <show_in_store>0</show_in_store>
566
+ <sort_order>35</sort_order>
567
+ </include_virtual_price>
568
  <export translate="label">
569
+ <label>Exportar CSV</label>
570
  <frontend_type>button</frontend_type>
571
  <frontend_model>correos/system_export_recoger</frontend_model>
 
572
  <show_in_default>0</show_in_default>
573
  <show_in_website>1</show_in_website>
574
  <show_in_store>0</show_in_store>
575
+ <sort_order>40</sort_order>
576
  </export>
577
  <import translate="label">
578
  <label>Importar</label>
579
  <frontend_type>import</frontend_type>
580
  <backend_model>correos/system_config_backend_shipping_recoger</backend_model>
 
581
  <show_in_default>0</show_in_default>
582
  <show_in_website>1</show_in_website>
583
  <show_in_store>0</show_in_store>
584
+ <sort_order>50</sort_order>
585
  </import>
586
  <recogeroficinacost translate="label">
587
  <label><![CDATA[Costo del env&iacute;o]]></label>
588
  <frontend_type>text</frontend_type>
 
589
  <show_in_default>1</show_in_default>
590
  <show_in_website>1</show_in_website>
591
  <show_in_store>1</show_in_store>
592
+ <sort_order>60</sort_order>
593
  </recogeroficinacost>
594
  <sallowspecific translate="label">
595
  <label><![CDATA[Env&iacute;o a pa&iacute;ses]]></label>
596
  <frontend_type>select</frontend_type>
 
597
  <frontend_class>shipping-applicable-country</frontend_class>
598
  <source_model>adminhtml/system_config_source_shipping_allspecificcountries</source_model>
599
  <show_in_default>1</show_in_default>
600
  <show_in_website>1</show_in_website>
601
  <show_in_store>0</show_in_store>
602
+ <sort_order>70</sort_order>
603
  </sallowspecific>
604
  <specificcountry translate="label">
605
  <label><![CDATA[Pa&iacute;ses de env&iacute;o]]></label>
606
  <frontend_type>multiselect</frontend_type>
 
607
  <source_model>adminhtml/system_config_source_country</source_model>
608
  <show_in_default>1</show_in_default>
609
  <show_in_website>1</show_in_website>
610
  <show_in_store>0</show_in_store>
611
  <can_be_empty>1</can_be_empty>
612
+ <sort_order>80</sort_order>
613
+ </specificcountry>
 
 
 
 
 
 
 
 
 
614
  <gateway_recoger translate="label">
615
  <label>URL datos</label>
616
+ <comment><![CDATA[Solo modificar si Correos lo indica]]></comment>
617
  <default></default>
618
  <frontend_type>text</frontend_type>
 
619
  <show_in_default>1</show_in_default>
620
  <show_in_website>1</show_in_website>
621
  <show_in_store>1</show_in_store>
622
+ <sort_order>90</sort_order>
623
+ </gateway_recoger>
 
624
  <sort_order translate="label">
625
  <label>Orden</label>
626
  <frontend_type>text</frontend_type>
 
627
  <show_in_default>1</show_in_default>
628
  <show_in_website>1</show_in_website>
629
  <show_in_store>1</show_in_store>
630
+ <sort_order>100</sort_order>
631
  </sort_order>
 
632
  </fields>
633
  </recogeroficina>
634
+ <correosinter translate="label" module="shipping">
635
+ <label><![CDATA[Correos - Paquete Postal Internacional Prioritario]]></label>
636
+ <frontend_type>text</frontend_type>
637
+ <sort_order>40</sort_order>
638
+ <show_in_default>1</show_in_default>
639
+ <show_in_website>1</show_in_website>
640
+ <show_in_store>1</show_in_store>
641
+ <fields>
642
+ <active translate="label">
643
+ <label>Activado</label>
644
+ <frontend_type>select</frontend_type>
645
+ <source_model>adminhtml/system_config_source_yesno</source_model>
646
+ <show_in_default>1</show_in_default>
647
+ <show_in_website>1</show_in_website>
648
+ <show_in_store>0</show_in_store>
649
+ <sort_order>10</sort_order>
650
+ </active>
651
+ <title translate="label">
652
+ <label><![CDATA[T&iacute;tulo]]></label>
653
+ <frontend_type>text</frontend_type>
654
+ <show_in_default>1</show_in_default>
655
+ <show_in_website>1</show_in_website>
656
+ <show_in_store>1</show_in_store>
657
+ <sort_order>20</sort_order>
658
+ </title>
659
+ <condition_name translate="label">
660
+ <label><![CDATA[Tipo de condici&oacute;n]]></label>
661
+ <frontend_type>select</frontend_type>
662
+ <source_model>adminhtml/system_config_source_shipping_tablerate</source_model>
663
+ <show_in_default>1</show_in_default>
664
+ <show_in_website>1</show_in_website>
665
+ <show_in_store>0</show_in_store>
666
+ <sort_order>30</sort_order>
667
+ </condition_name>
668
+ <include_virtual_price translate="label">
669
+ <label>Include Virtual Products in Price Calculation</label>
670
+ <frontend_type>select</frontend_type>
671
+ <source_model>adminhtml/system_config_source_yesno</source_model>
672
+ <show_in_default>1</show_in_default>
673
+ <show_in_website>1</show_in_website>
674
+ <show_in_store>0</show_in_store>
675
+ <sort_order>35</sort_order>
676
+ </include_virtual_price>
677
+ <export translate="label">
678
+ <label>Exportar CSV</label>
679
+ <frontend_type>button</frontend_type>
680
+ <frontend_model>correos/system_export_internacional</frontend_model>
681
+ <show_in_default>0</show_in_default>
682
+ <show_in_website>1</show_in_website>
683
+ <show_in_store>0</show_in_store>
684
+ <sort_order>40</sort_order>
685
+ </export>
686
+ <import translate="label">
687
+ <label>Importar</label>
688
+ <frontend_type>import</frontend_type>
689
+ <backend_model>correos/system_config_backend_shipping_internacional</backend_model>
690
+ <show_in_default>0</show_in_default>
691
+ <show_in_website>1</show_in_website>
692
+ <show_in_store>0</show_in_store>
693
+ <sort_order>50</sort_order>
694
+ </import>
695
+ <correosintercost translate="label">
696
+ <label><![CDATA[Costo del env&iacute;o]]></label>
697
+ <frontend_type>text</frontend_type>
698
+ <show_in_default>1</show_in_default>
699
+ <show_in_website>1</show_in_website>
700
+ <show_in_store>1</show_in_store>
701
+ <sort_order>60</sort_order>
702
+ </correosintercost>
703
+ <sallowspecific translate="label">
704
+ <label><![CDATA[Env&iacute;o a pa&iacute;ses]]></label>
705
+ <frontend_type>select</frontend_type>
706
+ <frontend_class>shipping-applicable-country</frontend_class>
707
+ <source_model>adminhtml/system_config_source_shipping_allspecificcountries</source_model>
708
+ <show_in_default>1</show_in_default>
709
+ <show_in_website>1</show_in_website>
710
+ <show_in_store>0</show_in_store>
711
+ <sort_order>70</sort_order>
712
+ </sallowspecific>
713
+ <specificcountry translate="label">
714
+ <label><![CDATA[Pa&iacute;ses de env&iacute;o]]></label>
715
+ <frontend_type>multiselect</frontend_type>
716
+ <source_model>adminhtml/system_config_source_country</source_model>
717
+ <show_in_default>1</show_in_default>
718
+ <show_in_website>1</show_in_website>
719
+ <show_in_store>0</show_in_store>
720
+ <can_be_empty>1</can_be_empty>
721
+ <sort_order>80</sort_order>
722
+ </specificcountry>
723
+ <sort_order translate="label">
724
+ <label>Orden</label>
725
+ <frontend_type>text</frontend_type>
726
+ <show_in_default>1</show_in_default>
727
+ <show_in_website>1</show_in_website>
728
+ <show_in_store>0</show_in_store>
729
+ <sort_order>100</sort_order>
730
+ </sort_order>
731
+ </fields>
732
+ </correosinter>
733
 
734
  </groups>
735
  </carriers>
app/code/local/Ydral/Correos/log.txt DELETED
@@ -1,13 +0,0 @@
1
-
2
- v0.1.0
3
- -----------------------------------
4
- - Versi�n inicial.
5
-
6
- v0.2.0
7
- -----------------------------------
8
- - Se a�ade la posibilidad de tablas con diferentes tipos de selecci�n.
9
- - Se solucionan problemas varios.
10
-
11
- v0.3.0
12
- -----------------------------------
13
- - Se solucionan problemas varios.
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/local/Ydral/Correos/sql/correos_setup/mysql4-upgrade-0.3.0-0.4.0.php ADDED
@@ -0,0 +1,2 @@
 
 
1
+ <?php
2
+ $installer = $this;
app/code/local/Ydral/Correos/sql/correos_setup/mysql4-upgrade-0.4.0-1.5.0.php ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ $installer = $this;
3
+
4
+ $installer->startSetup();
5
+
6
+ $installer->run("
7
+ ALTER TABLE `{$this->getTable('correos_recoger_oficina')}` ADD `movil_asociado` VARCHAR( 10 ) NOT NULL;
8
+ ");
9
+ $installer->endSetup();
app/code/local/Ydral/Correos/sql/correos_setup/mysql4-upgrade-1.5.0-2.0.0.php ADDED
@@ -0,0 +1,28 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ $installer = $this;
3
+
4
+ $installer->startSetup();
5
+
6
+ $installer->run("
7
+
8
+ CREATE TABLE IF NOT EXISTS `{$this->getTable('correos_remitente')}` (
9
+ `id` int(10) NOT NULL AUTO_INCREMENT,
10
+ `nombre` varchar(50) NOT NULL,
11
+ `apellidos` varchar(50) NOT NULL,
12
+ `dni` varchar(15) NOT NULL,
13
+ `empresa` varchar(50) NOT NULL,
14
+ `persona_contacto` varchar(50) NOT NULL,
15
+ `pais` varchar(40) NOT NULL,
16
+ `provincia` varchar(40) NOT NULL,
17
+ `cp` varchar(10) NOT NULL,
18
+ `localidad` varchar(50) NOT NULL,
19
+ `direccion` varchar(50) NOT NULL,
20
+ `telefono` varchar(12) NOT NULL,
21
+ `email` varchar(50) NOT NULL,
22
+ `telefono_movil` varchar(12) NOT NULL,
23
+ PRIMARY KEY (`id`)
24
+ ) ENGINE=MyISAM DEFAULT CHARSET=utf8;
25
+
26
+
27
+ ");
28
+ $installer->endSetup();
app/design/adminhtml/default/default/layout/correos.xml CHANGED
@@ -1,17 +1,36 @@
1
  <?xml version="1.0"?>
2
  <layout>
 
3
  <adminhtml_system_config_edit>
4
  <reference name="head">
5
- <action method="addCss"><stylesheet>correos.css</stylesheet></action>
 
 
 
 
 
6
  </reference>
7
- </adminhtml_system_config_edit>
8
 
9
- <adminhtml_sales_order_view>
10
- <reference name="order_tab_info">
11
- <action method="setTemplate" ifconfig="carriers/recogeroficina/active">
12
- <template>correos/tab_info.phtml</template>
13
- </action>
 
 
 
 
 
 
 
 
 
 
 
 
 
14
  </reference>
15
- </adminhtml_sales_order_view>
16
 
17
  </layout>
1
  <?xml version="1.0"?>
2
  <layout>
3
+
4
  <adminhtml_system_config_edit>
5
  <reference name="head">
6
+ <action method="addJs" ifconfig="correos/general/active"><script>correos/proj4js-compressed.js</script></action>
7
+ <action method="addJs" ifconfig="correos/general/active"><script>correos/correos.js</script></action>
8
+ <action method="addCss" ifconfig="correos/general/active"><stylesheet>correos.css</stylesheet></action>
9
+ </reference>
10
+ <reference name="js">
11
+ <block type="core/template" name="correosHead" template="correos/head.phtml"/>
12
  </reference>
13
+ </adminhtml_system_config_edit>
14
 
15
+ <adminhtml_sales_order_shipment_new>
16
+ <reference name="head">
17
+ <action method="addCss" ifconfig="correos/general/active"><stylesheet>correos.css</stylesheet></action>
18
+ </reference>
19
+ <reference name="order_items"><action method="setTemplate"><template>correos/sales_order_shipment_create_items.phtml</template></action></reference>
20
+ </adminhtml_sales_order_shipment_new>
21
+
22
+
23
+
24
+
25
+ <adminhtml_sales_order_create_index>
26
+ <reference name="head">
27
+ <action method="addJs" ifconfig="correos/general/active"><script>correos/proj4js-compressed.js</script></action>
28
+ <action method="addJs" ifconfig="correos/general/active"><script>correos/correos.js</script></action>
29
+ <action method="addCss" ifconfig="correos/general/active"><stylesheet>correos.css</stylesheet></action>
30
+ </reference>
31
+ <reference name="js">
32
+ <block type="core/template" name="correosHead" template="correos/head.phtml"/>
33
  </reference>
34
+ </adminhtml_sales_order_create_index>
35
 
36
  </layout>
app/design/adminhtml/default/default/template/correos/head.phtml ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ if (Mage::app()->getStore()->isCurrentlySecure()){
3
+ $url = 'https://maps-api-ssl.google.com/maps/api/js?sensor=false';
4
+ } else {
5
+ $url = 'http://maps.google.com/maps/api/js?sensor=false';
6
+ }
7
+ echo '<script type="text/javascript" src="' . $url . '"></script>';
8
+ ?>
9
+ <script type="text/javascript">
10
+ var BASE_URL_CORREOS = '<?php echo Mage::getUrl('/',array('_secure'=>true)); ?>';
11
+ var SKIN_URL_CORREOS = '<?php echo $this->getSkinUrl(); ?>';
12
+ </script>
app/design/adminhtml/default/default/template/correos/sales_order_shipment_create_items.phtml ADDED
@@ -0,0 +1,165 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Academic Free License (AFL 3.0)
8
+ * that is bundled with this package in the file LICENSE_AFL.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/afl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magentocommerce.com so we can send you a copy immediately.
14
+ *
15
+ * DISCLAIMER
16
+ *
17
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
18
+ * versions in the future. If you wish to customize Magento for your
19
+ * needs please refer to http://www.magentocommerce.com for more information.
20
+ *
21
+ * @category design
22
+ * @package default_default
23
+ * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com)
24
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
25
+ */
26
+ ?>
27
+ <div class="grid np">
28
+ <div class="hor-scroll">
29
+ <table cellspacing="0" class="data order-tables">
30
+ <col />
31
+ <col width="1" />
32
+ <col width="1" />
33
+ <?php if (!$this->canShipPartiallyItem()): ?>
34
+ <col width="20" />
35
+ <?php endif; ?>
36
+ <thead>
37
+ <tr class="headings">
38
+ <th><?php echo $this->helper('sales')->__('Product') ?></th>
39
+ <th class="a-center"><?php echo $this->helper('sales')->__('Qty') ?></th>
40
+ <th<?php if ($this->isShipmentRegular()): ?> class="last"<?php endif; ?>><span class="nobr"><?php echo $this->helper('sales')->__('Qty to Ship') ?></span></th>
41
+
42
+ <?php if (!$this->canShipPartiallyItem()): ?>
43
+ <th class="a-center last"><span class="nobr"><?php echo $this->helper('sales')->__('Ship') ?></span></th>
44
+ <?php endif; ?>
45
+
46
+ </tr>
47
+ </thead>
48
+ <?php $_items = $this->getShipment()->getAllItems() ?>
49
+ <?php $_i=0;foreach ($_items as $_item): if ($_item->getOrderItem()->getIsVirtual() || $_item->getOrderItem()->getParentItem()): continue; endif; $_i++ ?>
50
+ <tbody class="<?php echo $_i%2?'odd':'even' ?>">
51
+ <?php echo $this->getItemHtml($_item) ?>
52
+ <?php echo $this->getItemExtraInfoHtml($_item->getOrderItem()) ?>
53
+ </tbody>
54
+ <?php endforeach; ?>
55
+ </table>
56
+ </div>
57
+ </div>
58
+ <br />
59
+ <div class="box-left entry-edit">
60
+ <div class="entry-edit-head"><h4><?php echo $this->__('Shipment Comments') ?></h4></div>
61
+ <fieldset>
62
+ <div id="order-history_form">
63
+ <span class="field-row">
64
+ <label class="normal" for="shipment_comment_text"><?php echo Mage::helper('sales')->__('Shipment Comments') ?></label>
65
+ <textarea id="shipment_comment_text" name="shipment[comment_text]" rows="3" cols="5" style="height:6em; width:99%;"><?php echo $this->getShipment()->getCommentText(); ?></textarea>
66
+ </span>
67
+ <div class="clear"></div>
68
+ </div>
69
+ </fieldset>
70
+ </div>
71
+
72
+ <div class="box-right entry-edit">
73
+ <?php
74
+ /**
75
+ * CORREOS MULTIREMITENTE
76
+ */
77
+ $_order = $this->getOrder();
78
+ if (Mage::helper('correos')->getValueConfig('multisender', 'remitente') && (in_array($_order->getShippingMethod(), Mage::helper('correos')->getAllowedMethods()))):
79
+ $remitentes = Mage::getModel('correos/remitente')->getCollection();
80
+ ?>
81
+ <div class="order-totals order-totals-correos">
82
+ <div class="entry-edit-head"><h4><?php echo Mage::helper('correos')->__('Selección del remitente') ?></h4></div>
83
+ <div>
84
+ <p class="multiremitente">
85
+ <label for="create_remitente_select"><?php echo Mage::helper('correos')->__('Seleccione la dirección con la que desea enviar el paquete.') ?></label>
86
+ <select id="remitente_select" name="shipment[remitente_select]" class="required-entry select absolute-advice">
87
+ <option value=""></option>
88
+ <?php foreach($remitentes->getItems() as $remitente): ?>
89
+ <option value="<?php echo $remitente->getId() ?>"><?php echo $remitente->getEmpresa() . " - " . $remitente->getNombre() . " " . $remitente->getApellidos() . " [" . $remitente->getDni() . "] - (" . $remitente->getLocalidad() . " - " . $remitente->getDireccion() . " - " . $remitente->getPais() . ")"; ?></option>
90
+ <?php endforeach; ?>
91
+ </select>
92
+ </p>
93
+ </div>
94
+ </div>
95
+ <br />
96
+ <?php
97
+ endif;
98
+ /**
99
+ * end multiremitente
100
+ */
101
+ ?>
102
+ <div class="order-totals">
103
+ <div class="order-totals-bottom">
104
+ <?php if ($this->canCreateShippingLabel()): ?>
105
+ <p>
106
+ <label class="normal" for="create_shipping_label"><?php echo Mage::helper('sales')->__('Create Shipping Label') ?></label>
107
+ <input id="create_shipping_label" name="shipment[create_shipping_label]" value="1" type="checkbox" onclick="toggleCreateLabelCheckbox();" />
108
+ </p>
109
+ <?php endif ?>
110
+ <p>
111
+ <label class="normal" for="notify_customer"><?php echo Mage::helper('sales')->__('Append Comments') ?></label>
112
+ <input id="notify_customer" name="shipment[comment_customer_notify]" value="1" type="checkbox" />
113
+ </p>
114
+ <?php if ($this->canSendShipmentEmail()): ?>
115
+ <p>
116
+ <label class="normal" for="send_email"><?php echo Mage::helper('sales')->__('Email Copy of Shipment') ?></label>
117
+ <input id="send_email" name="shipment[send_email]" value="1" type="checkbox" />
118
+ </p>
119
+ <?php endif; ?>
120
+ <div class="a-right">
121
+ <?php echo $this->getChildHtml('submit_button') ?>
122
+ </div>
123
+ </div>
124
+ </div>
125
+ </div>
126
+ <div class="clear"></div>
127
+ <script type="text/javascript">
128
+ //<![CDATA[
129
+ var sendEmailCheckbox = $('send_email');
130
+ if (sendEmailCheckbox) {
131
+ var notifyCustomerCheckbox = $('notify_customer');
132
+ var shipmentCommentText = $('shipment_comment_text');
133
+ Event.observe(sendEmailCheckbox, 'change', bindSendEmail);
134
+ bindSendEmail();
135
+ }
136
+ function bindSendEmail()
137
+ {
138
+ if (sendEmailCheckbox.checked == true) {
139
+ notifyCustomerCheckbox.disabled = false;
140
+ //shipmentCommentText.disabled = false;
141
+ }
142
+ else {
143
+ notifyCustomerCheckbox.disabled = true;
144
+ //shipmentCommentText.disabled = true;
145
+ }
146
+ }
147
+ function toggleCreateLabelCheckbox(){
148
+ var checkbox = $('create_shipping_label');
149
+ var submitButton = checkbox.up('.order-totals').select('.submit-button span')[0];
150
+ if (checkbox.checked) {
151
+ submitButton.innerText += '...';
152
+ } else {
153
+ submitButton.innerText = submitButton.innerText.replace(/\.\.\.$/, '');
154
+ }
155
+ }
156
+ function submitShipment(btn){
157
+ var checkbox = $(btn).up('.order-totals').select('#create_shipping_label')[0];
158
+ if (checkbox && checkbox.checked) {
159
+ packaging.showWindow();
160
+ } else if(editForm.submit()) {
161
+ disableElements('submit-button');
162
+ }
163
+ }
164
+ //]]>
165
+ </script>
app/design/adminhtml/default/default/template/correos/tab_info.phtml CHANGED
@@ -30,9 +30,12 @@
30
  /*
31
  envio4872_envio4872
32
  recogeroficina_recogeroficina
 
33
  */
34
  $_envioCorreos = false;
35
- if (($_order->getShippingMethod() == 'recogeroficina_recogeroficina') || ($_order->getShippingMethod() == 'envio4872_envio4872'))
 
 
36
  {
37
  $_envioCorreos = true;
38
  }
@@ -127,7 +130,7 @@ if (($_order->getShippingMethod() == 'recogeroficina_recogeroficina') || ($_orde
127
 
128
  <?php
129
  $tracks = $_order->getTracksCollection();
130
- $tracksValidos = array ('Correos', 'envio4872', 'recogeroficina');
131
  foreach ($tracks as $track):
132
 
133
  if (in_array($track->getCarrierCode(), $tracksValidos)):
30
  /*
31
  envio4872_envio4872
32
  recogeroficina_recogeroficina
33
+ correosinter_correosinter
34
  */
35
  $_envioCorreos = false;
36
+ if (($_order->getShippingMethod() == 'recogeroficina_recogeroficina')
37
+ || ($_order->getShippingMethod() == 'envio4872_envio4872')
38
+ || ($_order->getShippingMethod() == 'correosinter_correosinter'))
39
  {
40
  $_envioCorreos = true;
41
  }
130
 
131
  <?php
132
  $tracks = $_order->getTracksCollection();
133
+ $tracksValidos = array ('Correos', 'envio4872', 'recogeroficina', 'correosinter');
134
  foreach ($tracks as $track):
135
 
136
  if (in_array($track->getCarrierCode(), $tracksValidos)):
app/design/frontend/base/default/layout/correos.xml CHANGED
@@ -1,14 +1,25 @@
1
  <?xml version="1.0"?>
2
  <layout version="0.1.0">
3
 
 
 
 
 
 
 
 
 
 
 
4
  <!-- <checkout_onepage_index> -->
 
5
  <default>
6
  <reference name="head" ifconfig="carriers/recogeroficina/active">
7
  <action method="addItem"><type>skin_js</type><name>js/correos.js</name></action>
8
  <action method="addCss"><stylesheet>css/correos.css</stylesheet></action>
9
- <block type="core/template" name="correosHead" template="correos/head.phtml"/>
10
  </reference>
11
  </default>
 
12
  <!-- </checkout_onepage_index> -->
13
 
14
  <correos_tracking_popup translate="label">
1
  <?xml version="1.0"?>
2
  <layout version="0.1.0">
3
 
4
+ <default>
5
+ <reference name="head">
6
+ <action method="addJs" ifconfig="correos/general/active"><script>correos/proj4js-compressed.js</script></action>
7
+ <action method="addJs" ifconfig="correos/general/active"><script>correos/correos.js</script></action>
8
+ <action method="addCss" ifconfig="correos/general/active"><stylesheet>css/correos.css</stylesheet></action>
9
+ <block type="core/template" name="correosHead" template="correos/head.phtml"/>
10
+ </reference>
11
+ </default>
12
+
13
+
14
  <!-- <checkout_onepage_index> -->
15
+ <!--
16
  <default>
17
  <reference name="head" ifconfig="carriers/recogeroficina/active">
18
  <action method="addItem"><type>skin_js</type><name>js/correos.js</name></action>
19
  <action method="addCss"><stylesheet>css/correos.css</stylesheet></action>
 
20
  </reference>
21
  </default>
22
+ -->
23
  <!-- </checkout_onepage_index> -->
24
 
25
  <correos_tracking_popup translate="label">
app/design/frontend/base/default/template/correos/available.phtml ADDED
@@ -0,0 +1,99 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Academic Free License (AFL 3.0)
8
+ * that is bundled with this package in the file LICENSE_AFL.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/afl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magentocommerce.com so we can send you a copy immediately.
14
+ *
15
+ * DISCLAIMER
16
+ *
17
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
18
+ * versions in the future. If you wish to customize Magento for your
19
+ * needs please refer to http://www.magentocommerce.com for more information.
20
+ *
21
+ * @category design
22
+ * @package base_default
23
+ * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com)
24
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
25
+ */
26
+ ?>
27
+ <?php if (!($_shippingRateGroups = $this->getShippingRates())): ?>
28
+ <p><?php echo $this->__('Sorry, no quotes are available for this order at this time.') ?></p>
29
+ <?php else: ?>
30
+ <dl class="sp-methods">
31
+ <?php $shippingCodePrice = array(); ?>
32
+ <?php $_sole = count($_shippingRateGroups) == 1; foreach ($_shippingRateGroups as $code => $_rates): ?>
33
+ <dt><?php echo $this->getCarrierName($code) ?></dt>
34
+ <dd>
35
+ <ul>
36
+ <?php $_sole = $_sole && count($_rates) == 1; foreach ($_rates as $_rate): ?>
37
+ <?php $shippingCodePrice[] = "'".$_rate->getCode()."':".(float)$_rate->getPrice(); ?>
38
+ <li>
39
+ <?php if ($_rate->getErrorMessage()): ?>
40
+ <ul class="messages"><li class="error-msg"><ul><li><?php echo $_rate->getErrorMessage() ?></li></ul></li></ul>
41
+ <?php else: ?>
42
+ <?php if ($_sole && $_rate->getCode() != 'recogeroficina_recogeroficina') : ?>
43
+ <span class="no-display"><input name="shipping_method" type="radio" value="<?php echo $_rate->getCode() ?>" id="s_method_<?php echo $_rate->getCode() ?>" checked="checked" /></span>
44
+ <?php else: ?>
45
+ <input name="shipping_method" type="radio" value="<?php echo $_rate->getCode() ?>" id="s_method_<?php echo $_rate->getCode() ?>"<?php if($_rate->getCode()===$this->getAddressShippingMethod()) echo ' checked="checked"' ?> class="radio"/>
46
+
47
+ <?php if ($_rate->getCode() === $this->getAddressShippingMethod()): ?>
48
+ <script type="text/javascript">
49
+ //<![CDATA[
50
+ lastPrice = <?php echo (float)$_rate->getPrice(); ?>;
51
+ //]]>
52
+ </script>
53
+ <?php endif; ?>
54
+
55
+ <?php endif; ?>
56
+ <label for="s_method_<?php echo $_rate->getCode() ?>"><?php echo $_rate->getMethodTitle() ?>
57
+ <?php $_excl = $this->getShippingPrice($_rate->getPrice(), $this->helper('tax')->displayShippingPriceIncludingTax()); ?>
58
+ <?php $_incl = $this->getShippingPrice($_rate->getPrice(), true); ?>
59
+ <?php echo $_excl; ?>
60
+ <?php if ($this->helper('tax')->displayShippingBothPrices() && $_incl != $_excl): ?>
61
+ (<?php echo $this->__('Incl. Tax'); ?> <?php echo $_incl; ?>)
62
+ <?php endif; ?>
63
+ </label>
64
+ <?php endif ?>
65
+ </li>
66
+ <?php endforeach; ?>
67
+ </ul>
68
+ </dd>
69
+ <?php endforeach; ?>
70
+ </dl>
71
+ <script type="text/javascript">
72
+ //<![CDATA[
73
+ <?php if (!empty($shippingCodePrice)): ?>
74
+ var shippingCodePrice = {<?php echo implode(',',$shippingCodePrice); ?>};
75
+ <?php endif; ?>
76
+
77
+ $$('input[type="radio"][name="shipping_method"]').each(function(el){
78
+ Event.observe(el, 'click', function(){
79
+ if (el.checked == true) {
80
+ var getShippingCode = el.getValue();
81
+ <?php if (!empty($shippingCodePrice)): ?>
82
+ var newPrice = shippingCodePrice[getShippingCode];
83
+ if (!lastPrice) {
84
+ lastPrice = newPrice;
85
+ quoteBaseGrandTotal += newPrice;
86
+ }
87
+ if (newPrice != lastPrice) {
88
+ quoteBaseGrandTotal += (newPrice-lastPrice);
89
+ lastPrice = newPrice;
90
+ }
91
+ <?php endif; ?>
92
+ checkQuoteBaseGrandTotal = quoteBaseGrandTotal;
93
+ return false;
94
+ }
95
+ });
96
+ });
97
+ //]]>
98
+ </script>
99
+ <?php endif; ?>
app/design/frontend/base/default/template/correos/head.phtml CHANGED
@@ -1,3 +1,12 @@
1
- <script type="text/javascript">
2
- var BASE_URL_CORREOS = '<?php echo $this->getBaseUrl(); ?>';
 
 
 
 
 
 
 
 
 
3
  </script>
1
+ <?php
2
+ if (Mage::app()->getStore()->isCurrentlySecure()){
3
+ $url = 'https://maps-api-ssl.google.com/maps/api/js?sensor=false';
4
+ } else {
5
+ $url = 'http://maps.google.com/maps/api/js?sensor=false';
6
+ }
7
+ echo '<script type="text/javascript" src="' . $url . '"></script>';
8
+ ?>
9
+ <script type="text/javascript">
10
+ var BASE_URL_CORREOS = '<?php echo Mage::getUrl('',array('_secure'=>true)); ?>';
11
+ var SKIN_URL_CORREOS = '<?php echo $this->getSkinUrl(); ?>';
12
  </script>
app/design/frontend/base/default/template/correos/order_info.phtml CHANGED
@@ -72,15 +72,15 @@
72
  /* CORREOS START */
73
  ?>
74
  <?php
75
- $_dataRecogida = Mage::getModel('correos/ydral_recogeroficina')->readCheckoutData('order', $_order->getRealOrderId());
76
- if ($_dataRecogida['correos_oficina'] == '')
77
  {
78
  $codPostalRecogida = $_order->getShippingAddress()->getPostcode();
79
  } else {
80
- $codPostalRecogida = $_dataRecogida['correos_oficina'];
81
  }
82
  if ($_dataRecogida):
83
- $_dataOficina = Mage::getModel('correos/ydral_recogeroficina')->dataOficinas($_dataRecogida['correos_recogida'], $codPostalRecogida);
84
 
85
  if ($_dataOficina):
86
  ?>
72
  /* CORREOS START */
73
  ?>
74
  <?php
75
+ $_dataRecogida = Mage::getModel('correos/recoger')->getCheckoutData('order', $_order->getRealOrderId())->getFirstItem();
76
+ if ($_dataRecogida->getCorreosOficina() == '')
77
  {
78
  $codPostalRecogida = $_order->getShippingAddress()->getPostcode();
79
  } else {
80
+ $codPostalRecogida = $_dataRecogida->getCorreosOficina();
81
  }
82
  if ($_dataRecogida):
83
+ $_dataOficina = Mage::getModel('correos/oficinas')->dataOficinas($_dataRecogida->getCorreosRecogida(), $codPostalRecogida);
84
 
85
  if ($_dataOficina):
86
  ?>
app/design/frontend/base/default/template/correos/popup.phtml CHANGED
@@ -77,7 +77,7 @@ $tracksValidos = array ('Correos', 'envio4872', 'recogeroficina');
77
 
78
  <?php
79
 
80
- $_trackCorreos = Mage::getModel('correos/ydral_shipment')->localizarEnvioFases($track['number']);
81
 
82
  if ($_trackCorreos):
83
  ?>
@@ -217,7 +217,7 @@ $tracksValidos = array ('Correos', 'envio4872', 'recogeroficina');
217
 
218
  <?php
219
 
220
- $_trackCorreos = Mage::getModel('correos/ydral_shipment')->localizarEnvioFases($track['number']);
221
 
222
  if ($_trackCorreos):
223
  ?>
77
 
78
  <?php
79
 
80
+ $_trackCorreos = Mage::getModel('correos/seguimiento')->localizarEnvioFases($track['number']);
81
 
82
  if ($_trackCorreos):
83
  ?>
217
 
218
  <?php
219
 
220
+ $_trackCorreos = Mage::getModel('correos/seguimiento')->localizarEnvioFases($track['number']);
221
 
222
  if ($_trackCorreos):
223
  ?>
app/locale/es_ES/Ydral_Correos.csv ADDED
@@ -0,0 +1,84 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ "Versión del modulo: %s","Versión del modulo: %s"
2
+ "El sistema de multiremitente le permite, durante el proceso de envío, seleccionar el remitente de su paquete de Correos.","El sistema de multiremitente le permite, durante el proceso de envío, seleccionar el remitente de su paquete de Correos."
3
+ "Si solo va a utilizar un único remitente, no seleccione la opción de multiremitente y rellene los datos generales de remitente.","Si solo va a utilizar un único remitente, no seleccione la opción de multiremitente y rellene los datos generales de remitente."
4
+ "Si va a utilizar el sistema multiremitente debe subir un fichero en formato CSV con la siguiente estructura:","Si va a utilizar el sistema multiremitente debe subir un fichero en formato CSV con la siguiente estructura:"
5
+ "Nombre,Apellidos,DNI,Empresa,Persona_de_contacto,País,Provincia,CP,Localidad,Dirección,Teléfono,Email,Teléfono_Móvil","Nombre,Apellidos,DNI,Empresa,Persona_de_contacto,País,Provincia,CP,Localidad,Dirección,Teléfono,Email,Teléfono_Móvil"
6
+ "Cada línea del fichero corresponde con una dirección de remitente.","Cada línea del fichero corresponde con una dirección de remitente."
7
+ "Activado","Activado"
8
+ "Configuraci&oacute;n del modulo de Correos. Los datos le ser&aacute;n enviados por Correos.","Configuraci&oacute;n del modulo de Correos. Los datos le ser&aacute;n enviados por Correos."
9
+ "C&oacute;digo de etiquetador","C&oacute;digo de etiquetador"
10
+ "N&uacute;mero de contrato","N&uacute;mero de contrato"
11
+ "N&uacute;mero de cliente","N&uacute;mero de cliente"
12
+ "Obligatorio si no dispone de c&oacute;digo de etiquetador.","Obligatorio si no dispone de c&oacute;digo de etiquetador."
13
+ "Usuario de Correos","Usuario de Correos"
14
+ "Usuario para la pasarela otorgado por Correos.","Usuario para la pasarela otorgado por Correos."
15
+ "Password de Correos","Password de Correos"
16
+ "Password para la pasarela otorgado por Correos.","Password para la pasarela otorgado por Correos."
17
+ "Direcciones de correos.","Direcciones de correos."
18
+ "URL datos","URL datos"
19
+ "URL localizaci&oacute;n","URL localizaci&oacute;n"
20
+ "Datos del remitente","Datos del remitente"
21
+ "Utilizar Multiremitente","Utilizar Multiremitente"
22
+ "Permite seleccionar entre diferentes direcciones el remitente del env&iacute;o.","Permite seleccionar entre diferentes direcciones el remitente del env&iacute;o."
23
+ "Importar","Importar"
24
+ "Exportar CSV","Exportar CSV"
25
+ "Nombre del remitente","Nombre del remitente"
26
+ "Apellidos del remitente","Apellidos del remitente"
27
+ "DNI/NIF","DNI/NIF"
28
+ "Empresa","Empresa"
29
+ "Persona de contacto","Persona de contacto"
30
+ "Direcci&oacute;n","Direcci&oacute;n"
31
+ "Localidad","Localidad"
32
+ "C&oacute;digo Postal","C&oacute;digo Postal"
33
+ "Provincia","Provincia"
34
+ "Tel&eacute;fono","Tel&eacute;fono"
35
+ "E-mail","E-mail"
36
+ "Tel&eacute;fono env&iacute;o de SMS","Tel&eacute;fono env&iacute;o de SMS"
37
+ "Configuraci&oacute;n del paquete","Configuraci&oacute;n del paquete"
38
+ "Solo modificar si Correos lo indica","Solo modificar si Correos lo indica"
39
+ "Valor asegurado (hasta)","Valor asegurado (hasta)"
40
+ "Configuraci&oacute;n del peso en el cat&aacute;logo","Configuraci&oacute;n del peso en el cat&aacute;logo"
41
+ "Indicar la unidad en la que se han a&ntilde;adido el peso en los productos del cat&aacute;logo","Indicar la unidad en la que se han a&ntilde;adido el peso en los productos del cat&aacute;logo"
42
+ "Gramos","Gramos"
43
+ "Kilos","Kilos"
44
+ "Configuraciones adicionales","Configuraciones adicionales"
45
+ "Activar log de Correos","Activar log de Correos"
46
+ "Mostrar mapa de oficinas","Mostrar mapa de oficinas"
47
+ "Guardar etiqueta PDF","Guardar etiqueta PDF"
48
+ "Guarda la etiqueta en una carpeta local o es descargada desde el servidor de Correos en cada petici&oacute;n.","Guarda la etiqueta en una carpeta local o es descargada desde el servidor de Correos en cada petici&oacute;n."
49
+ "T&iacute;tulo","T&iacute;tulo"
50
+ "Tipo de condici&oacute;n","Tipo de condici&oacute;n"
51
+ "Importar","Importar"
52
+ "Costo del env&iacute;o","Costo del env&iacute;o"
53
+ "Env&iacute;o a pa&iacute;ses","Env&iacute;o a pa&iacute;ses"
54
+ "Pa&iacute;ses de env&iacute;o","Pa&iacute;ses de env&iacute;o"
55
+ "Mostrar m&eacute;todo aunque no este disponible","Mostrar m&eacute;todo aunque no este disponible"
56
+ "Orden","Orden"
57
+ "No se han definido los datos de etiquetador o usuario/password del servicio. Error.","No se han definido los datos de etiquetador o usuario/password del servicio. Error."
58
+ "Uno de los campos de remitente Nombre o Empresa es obligatorio.","Uno de los campos de remitente Nombre o Empresa es obligatorio."
59
+ "El campo %s de la sección %s es obligatorio para registrar el envío de un paquete.","El campo %s de la sección %s es obligatorio para registrar el envío de un paquete."
60
+ "No se puede registrar un pedido con el n&uacute;mero de tel&eacute;fono aportado (%s), porque no se podr&aacute; notificar a este n&uacute;mero.","No se puede registrar un pedido con el n&uacute;mero de tel&eacute;fono aportado (%s), porque no se podr&aacute; notificar a este n&uacute;mero."
61
+ "No se ha podido contactar con el servidor de Correos.","No se ha podido contactar con el servidor de Correos."
62
+ "No hay datos asociados a este pedido de Correos.","No hay datos asociados a este pedido de Correos."
63
+ "El pedido a reembolsar es mayor de 1000€ y no puede enviarse bajo Correos.","El pedido a reembolsar es mayor de 1000€ y no puede enviarse bajo Correos."
64
+ "La pasarela de Correos ha devuelto un error de acceso. Compruebe sus credenciales.","La pasarela de Correos ha devuelto un error de acceso. Compruebe sus credenciales."
65
+ "Error en los datos devueltos por Correos.","Error en los datos devueltos por Correos."
66
+ "Error en los datos devueltos por Correos. Problema de conexión o datos.","Error en los datos devueltos por Correos. Problema de conexión o datos."
67
+ "Información del envío con Correos","Información del envío con Correos"
68
+ "Envío a la oficina: %s","Envío a la oficina: %s"
69
+ "Oficina <strong>%s</strong> - %s-%s (%s)","Oficina <strong>%s</strong> - %s-%s (%s)"
70
+ "Formato de fichero de remitentes inválido.","Formato de fichero de remitentes inválido."
71
+ "Dede indicarse un nombre o una empresa en la dirección de la línea #%s","Dede indicarse un nombre o una empresa en la dirección de la línea #%s"
72
+ "El código postal es un campo obligatorio en la línea #%s","El código postal es un campo obligatorio en la línea #%s"
73
+ "La localidad es un campo obligatorio en la línea #%s","La localidad es un campo obligatorio en la línea #%s"
74
+ "La dirección es un campo obligatorio en la línea #%s","La dirección es un campo obligatorio en la línea #%s"
75
+ "El teléfono móvil es un campo obligatorio en la línea #%s","El teléfono móvil es un campo obligatorio en la línea #%s"
76
+ "El teléfono móvil es incorrecto en la línea #%s","El teléfono móvil es incorrecto en la línea #%s"
77
+ "Selección del remitente","Selección del remitente"
78
+ "Seleccione la dirección con la que desea enviar el paquete.","Seleccione la dirección con la que desea enviar el paquete."
79
+ "Imprimir preregistro","Imprimir preregistro"
80
+ "No se han encontrado pedidos para imprimir.","No se han encontrado pedidos para imprimir."
81
+ "Imprimir etiqueta de envío.","Imprimir etiqueta de envío."
82
+ "El servidor de Correos ha devuelto una respuesta vacía.","El servidor de Correos ha devuelto una respuesta vacía."
83
+ "El pedido %s no se ha podido imprimir.","El pedido %s no se ha podido imprimir."
84
+ "No se han encontrado ficheros de PDF para imprimir.","No se han encontrado ficheros de PDF para imprimir."
js/correos/correos.js ADDED
@@ -0,0 +1,296 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ var clicked = false;
3
+
4
+ Proj4js.defs = {
5
+ 'WGS84': "+title=long/lat:WGS84 +proj=longlat +ellps=WGS84 +datum=WGS84 +units=degrees",
6
+ 'EPSG:3875': "+title= Google Mercator +proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +no_defs"};
7
+
8
+ var source = new Proj4js.Proj('EPSG:3875');
9
+ var dest = new Proj4js.Proj('WGS84');
10
+
11
+ PuntosCorreos = Class.create();
12
+ PuntosCorreos.prototype = {
13
+
14
+ initialize: function()
15
+ {
16
+ this.correosResultados = '';
17
+ this.codigoPostalVal = '';
18
+
19
+ Event.observe(window, 'load', function()
20
+ {
21
+ //$$('.main').invoke('observe', 'click', function(e)
22
+ $$('.wrapper').invoke('observe', 'click', function(e)
23
+ {
24
+ var element = e.element();
25
+ //if (element.getValue())
26
+ if (!element.disabled && element.name)
27
+ {
28
+ if (element.getValue() == 'recogeroficina_recogeroficina')
29
+ {
30
+ if (!clicked)
31
+ {
32
+ clicked = true;
33
+ PuntosCorreos.getPuntosCorreos();
34
+ }
35
+ }
36
+ else if (element.getValue() == 'envio4872_envio4872')
37
+ {
38
+ if (!clicked)
39
+ {
40
+ clicked = true;
41
+ PuntosCorreos.getAddressPhone();
42
+ }
43
+ }
44
+ }
45
+ });
46
+
47
+ });
48
+ },
49
+
50
+ validaRadio:function()
51
+ {
52
+ var radioValue = Form.getInputs('co-shipping-method-form','radio','shipping_method').find(function(radio) { return radio.checked; }).value;
53
+ if (radioValue == 'recogeroficina_recogeroficina')
54
+ {
55
+ this.getPuntosCorreos();
56
+ }
57
+ },
58
+
59
+ getAddressPhone:function()
60
+ {
61
+ if ($('content_4872_correos') != undefined) { $('content_4872_correos').remove(); }
62
+ if ($('content_puntos_correos') != undefined) { $('content_puntos_correos').remove(); }
63
+
64
+ if ($('shipping-method-please-wait'))
65
+ {
66
+ Element.show('shipping-method-please-wait');
67
+ }
68
+ this.reloadurl = BASE_URL_CORREOS+'correos/index/getphone/';
69
+ new Ajax.Request(this.reloadurl, {
70
+ method: 'post',
71
+ onComplete: this.reloadMethod.bind(this)
72
+ });
73
+ },
74
+
75
+ getPuntosCorreos:function()
76
+ {
77
+
78
+ var codPostal = '';
79
+
80
+ if ($('cp_oficina_correos') != undefined)
81
+ {
82
+ codPostal = $('cp_oficina_correos').value;
83
+ this.codigoPostalVal = codPostal;
84
+ } else if ($('billing:postcode') != undefined) {
85
+ codPostal = $('billing:postcode').value;
86
+ this.codigoPostalVal = codPostal;
87
+ } else if ($('order-shipping_address_postcode') != undefined) {
88
+ codPostal = $('order-shipping_address_postcode').value;
89
+ this.codigoPostalVal = codPostal;
90
+ }
91
+
92
+ if ($('content_puntos_correos') != undefined) { $('content_puntos_correos').remove(); }
93
+ if ($('content_4872_correos') != undefined) { $('content_4872_correos').remove(); }
94
+
95
+
96
+ if ($('shipping-method-please-wait'))
97
+ {
98
+ Element.show('shipping-method-please-wait');
99
+ }
100
+
101
+ this.reloadurl = BASE_URL_CORREOS+'correos/checkout/getdata/';
102
+ new Ajax.Request(this.reloadurl, {
103
+ method: 'post',
104
+ parameters: {codigoPostal: codPostal},
105
+ onComplete: this.reloadChildren.bind(this)
106
+ });
107
+
108
+ },
109
+
110
+ reloadChildren: function(transport)
111
+ {
112
+ if ($('shipping-method-please-wait'))
113
+ {
114
+ Element.hide('shipping-method-please-wait');
115
+ }
116
+ clicked = false;
117
+
118
+ try
119
+ {
120
+ var jsonResponse = transport.responseText.evalJSON(true);
121
+ this.correosResultados = jsonResponse;
122
+ } catch (e) {
123
+ this.correosResultados = '';
124
+ }
125
+
126
+ if (this.correosResultados == '')
127
+ {
128
+
129
+ var htmlInicial = '<div id="content_puntos_correos" style="margin-left: 15px; clear: both; "><p>' + transport.responseText + '</p><div style="clear: both; "></div></div>';
130
+ //$('s_method_recogeroficina_recogeroficina').next().insert({after: htmlInicial})
131
+ this.insertContentOficina(htmlInicial);
132
+
133
+ } else {
134
+
135
+ var htmlInicial = '<div id="content_puntos_correos" style="margin-left: 15px; clear: both; "><b>Introduce el c&oacute;digo postal para buscar oficina: </b><input type="text" name="cp_oficina_correos" id="cp_oficina_correos" value="" />';
136
+ if (this.checkPhone(this.correosResultados.shipping_address.telephone)) htmlInicial += '<input type="hidden" name="phone_correos" value="'+this.correosResultados.shipping_address.telephone+'" id="phone_correos" />';
137
+ htmlInicial += '<input type="hidden" name="cp_search" value="'+this.codigoPostalVal+'" id="cp_search" /><input type="button" value="Buscar" onClick="PuntosCorreos.getPuntosCorreos(); return false; " /><br />La oficina de Correos te avisar&aacute; cuando el paquete est&eacute; listo en sus oficinas:<br /><div id="oficinas_correos_content"><select id="oficinas_correos_content_select" name="oficinas_correos_content_select" onchange="PuntosCorreos.correosInfo();"></select></div>';
138
+ if (!this.checkPhone(this.correosResultados.shipping_address.telephone)) htmlInicial += '<br /><div><p>Introduce tu n&uacute;mero de m&oacute;vil para poder realizar la entrega del env&iacute;o. Este tel&eacute;fono solo ser&aacute; utilizado para informarle del estado de su env&iacute;o.</p><input type="text" name="phone_correos" value="" id="phone_correos" /></div>';
139
+ htmlInicial += '<div id="correos_info_time" style="display: none; "></div>';
140
+ htmlInicial += '<div id="correos_info_map" style="display: none; "></div></div>';
141
+ //$('s_method_recogeroficina_recogeroficina').next().insert({after: htmlInicial})
142
+ this.insertContentOficina(htmlInicial);
143
+
144
+ this.fillDropDownCorreos ($('oficinas_correos_content_select'), this.correosResultados);
145
+
146
+ }
147
+
148
+
149
+
150
+ },
151
+
152
+ insertContentOficina: function(text)
153
+ {
154
+ if ($('order-shipping-method-info'))
155
+ {
156
+ if ($('order-shipping_method-aditional') != undefined) { $('order-shipping_method-aditional').remove(); }
157
+ text = '<div id="order-shipping_method-aditional" class="box-right"><div class="entry-edit"><div class="entry-edit-head"><div style="float: right;"></div><h4 class="fieldset-legend head-shipping-method icon-head">Adicional</h4></div><div class="fieldset">' + text;
158
+ text += '</div></div></div>';
159
+ $('order-methods').next().insert({after: text});
160
+ } else {
161
+ $('s_method_recogeroficina_recogeroficina').next().insert({after: text});
162
+ }
163
+ },
164
+
165
+ reloadMethod: function(transport)
166
+ {
167
+ if ($('shipping-method-please-wait'))
168
+ {
169
+ Element.hide('shipping-method-please-wait');
170
+ }
171
+ clicked = false;
172
+
173
+ if (!this.checkPhone(transport.responseText))
174
+ {
175
+ var htmlInicial = '<div id="content_4872_correos" style="margin-left: 15px; clear: both; "><p>Si desea recibir informaci&oacute;n sobre el estado de su env&iacute;o mediante SMS por favor facil&iacute;tenos su tel&eacute;fono m&oacute;vil.</p><input type="text" name="phone_correos" value="" id="phone_correos" /></div>';
176
+ if ($('order-shipping-method-info'))
177
+ {
178
+ if ($('order-shipping_method-aditional') != undefined) { $('order-shipping_method-aditional').remove(); }
179
+ htmlInicial = '<div id="order-shipping_method-aditional" class="box-right"><div class="entry-edit"><div class="entry-edit-head"><div style="float: right;"></div><h4 class="fieldset-legend head-shipping-method icon-head">Adicional</h4></div><div class="fieldset">' + htmlInicial;
180
+ htmlInicial += '</div></div></div>';
181
+ $('order-methods').next().insert({after: htmlInicial});
182
+ } else {
183
+ $('s_method_envio4872_envio4872').next().insert({after: htmlInicial})
184
+ }
185
+ }
186
+
187
+ },
188
+
189
+ fillDropDownCorreos:function (field, data)
190
+ {
191
+ /*
192
+ var htmlRadio = '';
193
+ data.each(
194
+ function(e) {
195
+ htmlRadio+= '<input type="radio" value="'+e.unidad+'" name="oficinas_correos" />&nbsp;<label>'+e.nombre+' - '+e.direccion+" - "+e.cp+' '+e.cp+'</label><br />';
196
+ }
197
+ );
198
+
199
+ $(field).update(htmlRadio);
200
+ */
201
+
202
+
203
+ for(i=field.options.length-1;i>=0;i--) { field.remove(i); }
204
+
205
+ data.oficinas.each(
206
+ function(e) {
207
+ field.options.add(new Option(e.direccion+" - "+e.cp+' - '+e.localidad,e.unidad));
208
+ }
209
+ );
210
+
211
+ this.correosInfo()
212
+
213
+
214
+ },
215
+
216
+ checkPhone:function (phone)
217
+ {
218
+
219
+ if (phone === null) return false;
220
+
221
+ if(phone.match(/^(6|7)[0-9]{8}$/))
222
+ {
223
+ return true;
224
+ } else {
225
+ return false;
226
+ }
227
+ },
228
+
229
+ correosInfo:function()
230
+ {
231
+
232
+ var puntoActual = $('oficinas_correos_content_select').value;
233
+ this.correosResultados.oficinas.each(
234
+ function(e) {
235
+ if (e.unidad == puntoActual)
236
+ {
237
+ $('correos_info_map').setStyle({display: 'block'});
238
+ $('correos_info_time').setStyle({display: 'block'});
239
+
240
+ // info del punto
241
+ this.infoGoogleMaps(e);
242
+ this.infoHorarios(e);
243
+
244
+ }
245
+ }.bind(this));
246
+
247
+ },
248
+
249
+ infoHorarios: function (e)
250
+ {
251
+
252
+ var tablaHorarios = '<ol>';
253
+ tablaHorarios += '<li><strong>Oficina</strong></li>';
254
+ tablaHorarios += '<li>'+e.nombre+'<li>';
255
+ tablaHorarios += '<li><strong>Horarios</strong></li>';
256
+ tablaHorarios += '<li>Horario de Lunes a Viernes: '+e.horariolv+'</li>';
257
+ tablaHorarios += '<li>Horario de S&aacute;bados: '+e.horarios+'</li>';
258
+ tablaHorarios += '<li>Horario de Festivos: '+e.horariof+'</li>';
259
+ tablaHorarios += '</ol>';
260
+
261
+ $('correos_info_time').update(tablaHorarios);
262
+
263
+ },
264
+
265
+ infoGoogleMaps:function(e)
266
+ {
267
+
268
+ var p = new Proj4js.Point(e.coorx,e.coory);
269
+ var pointDest = Proj4js.transform(source, dest, p);
270
+
271
+ //var latlng = new google.maps.LatLng(e.coorx, e.coory);
272
+ var latlng = new google.maps.LatLng(pointDest.y,pointDest.x);
273
+ var myOptions = {
274
+ zoom: 16,
275
+ center: latlng,
276
+ mapTypeId: google.maps.MapTypeId.ROADMAP
277
+ };
278
+
279
+ var imagen = new google.maps.MarkerImage(SKIN_URL_CORREOS + 'images/correos/correos.png', new google.maps.Size(60,46), new google.maps.Point(0,0), new google.maps.Point(10,57));
280
+ //var sombra = new google.maps.MarkerImage(BASE_URL_CORREOS + '/skin/frontend/default/default/images/correos/globosombra.png', new google.maps.Size(100,19), new google.maps.Point(0,0), new google.maps.Point(31,19));
281
+
282
+ var map = new google.maps.Map(document.getElementById("correos_info_map"), myOptions);
283
+
284
+ var beachMarker = new google.maps.Marker({
285
+ position: latlng,
286
+ map: map,
287
+ icon: imagen
288
+ //shadow: sombra
289
+ });
290
+
291
+ },
292
+
293
+ }
294
+
295
+ var PuntosCorreos = new PuntosCorreos();
296
+
js/correos/proj4js-compressed.js ADDED
@@ -0,0 +1,180 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ proj4js.js -- Javascript reprojection library.
3
+
4
+ Authors: Mike Adair madairATdmsolutions.ca
5
+ Richard Greenwood richATgreenwoodmap.com
6
+ Didier Richard didier.richardATign.fr
7
+ Stephen Irons stephen.ironsATclear.net.nz
8
+ Olivier Terral oterralATgmail.com
9
+
10
+ License:
11
+ Copyright (c) 2012, Mike Adair, Richard Greenwood, Didier Richard,
12
+ Stephen Irons and Olivier Terral
13
+
14
+ Permission is hereby granted, free of charge, to any person obtaining a
15
+ copy of this software and associated documentation files (the "Software"),
16
+ to deal in the Software without restriction, including without limitation
17
+ the rights to use, copy, modify, merge, publish, distribute, sublicense,
18
+ and/or sell copies of the Software, and to permit persons to whom the
19
+ Software is furnished to do so, subject to the following conditions:
20
+
21
+ The above copyright notice and this permission notice shall be included
22
+ in all copies or substantial portions of the Software.
23
+
24
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
25
+ OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
26
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
27
+ THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
28
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
29
+ FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
30
+ DEALINGS IN THE SOFTWARE.
31
+
32
+ Note: This program is an almost direct port of the C library PROJ.4.
33
+ */
34
+ var Proj4js={defaultDatum:"WGS84",transform:function(a,c,b){if(!a.readyToUse)return this.reportError("Proj4js initialization for:"+a.srsCode+" not yet complete"),b;if(!c.readyToUse)return this.reportError("Proj4js initialization for:"+c.srsCode+" not yet complete"),b;if(a.datum&&c.datum&&((a.datum.datum_type==Proj4js.common.PJD_3PARAM||a.datum.datum_type==Proj4js.common.PJD_7PARAM)&&"WGS84"!=c.datumCode||(c.datum.datum_type==Proj4js.common.PJD_3PARAM||c.datum.datum_type==Proj4js.common.PJD_7PARAM)&&
35
+ "WGS84"!=a.datumCode)){var d=Proj4js.WGS84;this.transform(a,d,b);a=d}"enu"!=a.axis&&this.adjust_axis(a,!1,b);"longlat"==a.projName?(b.x*=Proj4js.common.D2R,b.y*=Proj4js.common.D2R):(a.to_meter&&(b.x*=a.to_meter,b.y*=a.to_meter),a.inverse(b));a.from_greenwich&&(b.x+=a.from_greenwich);b=this.datum_transform(a.datum,c.datum,b);c.from_greenwich&&(b.x-=c.from_greenwich);"longlat"==c.projName?(b.x*=Proj4js.common.R2D,b.y*=Proj4js.common.R2D):(c.forward(b),c.to_meter&&(b.x/=c.to_meter,b.y/=c.to_meter));
36
+ "enu"!=c.axis&&this.adjust_axis(c,!0,b);return b},datum_transform:function(a,c,b){if(a.compare_datums(c)||a.datum_type==Proj4js.common.PJD_NODATUM||c.datum_type==Proj4js.common.PJD_NODATUM)return b;if(a.es!=c.es||a.a!=c.a||a.datum_type==Proj4js.common.PJD_3PARAM||a.datum_type==Proj4js.common.PJD_7PARAM||c.datum_type==Proj4js.common.PJD_3PARAM||c.datum_type==Proj4js.common.PJD_7PARAM)a.geodetic_to_geocentric(b),(a.datum_type==Proj4js.common.PJD_3PARAM||a.datum_type==Proj4js.common.PJD_7PARAM)&&a.geocentric_to_wgs84(b),
37
+ (c.datum_type==Proj4js.common.PJD_3PARAM||c.datum_type==Proj4js.common.PJD_7PARAM)&&c.geocentric_from_wgs84(b),c.geocentric_to_geodetic(b);return b},adjust_axis:function(a,c,b){for(var d=b.x,e=b.y,f=b.z||0,g,i,h=0;3>h;h++)if(!c||!(2==h&&void 0===b.z))switch(0==h?(g=d,i="x"):1==h?(g=e,i="y"):(g=f,i="z"),a.axis[h]){case "e":b[i]=g;break;case "w":b[i]=-g;break;case "n":b[i]=g;break;case "s":b[i]=-g;break;case "u":void 0!==b[i]&&(b.z=g);break;case "d":void 0!==b[i]&&(b.z=-g);break;default:return alert("ERROR: unknow axis ("+
38
+ a.axis[h]+") - check definition of "+a.projName),null}return b},reportError:function(){},extend:function(a,c){a=a||{};if(c)for(var b in c){var d=c[b];void 0!==d&&(a[b]=d)}return a},Class:function(){for(var a=function(){this.initialize.apply(this,arguments)},c={},b,d=0;d<arguments.length;++d)b="function"==typeof arguments[d]?arguments[d].prototype:arguments[d],Proj4js.extend(c,b);a.prototype=c;return a},bind:function(a,c){var b=Array.prototype.slice.apply(arguments,[2]);return function(){var d=b.concat(Array.prototype.slice.apply(arguments,
39
+ [0]));return a.apply(c,d)}},scriptName:"proj4js-compressed.js",defsLookupService:"http://spatialreference.org/ref",libPath:null,getScriptLocation:function(){if(this.libPath)return this.libPath;for(var a=this.scriptName,c=a.length,b=document.getElementsByTagName("script"),d=0;d<b.length;d++){var e=b[d].getAttribute("src");if(e){var f=e.lastIndexOf(a);if(-1<f&&f+c==e.length){this.libPath=e.slice(0,-c);break}}}return this.libPath||""},loadScript:function(a,c,b,d){var e=document.createElement("script");
40
+ e.defer=!1;e.type="text/javascript";e.id=a;e.src=a;e.onload=c;e.onerror=b;e.loadCheck=d;/MSIE/.test(navigator.userAgent)&&(e.onreadystatechange=this.checkReadyState);document.getElementsByTagName("head")[0].appendChild(e)},checkReadyState:function(){if("loaded"==this.readyState)if(this.loadCheck())this.onload();else this.onerror()}};
41
+ Proj4js.Proj=Proj4js.Class({readyToUse:!1,title:null,projName:null,units:null,datum:null,x0:0,y0:0,localCS:!1,queue:null,initialize:function(a,c){this.srsCodeInput=a;this.queue=[];c&&this.queue.push(c);if(0<=a.indexOf("GEOGCS")||0<=a.indexOf("GEOCCS")||0<=a.indexOf("PROJCS")||0<=a.indexOf("LOCAL_CS"))this.parseWKT(a),this.deriveConstants(),this.loadProjCode(this.projName);else{if(0==a.indexOf("urn:")){var b=a.split(":");if(("ogc"==b[1]||"x-ogc"==b[1])&&"def"==b[2]&&"crs"==b[3])a=b[4]+":"+b[b.length-
42
+ 1]}else 0==a.indexOf("http://")&&(b=a.split("#"),b[0].match(/epsg.org/)?a="EPSG:"+b[1]:b[0].match(/RIG.xml/)&&(a="IGNF:"+b[1]));this.srsCode=a.toUpperCase();0==this.srsCode.indexOf("EPSG")?(this.srsCode=this.srsCode,this.srsAuth="epsg",this.srsProjNumber=this.srsCode.substring(5)):0==this.srsCode.indexOf("IGNF")?(this.srsCode=this.srsCode,this.srsAuth="IGNF",this.srsProjNumber=this.srsCode.substring(5)):0==this.srsCode.indexOf("CRS")?(this.srsCode=this.srsCode,this.srsAuth="CRS",this.srsProjNumber=
43
+ this.srsCode.substring(4)):(this.srsAuth="",this.srsProjNumber=this.srsCode);this.loadProjDefinition()}},loadProjDefinition:function(){if(Proj4js.defs[this.srsCode])this.defsLoaded();else{var a=Proj4js.getScriptLocation()+"defs/"+this.srsAuth.toUpperCase()+this.srsProjNumber+".js";Proj4js.loadScript(a,Proj4js.bind(this.defsLoaded,this),Proj4js.bind(this.loadFromService,this),Proj4js.bind(this.checkDefsLoaded,this))}},loadFromService:function(){Proj4js.loadScript(Proj4js.defsLookupService+"/"+this.srsAuth+
44
+ "/"+this.srsProjNumber+"/proj4js/",Proj4js.bind(this.defsLoaded,this),Proj4js.bind(this.defsFailed,this),Proj4js.bind(this.checkDefsLoaded,this))},defsLoaded:function(){this.parseDefs();this.loadProjCode(this.projName)},checkDefsLoaded:function(){return Proj4js.defs[this.srsCode]?!0:!1},defsFailed:function(){Proj4js.reportError("failed to load projection definition for: "+this.srsCode);Proj4js.defs[this.srsCode]=Proj4js.defs.WGS84;this.defsLoaded()},loadProjCode:function(a){if(Proj4js.Proj[a])this.initTransforms();
45
+ else{var c=Proj4js.getScriptLocation()+"projCode/"+a+".js";Proj4js.loadScript(c,Proj4js.bind(this.loadProjCodeSuccess,this,a),Proj4js.bind(this.loadProjCodeFailure,this,a),Proj4js.bind(this.checkCodeLoaded,this,a))}},loadProjCodeSuccess:function(a){Proj4js.Proj[a].dependsOn?this.loadProjCode(Proj4js.Proj[a].dependsOn):this.initTransforms()},loadProjCodeFailure:function(a){Proj4js.reportError("failed to find projection file for: "+a)},checkCodeLoaded:function(a){return Proj4js.Proj[a]?!0:!1},initTransforms:function(){Proj4js.extend(this,
46
+ Proj4js.Proj[this.projName]);this.init();this.readyToUse=!0;if(this.queue)for(var a;a=this.queue.shift();)a.call(this,this)},wktRE:/^(\w+)\[(.*)\]$/,parseWKT:function(a){if(a=a.match(this.wktRE)){var c=a[1],b=a[2].split(","),d;d="TOWGS84"==c.toUpperCase()?c:b.shift();d=d.replace(/^\"/,"");d=d.replace(/\"$/,"");for(var a=[],e=0,f="",g=0;g<b.length;++g){for(var i=b[g],h=0;h<i.length;++h)"["==i.charAt(h)&&++e,"]"==i.charAt(h)&&--e;f+=i;0===e?(a.push(f),f=""):f+=","}switch(c){case "LOCAL_CS":this.projName=
47
+ "identity";this.localCS=!0;this.srsCode=d;break;case "GEOGCS":this.projName="longlat";this.geocsCode=d;this.srsCode||(this.srsCode=d);break;case "PROJCS":this.srsCode=d;break;case "PROJECTION":this.projName=Proj4js.wktProjections[d];break;case "DATUM":this.datumName=d;break;case "LOCAL_DATUM":this.datumCode="none";break;case "SPHEROID":this.ellps=d;this.a=parseFloat(a.shift());this.rf=parseFloat(a.shift());break;case "PRIMEM":this.from_greenwich=parseFloat(a.shift());break;case "UNIT":this.units=
48
+ d;this.unitsPerMeter=parseFloat(a.shift());break;case "PARAMETER":c=d.toLowerCase();b=parseFloat(a.shift());switch(c){case "false_easting":this.x0=b;break;case "false_northing":this.y0=b;break;case "scale_factor":this.k0=b;break;case "central_meridian":this.long0=b*Proj4js.common.D2R;break;case "latitude_of_origin":this.lat0=b*Proj4js.common.D2R}break;case "TOWGS84":this.datum_params=a;break;case "AXIS":c=d.toLowerCase();b=a.shift();switch(b){case "EAST":b="e";break;case "WEST":b="w";break;case "NORTH":b=
49
+ "n";break;case "SOUTH":b="s";break;case "UP":b="u";break;case "DOWN":b="d";break;default:b=" "}this.axis||(this.axis="enu");switch(c){case "x":this.axis=b+this.axis.substr(1,2);break;case "y":this.axis=this.axis.substr(0,1)+b+this.axis.substr(2,1);break;case "z":this.axis=this.axis.substr(0,2)+b}}for(g=0;g<a.length;++g)this.parseWKT(a[g])}},parseDefs:function(){this.defData=Proj4js.defs[this.srsCode];var a,c;if(this.defData){for(var b=this.defData.split("+"),d=0;d<b.length;d++)switch(c=b[d].split("="),
50
+ a=c[0].toLowerCase(),c=c[1],a.replace(/\s/gi,"")){case "title":this.title=c;break;case "proj":this.projName=c.replace(/\s/gi,"");break;case "units":this.units=c.replace(/\s/gi,"");break;case "datum":this.datumCode=c.replace(/\s/gi,"");break;case "nadgrids":this.nagrids=c.replace(/\s/gi,"");break;case "ellps":this.ellps=c.replace(/\s/gi,"");break;case "a":this.a=parseFloat(c);break;case "b":this.b=parseFloat(c);break;case "rf":this.rf=parseFloat(c);break;case "lat_0":this.lat0=c*Proj4js.common.D2R;
51
+ break;case "lat_1":this.lat1=c*Proj4js.common.D2R;break;case "lat_2":this.lat2=c*Proj4js.common.D2R;break;case "lat_ts":this.lat_ts=c*Proj4js.common.D2R;break;case "lon_0":this.long0=c*Proj4js.common.D2R;break;case "alpha":this.alpha=parseFloat(c)*Proj4js.common.D2R;break;case "lonc":this.longc=c*Proj4js.common.D2R;break;case "x_0":this.x0=parseFloat(c);break;case "y_0":this.y0=parseFloat(c);break;case "k_0":this.k0=parseFloat(c);break;case "k":this.k0=parseFloat(c);break;case "r_a":this.R_A=!0;break;
52
+ case "zone":this.zone=parseInt(c,10);break;case "south":this.utmSouth=!0;break;case "towgs84":this.datum_params=c.split(",");break;case "to_meter":this.to_meter=parseFloat(c);break;case "from_greenwich":this.from_greenwich=c*Proj4js.common.D2R;break;case "pm":c=c.replace(/\s/gi,"");this.from_greenwich=Proj4js.PrimeMeridian[c]?Proj4js.PrimeMeridian[c]:parseFloat(c);this.from_greenwich*=Proj4js.common.D2R;break;case "axis":c=c.replace(/\s/gi,""),3==c.length&&-1!="ewnsud".indexOf(c.substr(0,1))&&-1!=
53
+ "ewnsud".indexOf(c.substr(1,1))&&-1!="ewnsud".indexOf(c.substr(2,1))&&(this.axis=c)}this.deriveConstants()}},deriveConstants:function(){"@null"==this.nagrids&&(this.datumCode="none");if(this.datumCode&&"none"!=this.datumCode){var a=Proj4js.Datum[this.datumCode];a&&(this.datum_params=a.towgs84?a.towgs84.split(","):null,this.ellps=a.ellipse,this.datumName=a.datumName?a.datumName:this.datumCode)}this.a||Proj4js.extend(this,Proj4js.Ellipsoid[this.ellps]?Proj4js.Ellipsoid[this.ellps]:Proj4js.Ellipsoid.WGS84);
54
+ this.rf&&!this.b&&(this.b=(1-1/this.rf)*this.a);if(0===this.rf||Math.abs(this.a-this.b)<Proj4js.common.EPSLN)this.sphere=!0,this.b=this.a;this.a2=this.a*this.a;this.b2=this.b*this.b;this.es=(this.a2-this.b2)/this.a2;this.e=Math.sqrt(this.es);this.R_A&&(this.a*=1-this.es*(Proj4js.common.SIXTH+this.es*(Proj4js.common.RA4+this.es*Proj4js.common.RA6)),this.a2=this.a*this.a,this.b2=this.b*this.b,this.es=0);this.ep2=(this.a2-this.b2)/this.b2;this.k0||(this.k0=1);this.axis||(this.axis="enu");this.datum=
55
+ new Proj4js.datum(this)}});Proj4js.Proj.longlat={init:function(){},forward:function(a){return a},inverse:function(a){return a}};Proj4js.Proj.identity=Proj4js.Proj.longlat;
56
+ Proj4js.defs={WGS84:"+title=long/lat:WGS84 +proj=longlat +ellps=WGS84 +datum=WGS84 +units=degrees","EPSG:4326":"+title=long/lat:WGS84 +proj=longlat +a=6378137.0 +b=6356752.31424518 +ellps=WGS84 +datum=WGS84 +units=degrees","EPSG:4269":"+title=long/lat:NAD83 +proj=longlat +a=6378137.0 +b=6356752.31414036 +ellps=GRS80 +datum=NAD83 +units=degrees","EPSG:3875":"+title= Google Mercator +proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +no_defs"};
57
+ Proj4js.defs["EPSG:3785"]=Proj4js.defs["EPSG:3875"];Proj4js.defs.GOOGLE=Proj4js.defs["EPSG:3875"];Proj4js.defs["EPSG:900913"]=Proj4js.defs["EPSG:3875"];Proj4js.defs["EPSG:102113"]=Proj4js.defs["EPSG:3875"];
58
+ Proj4js.common={PI:3.141592653589793,HALF_PI:1.5707963267948966,TWO_PI:6.283185307179586,FORTPI:0.7853981633974483,R2D:57.29577951308232,D2R:0.017453292519943295,SEC_TO_RAD:4.84813681109536E-6,EPSLN:1.0E-10,MAX_ITER:20,COS_67P5:0.3826834323650898,AD_C:1.0026,PJD_UNKNOWN:0,PJD_3PARAM:1,PJD_7PARAM:2,PJD_GRIDSHIFT:3,PJD_WGS84:4,PJD_NODATUM:5,SRS_WGS84_SEMIMAJOR:6378137,SIXTH:0.16666666666666666,RA4:0.04722222222222222,RA6:0.022156084656084655,RV4:0.06944444444444445,RV6:0.04243827160493827,msfnz:function(a,
59
+ c,b){a*=c;return b/Math.sqrt(1-a*a)},tsfnz:function(a,c,b){b*=a;b=Math.pow((1-b)/(1+b),0.5*a);return Math.tan(0.5*(this.HALF_PI-c))/b},phi2z:function(a,c){for(var b=0.5*a,d,e=this.HALF_PI-2*Math.atan(c),f=0;15>=f;f++)if(d=a*Math.sin(e),d=this.HALF_PI-2*Math.atan(c*Math.pow((1-d)/(1+d),b))-e,e+=d,1.0E-10>=Math.abs(d))return e;alert("phi2z has NoConvergence");return-9999},qsfnz:function(a,c){var b;return 1.0E-7<a?(b=a*c,(1-a*a)*(c/(1-b*b)-0.5/a*Math.log((1-b)/(1+b)))):2*c},asinz:function(a){1<Math.abs(a)&&
60
+ (a=1<a?1:-1);return Math.asin(a)},e0fn:function(a){return 1-0.25*a*(1+a/16*(3+1.25*a))},e1fn:function(a){return 0.375*a*(1+0.25*a*(1+0.46875*a))},e2fn:function(a){return 0.05859375*a*a*(1+0.75*a)},e3fn:function(a){return a*a*a*(35/3072)},mlfn:function(a,c,b,d,e){return a*e-c*Math.sin(2*e)+b*Math.sin(4*e)-d*Math.sin(6*e)},srat:function(a,c){return Math.pow((1-a)/(1+a),c)},sign:function(a){return 0>a?-1:1},adjust_lon:function(a){return a=Math.abs(a)<this.PI?a:a-this.sign(a)*this.TWO_PI},adjust_lat:function(a){return a=
61
+ Math.abs(a)<this.HALF_PI?a:a-this.sign(a)*this.PI},latiso:function(a,c,b){if(Math.abs(c)>this.HALF_PI)return+Number.NaN;if(c==this.HALF_PI)return Number.POSITIVE_INFINITY;if(c==-1*this.HALF_PI)return-1*Number.POSITIVE_INFINITY;b*=a;return Math.log(Math.tan((this.HALF_PI+c)/2))+a*Math.log((1-b)/(1+b))/2},fL:function(a,c){return 2*Math.atan(a*Math.exp(c))-this.HALF_PI},invlatiso:function(a,c){var b=this.fL(1,c),d=0,e=0;do d=b,e=a*Math.sin(d),b=this.fL(Math.exp(a*Math.log((1+e)/(1-e))/2),c);while(1.0E-12<
62
+ Math.abs(b-d));return b},sinh:function(a){a=Math.exp(a);return(a-1/a)/2},cosh:function(a){a=Math.exp(a);return(a+1/a)/2},tanh:function(a){a=Math.exp(a);return(a-1/a)/(a+1/a)},asinh:function(a){return(0<=a?1:-1)*Math.log(Math.abs(a)+Math.sqrt(a*a+1))},acosh:function(a){return 2*Math.log(Math.sqrt((a+1)/2)+Math.sqrt((a-1)/2))},atanh:function(a){return Math.log((a-1)/(a+1))/2},gN:function(a,c,b){c*=b;return a/Math.sqrt(1-c*c)},pj_enfn:function(a){var c=[];c[0]=this.C00-a*(this.C02+a*(this.C04+a*(this.C06+
63
+ a*this.C08)));c[1]=a*(this.C22-a*(this.C04+a*(this.C06+a*this.C08)));var b=a*a;c[2]=b*(this.C44-a*(this.C46+a*this.C48));b*=a;c[3]=b*(this.C66-a*this.C68);c[4]=b*a*this.C88;return c},pj_mlfn:function(a,c,b,d){b*=c;c*=c;return d[0]*a-b*(d[1]+c*(d[2]+c*(d[3]+c*d[4])))},pj_inv_mlfn:function(a,c,b){for(var d=1/(1-c),e=a,f=Proj4js.common.MAX_ITER;f;--f){var g=Math.sin(e),i=1-c*g*g,i=(this.pj_mlfn(e,g,Math.cos(e),b)-a)*i*Math.sqrt(i)*d,e=e-i;if(Math.abs(i)<Proj4js.common.EPSLN)return e}Proj4js.reportError("cass:pj_inv_mlfn: Convergence error");
64
+ return e},C00:1,C02:0.25,C04:0.046875,C06:0.01953125,C08:0.01068115234375,C22:0.75,C44:0.46875,C46:0.013020833333333334,C48:0.007120768229166667,C66:0.3645833333333333,C68:0.005696614583333333,C88:0.3076171875};
65
+ Proj4js.datum=Proj4js.Class({initialize:function(a){this.datum_type=Proj4js.common.PJD_WGS84;a.datumCode&&"none"==a.datumCode&&(this.datum_type=Proj4js.common.PJD_NODATUM);if(a&&a.datum_params){for(var c=0;c<a.datum_params.length;c++)a.datum_params[c]=parseFloat(a.datum_params[c]);if(0!=a.datum_params[0]||0!=a.datum_params[1]||0!=a.datum_params[2])this.datum_type=Proj4js.common.PJD_3PARAM;if(3<a.datum_params.length&&(0!=a.datum_params[3]||0!=a.datum_params[4]||0!=a.datum_params[5]||0!=a.datum_params[6]))this.datum_type=
66
+ Proj4js.common.PJD_7PARAM,a.datum_params[3]*=Proj4js.common.SEC_TO_RAD,a.datum_params[4]*=Proj4js.common.SEC_TO_RAD,a.datum_params[5]*=Proj4js.common.SEC_TO_RAD,a.datum_params[6]=a.datum_params[6]/1E6+1}a&&(this.a=a.a,this.b=a.b,this.es=a.es,this.ep2=a.ep2,this.datum_params=a.datum_params)},compare_datums:function(a){return this.datum_type!=a.datum_type||this.a!=a.a||5.0E-11<Math.abs(this.es-a.es)?!1:this.datum_type==Proj4js.common.PJD_3PARAM?this.datum_params[0]==a.datum_params[0]&&this.datum_params[1]==
67
+ a.datum_params[1]&&this.datum_params[2]==a.datum_params[2]:this.datum_type==Proj4js.common.PJD_7PARAM?this.datum_params[0]==a.datum_params[0]&&this.datum_params[1]==a.datum_params[1]&&this.datum_params[2]==a.datum_params[2]&&this.datum_params[3]==a.datum_params[3]&&this.datum_params[4]==a.datum_params[4]&&this.datum_params[5]==a.datum_params[5]&&this.datum_params[6]==a.datum_params[6]:this.datum_type==Proj4js.common.PJD_GRIDSHIFT||a.datum_type==Proj4js.common.PJD_GRIDSHIFT?(alert("ERROR: Grid shift transformations are not implemented."),
68
+ !1):!0},geodetic_to_geocentric:function(a){var c=a.x,b=a.y,d=a.z?a.z:0,e,f,g;if(b<-Proj4js.common.HALF_PI&&b>-1.001*Proj4js.common.HALF_PI)b=-Proj4js.common.HALF_PI;else if(b>Proj4js.common.HALF_PI&&b<1.001*Proj4js.common.HALF_PI)b=Proj4js.common.HALF_PI;else if(b<-Proj4js.common.HALF_PI||b>Proj4js.common.HALF_PI)return Proj4js.reportError("geocent:lat out of range:"+b),null;c>Proj4js.common.PI&&(c-=2*Proj4js.common.PI);f=Math.sin(b);g=Math.cos(b);e=this.a/Math.sqrt(1-this.es*f*f);b=(e+d)*g*Math.cos(c);
69
+ c=(e+d)*g*Math.sin(c);d=(e*(1-this.es)+d)*f;a.x=b;a.y=c;a.z=d;return 0},geocentric_to_geodetic:function(a){var c,b,d,e,f,g,i,h,j,k,l=a.x;d=a.y;var m=a.z?a.z:0;c=Math.sqrt(l*l+d*d);b=Math.sqrt(l*l+d*d+m*m);if(1.0E-12>c/this.a){if(l=0,1.0E-12>b/this.a)return}else l=Math.atan2(d,l);d=m/b;e=c/b;f=1/Math.sqrt(1-this.es*(2-this.es)*e*e);i=e*(1-this.es)*f;h=d*f;k=0;do k++,g=this.a/Math.sqrt(1-this.es*h*h),b=c*i+m*h-g*(1-this.es*h*h),g=this.es*g/(g+b),f=1/Math.sqrt(1-g*(2-g)*e*e),g=e*(1-g)*f,f*=d,j=f*i-g*
70
+ h,i=g,h=f;while(1.0E-24<j*j&&30>k);c=Math.atan(f/Math.abs(g));a.x=l;a.y=c;a.z=b;return a},geocentric_to_geodetic_noniter:function(a){var c=a.x,b=a.y,d=a.z?a.z:0,e,f,g,i,h,c=parseFloat(c),b=parseFloat(b),d=parseFloat(d);h=!1;if(0!=c)e=Math.atan2(b,c);else if(0<b)e=Proj4js.common.HALF_PI;else if(0>b)e=-Proj4js.common.HALF_PI;else if(h=!0,e=0,0<d)f=Proj4js.common.HALF_PI;else if(0>d)f=-Proj4js.common.HALF_PI;else return;g=c*c+b*b;c=Math.sqrt(g);b=d*Proj4js.common.AD_C;g=Math.sqrt(b*b+g);b/=g;g=c/g;b=
71
+ d+this.b*this.ep2*b*b*b;i=c-this.a*this.es*g*g*g;g=Math.sqrt(b*b+i*i);b/=g;g=i/g;i=this.a/Math.sqrt(1-this.es*b*b);d=g>=Proj4js.common.COS_67P5?c/g-i:g<=-Proj4js.common.COS_67P5?c/-g-i:d/b+i*(this.es-1);!1==h&&(f=Math.atan(b/g));a.x=e;a.y=f;a.z=d;return a},geocentric_to_wgs84:function(a){if(this.datum_type==Proj4js.common.PJD_3PARAM)a.x+=this.datum_params[0],a.y+=this.datum_params[1],a.z+=this.datum_params[2];else if(this.datum_type==Proj4js.common.PJD_7PARAM){var c=this.datum_params[3],b=this.datum_params[4],
72
+ d=this.datum_params[5],e=this.datum_params[6],f=e*(d*a.x+a.y-c*a.z)+this.datum_params[1],c=e*(-b*a.x+c*a.y+a.z)+this.datum_params[2];a.x=e*(a.x-d*a.y+b*a.z)+this.datum_params[0];a.y=f;a.z=c}},geocentric_from_wgs84:function(a){if(this.datum_type==Proj4js.common.PJD_3PARAM)a.x-=this.datum_params[0],a.y-=this.datum_params[1],a.z-=this.datum_params[2];else if(this.datum_type==Proj4js.common.PJD_7PARAM){var c=this.datum_params[3],b=this.datum_params[4],d=this.datum_params[5],e=this.datum_params[6],f=(a.x-
73
+ this.datum_params[0])/e,g=(a.y-this.datum_params[1])/e,e=(a.z-this.datum_params[2])/e;a.x=f+d*g-b*e;a.y=-d*f+g+c*e;a.z=b*f-c*g+e}}});
74
+ Proj4js.Point=Proj4js.Class({initialize:function(a,c,b){"object"==typeof a?(this.x=a[0],this.y=a[1],this.z=a[2]||0):"string"==typeof a&&"undefined"==typeof c?(a=a.split(","),this.x=parseFloat(a[0]),this.y=parseFloat(a[1]),this.z=parseFloat(a[2])||0):(this.x=a,this.y=c,this.z=b||0)},clone:function(){return new Proj4js.Point(this.x,this.y,this.z)},toString:function(){return"x="+this.x+",y="+this.y},toShortString:function(){return this.x+", "+this.y}});
75
+ Proj4js.PrimeMeridian={greenwich:0,lisbon:-9.131906111111,paris:2.337229166667,bogota:-74.080916666667,madrid:-3.687938888889,rome:12.452333333333,bern:7.439583333333,jakarta:106.807719444444,ferro:-17.666666666667,brussels:4.367975,stockholm:18.058277777778,athens:23.7163375,oslo:10.722916666667};
76
+ Proj4js.Ellipsoid={MERIT:{a:6378137,rf:298.257,ellipseName:"MERIT 1983"},SGS85:{a:6378136,rf:298.257,ellipseName:"Soviet Geodetic System 85"},GRS80:{a:6378137,rf:298.257222101,ellipseName:"GRS 1980(IUGG, 1980)"},IAU76:{a:6378140,rf:298.257,ellipseName:"IAU 1976"},airy:{a:6377563.396,b:6356256.91,ellipseName:"Airy 1830"},"APL4.":{a:6378137,rf:298.25,ellipseName:"Appl. Physics. 1965"},NWL9D:{a:6378145,rf:298.25,ellipseName:"Naval Weapons Lab., 1965"},mod_airy:{a:6377340.189,b:6356034.446,ellipseName:"Modified Airy"},
77
+ andrae:{a:6377104.43,rf:300,ellipseName:"Andrae 1876 (Den., Iclnd.)"},aust_SA:{a:6378160,rf:298.25,ellipseName:"Australian Natl & S. Amer. 1969"},GRS67:{a:6378160,rf:298.247167427,ellipseName:"GRS 67(IUGG 1967)"},bessel:{a:6377397.155,rf:299.1528128,ellipseName:"Bessel 1841"},bess_nam:{a:6377483.865,rf:299.1528128,ellipseName:"Bessel 1841 (Namibia)"},clrk66:{a:6378206.4,b:6356583.8,ellipseName:"Clarke 1866"},clrk80:{a:6378249.145,rf:293.4663,ellipseName:"Clarke 1880 mod."},CPM:{a:6375738.7,rf:334.29,
78
+ ellipseName:"Comm. des Poids et Mesures 1799"},delmbr:{a:6376428,rf:311.5,ellipseName:"Delambre 1810 (Belgium)"},engelis:{a:6378136.05,rf:298.2566,ellipseName:"Engelis 1985"},evrst30:{a:6377276.345,rf:300.8017,ellipseName:"Everest 1830"},evrst48:{a:6377304.063,rf:300.8017,ellipseName:"Everest 1948"},evrst56:{a:6377301.243,rf:300.8017,ellipseName:"Everest 1956"},evrst69:{a:6377295.664,rf:300.8017,ellipseName:"Everest 1969"},evrstSS:{a:6377298.556,rf:300.8017,ellipseName:"Everest (Sabah & Sarawak)"},
79
+ fschr60:{a:6378166,rf:298.3,ellipseName:"Fischer (Mercury Datum) 1960"},fschr60m:{a:6378155,rf:298.3,ellipseName:"Fischer 1960"},fschr68:{a:6378150,rf:298.3,ellipseName:"Fischer 1968"},helmert:{a:6378200,rf:298.3,ellipseName:"Helmert 1906"},hough:{a:6378270,rf:297,ellipseName:"Hough"},intl:{a:6378388,rf:297,ellipseName:"International 1909 (Hayford)"},kaula:{a:6378163,rf:298.24,ellipseName:"Kaula 1961"},lerch:{a:6378139,rf:298.257,ellipseName:"Lerch 1979"},mprts:{a:6397300,rf:191,ellipseName:"Maupertius 1738"},
80
+ new_intl:{a:6378157.5,b:6356772.2,ellipseName:"New International 1967"},plessis:{a:6376523,rf:6355863,ellipseName:"Plessis 1817 (France)"},krass:{a:6378245,rf:298.3,ellipseName:"Krassovsky, 1942"},SEasia:{a:6378155,b:6356773.3205,ellipseName:"Southeast Asia"},walbeck:{a:6376896,b:6355834.8467,ellipseName:"Walbeck"},WGS60:{a:6378165,rf:298.3,ellipseName:"WGS 60"},WGS66:{a:6378145,rf:298.25,ellipseName:"WGS 66"},WGS72:{a:6378135,rf:298.26,ellipseName:"WGS 72"},WGS84:{a:6378137,rf:298.257223563,ellipseName:"WGS 84"},
81
+ sphere:{a:6370997,b:6370997,ellipseName:"Normal Sphere (r=6370997)"}};
82
+ Proj4js.Datum={WGS84:{towgs84:"0,0,0",ellipse:"WGS84",datumName:"WGS84"},GGRS87:{towgs84:"-199.87,74.79,246.62",ellipse:"GRS80",datumName:"Greek_Geodetic_Reference_System_1987"},NAD83:{towgs84:"0,0,0",ellipse:"GRS80",datumName:"North_American_Datum_1983"},NAD27:{nadgrids:"@conus,@alaska,@ntv2_0.gsb,@ntv1_can.dat",ellipse:"clrk66",datumName:"North_American_Datum_1927"},potsdam:{towgs84:"606.0,23.0,413.0",ellipse:"bessel",datumName:"Potsdam Rauenberg 1950 DHDN"},carthage:{towgs84:"-263.0,6.0,431.0",
83
+ ellipse:"clark80",datumName:"Carthage 1934 Tunisia"},hermannskogel:{towgs84:"653.0,-212.0,449.0",ellipse:"bessel",datumName:"Hermannskogel"},ire65:{towgs84:"482.530,-130.596,564.557,-1.042,-0.214,-0.631,8.15",ellipse:"mod_airy",datumName:"Ireland 1965"},nzgd49:{towgs84:"59.47,-5.04,187.44,0.47,-0.1,1.024,-4.5993",ellipse:"intl",datumName:"New Zealand Geodetic Datum 1949"},OSGB36:{towgs84:"446.448,-125.157,542.060,0.1502,0.2470,0.8421,-20.4894",ellipse:"airy",datumName:"Airy 1830"}};
84
+ Proj4js.WGS84=new Proj4js.Proj("WGS84");Proj4js.Datum.OSB36=Proj4js.Datum.OSGB36;Proj4js.wktProjections={"Lambert Tangential Conformal Conic Projection":"lcc",Mercator:"merc","Popular Visualisation Pseudo Mercator":"merc",Mercator_1SP:"merc",Transverse_Mercator:"tmerc","Transverse Mercator":"tmerc","Lambert Azimuthal Equal Area":"laea","Universal Transverse Mercator System":"utm"};
85
+ Proj4js.Proj.aea={init:function(){Math.abs(this.lat1+this.lat2)<Proj4js.common.EPSLN?Proj4js.reportError("aeaInitEqualLatitudes"):(this.temp=this.b/this.a,this.es=1-Math.pow(this.temp,2),this.e3=Math.sqrt(this.es),this.sin_po=Math.sin(this.lat1),this.cos_po=Math.cos(this.lat1),this.con=this.t1=this.sin_po,this.ms1=Proj4js.common.msfnz(this.e3,this.sin_po,this.cos_po),this.qs1=Proj4js.common.qsfnz(this.e3,this.sin_po,this.cos_po),this.sin_po=Math.sin(this.lat2),this.cos_po=Math.cos(this.lat2),this.t2=
86
+ this.sin_po,this.ms2=Proj4js.common.msfnz(this.e3,this.sin_po,this.cos_po),this.qs2=Proj4js.common.qsfnz(this.e3,this.sin_po,this.cos_po),this.sin_po=Math.sin(this.lat0),this.cos_po=Math.cos(this.lat0),this.t3=this.sin_po,this.qs0=Proj4js.common.qsfnz(this.e3,this.sin_po,this.cos_po),this.ns0=Math.abs(this.lat1-this.lat2)>Proj4js.common.EPSLN?(this.ms1*this.ms1-this.ms2*this.ms2)/(this.qs2-this.qs1):this.con,this.c=this.ms1*this.ms1+this.ns0*this.qs1,this.rh=this.a*Math.sqrt(this.c-this.ns0*this.qs0)/
87
+ this.ns0)},forward:function(a){var c=a.x,b=a.y;this.sin_phi=Math.sin(b);this.cos_phi=Math.cos(b);var b=Proj4js.common.qsfnz(this.e3,this.sin_phi,this.cos_phi),b=this.a*Math.sqrt(this.c-this.ns0*b)/this.ns0,d=this.ns0*Proj4js.common.adjust_lon(c-this.long0),c=b*Math.sin(d)+this.x0,b=this.rh-b*Math.cos(d)+this.y0;a.x=c;a.y=b;return a},inverse:function(a){var c,b,d;a.x-=this.x0;a.y=this.rh-a.y+this.y0;0<=this.ns0?(c=Math.sqrt(a.x*a.x+a.y*a.y),b=1):(c=-Math.sqrt(a.x*a.x+a.y*a.y),b=-1);d=0;0!=c&&(d=Math.atan2(b*
88
+ a.x,b*a.y));b=c*this.ns0/this.a;c=(this.c-b*b)/this.ns0;1.0E-10<=this.e3?(b=1-0.5*(1-this.es)*Math.log((1-this.e3)/(1+this.e3))/this.e3,b=1.0E-10<Math.abs(Math.abs(b)-Math.abs(c))?this.phi1z(this.e3,c):0<=c?0.5*Proj4js.common.PI:-0.5*Proj4js.common.PI):b=this.phi1z(this.e3,c);d=Proj4js.common.adjust_lon(d/this.ns0+this.long0);a.x=d;a.y=b;return a},phi1z:function(a,c){var b,d,e,f,g=Proj4js.common.asinz(0.5*c);if(a<Proj4js.common.EPSLN)return g;for(var i=a*a,h=1;25>=h;h++)if(b=Math.sin(g),d=Math.cos(g),
89
+ e=a*b,f=1-e*e,b=0.5*f*f/d*(c/(1-i)-b/f+0.5/a*Math.log((1-e)/(1+e))),g+=b,1.0E-7>=Math.abs(b))return g;Proj4js.reportError("aea:phi1z:Convergence error");return null}};
90
+ Proj4js.Proj.sterea={dependsOn:"gauss",init:function(){Proj4js.Proj.gauss.init.apply(this);this.rc?(this.sinc0=Math.sin(this.phic0),this.cosc0=Math.cos(this.phic0),this.R2=2*this.rc,this.title||(this.title="Oblique Stereographic Alternative")):Proj4js.reportError("sterea:init:E_ERROR_0")},forward:function(a){var c,b,d,e;a.x=Proj4js.common.adjust_lon(a.x-this.long0);Proj4js.Proj.gauss.forward.apply(this,[a]);c=Math.sin(a.y);b=Math.cos(a.y);d=Math.cos(a.x);e=this.k0*this.R2/(1+this.sinc0*c+this.cosc0*
91
+ b*d);a.x=e*b*Math.sin(a.x);a.y=e*(this.cosc0*c-this.sinc0*b*d);a.x=this.a*a.x+this.x0;a.y=this.a*a.y+this.y0;return a},inverse:function(a){var c,b,d,e;a.x=(a.x-this.x0)/this.a;a.y=(a.y-this.y0)/this.a;a.x/=this.k0;a.y/=this.k0;(e=Math.sqrt(a.x*a.x+a.y*a.y))?(d=2*Math.atan2(e,this.R2),c=Math.sin(d),b=Math.cos(d),d=Math.asin(b*this.sinc0+a.y*c*this.cosc0/e),c=Math.atan2(a.x*c,e*this.cosc0*b-a.y*this.sinc0*c)):(d=this.phic0,c=0);a.x=c;a.y=d;Proj4js.Proj.gauss.inverse.apply(this,[a]);a.x=Proj4js.common.adjust_lon(a.x+
92
+ this.long0);return a}};function phi4z(a,c,b,d,e,f,g,i,h){var j,k,l,m,n,o,h=f;for(o=1;15>=o;o++)if(j=Math.sin(h),l=Math.tan(h),i=l*Math.sqrt(1-a*j*j),k=Math.sin(2*h),m=c*h-b*k+d*Math.sin(4*h)-e*Math.sin(6*h),n=c-2*b*Math.cos(2*h)+4*d*Math.cos(4*h)-6*e*Math.cos(6*h),j=2*m+i*(m*m+g)-2*f*(i*m+1),l=a*k*(m*m+g-2*f*m)/(2*i),i=2*(f-m)*(i*n-2/k)-2*n,j/=l+i,h+=j,1.0E-10>=Math.abs(j))return h;Proj4js.reportError("phi4z: No convergence");return null}
93
+ function e4fn(a){var c;c=1+a;a=1-a;return Math.sqrt(Math.pow(c,c)*Math.pow(a,a))}
94
+ Proj4js.Proj.poly={init:function(){0==this.lat0&&(this.lat0=90);this.temp=this.b/this.a;this.es=1-Math.pow(this.temp,2);this.e=Math.sqrt(this.es);this.e0=Proj4js.common.e0fn(this.es);this.e1=Proj4js.common.e1fn(this.es);this.e2=Proj4js.common.e2fn(this.es);this.e3=Proj4js.common.e3fn(this.es);this.ml0=Proj4js.common.mlfn(this.e0,this.e1,this.e2,this.e3,this.lat0)},forward:function(a){var c,b,d,e,f;d=a.y;b=Proj4js.common.adjust_lon(a.x-this.long0);1.0E-7>=Math.abs(d)?(f=this.x0+this.a*b,c=this.y0-
95
+ this.a*this.ml0):(c=Math.sin(d),b=Math.cos(d),d=Proj4js.common.mlfn(this.e0,this.e1,this.e2,this.e3,d),e=Proj4js.common.msfnz(this.e,c,b),b=c,f=this.x0+this.a*e*Math.sin(b)/c,c=this.y0+this.a*(d-this.ml0+e*(1-Math.cos(b))/c));a.x=f;a.y=c;return a},inverse:function(a){var c,b;a.x-=this.x0;a.y-=this.y0;c=this.ml0+a.y/this.a;if(1.0E-7>=Math.abs(c))c=a.x/this.a+this.long0,b=0;else{c=c*c+a.x/this.a*(a.x/this.a);c=phi4z(this.es,this.e0,this.e1,this.e2,this.e3,this.al,c,void 0,b);if(1!=c)return c;c=Proj4js.common.adjust_lon(Proj4js.common.asinz(NaN*
96
+ a.x/this.a)/Math.sin(b)+this.long0)}a.x=c;a.y=b;return a}};
97
+ Proj4js.Proj.equi={init:function(){this.x0||(this.x0=0);this.y0||(this.y0=0);this.lat0||(this.lat0=0);this.long0||(this.long0=0)},forward:function(a){var c=a.y,b=this.x0+this.a*Proj4js.common.adjust_lon(a.x-this.long0)*Math.cos(this.lat0),c=this.y0+this.a*c;this.t1=b;this.t2=Math.cos(this.lat0);a.x=b;a.y=c;return a},inverse:function(a){a.x-=this.x0;a.y-=this.y0;var c=a.y/this.a;Math.abs(c)>Proj4js.common.HALF_PI&&Proj4js.reportError("equi:Inv:DataError");var b=Proj4js.common.adjust_lon(this.long0+
98
+ a.x/(this.a*Math.cos(this.lat0)));a.x=b;a.y=c}};
99
+ Proj4js.Proj.merc={init:function(){this.lat_ts&&(this.k0=this.sphere?Math.cos(this.lat_ts):Proj4js.common.msfnz(this.es,Math.sin(this.lat_ts),Math.cos(this.lat_ts)))},forward:function(a){var c=a.x,b=a.y;if(90<b*Proj4js.common.R2D&&-90>b*Proj4js.common.R2D&&180<c*Proj4js.common.R2D&&-180>c*Proj4js.common.R2D)return Proj4js.reportError("merc:forward: llInputOutOfRange: "+c+" : "+b),null;if(Math.abs(Math.abs(b)-Proj4js.common.HALF_PI)<=Proj4js.common.EPSLN)return Proj4js.reportError("merc:forward: ll2mAtPoles"),null;
100
+ if(this.sphere)c=this.x0+this.a*this.k0*Proj4js.common.adjust_lon(c-this.long0),b=this.y0+this.a*this.k0*Math.log(Math.tan(Proj4js.common.FORTPI+0.5*b));else var d=Math.sin(b),b=Proj4js.common.tsfnz(this.e,b,d),c=this.x0+this.a*this.k0*Proj4js.common.adjust_lon(c-this.long0),b=this.y0-this.a*this.k0*Math.log(b);a.x=c;a.y=b;return a},inverse:function(a){var c=a.x-this.x0,b=a.y-this.y0;if(this.sphere)b=Proj4js.common.HALF_PI-2*Math.atan(Math.exp(-b/this.a*this.k0));else if(b=Math.exp(-b/(this.a*this.k0)),
101
+ b=Proj4js.common.phi2z(this.e,b),-9999==b)return Proj4js.reportError("merc:inverse: lat = -9999"),null;c=Proj4js.common.adjust_lon(this.long0+c/(this.a*this.k0));a.x=c;a.y=b;return a}};Proj4js.Proj.utm={dependsOn:"tmerc",init:function(){this.zone?(this.lat0=0,this.long0=(6*Math.abs(this.zone)-183)*Proj4js.common.D2R,this.x0=5E5,this.y0=this.utmSouth?1E7:0,this.k0=0.9996,Proj4js.Proj.tmerc.init.apply(this),this.forward=Proj4js.Proj.tmerc.forward,this.inverse=Proj4js.Proj.tmerc.inverse):Proj4js.reportError("utm:init: zone must be specified for UTM")}};
102
+ Proj4js.Proj.eqdc={init:function(){this.mode||(this.mode=0);this.temp=this.b/this.a;this.es=1-Math.pow(this.temp,2);this.e=Math.sqrt(this.es);this.e0=Proj4js.common.e0fn(this.es);this.e1=Proj4js.common.e1fn(this.es);this.e2=Proj4js.common.e2fn(this.es);this.e3=Proj4js.common.e3fn(this.es);this.sinphi=Math.sin(this.lat1);this.cosphi=Math.cos(this.lat1);this.ms1=Proj4js.common.msfnz(this.e,this.sinphi,this.cosphi);this.ml1=Proj4js.common.mlfn(this.e0,this.e1,this.e2,this.e3,this.lat1);0!=this.mode?
103
+ (Math.abs(this.lat1+this.lat2)<Proj4js.common.EPSLN&&Proj4js.reportError("eqdc:Init:EqualLatitudes"),this.sinphi=Math.sin(this.lat2),this.cosphi=Math.cos(this.lat2),this.ms2=Proj4js.common.msfnz(this.e,this.sinphi,this.cosphi),this.ml2=Proj4js.common.mlfn(this.e0,this.e1,this.e2,this.e3,this.lat2),this.ns=Math.abs(this.lat1-this.lat2)>=Proj4js.common.EPSLN?(this.ms1-this.ms2)/(this.ml2-this.ml1):this.sinphi):this.ns=this.sinphi;this.g=this.ml1+this.ms1/this.ns;this.ml0=Proj4js.common.mlfn(this.e0,
104
+ this.e1,this.e2,this.e3,this.lat0);this.rh=this.a*(this.g-this.ml0)},forward:function(a){var c=a.x,b=this.a*(this.g-Proj4js.common.mlfn(this.e0,this.e1,this.e2,this.e3,a.y)),d=this.ns*Proj4js.common.adjust_lon(c-this.long0),c=this.x0+b*Math.sin(d),b=this.y0+this.rh-b*Math.cos(d);a.x=c;a.y=b;return a},inverse:function(a){a.x-=this.x0;a.y=this.rh-a.y+this.y0;var c,b;0<=this.ns?(b=Math.sqrt(a.x*a.x+a.y*a.y),c=1):(b=-Math.sqrt(a.x*a.x+a.y*a.y),c=-1);var d=0;0!=b&&(d=Math.atan2(c*a.x,c*a.y));c=this.phi3z(this.g-
105
+ b/this.a,this.e0,this.e1,this.e2,this.e3);d=Proj4js.common.adjust_lon(this.long0+d/this.ns);a.x=d;a.y=c;return a},phi3z:function(a,c,b,d,e){var f,g;f=a;for(var i=0;15>i;i++)if(g=(a+b*Math.sin(2*f)-d*Math.sin(4*f)+e*Math.sin(6*f))/c-f,f+=g,1.0E-10>=Math.abs(g))return f;Proj4js.reportError("PHI3Z-CONV:Latitude failed to converge after 15 iterations");return null}};
106
+ Proj4js.Proj.tmerc={init:function(){this.e0=Proj4js.common.e0fn(this.es);this.e1=Proj4js.common.e1fn(this.es);this.e2=Proj4js.common.e2fn(this.es);this.e3=Proj4js.common.e3fn(this.es);this.ml0=this.a*Proj4js.common.mlfn(this.e0,this.e1,this.e2,this.e3,this.lat0)},forward:function(a){var c=a.y,b=Proj4js.common.adjust_lon(a.x-this.long0),d,e;d=Math.sin(c);var f=Math.cos(c);if(this.sphere){var g=f*Math.sin(b);if(1.0E-10>Math.abs(Math.abs(g)-1))return Proj4js.reportError("tmerc:forward: Point projects into infinity"),
107
+ 93;e=0.5*this.a*this.k0*Math.log((1+g)/(1-g));d=Math.acos(f*Math.cos(b)/Math.sqrt(1-g*g));0>c&&(d=-d);c=this.a*this.k0*(d-this.lat0)}else{e=f*b;var b=Math.pow(e,2),f=this.ep2*Math.pow(f,2),g=Math.tan(c),i=Math.pow(g,2);d=1-this.es*Math.pow(d,2);d=this.a/Math.sqrt(d);c=this.a*Proj4js.common.mlfn(this.e0,this.e1,this.e2,this.e3,c);e=this.k0*d*e*(1+b/6*(1-i+f+b/20*(5-18*i+Math.pow(i,2)+72*f-58*this.ep2)))+this.x0;c=this.k0*(c-this.ml0+d*g*b*(0.5+b/24*(5-i+9*f+4*Math.pow(f,2)+b/30*(61-58*i+Math.pow(i,
108
+ 2)+600*f-330*this.ep2))))+this.y0}a.x=e;a.y=c;return a},inverse:function(a){var c,b,d,e;if(this.sphere){b=Math.exp(a.x/(this.a*this.k0));var f=0.5*(b-1/b);d=this.lat0+a.y/(this.a*this.k0);e=Math.cos(d);c=Math.sqrt((1-e*e)/(1+f*f));b=Proj4js.common.asinz(c);0>d&&(b=-b);c=0==f&&0==e?this.long0:Proj4js.common.adjust_lon(Math.atan2(f,e)+this.long0)}else{var f=a.x-this.x0,g=a.y-this.y0;b=c=(this.ml0+g/this.k0)/this.a;for(e=0;;e++){d=(c+this.e1*Math.sin(2*b)-this.e2*Math.sin(4*b)+this.e3*Math.sin(6*b))/
109
+ this.e0-b;b+=d;if(Math.abs(d)<=Proj4js.common.EPSLN)break;if(6<=e)return Proj4js.reportError("tmerc:inverse: Latitude failed to converge"),95}if(Math.abs(b)<Proj4js.common.HALF_PI){c=Math.sin(b);d=Math.cos(b);var i=Math.tan(b);e=this.ep2*Math.pow(d,2);var g=Math.pow(e,2),h=Math.pow(i,2),j=Math.pow(h,2);c=1-this.es*Math.pow(c,2);var k=this.a/Math.sqrt(c);c=k*(1-this.es)/c;var f=f/(k*this.k0),l=Math.pow(f,2);b-=k*i*l/c*(0.5-l/24*(5+3*h+10*e-4*g-9*this.ep2-l/30*(61+90*h+298*e+45*j-252*this.ep2-3*g)));
110
+ c=Proj4js.common.adjust_lon(this.long0+f*(1-l/6*(1+2*h+e-l/20*(5-2*e+28*h-3*g+8*this.ep2+24*j)))/d)}else b=Proj4js.common.HALF_PI*Proj4js.common.sign(g),c=this.long0}a.x=c;a.y=b;return a}};Proj4js.defs.GOOGLE="+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +no_defs";Proj4js.defs["EPSG:900913"]=Proj4js.defs.GOOGLE;
111
+ Proj4js.Proj.gstmerc={init:function(){var a=this.b/this.a;this.e=Math.sqrt(1-a*a);this.lc=this.long0;this.rs=Math.sqrt(1+this.e*this.e*Math.pow(Math.cos(this.lat0),4)/(1-this.e*this.e));var a=Math.sin(this.lat0),c=Math.asin(a/this.rs),b=Math.sin(c);this.cp=Proj4js.common.latiso(0,c,b)-this.rs*Proj4js.common.latiso(this.e,this.lat0,a);this.n2=this.k0*this.a*Math.sqrt(1-this.e*this.e)/(1-this.e*this.e*a*a);this.xs=this.x0;this.ys=this.y0-this.n2*c;this.title||(this.title="Gauss Schreiber transverse mercator")},
112
+ forward:function(a){var c=a.y,b=this.rs*(a.x-this.lc),c=this.cp+this.rs*Proj4js.common.latiso(this.e,c,Math.sin(c)),d=Math.asin(Math.sin(b)/Proj4js.common.cosh(c)),d=Proj4js.common.latiso(0,d,Math.sin(d));a.x=this.xs+this.n2*d;a.y=this.ys+this.n2*Math.atan(Proj4js.common.sinh(c)/Math.cos(b));return a},inverse:function(a){var c=a.x,b=a.y,d=Math.atan(Proj4js.common.sinh((c-this.xs)/this.n2)/Math.cos((b-this.ys)/this.n2)),c=Math.asin(Math.sin((b-this.ys)/this.n2)/Proj4js.common.cosh((c-this.xs)/this.n2)),
113
+ c=Proj4js.common.latiso(0,c,Math.sin(c));a.x=this.lc+d/this.rs;a.y=Proj4js.common.invlatiso(this.e,(c-this.cp)/this.rs);return a}};
114
+ Proj4js.Proj.ortho={init:function(){this.sin_p14=Math.sin(this.lat0);this.cos_p14=Math.cos(this.lat0)},forward:function(a){var c,b,d,e,f;b=a.y;d=Proj4js.common.adjust_lon(a.x-this.long0);c=Math.sin(b);b=Math.cos(b);e=Math.cos(d);f=this.sin_p14*c+this.cos_p14*b*e;if(0<f||Math.abs(f)<=Proj4js.common.EPSLN)var g=1*this.a*b*Math.sin(d),i=this.y0+1*this.a*(this.cos_p14*c-this.sin_p14*b*e);else Proj4js.reportError("orthoFwdPointError");a.x=g;a.y=i;return a},inverse:function(a){var c,b,d,e;a.x-=this.x0;
115
+ a.y-=this.y0;c=Math.sqrt(a.x*a.x+a.y*a.y);c>this.a+1.0E-7&&Proj4js.reportError("orthoInvDataError");b=Proj4js.common.asinz(c/this.a);d=Math.sin(b);e=Math.cos(b);b=this.long0;Math.abs(c);d=Proj4js.common.asinz(e*this.sin_p14+a.y*d*this.cos_p14/c);c=Math.abs(this.lat0)-Proj4js.common.HALF_PI;Math.abs(c)<=Proj4js.common.EPSLN&&(b=0<=this.lat0?Proj4js.common.adjust_lon(this.long0+Math.atan2(a.x,-a.y)):Proj4js.common.adjust_lon(this.long0-Math.atan2(-a.x,a.y)));Math.sin(d);a.x=b;a.y=d;return a}};
116
+ Proj4js.Proj.krovak={init:function(){this.a=6377397.155;this.es=0.006674372230614;this.e=Math.sqrt(this.es);this.lat0||(this.lat0=0.863937979737193);this.long0||(this.long0=0.4334234309119251);this.k0||(this.k0=0.9999);this.s45=0.785398163397448;this.s90=2*this.s45;this.fi0=this.lat0;this.e2=this.es;this.e=Math.sqrt(this.e2);this.alfa=Math.sqrt(1+this.e2*Math.pow(Math.cos(this.fi0),4)/(1-this.e2));this.uq=1.04216856380474;this.u0=Math.asin(Math.sin(this.fi0)/this.alfa);this.g=Math.pow((1+this.e*Math.sin(this.fi0))/
117
+ (1-this.e*Math.sin(this.fi0)),this.alfa*this.e/2);this.k=Math.tan(this.u0/2+this.s45)/Math.pow(Math.tan(this.fi0/2+this.s45),this.alfa)*this.g;this.k1=this.k0;this.n0=this.a*Math.sqrt(1-this.e2)/(1-this.e2*Math.pow(Math.sin(this.fi0),2));this.s0=1.37008346281555;this.n=Math.sin(this.s0);this.ro0=this.k1*this.n0/Math.tan(this.s0);this.ad=this.s90-this.uq},forward:function(a){var c,b,d;b=a.y;d=Proj4js.common.adjust_lon(a.x-this.long0);c=Math.pow((1+this.e*Math.sin(b))/(1-this.e*Math.sin(b)),this.alfa*
118
+ this.e/2);c=2*(Math.atan(this.k*Math.pow(Math.tan(b/2+this.s45),this.alfa)/c)-this.s45);b=-d*this.alfa;d=Math.asin(Math.cos(this.ad)*Math.sin(c)+Math.sin(this.ad)*Math.cos(c)*Math.cos(b));c=this.n*Math.asin(Math.cos(c)*Math.sin(b)/Math.cos(d));d=this.ro0*Math.pow(Math.tan(this.s0/2+this.s45),this.n)/Math.pow(Math.tan(d/2+this.s45),this.n);a.y=d*Math.cos(c)/1;a.x=d*Math.sin(c)/1;this.czech&&(a.y*=-1,a.x*=-1);return a},inverse:function(a){var c,b,d;c=a.x;a.x=a.y;a.y=c;this.czech&&(a.y*=-1,a.x*=-1);
119
+ c=Math.sqrt(a.x*a.x+a.y*a.y);b=Math.atan2(a.y,a.x)/Math.sin(this.s0);d=2*(Math.atan(Math.pow(this.ro0/c,1/this.n)*Math.tan(this.s0/2+this.s45))-this.s45);c=Math.asin(Math.cos(this.ad)*Math.sin(d)-Math.sin(this.ad)*Math.cos(d)*Math.cos(b));b=Math.asin(Math.cos(d)*Math.sin(b)/Math.cos(c));a.x=this.long0-b/this.alfa;b=c;var e=d=0;do a.y=2*(Math.atan(Math.pow(this.k,-1/this.alfa)*Math.pow(Math.tan(c/2+this.s45),1/this.alfa)*Math.pow((1+this.e*Math.sin(b))/(1-this.e*Math.sin(b)),this.e/2))-this.s45),1.0E-10>
120
+ Math.abs(b-a.y)&&(d=1),b=a.y,e+=1;while(0==d&&15>e);return 15<=e?(Proj4js.reportError("PHI3Z-CONV:Latitude failed to converge after 15 iterations"),null):a}};
121
+ Proj4js.Proj.somerc={init:function(){var a=this.lat0;this.lambda0=this.long0;var c=Math.sin(a),b=this.a,d=1/this.rf,d=2*d-Math.pow(d,2),e=this.e=Math.sqrt(d);this.R=this.k0*b*Math.sqrt(1-d)/(1-d*Math.pow(c,2));this.alpha=Math.sqrt(1+d/(1-d)*Math.pow(Math.cos(a),4));this.b0=Math.asin(c/this.alpha);this.K=Math.log(Math.tan(Math.PI/4+this.b0/2))-this.alpha*Math.log(Math.tan(Math.PI/4+a/2))+this.alpha*e/2*Math.log((1+e*c)/(1-e*c))},forward:function(a){var c=Math.log(Math.tan(Math.PI/4-a.y/2)),b=this.e/
122
+ 2*Math.log((1+this.e*Math.sin(a.y))/(1-this.e*Math.sin(a.y))),b=2*(Math.atan(Math.exp(-this.alpha*(c+b)+this.K))-Math.PI/4),d=this.alpha*(a.x-this.lambda0),c=Math.atan(Math.sin(d)/(Math.sin(this.b0)*Math.tan(b)+Math.cos(this.b0)*Math.cos(d))),b=Math.asin(Math.cos(this.b0)*Math.sin(b)-Math.sin(this.b0)*Math.cos(b)*Math.cos(d));a.y=this.R/2*Math.log((1+Math.sin(b))/(1-Math.sin(b)))+this.y0;a.x=this.R*c+this.x0;return a},inverse:function(a){for(var c=(a.x-this.x0)/this.R,b=2*(Math.atan(Math.exp((a.y-
123
+ this.y0)/this.R))-Math.PI/4),d=Math.asin(Math.cos(this.b0)*Math.sin(b)+Math.sin(this.b0)*Math.cos(b)*Math.cos(c)),c=this.lambda0+Math.atan(Math.sin(c)/(Math.cos(this.b0)*Math.cos(c)-Math.sin(this.b0)*Math.tan(b)))/this.alpha,b=0,e=d,f=-1E3,g=0;1.0E-7<Math.abs(e-f);){if(20<++g){Proj4js.reportError("omercFwdInfinity");return}b=1/this.alpha*(Math.log(Math.tan(Math.PI/4+d/2))-this.K)+this.e*Math.log(Math.tan(Math.PI/4+Math.asin(this.e*Math.sin(e))/2));f=e;e=2*Math.atan(Math.exp(b))-Math.PI/2}a.x=c;a.y=
124
+ e;return a}};
125
+ Proj4js.Proj.stere={ssfn_:function(a,c,b){c*=b;return Math.tan(0.5*(Proj4js.common.HALF_PI+a))*Math.pow((1-c)/(1+c),0.5*b)},TOL:1.0E-8,NITER:8,CONV:1.0E-10,S_POLE:0,N_POLE:1,OBLIQ:2,EQUIT:3,init:function(){this.phits=this.lat_ts?this.lat_ts:Proj4js.common.HALF_PI;var a=Math.abs(this.lat0);this.mode=Math.abs(a)-Proj4js.common.HALF_PI<Proj4js.common.EPSLN?0>this.lat0?this.S_POLE:this.N_POLE:a>Proj4js.common.EPSLN?this.OBLIQ:this.EQUIT;this.phits=Math.abs(this.phits);if(this.es){var c;switch(this.mode){case this.N_POLE:case this.S_POLE:Math.abs(this.phits-Proj4js.common.HALF_PI)<
126
+ Proj4js.common.EPSLN?this.akm1=2*this.k0/Math.sqrt(Math.pow(1+this.e,1+this.e)*Math.pow(1-this.e,1-this.e)):(a=Math.sin(this.phits),this.akm1=Math.cos(this.phits)/Proj4js.common.tsfnz(this.e,this.phits,a),a*=this.e,this.akm1/=Math.sqrt(1-a*a));break;case this.EQUIT:this.akm1=2*this.k0;break;case this.OBLIQ:a=Math.sin(this.lat0),c=2*Math.atan(this.ssfn_(this.lat0,a,this.e))-Proj4js.common.HALF_PI,a*=this.e,this.akm1=2*this.k0*Math.cos(this.lat0)/Math.sqrt(1-a*a),this.sinX1=Math.sin(c),this.cosX1=Math.cos(c)}}else switch(this.mode){case this.OBLIQ:this.sinph0=
127
+ Math.sin(this.lat0),this.cosph0=Math.cos(this.lat0);case this.EQUIT:this.akm1=2*this.k0;break;case this.S_POLE:case this.N_POLE:this.akm1=Math.abs(this.phits-Proj4js.common.HALF_PI)>=Proj4js.common.EPSLN?Math.cos(this.phits)/Math.tan(Proj4js.common.FORTPI-0.5*this.phits):2*this.k0}},forward:function(a){var c=a.x,c=Proj4js.common.adjust_lon(c-this.long0),b=a.y,d,e;if(this.sphere){var f,g,i;f=Math.sin(b);g=Math.cos(b);i=Math.cos(c);c=Math.sin(c);switch(this.mode){case this.EQUIT:e=1+g*i;e<=Proj4js.common.EPSLN&&
128
+ Proj4js.reportError("stere:forward:Equit");e=this.akm1/e;d=e*g*c;e*=f;break;case this.OBLIQ:e=1+this.sinph0*f+this.cosph0*g*i;e<=Proj4js.common.EPSLN&&Proj4js.reportError("stere:forward:Obliq");e=this.akm1/e;d=e*g*c;e*=this.cosph0*f-this.sinph0*g*i;break;case this.N_POLE:i=-i,b=-b;case this.S_POLE:Math.abs(b-Proj4js.common.HALF_PI)<this.TOL&&Proj4js.reportError("stere:forward:S_POLE"),e=this.akm1*Math.tan(Proj4js.common.FORTPI+0.5*b),d=c*e,e*=i}}else{i=Math.cos(c);c=Math.sin(c);f=Math.sin(b);var h;
129
+ if(this.mode==this.OBLIQ||this.mode==this.EQUIT)h=2*Math.atan(this.ssfn_(b,f,this.e)),g=Math.sin(h-Proj4js.common.HALF_PI),h=Math.cos(h);switch(this.mode){case this.OBLIQ:b=this.akm1/(this.cosX1*(1+this.sinX1*g+this.cosX1*h*i));e=b*(this.cosX1*g-this.sinX1*h*i);d=b*h;break;case this.EQUIT:b=2*this.akm1/(1+h*i);e=b*g;d=b*h;break;case this.S_POLE:b=-b,i=-i,f=-f;case this.N_POLE:d=this.akm1*Proj4js.common.tsfnz(this.e,b,f),e=-d*i}d*=c}a.x=d*this.a+this.x0;a.y=e*this.a+this.y0;return a},inverse:function(a){var c=
130
+ (a.x-this.x0)/this.a,b=(a.y-this.y0)/this.a,d,e,f,g=d=0,i,h=f=0;if(this.sphere){g=Math.sqrt(c*c+b*b);h=2*Math.atan(g/this.akm1);f=Math.sin(h);h=Math.cos(h);d=0;switch(this.mode){case this.EQUIT:e=Math.abs(g)<=Proj4js.common.EPSLN?0:Math.asin(b*f/g);if(0!=h||0!=c)d=Math.atan2(c*f,h*g);break;case this.OBLIQ:e=Math.abs(g)<=Proj4js.common.EPSLN?this.phi0:Math.asin(h*this.sinph0+b*f*this.cosph0/g);h-=this.sinph0*Math.sin(e);if(0!=h||0!=c)d=Math.atan2(c*f*this.cosph0,h*g);break;case this.N_POLE:b=-b;case this.S_POLE:e=
131
+ Math.abs(g)<=Proj4js.common.EPSLN?this.phi0:Math.asin(this.mode==this.S_POLE?-h:h),d=0==c&&0==b?0:Math.atan2(c,b)}a.x=Proj4js.common.adjust_lon(d+this.long0);a.y=e}else{i=Math.sqrt(c*c+b*b);switch(this.mode){case this.OBLIQ:case this.EQUIT:d=2*Math.atan2(i*this.cosX1,this.akm1);f=Math.cos(d);e=Math.sin(d);g=0==i?Math.asin(f*this.sinX1):Math.asin(f*this.sinX1+b*e*this.cosX1/i);d=Math.tan(0.5*(Proj4js.common.HALF_PI+g));c*=e;b=i*this.cosX1*f-b*this.sinX1*e;h=Proj4js.common.HALF_PI;f=0.5*this.e;break;
132
+ case this.N_POLE:b=-b;case this.S_POLE:d=-i/this.akm1,g=Proj4js.common.HALF_PI-2*Math.atan(d),h=-Proj4js.common.HALF_PI,f=-0.5*this.e}for(i=this.NITER;i--;g=e)if(e=this.e*Math.sin(g),e=2*Math.atan(d*Math.pow((1+e)/(1-e),f))-h,Math.abs(g-e)<this.CONV)return this.mode==this.S_POLE&&(e=-e),d=0==c&&0==b?0:Math.atan2(c,b),a.x=Proj4js.common.adjust_lon(d+this.long0),a.y=e,a}}};
133
+ Proj4js.Proj.nzmg={iterations:1,init:function(){this.A=[];this.A[1]=0.6399175073;this.A[2]=-0.1358797613;this.A[3]=0.063294409;this.A[4]=-0.02526853;this.A[5]=0.0117879;this.A[6]=-0.0055161;this.A[7]=0.0026906;this.A[8]=-0.001333;this.A[9]=6.7E-4;this.A[10]=-3.4E-4;this.B_re=[];this.B_im=[];this.B_re[1]=0.7557853228;this.B_im[1]=0;this.B_re[2]=0.249204646;this.B_im[2]=0.003371507;this.B_re[3]=-0.001541739;this.B_im[3]=0.04105856;this.B_re[4]=-0.10162907;this.B_im[4]=0.01727609;this.B_re[5]=-0.26623489;
134
+ this.B_im[5]=-0.36249218;this.B_re[6]=-0.6870983;this.B_im[6]=-1.1651967;this.C_re=[];this.C_im=[];this.C_re[1]=1.3231270439;this.C_im[1]=0;this.C_re[2]=-0.577245789;this.C_im[2]=-0.007809598;this.C_re[3]=0.508307513;this.C_im[3]=-0.112208952;this.C_re[4]=-0.15094762;this.C_im[4]=0.18200602;this.C_re[5]=1.01418179;this.C_im[5]=1.64497696;this.C_re[6]=1.9660549;this.C_im[6]=2.5127645;this.D=[];this.D[1]=1.5627014243;this.D[2]=0.5185406398;this.D[3]=-0.03333098;this.D[4]=-0.1052906;this.D[5]=-0.0368594;
135
+ this.D[6]=0.007317;this.D[7]=0.0122;this.D[8]=0.00394;this.D[9]=-0.0013},forward:function(a){for(var c=1.0E-5*((a.y-this.lat0)/Proj4js.common.SEC_TO_RAD),b=a.x-this.long0,d=1,e=0,f=1;10>=f;f++)d*=c,e+=this.A[f]*d;for(var c=e,d=1,g=0,i=0,h=0,f=1;6>=f;f++)e=d*c-g*b,g=g*c+d*b,d=e,i=i+this.B_re[f]*d-this.B_im[f]*g,h=h+this.B_im[f]*d+this.B_re[f]*g;a.x=h*this.a+this.x0;a.y=i*this.a+this.y0;return a},inverse:function(a){for(var c=(a.y-this.y0)/this.a,b=(a.x-this.x0)/this.a,d=1,e=0,f,g=0,i=0,h=1;6>=h;h++)f=
136
+ d*c-e*b,e=e*c+d*b,d=f,g=g+this.C_re[h]*d-this.C_im[h]*e,i=i+this.C_im[h]*d+this.C_re[h]*e;for(d=0;d<this.iterations;d++){var j=g,k=i,l;f=c;e=b;for(h=2;6>=h;h++)l=j*g-k*i,k=k*g+j*i,j=l,f+=(h-1)*(this.B_re[h]*j-this.B_im[h]*k),e+=(h-1)*(this.B_im[h]*j+this.B_re[h]*k);for(var j=1,k=0,m=this.B_re[1],n=this.B_im[1],h=2;6>=h;h++)l=j*g-k*i,k=k*g+j*i,j=l,m+=h*(this.B_re[h]*j-this.B_im[h]*k),n+=h*(this.B_im[h]*j+this.B_re[h]*k);i=m*m+n*n;g=(f*m+e*n)/i;i=(e*m-f*n)/i}c=g;b=1;g=0;for(h=1;9>=h;h++)b*=c,g+=this.D[h]*
137
+ b;h=this.lat0+1E5*g*Proj4js.common.SEC_TO_RAD;a.x=this.long0+i;a.y=h;return a}};Proj4js.Proj.mill={init:function(){},forward:function(a){var c=a.y,b=this.x0+this.a*Proj4js.common.adjust_lon(a.x-this.long0),c=this.y0+1.25*this.a*Math.log(Math.tan(Proj4js.common.PI/4+c/2.5));a.x=b;a.y=c;return a},inverse:function(a){a.x-=this.x0;a.y-=this.y0;var c=Proj4js.common.adjust_lon(this.long0+a.x/this.a),b=2.5*(Math.atan(Math.exp(0.8*a.y/this.a))-Proj4js.common.PI/4);a.x=c;a.y=b;return a}};
138
+ Proj4js.Proj.gnom={init:function(){this.sin_p14=Math.sin(this.lat0);this.cos_p14=Math.cos(this.lat0);this.infinity_dist=1E3*this.a;this.rc=1},forward:function(a){var c,b,d,e,f;b=a.y;d=Proj4js.common.adjust_lon(a.x-this.long0);c=Math.sin(b);b=Math.cos(b);e=Math.cos(d);f=this.sin_p14*c+this.cos_p14*b*e;0<f||Math.abs(f)<=Proj4js.common.EPSLN?(d=this.x0+1*this.a*b*Math.sin(d)/f,c=this.y0+1*this.a*(this.cos_p14*c-this.sin_p14*b*e)/f):(Proj4js.reportError("orthoFwdPointError"),d=this.x0+this.infinity_dist*
139
+ b*Math.sin(d),c=this.y0+this.infinity_dist*(this.cos_p14*c-this.sin_p14*b*e));a.x=d;a.y=c;return a},inverse:function(a){var c,b,d,e;a.x=(a.x-this.x0)/this.a;a.y=(a.y-this.y0)/this.a;a.x/=this.k0;a.y/=this.k0;(c=Math.sqrt(a.x*a.x+a.y*a.y))?(e=Math.atan2(c,this.rc),b=Math.sin(e),d=Math.cos(e),e=Proj4js.common.asinz(d*this.sin_p14+a.y*b*this.cos_p14/c),c=Math.atan2(a.x*b,c*this.cos_p14*d-a.y*this.sin_p14*b),c=Proj4js.common.adjust_lon(this.long0+c)):(e=this.phic0,c=0);a.x=c;a.y=e;return a}};
140
+ Proj4js.Proj.sinu={init:function(){this.sphere?(this.n=1,this.es=this.m=0,this.C_y=Math.sqrt((this.m+1)/this.n),this.C_x=this.C_y/(this.m+1)):this.en=Proj4js.common.pj_enfn(this.es)},forward:function(a){var c,b;c=a.x;b=a.y;c=Proj4js.common.adjust_lon(c-this.long0);if(this.sphere){if(this.m)for(var d=this.n*Math.sin(b),e=Proj4js.common.MAX_ITER;e;--e){var f=(this.m*b+Math.sin(b)-d)/(this.m+Math.cos(b));b-=f;if(Math.abs(f)<Proj4js.common.EPSLN)break}else b=1!=this.n?Math.asin(this.n*Math.sin(b)):b;
141
+ c=this.a*this.C_x*c*(this.m+Math.cos(b));b*=this.a*this.C_y}else d=Math.sin(b),e=Math.cos(b),b=this.a*Proj4js.common.pj_mlfn(b,d,e,this.en),c=this.a*c*e/Math.sqrt(1-this.es*d*d);a.x=c;a.y=b;return a},inverse:function(a){var c,b;a.x-=this.x0;a.y-=this.y0;if(this.sphere)a.y/=this.C_y,c=this.m?Math.asin((this.m*a.y+Math.sin(a.y))/this.n):1!=this.n?Math.asin(Math.sin(a.y)/this.n):a.y,b=a.x/(this.C_x*(this.m+Math.cos(a.y)));else{c=Proj4js.common.pj_inv_mlfn(a.y/this.a,this.es,this.en);var d=Math.abs(c);
142
+ d<Proj4js.common.HALF_PI?(d=Math.sin(c),b=this.long0+a.x*Math.sqrt(1-this.es*d*d)/(this.a*Math.cos(c)),b=Proj4js.common.adjust_lon(b)):d-Proj4js.common.EPSLN<Proj4js.common.HALF_PI&&(b=this.long0)}a.x=b;a.y=c;return a}};
143
+ Proj4js.Proj.vandg={init:function(){this.R=6370997},forward:function(a){var c=a.y,b=Proj4js.common.adjust_lon(a.x-this.long0);Math.abs(c);var d=Proj4js.common.asinz(2*Math.abs(c/Proj4js.common.PI));(Math.abs(b)<=Proj4js.common.EPSLN||Math.abs(Math.abs(c)-Proj4js.common.HALF_PI)<=Proj4js.common.EPSLN)&&Math.tan(0.5*d);var e=0.5*Math.abs(Proj4js.common.PI/b-b/Proj4js.common.PI),f=e*e,g=Math.sin(d),d=Math.cos(d),d=d/(g+d-1),g=d*(2/g-1),g=g*g,f=Proj4js.common.PI*this.R*(e*(d-g)+Math.sqrt(f*(d-g)*(d-g)-
144
+ (g+f)*(d*d-g)))/(g+f);0>b&&(f=-f);b=this.x0+f;f=Math.abs(f/(Proj4js.common.PI*this.R));c=0<=c?this.y0+Proj4js.common.PI*this.R*Math.sqrt(1-f*f-2*e*f):this.y0-Proj4js.common.PI*this.R*Math.sqrt(1-f*f-2*e*f);a.x=b;a.y=c;return a},inverse:function(a){var c,b,d,e,f,g,i,h;a.x-=this.x0;a.y-=this.y0;h=Proj4js.common.PI*this.R;c=a.x/h;d=a.y/h;e=c*c+d*d;f=-Math.abs(d)*(1+e);b=f-2*d*d+c*c;g=-2*f+1+2*d*d+e*e;h=d*d/g+(2*b*b*b/g/g/g-9*f*b/g/g)/27;i=(f-b*b/3/g)/g;f=2*Math.sqrt(-i/3);h=3*h/i/f;1<Math.abs(h)&&(h=
145
+ 0<=h?1:-1);h=Math.acos(h)/3;b=0<=a.y?(-f*Math.cos(h+Proj4js.common.PI/3)-b/3/g)*Proj4js.common.PI:-(-f*Math.cos(h+Proj4js.common.PI/3)-b/3/g)*Proj4js.common.PI;Math.abs(c);c=Proj4js.common.adjust_lon(this.long0+Proj4js.common.PI*(e-1+Math.sqrt(1+2*(c*c-d*d)+e*e))/2/c);a.x=c;a.y=b;return a}};
146
+ Proj4js.Proj.cea={init:function(){},forward:function(a){var c=a.y,b=this.x0+this.a*Proj4js.common.adjust_lon(a.x-this.long0)*Math.cos(this.lat_ts),c=this.y0+this.a*Math.sin(c)/Math.cos(this.lat_ts);a.x=b;a.y=c;return a},inverse:function(a){a.x-=this.x0;a.y-=this.y0;var c=Proj4js.common.adjust_lon(this.long0+a.x/this.a/Math.cos(this.lat_ts)),b=Math.asin(a.y/this.a*Math.cos(this.lat_ts));a.x=c;a.y=b;return a}};
147
+ Proj4js.Proj.eqc={init:function(){this.x0||(this.x0=0);this.y0||(this.y0=0);this.lat0||(this.lat0=0);this.long0||(this.long0=0);this.lat_ts||(this.lat_ts=0);this.title||(this.title="Equidistant Cylindrical (Plate Carre)");this.rc=Math.cos(this.lat_ts)},forward:function(a){var c=a.y,b=Proj4js.common.adjust_lon(a.x-this.long0),c=Proj4js.common.adjust_lat(c-this.lat0);a.x=this.x0+this.a*b*this.rc;a.y=this.y0+this.a*c;return a},inverse:function(a){var c=a.y;a.x=Proj4js.common.adjust_lon(this.long0+(a.x-
148
+ this.x0)/(this.a*this.rc));a.y=Proj4js.common.adjust_lat(this.lat0+(c-this.y0)/this.a);return a}};
149
+ Proj4js.Proj.cass={init:function(){this.sphere||(this.en=Proj4js.common.pj_enfn(this.es),this.m0=Proj4js.common.pj_mlfn(this.lat0,Math.sin(this.lat0),Math.cos(this.lat0),this.en))},C1:0.16666666666666666,C2:0.008333333333333333,C3:0.041666666666666664,C4:0.3333333333333333,C5:0.06666666666666667,forward:function(a){var c,b,d=a.x,e=a.y,d=Proj4js.common.adjust_lon(d-this.long0);this.sphere?(c=Math.asin(Math.cos(e)*Math.sin(d)),b=Math.atan2(Math.tan(e),Math.cos(d))-this.phi0):(this.n=Math.sin(e),this.c=
150
+ Math.cos(e),b=Proj4js.common.pj_mlfn(e,this.n,this.c,this.en),this.n=1/Math.sqrt(1-this.es*this.n*this.n),this.tn=Math.tan(e),this.t=this.tn*this.tn,this.a1=d*this.c,this.c*=this.es*this.c/(1-this.es),this.a2=this.a1*this.a1,c=this.n*this.a1*(1-this.a2*this.t*(this.C1-(8-this.t+8*this.c)*this.a2*this.C2)),b-=this.m0-this.n*this.tn*this.a2*(0.5+(5-this.t+6*this.c)*this.a2*this.C3));a.x=this.a*c+this.x0;a.y=this.a*b+this.y0;return a},inverse:function(a){a.x-=this.x0;a.y-=this.y0;var c=a.x/this.a,b=
151
+ a.y/this.a;if(this.sphere)this.dd=b+this.lat0,b=Math.asin(Math.sin(this.dd)*Math.cos(c)),c=Math.atan2(Math.tan(c),Math.cos(this.dd));else{var d=Proj4js.common.pj_inv_mlfn(this.m0+b,this.es,this.en);this.tn=Math.tan(d);this.t=this.tn*this.tn;this.n=Math.sin(d);this.r=1/(1-this.es*this.n*this.n);this.n=Math.sqrt(this.r);this.r*=(1-this.es)*this.n;this.dd=c/this.n;this.d2=this.dd*this.dd;b=d-this.n*this.tn/this.r*this.d2*(0.5-(1+3*this.t)*this.d2*this.C3);c=this.dd*(1+this.t*this.d2*(-this.C4+(1+3*this.t)*
152
+ this.d2*this.C5))/Math.cos(d)}a.x=Proj4js.common.adjust_lon(this.long0+c);a.y=b;return a}};
153
+ Proj4js.Proj.gauss={init:function(){var a=Math.sin(this.lat0),c=Math.cos(this.lat0),c=c*c;this.rc=Math.sqrt(1-this.es)/(1-this.es*a*a);this.C=Math.sqrt(1+this.es*c*c/(1-this.es));this.phic0=Math.asin(a/this.C);this.ratexp=0.5*this.C*this.e;this.K=Math.tan(0.5*this.phic0+Proj4js.common.FORTPI)/(Math.pow(Math.tan(0.5*this.lat0+Proj4js.common.FORTPI),this.C)*Proj4js.common.srat(this.e*a,this.ratexp))},forward:function(a){var c=a.x,b=a.y;a.y=2*Math.atan(this.K*Math.pow(Math.tan(0.5*b+Proj4js.common.FORTPI),
154
+ this.C)*Proj4js.common.srat(this.e*Math.sin(b),this.ratexp))-Proj4js.common.HALF_PI;a.x=this.C*c;return a},inverse:function(a){for(var c=a.x/this.C,b=a.y,d=Math.pow(Math.tan(0.5*b+Proj4js.common.FORTPI)/this.K,1/this.C),e=Proj4js.common.MAX_ITER;0<e;--e){b=2*Math.atan(d*Proj4js.common.srat(this.e*Math.sin(a.y),-0.5*this.e))-Proj4js.common.HALF_PI;if(1.0E-14>Math.abs(b-a.y))break;a.y=b}if(!e)return Proj4js.reportError("gauss:inverse:convergence failed"),null;a.x=c;a.y=b;return a}};
155
+ Proj4js.Proj.omerc={init:function(){this.mode||(this.mode=0);this.lon1||(this.lon1=0,this.mode=1);this.lon2||(this.lon2=0);this.lat2||(this.lat2=0);var a=1-Math.pow(this.b/this.a,2);Math.sqrt(a);this.sin_p20=Math.sin(this.lat0);this.cos_p20=Math.cos(this.lat0);this.con=1-this.es*this.sin_p20*this.sin_p20;this.com=Math.sqrt(1-a);this.bl=Math.sqrt(1+this.es*Math.pow(this.cos_p20,4)/(1-a));this.al=this.a*this.bl*this.k0*this.com/this.con;Math.abs(this.lat0)<Proj4js.common.EPSLN?this.el=this.d=this.ts=
156
+ 1:(this.ts=Proj4js.common.tsfnz(this.e,this.lat0,this.sin_p20),this.con=Math.sqrt(this.con),this.d=this.bl*this.com/(this.cos_p20*this.con),this.f=0<this.d*this.d-1?0<=this.lat0?this.d+Math.sqrt(this.d*this.d-1):this.d-Math.sqrt(this.d*this.d-1):this.d,this.el=this.f*Math.pow(this.ts,this.bl));0!=this.mode?(this.g=0.5*(this.f-1/this.f),this.gama=Proj4js.common.asinz(Math.sin(this.alpha)/this.d),this.longc-=Proj4js.common.asinz(this.g*Math.tan(this.gama))/this.bl,this.con=Math.abs(this.lat0),this.con>
157
+ Proj4js.common.EPSLN&&Math.abs(this.con-Proj4js.common.HALF_PI)>Proj4js.common.EPSLN?(this.singam=Math.sin(this.gama),this.cosgam=Math.cos(this.gama),this.sinaz=Math.sin(this.alpha),this.cosaz=Math.cos(this.alpha),this.u=0<=this.lat0?this.al/this.bl*Math.atan(Math.sqrt(this.d*this.d-1)/this.cosaz):-(this.al/this.bl)*Math.atan(Math.sqrt(this.d*this.d-1)/this.cosaz)):Proj4js.reportError("omerc:Init:DataError")):(this.sinphi=Math.sin(this.at1),this.ts1=Proj4js.common.tsfnz(this.e,this.lat1,this.sinphi),
158
+ this.sinphi=Math.sin(this.lat2),this.ts2=Proj4js.common.tsfnz(this.e,this.lat2,this.sinphi),this.h=Math.pow(this.ts1,this.bl),this.l=Math.pow(this.ts2,this.bl),this.f=this.el/this.h,this.g=0.5*(this.f-1/this.f),this.j=(this.el*this.el-this.l*this.h)/(this.el*this.el+this.l*this.h),this.p=(this.l-this.h)/(this.l+this.h),this.dlon=this.lon1-this.lon2,this.dlon<-Proj4js.common.PI&&(this.lon2-=2*Proj4js.common.PI),this.dlon>Proj4js.common.PI&&(this.lon2+=2*Proj4js.common.PI),this.dlon=this.lon1-this.lon2,
159
+ this.longc=0.5*(this.lon1+this.lon2)-Math.atan(this.j*Math.tan(0.5*this.bl*this.dlon)/this.p)/this.bl,this.dlon=Proj4js.common.adjust_lon(this.lon1-this.longc),this.gama=Math.atan(Math.sin(this.bl*this.dlon)/this.g),this.alpha=Proj4js.common.asinz(this.d*Math.sin(this.gama)),Math.abs(this.lat1-this.lat2)<=Proj4js.common.EPSLN?Proj4js.reportError("omercInitDataError"):this.con=Math.abs(this.lat1),this.con<=Proj4js.common.EPSLN||Math.abs(this.con-Proj4js.common.HALF_PI)<=Proj4js.common.EPSLN?Proj4js.reportError("omercInitDataError"):
160
+ Math.abs(Math.abs(this.lat0)-Proj4js.common.HALF_PI)<=Proj4js.common.EPSLN&&Proj4js.reportError("omercInitDataError"),this.singam=Math.sin(this.gam),this.cosgam=Math.cos(this.gam),this.sinaz=Math.sin(this.alpha),this.cosaz=Math.cos(this.alpha),this.u=0<=this.lat0?this.al/this.bl*Math.atan(Math.sqrt(this.d*this.d-1)/this.cosaz):-(this.al/this.bl)*Math.atan(Math.sqrt(this.d*this.d-1)/this.cosaz))},forward:function(a){var c,b,d,e,f;d=a.x;b=a.y;c=Math.sin(b);e=Proj4js.common.adjust_lon(d-this.longc);
161
+ d=Math.sin(this.bl*e);Math.abs(Math.abs(b)-Proj4js.common.HALF_PI)>Proj4js.common.EPSLN?(c=Proj4js.common.tsfnz(this.e,b,c),c=this.el/Math.pow(c,this.bl),f=0.5*(c-1/c),c=(f*this.singam-d*this.cosgam)/(0.5*(c+1/c)),b=Math.cos(this.bl*e),1.0E-7>Math.abs(b)?d=this.al*this.bl*e:(d=this.al*Math.atan((f*this.cosgam+d*this.singam)/b)/this.bl,0>b&&(d+=Proj4js.common.PI*this.al/this.bl))):(c=0<=b?this.singam:-this.singam,d=this.al*b/this.bl);Math.abs(Math.abs(c)-1)<=Proj4js.common.EPSLN&&Proj4js.reportError("omercFwdInfinity");
162
+ e=0.5*this.al*Math.log((1-c)/(1+c))/this.bl;d-=this.u;c=this.y0+d*this.cosaz-e*this.sinaz;a.x=this.x0+e*this.cosaz+d*this.sinaz;a.y=c;return a},inverse:function(a){var c,b,d,e;a.x-=this.x0;a.y-=this.y0;c=a.x*this.cosaz-a.y*this.sinaz;d=a.y*this.cosaz+a.x*this.sinaz;d+=this.u;b=Math.exp(-this.bl*c/this.al);c=0.5*(b-1/b);b=0.5*(b+1/b);d=Math.sin(this.bl*d/this.al);e=(d*this.cosgam+c*this.singam)/b;Math.abs(Math.abs(e)-1)<=Proj4js.common.EPSLN?(c=this.longc,e=0<=e?Proj4js.common.HALF_PI:-Proj4js.common.HALF_PI):
163
+ (b=1/this.bl,e=Math.pow(this.el/Math.sqrt((1+e)/(1-e)),b),e=Proj4js.common.phi2z(this.e,e),c=this.longc-Math.atan2(c*this.cosgam-d*this.singam,b)/this.bl,c=Proj4js.common.adjust_lon(c));a.x=c;a.y=e;return a}};
164
+ Proj4js.Proj.lcc={init:function(){this.lat2||(this.lat2=this.lat0);this.k0||(this.k0=1);if(Math.abs(this.lat1+this.lat2)<Proj4js.common.EPSLN)Proj4js.reportError("lcc:init: Equal Latitudes");else{var a=this.b/this.a;this.e=Math.sqrt(1-a*a);var a=Math.sin(this.lat1),c=Math.cos(this.lat1),c=Proj4js.common.msfnz(this.e,a,c),b=Proj4js.common.tsfnz(this.e,this.lat1,a),d=Math.sin(this.lat2),e=Math.cos(this.lat2),e=Proj4js.common.msfnz(this.e,d,e),d=Proj4js.common.tsfnz(this.e,this.lat2,d),f=Proj4js.common.tsfnz(this.e,
165
+ this.lat0,Math.sin(this.lat0));this.ns=Math.abs(this.lat1-this.lat2)>Proj4js.common.EPSLN?Math.log(c/e)/Math.log(b/d):a;this.f0=c/(this.ns*Math.pow(b,this.ns));this.rh=this.a*this.f0*Math.pow(f,this.ns);this.title||(this.title="Lambert Conformal Conic")}},forward:function(a){var c=a.x,b=a.y;if(!(90>=b&&-90<=b&&180>=c&&-180<=c))return Proj4js.reportError("lcc:forward: llInputOutOfRange: "+c+" : "+b),null;var d=Math.abs(Math.abs(b)-Proj4js.common.HALF_PI);if(d>Proj4js.common.EPSLN)b=Proj4js.common.tsfnz(this.e,
166
+ b,Math.sin(b)),b=this.a*this.f0*Math.pow(b,this.ns);else{d=b*this.ns;if(0>=d)return Proj4js.reportError("lcc:forward: No Projection"),null;b=0}c=this.ns*Proj4js.common.adjust_lon(c-this.long0);a.x=this.k0*b*Math.sin(c)+this.x0;a.y=this.k0*(this.rh-b*Math.cos(c))+this.y0;return a},inverse:function(a){var c,b,d,e=(a.x-this.x0)/this.k0,f=this.rh-(a.y-this.y0)/this.k0;0<this.ns?(c=Math.sqrt(e*e+f*f),b=1):(c=-Math.sqrt(e*e+f*f),b=-1);d=0;0!=c&&(d=Math.atan2(b*e,b*f));if(0!=c||0<this.ns){if(b=1/this.ns,
167
+ c=Math.pow(c/(this.a*this.f0),b),c=Proj4js.common.phi2z(this.e,c),-9999==c)return null}else c=-Proj4js.common.HALF_PI;d=Proj4js.common.adjust_lon(d/this.ns+this.long0);a.x=d;a.y=c;return a}};
168
+ Proj4js.Proj.laea={S_POLE:1,N_POLE:2,EQUIT:3,OBLIQ:4,init:function(){var a=Math.abs(this.lat0);this.mode=Math.abs(a-Proj4js.common.HALF_PI)<Proj4js.common.EPSLN?0>this.lat0?this.S_POLE:this.N_POLE:Math.abs(a)<Proj4js.common.EPSLN?this.EQUIT:this.OBLIQ;if(0<this.es)switch(this.qp=Proj4js.common.qsfnz(this.e,1),this.mmf=0.5/(1-this.es),this.apa=this.authset(this.es),this.mode){case this.N_POLE:case this.S_POLE:this.dd=1;break;case this.EQUIT:this.rq=Math.sqrt(0.5*this.qp);this.dd=1/this.rq;this.xmf=
169
+ 1;this.ymf=0.5*this.qp;break;case this.OBLIQ:this.rq=Math.sqrt(0.5*this.qp),a=Math.sin(this.lat0),this.sinb1=Proj4js.common.qsfnz(this.e,a)/this.qp,this.cosb1=Math.sqrt(1-this.sinb1*this.sinb1),this.dd=Math.cos(this.lat0)/(Math.sqrt(1-this.es*a*a)*this.rq*this.cosb1),this.ymf=(this.xmf=this.rq)/this.dd,this.xmf*=this.dd}else this.mode==this.OBLIQ&&(this.sinph0=Math.sin(this.lat0),this.cosph0=Math.cos(this.lat0))},forward:function(a){var c,b,d=a.x,e=a.y,d=Proj4js.common.adjust_lon(d-this.long0);if(this.sphere){var f,
170
+ g,i;i=Math.sin(e);g=Math.cos(e);f=Math.cos(d);switch(this.mode){case this.OBLIQ:case this.EQUIT:b=this.mode==this.EQUIT?1+g*f:1+this.sinph0*i+this.cosph0*g*f;if(b<=Proj4js.common.EPSLN)return Proj4js.reportError("laea:fwd:y less than eps"),null;b=Math.sqrt(2/b);c=b*g*Math.sin(d);b*=this.mode==this.EQUIT?i:this.cosph0*i-this.sinph0*g*f;break;case this.N_POLE:f=-f;case this.S_POLE:if(Math.abs(e+this.phi0)<Proj4js.common.EPSLN)return Proj4js.reportError("laea:fwd:phi < eps"),null;b=Proj4js.common.FORTPI-
171
+ 0.5*e;b=2*(this.mode==this.S_POLE?Math.cos(b):Math.sin(b));c=b*Math.sin(d);b*=f}}else{var h=g=0,j=0;f=Math.cos(d);d=Math.sin(d);i=Math.sin(e);i=Proj4js.common.qsfnz(this.e,i);if(this.mode==this.OBLIQ||this.mode==this.EQUIT)g=i/this.qp,h=Math.sqrt(1-g*g);switch(this.mode){case this.OBLIQ:j=1+this.sinb1*g+this.cosb1*h*f;break;case this.EQUIT:j=1+h*f;break;case this.N_POLE:j=Proj4js.common.HALF_PI+e;i=this.qp-i;break;case this.S_POLE:j=e-Proj4js.common.HALF_PI,i=this.qp+i}if(Math.abs(j)<Proj4js.common.EPSLN)return Proj4js.reportError("laea:fwd:b < eps"),
172
+ null;switch(this.mode){case this.OBLIQ:case this.EQUIT:j=Math.sqrt(2/j);b=this.mode==this.OBLIQ?this.ymf*j*(this.cosb1*g-this.sinb1*h*f):(j=Math.sqrt(2/(1+h*f)))*g*this.ymf;c=this.xmf*j*h*d;break;case this.N_POLE:case this.S_POLE:0<=i?(c=(j=Math.sqrt(i))*d,b=f*(this.mode==this.S_POLE?j:-j)):c=b=0}}a.x=this.a*c+this.x0;a.y=this.a*b+this.y0;return a},inverse:function(a){a.x-=this.x0;a.y-=this.y0;var c=a.x/this.a,b=a.y/this.a,d;if(this.sphere){var e=0,f,g=0;f=Math.sqrt(c*c+b*b);d=0.5*f;if(1<d)return Proj4js.reportError("laea:Inv:DataError"),
173
+ null;d=2*Math.asin(d);if(this.mode==this.OBLIQ||this.mode==this.EQUIT)g=Math.sin(d),e=Math.cos(d);switch(this.mode){case this.EQUIT:d=Math.abs(f)<=Proj4js.common.EPSLN?0:Math.asin(b*g/f);c*=g;b=e*f;break;case this.OBLIQ:d=Math.abs(f)<=Proj4js.common.EPSLN?this.phi0:Math.asin(e*this.sinph0+b*g*this.cosph0/f);c*=g*this.cosph0;b=(e-Math.sin(d)*this.sinph0)*f;break;case this.N_POLE:b=-b;d=Proj4js.common.HALF_PI-d;break;case this.S_POLE:d-=Proj4js.common.HALF_PI}c=0==b&&(this.mode==this.EQUIT||this.mode==
174
+ this.OBLIQ)?0:Math.atan2(c,b)}else{d=0;switch(this.mode){case this.EQUIT:case this.OBLIQ:c/=this.dd;b*=this.dd;g=Math.sqrt(c*c+b*b);if(g<Proj4js.common.EPSLN)return a.x=0,a.y=this.phi0,a;f=2*Math.asin(0.5*g/this.rq);e=Math.cos(f);c*=f=Math.sin(f);this.mode==this.OBLIQ?(d=e*this.sinb1+b*f*this.cosb1/g,b=g*this.cosb1*e-b*this.sinb1*f):(d=b*f/g,b=g*e);break;case this.N_POLE:b=-b;case this.S_POLE:d=c*c+b*b;if(!d)return a.x=0,a.y=this.phi0,a;d=1-d/this.qp;this.mode==this.S_POLE&&(d=-d)}c=Math.atan2(c,
175
+ b);d=this.authlat(Math.asin(d),this.apa)}a.x=Proj4js.common.adjust_lon(this.long0+c);a.y=d;return a},P00:0.3333333333333333,P01:0.17222222222222222,P02:0.10257936507936508,P10:0.06388888888888888,P11:0.0664021164021164,P20:0.016415012942191543,authset:function(a){var c,b=[];b[0]=a*this.P00;c=a*a;b[0]+=c*this.P01;b[1]=c*this.P10;c*=a;b[0]+=c*this.P02;b[1]+=c*this.P11;b[2]=c*this.P20;return b},authlat:function(a,c){var b=a+a;return a+c[0]*Math.sin(b)+c[1]*Math.sin(b+b)+c[2]*Math.sin(b+b+b)}};
176
+ Proj4js.Proj.aeqd={init:function(){this.sin_p12=Math.sin(this.lat0);this.cos_p12=Math.cos(this.lat0)},forward:function(a){var c=a.x,b,d=Math.sin(a.y),e=Math.cos(a.y),c=Proj4js.common.adjust_lon(c-this.long0),f=Math.cos(c),g=this.sin_p12*d+this.cos_p12*e*f;if(Math.abs(Math.abs(g)-1)<Proj4js.common.EPSLN){if(b=1,0>g){Proj4js.reportError("aeqd:Fwd:PointError");return}}else b=Math.acos(g),b/=Math.sin(b);a.x=this.x0+this.a*b*e*Math.sin(c);a.y=this.y0+this.a*b*(this.cos_p12*d-this.sin_p12*e*f);return a},
177
+ inverse:function(a){a.x-=this.x0;a.y-=this.y0;var c=Math.sqrt(a.x*a.x+a.y*a.y);if(c>2*Proj4js.common.HALF_PI*this.a)Proj4js.reportError("aeqdInvDataError");else{var b=c/this.a,d=Math.sin(b),b=Math.cos(b),e=this.long0,f;if(Math.abs(c)<=Proj4js.common.EPSLN)f=this.lat0;else{f=Proj4js.common.asinz(b*this.sin_p12+a.y*d*this.cos_p12/c);var g=Math.abs(this.lat0)-Proj4js.common.HALF_PI;Math.abs(g)<=Proj4js.common.EPSLN?e=0<=this.lat0?Proj4js.common.adjust_lon(this.long0+Math.atan2(a.x,-a.y)):Proj4js.common.adjust_lon(this.long0-
178
+ Math.atan2(-a.x,a.y)):(g=b-this.sin_p12*Math.sin(f),Math.abs(g)<Proj4js.common.EPSLN&&Math.abs(a.x)<Proj4js.common.EPSLN||(Math.atan2(a.x*d*this.cos_p12,g*c),e=Proj4js.common.adjust_lon(this.long0+Math.atan2(a.x*d*this.cos_p12,g*c))))}a.x=e;a.y=f;return a}}};
179
+ Proj4js.Proj.moll={init:function(){},forward:function(a){for(var c=a.y,b=Proj4js.common.adjust_lon(a.x-this.long0),d=c,e=Proj4js.common.PI*Math.sin(c),f=0;;f++){var g=-(d+Math.sin(d)-e)/(1+Math.cos(d)),d=d+g;if(Math.abs(g)<Proj4js.common.EPSLN)break;50<=f&&Proj4js.reportError("moll:Fwd:IterationError")}d/=2;Proj4js.common.PI/2-Math.abs(c)<Proj4js.common.EPSLN&&(b=0);c=0.900316316158*this.a*b*Math.cos(d)+this.x0;d=1.4142135623731*this.a*Math.sin(d)+this.y0;a.x=c;a.y=d;return a},inverse:function(a){var c;
180
+ a.x-=this.x0;c=a.y/(1.4142135623731*this.a);0.999999999999<Math.abs(c)&&(c=0.999999999999);c=Math.asin(c);var b=Proj4js.common.adjust_lon(this.long0+a.x/(0.900316316158*this.a*Math.cos(c)));b<-Proj4js.common.PI&&(b=-Proj4js.common.PI);b>Proj4js.common.PI&&(b=Proj4js.common.PI);c=(2*c+Math.sin(2*c))/Proj4js.common.PI;1<Math.abs(c)&&(c=1);c=Math.asin(c);a.x=b;a.y=c;return a}};
lib/fpdf/font/courier.php ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
1
+ <?php
2
+ for($i=0;$i<=255;$i++)
3
+ $fpdf_charwidths['courier'][chr($i)]=600;
4
+ $fpdf_charwidths['courierB']=$fpdf_charwidths['courier'];
5
+ $fpdf_charwidths['courierI']=$fpdf_charwidths['courier'];
6
+ $fpdf_charwidths['courierBI']=$fpdf_charwidths['courier'];
7
+ ?>
lib/fpdf/font/desktop.ini ADDED
@@ -0,0 +1,4 @@
 
 
 
 
1
+ [ViewState]
2
+ Mode=
3
+ Vid=
4
+ FolderType=NotSpecified
lib/fpdf/font/helvetica.php ADDED
@@ -0,0 +1,15 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ $fpdf_charwidths['helvetica']=array(
3
+ chr(0)=>278,chr(1)=>278,chr(2)=>278,chr(3)=>278,chr(4)=>278,chr(5)=>278,chr(6)=>278,chr(7)=>278,chr(8)=>278,chr(9)=>278,chr(10)=>278,chr(11)=>278,chr(12)=>278,chr(13)=>278,chr(14)=>278,chr(15)=>278,chr(16)=>278,chr(17)=>278,chr(18)=>278,chr(19)=>278,chr(20)=>278,chr(21)=>278,
4
+ chr(22)=>278,chr(23)=>278,chr(24)=>278,chr(25)=>278,chr(26)=>278,chr(27)=>278,chr(28)=>278,chr(29)=>278,chr(30)=>278,chr(31)=>278,' '=>278,'!'=>278,'"'=>355,'#'=>556,'$'=>556,'%'=>889,'&'=>667,'\''=>191,'('=>333,')'=>333,'*'=>389,'+'=>584,
5
+ ','=>278,'-'=>333,'.'=>278,'/'=>278,'0'=>556,'1'=>556,'2'=>556,'3'=>556,'4'=>556,'5'=>556,'6'=>556,'7'=>556,'8'=>556,'9'=>556,':'=>278,';'=>278,'<'=>584,'='=>584,'>'=>584,'?'=>556,'@'=>1015,'A'=>667,
6
+ 'B'=>667,'C'=>722,'D'=>722,'E'=>667,'F'=>611,'G'=>778,'H'=>722,'I'=>278,'J'=>500,'K'=>667,'L'=>556,'M'=>833,'N'=>722,'O'=>778,'P'=>667,'Q'=>778,'R'=>722,'S'=>667,'T'=>611,'U'=>722,'V'=>667,'W'=>944,
7
+ 'X'=>667,'Y'=>667,'Z'=>611,'['=>278,'\\'=>278,']'=>278,'^'=>469,'_'=>556,'`'=>333,'a'=>556,'b'=>556,'c'=>500,'d'=>556,'e'=>556,'f'=>278,'g'=>556,'h'=>556,'i'=>222,'j'=>222,'k'=>500,'l'=>222,'m'=>833,
8
+ 'n'=>556,'o'=>556,'p'=>556,'q'=>556,'r'=>333,'s'=>500,'t'=>278,'u'=>556,'v'=>500,'w'=>722,'x'=>500,'y'=>500,'z'=>500,'{'=>334,'|'=>260,'}'=>334,'~'=>584,chr(127)=>350,chr(128)=>556,chr(129)=>350,chr(130)=>222,chr(131)=>556,
9
+ chr(132)=>333,chr(133)=>1000,chr(134)=>556,chr(135)=>556,chr(136)=>333,chr(137)=>1000,chr(138)=>667,chr(139)=>333,chr(140)=>1000,chr(141)=>350,chr(142)=>611,chr(143)=>350,chr(144)=>350,chr(145)=>222,chr(146)=>222,chr(147)=>333,chr(148)=>333,chr(149)=>350,chr(150)=>556,chr(151)=>1000,chr(152)=>333,chr(153)=>1000,
10
+ chr(154)=>500,chr(155)=>333,chr(156)=>944,chr(157)=>350,chr(158)=>500,chr(159)=>667,chr(160)=>278,chr(161)=>333,chr(162)=>556,chr(163)=>556,chr(164)=>556,chr(165)=>556,chr(166)=>260,chr(167)=>556,chr(168)=>333,chr(169)=>737,chr(170)=>370,chr(171)=>556,chr(172)=>584,chr(173)=>333,chr(174)=>737,chr(175)=>333,
11
+ chr(176)=>400,chr(177)=>584,chr(178)=>333,chr(179)=>333,chr(180)=>333,chr(181)=>556,chr(182)=>537,chr(183)=>278,chr(184)=>333,chr(185)=>333,chr(186)=>365,chr(187)=>556,chr(188)=>834,chr(189)=>834,chr(190)=>834,chr(191)=>611,chr(192)=>667,chr(193)=>667,chr(194)=>667,chr(195)=>667,chr(196)=>667,chr(197)=>667,
12
+ chr(198)=>1000,chr(199)=>722,chr(200)=>667,chr(201)=>667,chr(202)=>667,chr(203)=>667,chr(204)=>278,chr(205)=>278,chr(206)=>278,chr(207)=>278,chr(208)=>722,chr(209)=>722,chr(210)=>778,chr(211)=>778,chr(212)=>778,chr(213)=>778,chr(214)=>778,chr(215)=>584,chr(216)=>778,chr(217)=>722,chr(218)=>722,chr(219)=>722,
13
+ chr(220)=>722,chr(221)=>667,chr(222)=>667,chr(223)=>611,chr(224)=>556,chr(225)=>556,chr(226)=>556,chr(227)=>556,chr(228)=>556,chr(229)=>556,chr(230)=>889,chr(231)=>500,chr(232)=>556,chr(233)=>556,chr(234)=>556,chr(235)=>556,chr(236)=>278,chr(237)=>278,chr(238)=>278,chr(239)=>278,chr(240)=>556,chr(241)=>556,
14
+ chr(242)=>556,chr(243)=>556,chr(244)=>556,chr(245)=>556,chr(246)=>556,chr(247)=>584,chr(248)=>611,chr(249)=>556,chr(250)=>556,chr(251)=>556,chr(252)=>556,chr(253)=>500,chr(254)=>556,chr(255)=>500);
15
+ ?>
lib/fpdf/font/helveticab.php ADDED
@@ -0,0 +1,15 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ $fpdf_charwidths['helveticaB']=array(
3
+ chr(0)=>278,chr(1)=>278,chr(2)=>278,chr(3)=>278,chr(4)=>278,chr(5)=>278,chr(6)=>278,chr(7)=>278,chr(8)=>278,chr(9)=>278,chr(10)=>278,chr(11)=>278,chr(12)=>278,chr(13)=>278,chr(14)=>278,chr(15)=>278,chr(16)=>278,chr(17)=>278,chr(18)=>278,chr(19)=>278,chr(20)=>278,chr(21)=>278,
4
+ chr(22)=>278,chr(23)=>278,chr(24)=>278,chr(25)=>278,chr(26)=>278,chr(27)=>278,chr(28)=>278,chr(29)=>278,chr(30)=>278,chr(31)=>278,' '=>278,'!'=>333,'"'=>474,'#'=>556,'$'=>556,'%'=>889,'&'=>722,'\''=>238,'('=>333,')'=>333,'*'=>389,'+'=>584,
5
+ ','=>278,'-'=>333,'.'=>278,'/'=>278,'0'=>556,'1'=>556,'2'=>556,'3'=>556,'4'=>556,'5'=>556,'6'=>556,'7'=>556,'8'=>556,'9'=>556,':'=>333,';'=>333,'<'=>584,'='=>584,'>'=>584,'?'=>611,'@'=>975,'A'=>722,
6
+ 'B'=>722,'C'=>722,'D'=>722,'E'=>667,'F'=>611,'G'=>778,'H'=>722,'I'=>278,'J'=>556,'K'=>722,'L'=>611,'M'=>833,'N'=>722,'O'=>778,'P'=>667,'Q'=>778,'R'=>722,'S'=>667,'T'=>611,'U'=>722,'V'=>667,'W'=>944,
7
+ 'X'=>667,'Y'=>667,'Z'=>611,'['=>333,'\\'=>278,']'=>333,'^'=>584,'_'=>556,'`'=>333,'a'=>556,'b'=>611,'c'=>556,'d'=>611,'e'=>556,'f'=>333,'g'=>611,'h'=>611,'i'=>278,'j'=>278,'k'=>556,'l'=>278,'m'=>889,
8
+ 'n'=>611,'o'=>611,'p'=>611,'q'=>611,'r'=>389,'s'=>556,'t'=>333,'u'=>611,'v'=>556,'w'=>778,'x'=>556,'y'=>556,'z'=>500,'{'=>389,'|'=>280,'}'=>389,'~'=>584,chr(127)=>350,chr(128)=>556,chr(129)=>350,chr(130)=>278,chr(131)=>556,
9
+ chr(132)=>500,chr(133)=>1000,chr(134)=>556,chr(135)=>556,chr(136)=>333,chr(137)=>1000,chr(138)=>667,chr(139)=>333,chr(140)=>1000,chr(141)=>350,chr(142)=>611,chr(143)=>350,chr(144)=>350,chr(145)=>278,chr(146)=>278,chr(147)=>500,chr(148)=>500,chr(149)=>350,chr(150)=>556,chr(151)=>1000,chr(152)=>333,chr(153)=>1000,
10
+ chr(154)=>556,chr(155)=>333,chr(156)=>944,chr(157)=>350,chr(158)=>500,chr(159)=>667,chr(160)=>278,chr(161)=>333,chr(162)=>556,chr(163)=>556,chr(164)=>556,chr(165)=>556,chr(166)=>280,chr(167)=>556,chr(168)=>333,chr(169)=>737,chr(170)=>370,chr(171)=>556,chr(172)=>584,chr(173)=>333,chr(174)=>737,chr(175)=>333,
11
+ chr(176)=>400,chr(177)=>584,chr(178)=>333,chr(179)=>333,chr(180)=>333,chr(181)=>611,chr(182)=>556,chr(183)=>278,chr(184)=>333,chr(185)=>333,chr(186)=>365,chr(187)=>556,chr(188)=>834,chr(189)=>834,chr(190)=>834,chr(191)=>611,chr(192)=>722,chr(193)=>722,chr(194)=>722,chr(195)=>722,chr(196)=>722,chr(197)=>722,
12
+ chr(198)=>1000,chr(199)=>722,chr(200)=>667,chr(201)=>667,chr(202)=>667,chr(203)=>667,chr(204)=>278,chr(205)=>278,chr(206)=>278,chr(207)=>278,chr(208)=>722,chr(209)=>722,chr(210)=>778,chr(211)=>778,chr(212)=>778,chr(213)=>778,chr(214)=>778,chr(215)=>584,chr(216)=>778,chr(217)=>722,chr(218)=>722,chr(219)=>722,
13
+ chr(220)=>722,chr(221)=>667,chr(222)=>667,chr(223)=>611,chr(224)=>556,chr(225)=>556,chr(226)=>556,chr(227)=>556,chr(228)=>556,chr(229)=>556,chr(230)=>889,chr(231)=>556,chr(232)=>556,chr(233)=>556,chr(234)=>556,chr(235)=>556,chr(236)=>278,chr(237)=>278,chr(238)=>278,chr(239)=>278,chr(240)=>611,chr(241)=>611,
14
+ chr(242)=>611,chr(243)=>611,chr(244)=>611,chr(245)=>611,chr(246)=>611,chr(247)=>584,chr(248)=>611,chr(249)=>611,chr(250)=>611,chr(251)=>611,chr(252)=>611,chr(253)=>556,chr(254)=>611,chr(255)=>556);
15
+ ?>
lib/fpdf/font/helveticabi.php ADDED
@@ -0,0 +1,15 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ $fpdf_charwidths['helveticaBI']=array(
3
+ chr(0)=>278,chr(1)=>278,chr(2)=>278,chr(3)=>278,chr(4)=>278,chr(5)=>278,chr(6)=>278,chr(7)=>278,chr(8)=>278,chr(9)=>278,chr(10)=>278,chr(11)=>278,chr(12)=>278,chr(13)=>278,chr(14)=>278,chr(15)=>278,chr(16)=>278,chr(17)=>278,chr(18)=>278,chr(19)=>278,chr(20)=>278,chr(21)=>278,
4
+ chr(22)=>278,chr(23)=>278,chr(24)=>278,chr(25)=>278,chr(26)=>278,chr(27)=>278,chr(28)=>278,chr(29)=>278,chr(30)=>278,chr(31)=>278,' '=>278,'!'=>333,'"'=>474,'#'=>556,'$'=>556,'%'=>889,'&'=>722,'\''=>238,'('=>333,')'=>333,'*'=>389,'+'=>584,
5
+ ','=>278,'-'=>333,'.'=>278,'/'=>278,'0'=>556,'1'=>556,'2'=>556,'3'=>556,'4'=>556,'5'=>556,'6'=>556,'7'=>556,'8'=>556,'9'=>556,':'=>333,';'=>333,'<'=>584,'='=>584,'>'=>584,'?'=>611,'@'=>975,'A'=>722,
6
+ 'B'=>722,'C'=>722,'D'=>722,'E'=>667,'F'=>611,'G'=>778,'H'=>722,'I'=>278,'J'=>556,'K'=>722,'L'=>611,'M'=>833,'N'=>722,'O'=>778,'P'=>667,'Q'=>778,'R'=>722,'S'=>667,'T'=>611,'U'=>722,'V'=>667,'W'=>944,
7
+ 'X'=>667,'Y'=>667,'Z'=>611,'['=>333,'\\'=>278,']'=>333,'^'=>584,'_'=>556,'`'=>333,'a'=>556,'b'=>611,'c'=>556,'d'=>611,'e'=>556,'f'=>333,'g'=>611,'h'=>611,'i'=>278,'j'=>278,'k'=>556,'l'=>278,'m'=>889,
8
+ 'n'=>611,'o'=>611,'p'=>611,'q'=>611,'r'=>389,'s'=>556,'t'=>333,'u'=>611,'v'=>556,'w'=>778,'x'=>556,'y'=>556,'z'=>500,'{'=>389,'|'=>280,'}'=>389,'~'=>584,chr(127)=>350,chr(128)=>556,chr(129)=>350,chr(130)=>278,chr(131)=>556,
9
+ chr(132)=>500,chr(133)=>1000,chr(134)=>556,chr(135)=>556,chr(136)=>333,chr(137)=>1000,chr(138)=>667,chr(139)=>333,chr(140)=>1000,chr(141)=>350,chr(142)=>611,chr(143)=>350,chr(144)=>350,chr(145)=>278,chr(146)=>278,chr(147)=>500,chr(148)=>500,chr(149)=>350,chr(150)=>556,chr(151)=>1000,chr(152)=>333,chr(153)=>1000,
10
+ chr(154)=>556,chr(155)=>333,chr(156)=>944,chr(157)=>350,chr(158)=>500,chr(159)=>667,chr(160)=>278,chr(161)=>333,chr(162)=>556,chr(163)=>556,chr(164)=>556,chr(165)=>556,chr(166)=>280,chr(167)=>556,chr(168)=>333,chr(169)=>737,chr(170)=>370,chr(171)=>556,chr(172)=>584,chr(173)=>333,chr(174)=>737,chr(175)=>333,
11
+ chr(176)=>400,chr(177)=>584,chr(178)=>333,chr(179)=>333,chr(180)=>333,chr(181)=>611,chr(182)=>556,chr(183)=>278,chr(184)=>333,chr(185)=>333,chr(186)=>365,chr(187)=>556,chr(188)=>834,chr(189)=>834,chr(190)=>834,chr(191)=>611,chr(192)=>722,chr(193)=>722,chr(194)=>722,chr(195)=>722,chr(196)=>722,chr(197)=>722,
12
+ chr(198)=>1000,chr(199)=>722,chr(200)=>667,chr(201)=>667,chr(202)=>667,chr(203)=>667,chr(204)=>278,chr(205)=>278,chr(206)=>278,chr(207)=>278,chr(208)=>722,chr(209)=>722,chr(210)=>778,chr(211)=>778,chr(212)=>778,chr(213)=>778,chr(214)=>778,chr(215)=>584,chr(216)=>778,chr(217)=>722,chr(218)=>722,chr(219)=>722,
13
+ chr(220)=>722,chr(221)=>667,chr(222)=>667,chr(223)=>611,chr(224)=>556,chr(225)=>556,chr(226)=>556,chr(227)=>556,chr(228)=>556,chr(229)=>556,chr(230)=>889,chr(231)=>556,chr(232)=>556,chr(233)=>556,chr(234)=>556,chr(235)=>556,chr(236)=>278,chr(237)=>278,chr(238)=>278,chr(239)=>278,chr(240)=>611,chr(241)=>611,
14
+ chr(242)=>611,chr(243)=>611,chr(244)=>611,chr(245)=>611,chr(246)=>611,chr(247)=>584,chr(248)=>611,chr(249)=>611,chr(250)=>611,chr(251)=>611,chr(252)=>611,chr(253)=>556,chr(254)=>611,chr(255)=>556);
15
+ ?>
lib/fpdf/font/helveticai.php ADDED
@@ -0,0 +1,15 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ $fpdf_charwidths['helveticaI']=array(
3
+ chr(0)=>278,chr(1)=>278,chr(2)=>278,chr(3)=>278,chr(4)=>278,chr(5)=>278,chr(6)=>278,chr(7)=>278,chr(8)=>278,chr(9)=>278,chr(10)=>278,chr(11)=>278,chr(12)=>278,chr(13)=>278,chr(14)=>278,chr(15)=>278,chr(16)=>278,chr(17)=>278,chr(18)=>278,chr(19)=>278,chr(20)=>278,chr(21)=>278,
4
+ chr(22)=>278,chr(23)=>278,chr(24)=>278,chr(25)=>278,chr(26)=>278,chr(27)=>278,chr(28)=>278,chr(29)=>278,chr(30)=>278,chr(31)=>278,' '=>278,'!'=>278,'"'=>355,'#'=>556,'$'=>556,'%'=>889,'&'=>667,'\''=>191,'('=>333,')'=>333,'*'=>389,'+'=>584,
5
+ ','=>278,'-'=>333,'.'=>278,'/'=>278,'0'=>556,'1'=>556,'2'=>556,'3'=>556,'4'=>556,'5'=>556,'6'=>556,'7'=>556,'8'=>556,'9'=>556,':'=>278,';'=>278,'<'=>584,'='=>584,'>'=>584,'?'=>556,'@'=>1015,'A'=>667,
6
+ 'B'=>667,'C'=>722,'D'=>722,'E'=>667,'F'=>611,'G'=>778,'H'=>722,'I'=>278,'J'=>500,'K'=>667,'L'=>556,'M'=>833,'N'=>722,'O'=>778,'P'=>667,'Q'=>778,'R'=>722,'S'=>667,'T'=>611,'U'=>722,'V'=>667,'W'=>944,
7
+ 'X'=>667,'Y'=>667,'Z'=>611,'['=>278,'\\'=>278,']'=>278,'^'=>469,'_'=>556,'`'=>333,'a'=>556,'b'=>556,'c'=>500,'d'=>556,'e'=>556,'f'=>278,'g'=>556,'h'=>556,'i'=>222,'j'=>222,'k'=>500,'l'=>222,'m'=>833,
8
+ 'n'=>556,'o'=>556,'p'=>556,'q'=>556,'r'=>333,'s'=>500,'t'=>278,'u'=>556,'v'=>500,'w'=>722,'x'=>500,'y'=>500,'z'=>500,'{'=>334,'|'=>260,'}'=>334,'~'=>584,chr(127)=>350,chr(128)=>556,chr(129)=>350,chr(130)=>222,chr(131)=>556,
9
+ chr(132)=>333,chr(133)=>1000,chr(134)=>556,chr(135)=>556,chr(136)=>333,chr(137)=>1000,chr(138)=>667,chr(139)=>333,chr(140)=>1000,chr(141)=>350,chr(142)=>611,chr(143)=>350,chr(144)=>350,chr(145)=>222,chr(146)=>222,chr(147)=>333,chr(148)=>333,chr(149)=>350,chr(150)=>556,chr(151)=>1000,chr(152)=>333,chr(153)=>1000,
10
+ chr(154)=>500,chr(155)=>333,chr(156)=>944,chr(157)=>350,chr(158)=>500,chr(159)=>667,chr(160)=>278,chr(161)=>333,chr(162)=>556,chr(163)=>556,chr(164)=>556,chr(165)=>556,chr(166)=>260,chr(167)=>556,chr(168)=>333,chr(169)=>737,chr(170)=>370,chr(171)=>556,chr(172)=>584,chr(173)=>333,chr(174)=>737,chr(175)=>333,
11
+ chr(176)=>400,chr(177)=>584,chr(178)=>333,chr(179)=>333,chr(180)=>333,chr(181)=>556,chr(182)=>537,chr(183)=>278,chr(184)=>333,chr(185)=>333,chr(186)=>365,chr(187)=>556,chr(188)=>834,chr(189)=>834,chr(190)=>834,chr(191)=>611,chr(192)=>667,chr(193)=>667,chr(194)=>667,chr(195)=>667,chr(196)=>667,chr(197)=>667,
12
+ chr(198)=>1000,chr(199)=>722,chr(200)=>667,chr(201)=>667,chr(202)=>667,chr(203)=>667,chr(204)=>278,chr(205)=>278,chr(206)=>278,chr(207)=>278,chr(208)=>722,chr(209)=>722,chr(210)=>778,chr(211)=>778,chr(212)=>778,chr(213)=>778,chr(214)=>778,chr(215)=>584,chr(216)=>778,chr(217)=>722,chr(218)=>722,chr(219)=>722,
13
+ chr(220)=>722,chr(221)=>667,chr(222)=>667,chr(223)=>611,chr(224)=>556,chr(225)=>556,chr(226)=>556,chr(227)=>556,chr(228)=>556,chr(229)=>556,chr(230)=>889,chr(231)=>500,chr(232)=>556,chr(233)=>556,chr(234)=>556,chr(235)=>556,chr(236)=>278,chr(237)=>278,chr(238)=>278,chr(239)=>278,chr(240)=>556,chr(241)=>556,
14
+ chr(242)=>556,chr(243)=>556,chr(244)=>556,chr(245)=>556,chr(246)=>556,chr(247)=>584,chr(248)=>611,chr(249)=>556,chr(250)=>556,chr(251)=>556,chr(252)=>556,chr(253)=>500,chr(254)=>556,chr(255)=>500);
15
+ ?>
lib/fpdf/font/makefont/cp1250.map ADDED
@@ -0,0 +1,251 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ !00 U+0000 .notdef
2
+ !01 U+0001 .notdef
3
+ !02 U+0002 .notdef
4
+ !03 U+0003 .notdef
5
+ !04 U+0004 .notdef
6
+ !05 U+0005 .notdef
7
+ !06 U+0006 .notdef
8
+ !07 U+0007 .notdef
9
+ !08 U+0008 .notdef
10
+ !09 U+0009 .notdef
11
+ !0A U+000A .notdef
12
+ !0B U+000B .notdef
13
+ !0C U+000C .notdef
14
+ !0D U+000D .notdef
15
+ !0E U+000E .notdef
16
+ !0F U+000F .notdef
17
+ !10 U+0010 .notdef
18
+ !11 U+0011 .notdef
19
+ !12 U+0012 .notdef
20
+ !13 U+0013 .notdef
21
+ !14 U+0014 .notdef
22
+ !15 U+0015 .notdef
23
+ !16 U+0016 .notdef
24
+ !17 U+0017 .notdef
25
+ !18 U+0018 .notdef
26
+ !19 U+0019 .notdef
27
+ !1A U+001A .notdef
28
+ !1B U+001B .notdef
29
+ !1C U+001C .notdef
30
+ !1D U+001D .notdef
31
+ !1E U+001E .notdef
32
+ !1F U+001F .notdef
33
+ !20 U+0020 space
34
+ !21 U+0021 exclam
35
+ !22 U+0022 quotedbl
36
+ !23 U+0023 numbersign
37
+ !24 U+0024 dollar
38
+ !25 U+0025 percent
39
+ !26 U+0026 ampersand
40
+ !27 U+0027 quotesingle
41
+ !28 U+0028 parenleft
42
+ !29 U+0029 parenright
43
+ !2A U+002A asterisk
44
+ !2B U+002B plus
45
+ !2C U+002C comma
46
+ !2D U+002D hyphen
47
+ !2E U+002E period
48
+ !2F U+002F slash
49
+ !30 U+0030 zero
50
+ !31 U+0031 one
51
+ !32 U+0032 two
52
+ !33 U+0033 three
53
+ !34 U+0034 four
54
+ !35 U+0035 five
55
+ !36 U+0036 six
56
+ !37 U+0037 seven
57
+ !38 U+0038 eight
58
+ !39 U+0039 nine
59
+ !3A U+003A colon
60
+ !3B U+003B semicolon
61
+ !3C U+003C less
62
+ !3D U+003D equal
63
+ !3E U+003E greater
64
+ !3F U+003F question
65
+ !40 U+0040 at
66
+ !41 U+0041 A
67
+ !42 U+0042 B
68
+ !43 U+0043 C
69
+ !44 U+0044 D
70
+ !45 U+0045 E
71
+ !46 U+0046 F
72
+ !47 U+0047 G
73
+ !48 U+0048 H
74
+ !49 U+0049 I
75
+ !4A U+004A J
76
+ !4B U+004B K
77
+ !4C U+004C L
78
+ !4D U+004D M
79
+ !4E U+004E N
80
+ !4F U+004F O
81
+ !50 U+0050 P
82
+ !51 U+0051 Q
83
+ !52 U+0052 R
84
+ !53 U+0053 S
85
+ !54 U+0054 T
86
+ !55 U+0055 U
87
+ !56 U+0056 V
88
+ !57 U+0057 W
89
+ !58 U+0058 X
90
+ !59 U+0059 Y
91
+ !5A U+005A Z
92
+ !5B U+005B bracketleft
93
+ !5C U+005C backslash
94
+ !5D U+005D bracketright
95
+ !5E U+005E asciicircum
96
+ !5F U+005F underscore
97
+ !60 U+0060 grave
98
+ !61 U+0061 a
99
+ !62 U+0062 b
100
+ !63 U+0063 c
101
+ !64 U+0064 d
102
+ !65 U+0065 e
103
+ !66 U+0066 f
104
+ !67 U+0067 g
105
+ !68 U+0068 h
106
+ !69 U+0069 i
107
+ !6A U+006A j
108
+ !6B U+006B k
109
+ !6C U+006C l
110
+ !6D U+006D m
111
+ !6E U+006E n
112
+ !6F U+006F o
113
+ !70 U+0070 p
114
+ !71 U+0071 q
115
+ !72 U+0072 r
116
+ !73 U+0073 s
117
+ !74 U+0074 t
118
+ !75 U+0075 u
119
+ !76 U+0076 v
120
+ !77 U+0077 w
121
+ !78 U+0078 x
122
+ !79 U+0079 y
123
+ !7A U+007A z
124
+ !7B U+007B braceleft
125
+ !7C U+007C bar
126
+ !7D U+007D braceright
127
+ !7E U+007E asciitilde
128
+ !7F U+007F .notdef
129
+ !80 U+20AC Euro
130
+ !82 U+201A quotesinglbase
131
+ !84 U+201E quotedblbase
132
+ !85 U+2026 ellipsis
133
+ !86 U+2020 dagger
134
+ !87 U+2021 daggerdbl
135
+ !89 U+2030 perthousand
136
+ !8A U+0160 Scaron
137
+ !8B U+2039 guilsinglleft
138
+ !8C U+015A Sacute
139
+ !8D U+0164 Tcaron
140
+ !8E U+017D Zcaron
141
+ !8F U+0179 Zacute
142
+ !91 U+2018 quoteleft
143
+ !92 U+2019 quoteright
144
+ !93 U+201C quotedblleft
145
+ !94 U+201D quotedblright
146
+ !95 U+2022 bullet
147
+ !96 U+2013 endash
148
+ !97 U+2014 emdash
149
+ !99 U+2122 trademark
150
+ !9A U+0161 scaron
151
+ !9B U+203A guilsinglright
152
+ !9C U+015B sacute
153
+ !9D U+0165 tcaron
154
+ !9E U+017E zcaron
155
+ !9F U+017A zacute
156
+ !A0 U+00A0 space
157
+ !A1 U+02C7 caron
158
+ !A2 U+02D8 breve
159
+ !A3 U+0141 Lslash
160
+ !A4 U+00A4 currency
161
+ !A5 U+0104 Aogonek
162
+ !A6 U+00A6 brokenbar
163
+ !A7 U+00A7 section
164
+ !A8 U+00A8 dieresis
165
+ !A9 U+00A9 copyright
166
+ !AA U+015E Scedilla
167
+ !AB U+00AB guillemotleft
168
+ !AC U+00AC logicalnot
169
+ !AD U+00AD hyphen
170
+ !AE U+00AE registered
171
+ !AF U+017B Zdotaccent
172
+ !B0 U+00B0 degree
173
+ !B1 U+00B1 plusminus
174
+ !B2 U+02DB ogonek
175
+ !B3 U+0142 lslash
176
+ !B4 U+00B4 acute
177
+ !B5 U+00B5 mu
178
+ !B6 U+00B6 paragraph
179
+ !B7 U+00B7 periodcentered
180
+ !B8 U+00B8 cedilla
181
+ !B9 U+0105 aogonek
182
+ !BA U+015F scedilla
183
+ !BB U+00BB guillemotright
184
+ !BC U+013D Lcaron
185
+ !BD U+02DD hungarumlaut
186
+ !BE U+013E lcaron
187
+ !BF U+017C zdotaccent
188
+ !C0 U+0154 Racute
189
+ !C1 U+00C1 Aacute
190
+ !C2 U+00C2 Acircumflex
191
+ !C3 U+0102 Abreve
192
+ !C4 U+00C4 Adieresis
193
+ !C5 U+0139 Lacute
194
+ !C6 U+0106 Cacute
195
+ !C7 U+00C7 Ccedilla
196
+ !C8 U+010C Ccaron
197
+ !C9 U+00C9 Eacute
198
+ !CA U+0118 Eogonek
199
+ !CB U+00CB Edieresis
200
+ !CC U+011A Ecaron
201
+ !CD U+00CD Iacute
202
+ !CE U+00CE Icircumflex
203
+ !CF U+010E Dcaron
204
+ !D0 U+0110 Dcroat
205
+ !D1 U+0143 Nacute
206
+ !D2 U+0147 Ncaron
207
+ !D3 U+00D3 Oacute
208
+ !D4 U+00D4 Ocircumflex
209
+ !D5 U+0150 Ohungarumlaut
210
+ !D6 U+00D6 Odieresis
211
+ !D7 U+00D7 multiply
212
+ !D8 U+0158 Rcaron
213
+ !D9 U+016E Uring
214
+ !DA U+00DA Uacute
215
+ !DB U+0170 Uhungarumlaut
216
+ !DC U+00DC Udieresis
217
+ !DD U+00DD Yacute
218
+ !DE U+0162 Tcommaaccent
219
+ !DF U+00DF germandbls
220
+ !E0 U+0155 racute
221
+ !E1 U+00E1 aacute
222
+ !E2 U+00E2 acircumflex
223
+ !E3 U+0103 abreve
224
+ !E4 U+00E4 adieresis
225
+ !E5 U+013A lacute
226
+ !E6 U+0107 cacute
227
+ !E7 U+00E7 ccedilla
228
+ !E8 U+010D ccaron
229
+ !E9 U+00E9 eacute
230
+ !EA U+0119 eogonek
231
+ !EB U+00EB edieresis
232
+ !EC U+011B ecaron
233
+ !ED U+00ED iacute
234
+ !EE U+00EE icircumflex
235
+ !EF U+010F dcaron
236
+ !F0 U+0111 dcroat
237
+ !F1 U+0144 nacute
238
+ !F2 U+0148 ncaron
239
+ !F3 U+00F3 oacute
240
+ !F4 U+00F4 ocircumflex
241
+ !F5 U+0151 ohungarumlaut
242
+ !F6 U+00F6 odieresis
243
+ !F7 U+00F7 divide
244
+ !F8 U+0159 rcaron
245
+ !F9 U+016F uring
246
+ !FA U+00FA uacute
247
+ !FB U+0171 uhungarumlaut
248
+ !FC U+00FC udieresis
249
+ !FD U+00FD yacute
250
+ !FE U+0163 tcommaaccent
251
+ !FF U+02D9 dotaccent
lib/fpdf/font/makefont/cp1251.map ADDED
@@ -0,0 +1,255 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ !00 U+0000 .notdef
2
+ !01 U+0001 .notdef
3
+ !02 U+0002 .notdef
4
+ !03 U+0003 .notdef
5
+ !04 U+0004 .notdef
6
+ !05 U+0005 .notdef
7
+ !06 U+0006 .notdef
8
+ !07 U+0007 .notdef
9
+ !08 U+0008 .notdef
10
+ !09 U+0009 .notdef
11
+ !0A U+000A .notdef
12
+ !0B U+000B .notdef
13
+ !0C U+000C .notdef
14
+ !0D U+000D .notdef
15
+ !0E U+000E .notdef
16
+ !0F U+000F .notdef
17
+ !10 U+0010 .notdef
18
+ !11 U+0011 .notdef
19
+ !12 U+0012 .notdef
20
+ !13 U+0013 .notdef
21
+ !14 U+0014 .notdef
22
+ !15 U+0015 .notdef
23
+ !16 U+0016 .notdef
24
+ !17 U+0017 .notdef
25
+ !18 U+0018 .notdef
26
+ !19 U+0019 .notdef
27
+ !1A U+001A .notdef
28
+ !1B U+001B .notdef
29
+ !1C U+001C .notdef
30
+ !1D U+001D .notdef
31
+ !1E U+001E .notdef
32
+ !1F U+001F .notdef
33
+ !20 U+0020 space
34
+ !21 U+0021 exclam
35
+ !22 U+0022 quotedbl
36
+ !23 U+0023 numbersign
37
+ !24 U+0024 dollar
38
+ !25 U+0025 percent
39
+ !26 U+0026 ampersand
40
+ !27 U+0027 quotesingle
41
+ !28 U+0028 parenleft
42
+ !29 U+0029 parenright
43
+ !2A U+002A asterisk
44
+ !2B U+002B plus
45
+ !2C U+002C comma
46
+ !2D U+002D hyphen
47
+ !2E U+002E period
48
+ !2F U+002F slash
49
+ !30 U+0030 zero
50
+ !31 U+0031 one
51
+ !32 U+0032 two
52
+ !33 U+0033 three
53
+ !34 U+0034 four
54
+ !35 U+0035 five
55
+ !36 U+0036 six
56
+ !37 U+0037 seven
57
+ !38 U+0038 eight
58
+ !39 U+0039 nine
59
+ !3A U+003A colon
60
+ !3B U+003B semicolon
61
+ !3C U+003C less
62
+ !3D U+003D equal
63
+ !3E U+003E greater
64
+ !3F U+003F question
65
+ !40 U+0040 at
66
+ !41 U+0041 A
67
+ !42 U+0042 B
68
+ !43 U+0043 C
69
+ !44 U+0044 D
70
+ !45 U+0045 E
71
+ !46 U+0046 F
72
+ !47 U+0047 G
73
+ !48 U+0048 H
74
+ !49 U+0049 I
75
+ !4A U+004A J
76
+ !4B U+004B K
77
+ !4C U+004C L
78
+ !4D U+004D M
79
+ !4E U+004E N
80
+ !4F U+004F O
81
+ !50 U+0050 P
82
+ !51 U+0051 Q
83
+ !52 U+0052 R
84
+ !53 U+0053 S
85
+ !54 U+0054 T
86
+ !55 U+0055 U
87
+ !56 U+0056 V
88
+ !57 U+0057 W
89
+ !58 U+0058 X
90
+ !59 U+0059 Y
91
+ !5A U+005A Z
92
+ !5B U+005B bracketleft
93
+ !5C U+005C backslash
94
+ !5D U+005D bracketright
95
+ !5E U+005E asciicircum
96
+ !5F U+005F underscore
97
+ !60 U+0060 grave
98
+ !61 U+0061 a
99
+ !62 U+0062 b
100
+ !63 U+0063 c
101
+ !64 U+0064 d
102
+ !65 U+0065 e
103
+ !66 U+0066 f
104
+ !67 U+0067 g
105
+ !68 U+0068 h
106
+ !69 U+0069 i
107
+ !6A U+006A j
108
+ !6B U+006B k
109
+ !6C U+006C l
110
+ !6D U+006D m
111
+ !6E U+006E n
112
+ !6F U+006F o
113
+ !70 U+0070 p
114
+ !71 U+0071 q
115
+ !72 U+0072 r
116
+ !73 U+0073 s
117
+ !74 U+0074 t
118
+ !75 U+0075 u
119
+ !76 U+0076 v
120
+ !77 U+0077 w
121
+ !78 U+0078 x
122
+ !79 U+0079 y
123
+ !7A U+007A z
124
+ !7B U+007B braceleft
125
+ !7C U+007C bar
126
+ !7D U+007D braceright
127
+ !7E U+007E asciitilde
128
+ !7F U+007F .notdef
129
+ !80 U+0402 afii10051
130
+ !81 U+0403 afii10052
131
+ !82 U+201A quotesinglbase
132
+ !83 U+0453 afii10100
133
+ !84 U+201E quotedblbase
134
+ !85 U+2026 ellipsis
135
+ !86 U+2020 dagger
136
+ !87 U+2021 daggerdbl
137
+ !88 U+20AC Euro
138
+ !89 U+2030 perthousand
139
+ !8A U+0409 afii10058
140
+ !8B U+2039 guilsinglleft
141
+ !8C U+040A afii10059
142
+ !8D U+040C afii10061
143
+ !8E U+040B afii10060
144
+ !8F U+040F afii10145
145
+ !90 U+0452 afii10099
146
+ !91 U+2018 quoteleft
147
+ !92 U+2019 quoteright
148
+ !93 U+201C quotedblleft
149
+ !94 U+201D quotedblright
150
+ !95 U+2022 bullet
151
+ !96 U+2013 endash
152
+ !97 U+2014 emdash
153
+ !99 U+2122 trademark
154
+ !9A U+0459 afii10106
155
+ !9B U+203A guilsinglright
156
+ !9C U+045A afii10107
157
+ !9D U+045C afii10109
158
+ !9E U+045B afii10108
159
+ !9F U+045F afii10193
160
+ !A0 U+00A0 space
161
+ !A1 U+040E afii10062
162
+ !A2 U+045E afii10110
163
+ !A3 U+0408 afii10057
164
+ !A4 U+00A4 currency
165
+ !A5 U+0490 afii10050
166
+ !A6 U+00A6 brokenbar
167
+ !A7 U+00A7 section
168
+ !A8 U+0401 afii10023
169
+ !A9 U+00A9 copyright
170
+ !AA U+0404 afii10053
171
+ !AB U+00AB guillemotleft
172
+ !AC U+00AC logicalnot
173
+ !AD U+00AD hyphen
174
+ !AE U+00AE registered
175
+ !AF U+0407 afii10056
176
+ !B0 U+00B0 degree
177
+ !B1 U+00B1 plusminus
178
+ !B2 U+0406 afii10055
179
+ !B3 U+0456 afii10103
180
+ !B4 U+0491 afii10098
181
+ !B5 U+00B5 mu
182
+ !B6 U+00B6 paragraph
183
+ !B7 U+00B7 periodcentered
184
+ !B8 U+0451 afii10071
185
+ !B9 U+2116 afii61352
186
+ !BA U+0454 afii10101
187
+ !BB U+00BB guillemotright
188
+ !BC U+0458 afii10105
189
+ !BD U+0405 afii10054
190
+ !BE U+0455 afii10102
191
+ !BF U+0457 afii10104
192
+ !C0 U+0410 afii10017
193
+ !C1 U+0411 afii10018
194
+ !C2 U+0412 afii10019
195
+ !C3 U+0413 afii10020
196
+ !C4 U+0414 afii10021
197
+ !C5 U+0415 afii10022
198
+ !C6 U+0416 afii10024
199
+ !C7 U+0417 afii10025
200
+ !C8 U+0418 afii10026
201
+ !C9 U+0419 afii10027
202
+ !CA U+041A afii10028
203
+ !CB U+041B afii10029
204
+ !CC U+041C afii10030
205
+ !CD U+041D afii10031
206
+ !CE U+041E afii10032
207
+ !CF U+041F afii10033
208
+ !D0 U+0420 afii10034
209
+ !D1 U+0421 afii10035
210
+ !D2 U+0422 afii10036
211
+ !D3 U+0423 afii10037
212
+ !D4 U+0424 afii10038
213
+ !D5 U+0425 afii10039
214
+ !D6 U+0426 afii10040
215
+ !D7 U+0427 afii10041
216
+ !D8 U+0428 afii10042
217
+ !D9 U+0429 afii10043
218
+ !DA U+042A afii10044
219
+ !DB U+042B afii10045
220
+ !DC U+042C afii10046
221
+ !DD U+042D afii10047
222
+ !DE U+042E afii10048
223
+ !DF U+042F afii10049
224
+ !E0 U+0430 afii10065
225
+ !E1 U+0431 afii10066
226
+ !E2 U+0432 afii10067
227
+ !E3 U+0433 afii10068
228
+ !E4 U+0434 afii10069
229
+ !E5 U+0435 afii10070
230
+ !E6 U+0436 afii10072
231
+ !E7 U+0437 afii10073
232
+ !E8 U+0438 afii10074
233
+ !E9 U+0439 afii10075
234
+ !EA U+043A afii10076
235
+ !EB U+043B afii10077
236
+ !EC U+043C afii10078
237
+ !ED U+043D afii10079
238
+ !EE U+043E afii10080
239
+ !EF U+043F afii10081
240
+ !F0 U+0440 afii10082
241
+ !F1 U+0441 afii10083
242
+ !F2 U+0442 afii10084
243
+ !F3 U+0443 afii10085
244
+ !F4 U+0444 afii10086
245
+ !F5 U+0445 afii10087
246
+ !F6 U+0446 afii10088
247
+ !F7 U+0447 afii10089
248
+ !F8 U+0448 afii10090
249
+ !F9 U+0449 afii10091
250
+ !FA U+044A afii10092
251
+ !FB U+044B afii10093
252
+ !FC U+044C afii10094
253
+ !FD U+044D afii10095
254
+ !FE U+044E afii10096
255
+ !FF U+044F afii10097
lib/fpdf/font/makefont/cp1252.map ADDED
@@ -0,0 +1,251 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ !00 U+0000 .notdef
2
+ !01 U+0001 .notdef
3
+ !02 U+0002 .notdef
4
+ !03 U+0003 .notdef
5
+ !04 U+0004 .notdef
6
+ !05 U+0005 .notdef
7
+ !06 U+0006 .notdef
8
+ !07 U+0007 .notdef
9
+ !08 U+0008 .notdef
10
+ !09 U+0009 .notdef
11
+ !0A U+000A .notdef
12
+ !0B U+000B .notdef
13
+ !0C U+000C .notdef
14
+ !0D U+000D .notdef
15
+ !0E U+000E .notdef
16
+ !0F U+000F .notdef
17
+ !10 U+0010 .notdef
18
+ !11 U+0011 .notdef
19
+ !12 U+0012 .notdef
20
+ !13 U+0013 .notdef
21
+ !14 U+0014 .notdef
22
+ !15 U+0015 .notdef
23
+ !16 U+0016 .notdef
24
+ !17 U+0017 .notdef
25
+ !18 U+0018 .notdef
26
+ !19 U+0019 .notdef
27
+ !1A U+001A .notdef
28
+ !1B U+001B .notdef
29
+ !1C U+001C .notdef
30
+ !1D U+001D .notdef
31
+ !1E U+001E .notdef
32
+ !1F U+001F .notdef
33
+ !20 U+0020 space
34
+ !21 U+0021 exclam
35
+ !22 U+0022 quotedbl
36
+ !23 U+0023 numbersign
37
+ !24 U+0024 dollar
38
+ !25 U+0025 percent
39
+ !26 U+0026 ampersand
40
+ !27 U+0027 quotesingle
41
+ !28 U+0028 parenleft
42
+ !29 U+0029 parenright
43
+ !2A U+002A asterisk
44
+ !2B U+002B plus
45
+ !2C U+002C comma
46
+ !2D U+002D hyphen
47
+ !2E U+002E period
48
+ !2F U+002F slash
49
+ !30 U+0030 zero
50
+ !31 U+0031 one
51
+ !32 U+0032 two
52
+ !33 U+0033 three
53
+ !34 U+0034 four
54
+ !35 U+0035 five
55
+ !36 U+0036 six
56
+ !37 U+0037 seven
57
+ !38 U+0038 eight
58
+ !39 U+0039 nine
59
+ !3A U+003A colon
60
+ !3B U+003B semicolon
61
+ !3C U+003C less
62
+ !3D U+003D equal
63
+ !3E U+003E greater
64
+ !3F U+003F question
65
+ !40 U+0040 at
66
+ !41 U+0041 A
67
+ !42 U+0042 B
68
+ !43 U+0043 C
69
+ !44 U+0044 D
70
+ !45 U+0045 E
71
+ !46 U+0046 F
72
+ !47 U+0047 G
73
+ !48 U+0048 H
74
+ !49 U+0049 I
75
+ !4A U+004A J
76
+ !4B U+004B K
77
+ !4C U+004C L
78
+ !4D U+004D M
79
+ !4E U+004E N
80
+ !4F U+004F O
81
+ !50 U+0050 P
82
+ !51 U+0051 Q
83
+ !52 U+0052 R
84
+ !53 U+0053 S
85
+ !54 U+0054 T
86
+ !55 U+0055 U
87
+ !56 U+0056 V
88
+ !57 U+0057 W
89
+ !58 U+0058 X
90
+ !59 U+0059 Y
91
+ !5A U+005A Z
92
+ !5B U+005B bracketleft
93
+ !5C U+005C backslash
94
+ !5D U+005D bracketright
95
+ !5E U+005E asciicircum
96
+ !5F U+005F underscore
97
+ !60 U+0060 grave
98
+ !61 U+0061 a
99
+ !62 U+0062 b
100
+ !63 U+0063 c
101
+ !64 U+0064 d
102
+ !65 U+0065 e
103
+ !66 U+0066 f
104
+ !67 U+0067 g
105
+ !68 U+0068 h
106
+ !69 U+0069 i
107
+ !6A U+006A j
108
+ !6B U+006B k
109
+ !6C U+006C l
110
+ !6D U+006D m
111
+ !6E U+006E n
112
+ !6F U+006F o
113
+ !70 U+0070 p
114
+ !71 U+0071 q
115
+ !72 U+0072 r
116
+ !73 U+0073 s
117
+ !74 U+0074 t
118
+ !75 U+0075 u
119
+ !76 U+0076 v
120
+ !77 U+0077 w
121
+ !78 U+0078 x
122
+ !79 U+0079 y
123
+ !7A U+007A z
124
+ !7B U+007B braceleft
125
+ !7C U+007C bar
126
+ !7D U+007D braceright
127
+ !7E U+007E asciitilde
128
+ !7F U+007F .notdef
129
+ !80 U+20AC Euro
130
+ !82 U+201A quotesinglbase
131
+ !83 U+0192 florin
132
+ !84 U+201E quotedblbase
133
+ !85 U+2026 ellipsis
134
+ !86 U+2020 dagger
135
+ !87 U+2021 daggerdbl
136
+ !88 U+02C6 circumflex
137
+ !89 U+2030 perthousand
138
+ !8A U+0160 Scaron
139
+ !8B U+2039 guilsinglleft
140
+ !8C U+0152 OE
141
+ !8E U+017D Zcaron
142
+ !91 U+2018 quoteleft
143
+ !92 U+2019 quoteright
144
+ !93 U+201C quotedblleft
145
+ !94 U+201D quotedblright
146
+ !95 U+2022 bullet
147
+ !96 U+2013 endash
148
+ !97 U+2014 emdash
149
+ !98 U+02DC tilde
150
+ !99 U+2122 trademark
151
+ !9A U+0161 scaron
152
+ !9B U+203A guilsinglright
153
+ !9C U+0153 oe
154
+ !9E U+017E zcaron
155
+ !9F U+0178 Ydieresis
156
+ !A0 U+00A0 space
157
+ !A1 U+00A1 exclamdown
158
+ !A2 U+00A2 cent
159
+ !A3 U+00A3 sterling
160
+ !A4 U+00A4 currency
161
+ !A5 U+00A5 yen
162
+ !A6 U+00A6 brokenbar
163
+ !A7 U+00A7 section
164
+ !A8 U+00A8 dieresis
165
+ !A9 U+00A9 copyright
166
+ !AA U+00AA ordfeminine
167
+ !AB U+00AB guillemotleft
168
+ !AC U+00AC logicalnot
169
+ !AD U+00AD hyphen
170
+ !AE U+00AE registered
171
+ !AF U+00AF macron
172
+ !B0 U+00B0 degree
173
+ !B1 U+00B1 plusminus
174
+ !B2 U+00B2 twosuperior
175
+ !B3 U+00B3 threesuperior
176
+ !B4 U+00B4 acute
177
+ !B5 U+00B5 mu
178
+ !B6 U+00B6 paragraph
179
+ !B7 U+00B7 periodcentered
180
+ !B8 U+00B8 cedilla
181
+ !B9 U+00B9 onesuperior
182
+ !BA U+00BA ordmasculine
183
+ !BB U+00BB guillemotright
184
+ !BC U+00BC onequarter
185
+ !BD U+00BD onehalf
186
+ !BE U+00BE threequarters
187
+ !BF U+00BF questiondown
188
+ !C0 U+00C0 Agrave
189
+ !C1 U+00C1 Aacute
190
+ !C2 U+00C2 Acircumflex
191
+ !C3 U+00C3 Atilde
192
+ !C4 U+00C4 Adieresis
193
+ !C5 U+00C5 Aring
194
+ !C6 U+00C6 AE
195
+ !C7 U+00C7 Ccedilla
196
+ !C8 U+00C8 Egrave
197
+ !C9 U+00C9 Eacute
198
+ !CA U+00CA Ecircumflex
199
+ !CB U+00CB Edieresis
200
+ !CC U+00CC Igrave
201
+ !CD U+00CD Iacute
202
+ !CE U+00CE Icircumflex
203
+ !CF U+00CF Idieresis
204
+ !D0 U+00D0 Eth
205
+ !D1 U+00D1 Ntilde
206
+ !D2 U+00D2 Ograve
207
+ !D3 U+00D3 Oacute
208
+ !D4 U+00D4 Ocircumflex
209
+ !D5 U+00D5 Otilde
210
+ !D6 U+00D6 Odieresis
211
+ !D7 U+00D7 multiply
212
+ !D8 U+00D8 Oslash
213
+ !D9 U+00D9 Ugrave
214
+ !DA U+00DA Uacute
215
+ !DB U+00DB Ucircumflex
216
+ !DC U+00DC Udieresis
217
+ !DD U+00DD Yacute
218
+ !DE U+00DE Thorn
219
+ !DF U+00DF germandbls
220
+ !E0 U+00E0 agrave
221
+ !E1 U+00E1 aacute
222
+ !E2 U+00E2 acircumflex
223
+ !E3 U+00E3 atilde
224
+ !E4 U+00E4 adieresis
225
+ !E5 U+00E5 aring
226
+ !E6 U+00E6 ae
227
+ !E7 U+00E7 ccedilla
228
+ !E8 U+00E8 egrave
229
+ !E9 U+00E9 eacute
230
+ !EA U+00EA ecircumflex
231
+ !EB U+00EB edieresis
232
+ !EC U+00EC igrave
233
+ !ED U+00ED iacute
234
+ !EE U+00EE icircumflex
235
+ !EF U+00EF idieresis
236
+ !F0 U+00F0 eth
237
+ !F1 U+00F1 ntilde
238
+ !F2 U+00F2 ograve
239
+ !F3 U+00F3 oacute
240
+ !F4 U+00F4 ocircumflex
241
+ !F5 U+00F5 otilde
242
+ !F6 U+00F6 odieresis
243
+ !F7 U+00F7 divide
244
+ !F8 U+00F8 oslash
245
+ !F9 U+00F9 ugrave
246
+ !FA U+00FA uacute
247
+ !FB U+00FB ucircumflex
248
+ !FC U+00FC udieresis
249
+ !FD U+00FD yacute
250
+ !FE U+00FE thorn
251
+ !FF U+00FF ydieresis
lib/fpdf/font/makefont/cp1253.map ADDED
@@ -0,0 +1,239 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ !00 U+0000 .notdef
2
+ !01 U+0001 .notdef
3
+ !02 U+0002 .notdef
4
+ !03 U+0003 .notdef
5
+ !04 U+0004 .notdef
6
+ !05 U+0005 .notdef
7
+ !06 U+0006 .notdef
8
+ !07 U+0007 .notdef
9
+ !08 U+0008 .notdef
10
+ !09 U+0009 .notdef
11
+ !0A U+000A .notdef
12
+ !0B U+000B .notdef
13
+ !0C U+000C .notdef
14
+ !0D U+000D .notdef
15
+ !0E U+000E .notdef
16
+ !0F U+000F .notdef
17
+ !10 U+0010 .notdef
18
+ !11 U+0011 .notdef
19
+ !12 U+0012 .notdef
20
+ !13 U+0013 .notdef
21
+ !14 U+0014 .notdef
22
+ !15 U+0015 .notdef
23
+ !16 U+0016 .notdef
24
+ !17 U+0017 .notdef
25
+ !18 U+0018 .notdef
26
+ !19 U+0019 .notdef
27
+ !1A U+001A .notdef
28
+ !1B U+001B .notdef
29
+ !1C U+001C .notdef
30
+ !1D U+001D .notdef
31
+ !1E U+001E .notdef
32
+ !1F U+001F .notdef
33
+ !20 U+0020 space
34
+ !21 U+0021 exclam
35
+ !22 U+0022 quotedbl
36
+ !23 U+0023 numbersign
37
+ !24 U+0024 dollar
38
+ !25 U+0025 percent
39
+ !26 U+0026 ampersand
40
+ !27 U+0027 quotesingle
41
+ !28 U+0028 parenleft
42
+ !29 U+0029 parenright
43
+ !2A U+002A asterisk
44
+ !2B U+002B plus
45
+ !2C U+002C comma
46
+ !2D U+002D hyphen
47
+ !2E U+002E period
48
+ !2F U+002F slash
49
+ !30 U+0030 zero
50
+ !31 U+0031 one
51
+ !32 U+0032 two
52
+ !33 U+0033 three
53
+ !34 U+0034 four
54
+ !35 U+0035 five
55
+ !36 U+0036 six
56
+ !37 U+0037 seven
57
+ !38 U+0038 eight
58
+ !39 U+0039 nine
59
+ !3A U+003A colon
60
+ !3B U+003B semicolon
61
+ !3C U+003C less
62
+ !3D U+003D equal
63
+ !3E U+003E greater
64
+ !3F U+003F question
65
+ !40 U+0040 at
66
+ !41 U+0041 A
67
+ !42 U+0042 B
68
+ !43 U+0043 C
69
+ !44 U+0044 D
70
+ !45 U+0045 E
71
+ !46 U+0046 F
72
+ !47 U+0047 G
73
+ !48 U+0048 H
74
+ !49 U+0049 I
75
+ !4A U+004A J
76
+ !4B U+004B K
77
+ !4C U+004C L
78
+ !4D U+004D M
79
+ !4E U+004E N
80
+ !4F U+004F O
81
+ !50 U+0050 P
82
+ !51 U+0051 Q
83
+ !52 U+0052 R
84
+ !53 U+0053 S
85
+ !54 U+0054 T
86
+ !55 U+0055 U
87
+ !56 U+0056 V
88
+ !57 U+0057 W
89
+ !58 U+0058 X
90
+ !59 U+0059 Y
91
+ !5A U+005A Z
92
+ !5B U+005B bracketleft
93
+ !5C U+005C backslash
94
+ !5D U+005D bracketright
95
+ !5E U+005E asciicircum
96
+ !5F U+005F underscore
97
+ !60 U+0060 grave
98
+ !61 U+0061 a
99
+ !62 U+0062 b
100
+ !63 U+0063 c
101
+ !64 U+0064 d
102
+ !65 U+0065 e
103
+ !66 U+0066 f
104
+ !67 U+0067 g
105
+ !68 U+0068 h
106
+ !69 U+0069 i
107
+ !6A U+006A j
108
+ !6B U+006B k
109
+ !6C U+006C l
110
+ !6D U+006D m
111
+ !6E U+006E n
112
+ !6F U+006F o
113
+ !70 U+0070 p
114
+ !71 U+0071 q
115
+ !72 U+0072 r
116
+ !73 U+0073 s
117
+ !74 U+0074 t
118
+ !75 U+0075 u
119
+ !76 U+0076 v
120
+ !77 U+0077 w
121
+ !78 U+0078 x
122
+ !79 U+0079 y
123
+ !7A U+007A z
124
+ !7B U+007B braceleft
125
+ !7C U+007C bar
126
+ !7D U+007D braceright
127
+ !7E U+007E asciitilde
128
+ !7F U+007F .notdef
129
+ !80 U+20AC Euro
130
+ !82 U+201A quotesinglbase
131
+ !83 U+0192 florin
132
+ !84 U+201E quotedblbase
133
+ !85 U+2026 ellipsis
134
+ !86 U+2020 dagger
135
+ !87 U+2021 daggerdbl
136
+ !89 U+2030 perthousand
137
+ !8B U+2039 guilsinglleft
138
+ !91 U+2018 quoteleft
139
+ !92 U+2019 quoteright
140
+ !93 U+201C quotedblleft
141
+ !94 U+201D quotedblright
142
+ !95 U+2022 bullet
143
+ !96 U+2013 endash
144
+ !97 U+2014 emdash
145
+ !99 U+2122 trademark
146
+ !9B U+203A guilsinglright
147
+ !A0 U+00A0 space
148
+ !A1 U+0385 dieresistonos
149
+ !A2 U+0386 Alphatonos
150
+ !A3 U+00A3 sterling
151
+ !A4 U+00A4 currency
152
+ !A5 U+00A5 yen
153
+ !A6 U+00A6 brokenbar
154
+ !A7 U+00A7 section
155
+ !A8 U+00A8 dieresis
156
+ !A9 U+00A9 copyright
157
+ !AB U+00AB guillemotleft
158
+ !AC U+00AC logicalnot
159
+ !AD U+00AD hyphen
160
+ !AE U+00AE registered
161
+ !AF U+2015 afii00208
162
+ !B0 U+00B0 degree
163
+ !B1 U+00B1 plusminus
164
+ !B2 U+00B2 twosuperior
165
+ !B3 U+00B3 threesuperior
166
+ !B4 U+0384 tonos
167
+ !B5 U+00B5 mu
168
+ !B6 U+00B6 paragraph
169
+ !B7 U+00B7 periodcentered
170
+ !B8 U+0388 Epsilontonos
171
+ !B9 U+0389 Etatonos
172
+ !BA U+038A Iotatonos
173
+ !BB U+00BB guillemotright
174
+ !BC U+038C Omicrontonos
175
+ !BD U+00BD onehalf
176
+ !BE U+038E Upsilontonos
177
+ !BF U+038F Omegatonos
178
+ !C0 U+0390 iotadieresistonos
179
+ !C1 U+0391 Alpha
180
+ !C2 U+0392 Beta
181
+ !C3 U+0393 Gamma
182
+ !C4 U+0394 Delta
183
+ !C5 U+0395 Epsilon
184
+ !C6 U+0396 Zeta
185
+ !C7 U+0397 Eta
186
+ !C8 U+0398 Theta
187
+ !C9 U+0399 Iota
188
+ !CA U+039A Kappa
189
+ !CB U+039B Lambda
190
+ !CC U+039C Mu
191
+ !CD U+039D Nu
192
+ !CE U+039E Xi
193
+ !CF U+039F Omicron
194
+ !D0 U+03A0 Pi
195
+ !D1 U+03A1 Rho
196
+ !D3 U+03A3 Sigma
197
+ !D4 U+03A4 Tau
198
+ !D5 U+03A5 Upsilon
199
+ !D6 U+03A6 Phi
200
+ !D7 U+03A7 Chi
201
+ !D8 U+03A8 Psi
202
+ !D9 U+03A9 Omega
203
+ !DA U+03AA Iotadieresis
204
+ !DB U+03AB Upsilondieresis
205
+ !DC U+03AC alphatonos
206
+ !DD U+03AD epsilontonos
207
+ !DE U+03AE etatonos
208
+ !DF U+03AF iotatonos
209
+ !E0 U+03B0 upsilondieresistonos
210
+ !E1 U+03B1 alpha
211
+ !E2 U+03B2 beta
212
+ !E3 U+03B3 gamma
213
+ !E4 U+03B4 delta
214
+ !E5 U+03B5 epsilon
215
+ !E6 U+03B6 zeta
216
+ !E7 U+03B7 eta
217
+ !E8 U+03B8 theta
218
+ !E9 U+03B9 iota
219
+ !EA U+03BA kappa
220
+ !EB U+03BB lambda
221
+ !EC U+03BC mu
222
+ !ED U+03BD nu
223
+ !EE U+03BE xi
224
+ !EF U+03BF omicron
225
+ !F0 U+03C0 pi
226
+ !F1 U+03C1 rho
227
+ !F2 U+03C2 sigma1
228
+ !F3 U+03C3 sigma
229
+ !F4 U+03C4 tau
230
+ !F5 U+03C5 upsilon
231
+ !F6 U+03C6 phi
232
+ !F7 U+03C7 chi
233
+ !F8 U+03C8 psi
234
+ !F9 U+03C9 omega
235
+ !FA U+03CA iotadieresis
236
+ !FB U+03CB upsilondieresis
237
+ !FC U+03CC omicrontonos
238
+ !FD U+03CD upsilontonos
239
+ !FE U+03CE omegatonos
lib/fpdf/font/makefont/cp1254.map ADDED
@@ -0,0 +1,249 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ !00 U+0000 .notdef
2
+ !01 U+0001 .notdef
3
+ !02 U+0002 .notdef
4
+ !03 U+0003 .notdef
5
+ !04 U+0004 .notdef
6
+ !05 U+0005 .notdef
7
+ !06 U+0006 .notdef
8
+ !07 U+0007 .notdef
9
+ !08 U+0008 .notdef
10
+ !09 U+0009 .notdef
11
+ !0A U+000A .notdef
12
+ !0B U+000B .notdef
13
+ !0C U+000C .notdef
14
+ !0D U+000D .notdef
15
+ !0E U+000E .notdef
16
+ !0F U+000F .notdef
17
+ !10 U+0010 .notdef
18
+ !11 U+0011 .notdef
19
+ !12 U+0012 .notdef
20
+ !13 U+0013 .notdef
21
+ !14 U+0014 .notdef
22
+ !15 U+0015 .notdef
23
+ !16 U+0016 .notdef
24
+ !17 U+0017 .notdef
25
+ !18 U+0018 .notdef
26
+ !19 U+0019 .notdef
27
+ !1A U+001A .notdef
28
+ !1B U+001B .notdef
29
+ !1C U+001C .notdef
30
+ !1D U+001D .notdef
31
+ !1E U+001E .notdef
32
+ !1F U+001F .notdef
33
+ !20 U+0020 space
34
+ !21 U+0021 exclam
35
+ !22 U+0022 quotedbl
36
+ !23 U+0023 numbersign
37
+ !24 U+0024 dollar
38
+ !25 U+0025 percent
39
+ !26 U+0026 ampersand
40
+ !27 U+0027 quotesingle
41
+ !28 U+0028 parenleft
42
+ !29 U+0029 parenright
43
+ !2A U+002A asterisk
44
+ !2B U+002B plus
45
+ !2C U+002C comma
46
+ !2D U+002D hyphen
47
+ !2E U+002E period
48
+ !2F U+002F slash
49
+ !30 U+0030 zero
50
+ !31 U+0031 one
51
+ !32 U+0032 two
52
+ !33 U+0033 three
53
+ !34 U+0034 four
54
+ !35 U+0035 five
55
+ !36 U+0036 six
56
+ !37 U+0037 seven
57
+ !38 U+0038 eight
58
+ !39 U+0039 nine
59
+ !3A U+003A colon
60
+ !3B U+003B semicolon
61
+ !3C U+003C less
62
+ !3D U+003D equal
63
+ !3E U+003E greater
64
+ !3F U+003F question
65
+ !40 U+0040 at
66
+ !41 U+0041 A
67
+ !42 U+0042 B
68
+ !43 U+0043 C
69
+ !44 U+0044 D
70
+ !45 U+0045 E
71
+ !46 U+0046 F
72
+ !47 U+0047 G
73
+ !48 U+0048 H
74
+ !49 U+0049 I
75
+ !4A U+004A J
76
+ !4B U+004B K
77
+ !4C U+004C L
78
+ !4D U+004D M
79
+ !4E U+004E N
80
+ !4F U+004F O
81
+ !50 U+0050 P
82
+ !51 U+0051 Q
83
+ !52 U+0052 R
84
+ !53 U+0053 S
85
+ !54 U+0054 T
86
+ !55 U+0055 U
87
+ !56 U+0056 V
88
+ !57 U+0057 W
89
+ !58 U+0058 X
90
+ !59 U+0059 Y
91
+ !5A U+005A Z
92
+ !5B U+005B bracketleft
93
+ !5C U+005C backslash
94
+ !5D U+005D bracketright
95
+ !5E U+005E asciicircum
96
+ !5F U+005F underscore
97
+ !60 U+0060 grave
98
+ !61 U+0061 a
99
+ !62 U+0062 b
100
+ !63 U+0063 c
101
+ !64 U+0064 d
102
+ !65 U+0065 e
103
+ !66 U+0066 f
104
+ !67 U+0067 g
105
+ !68 U+0068 h
106
+ !69 U+0069 i
107
+ !6A U+006A j
108
+ !6B U+006B k
109
+ !6C U+006C l
110
+ !6D U+006D m
111
+ !6E U+006E n
112
+ !6F U+006F o
113
+ !70 U+0070 p
114
+ !71 U+0071 q
115
+ !72 U+0072 r
116
+ !73 U+0073 s
117
+ !74 U+0074 t
118
+ !75 U+0075 u
119
+ !76 U+0076 v
120
+ !77 U+0077 w
121
+ !78 U+0078 x
122
+ !79 U+0079 y
123
+ !7A U+007A z
124
+ !7B U+007B braceleft
125
+ !7C U+007C bar
126
+ !7D U+007D braceright
127
+ !7E U+007E asciitilde
128
+ !7F U+007F .notdef
129
+ !80 U+20AC Euro
130
+ !82 U+201A quotesinglbase
131
+ !83 U+0192 florin
132
+ !84 U+201E quotedblbase
133
+ !85 U+2026 ellipsis
134
+ !86 U+2020 dagger
135
+ !87 U+2021 daggerdbl
136
+ !88 U+02C6 circumflex
137
+ !89 U+2030 perthousand
138
+ !8A U+0160 Scaron
139
+ !8B U+2039 guilsinglleft
140
+ !8C U+0152 OE
141
+ !91 U+2018 quoteleft
142
+ !92 U+2019 quoteright
143
+ !93 U+201C quotedblleft
144
+ !94 U+201D quotedblright
145
+ !95 U+2022 bullet
146
+ !96 U+2013 endash
147
+ !97 U+2014 emdash
148
+ !98 U+02DC tilde
149
+ !99 U+2122 trademark
150
+ !9A U+0161 scaron
151
+ !9B U+203A guilsinglright
152
+ !9C U+0153 oe
153
+ !9F U+0178 Ydieresis
154
+ !A0 U+00A0 space
155
+ !A1 U+00A1 exclamdown
156
+ !A2 U+00A2 cent
157
+ !A3 U+00A3 sterling
158
+ !A4 U+00A4 currency
159
+ !A5 U+00A5 yen
160
+ !A6 U+00A6 brokenbar
161
+ !A7 U+00A7 section
162
+ !A8 U+00A8 dieresis
163
+ !A9 U+00A9 copyright
164
+ !AA U+00AA ordfeminine
165
+ !AB U+00AB guillemotleft
166
+ !AC U+00AC logicalnot
167
+ !AD U+00AD hyphen
168
+ !AE U+00AE registered
169
+ !AF U+00AF macron
170
+ !B0 U+00B0 degree
171
+ !B1 U+00B1 plusminus
172
+ !B2 U+00B2 twosuperior
173
+ !B3 U+00B3 threesuperior
174
+ !B4 U+00B4 acute
175
+ !B5 U+00B5 mu
176
+ !B6 U+00B6 paragraph
177
+ !B7 U+00B7 periodcentered
178
+ !B8 U+00B8 cedilla
179
+ !B9 U+00B9 onesuperior
180
+ !BA U+00BA ordmasculine
181
+ !BB U+00BB guillemotright
182
+ !BC U+00BC onequarter
183
+ !BD U+00BD onehalf
184
+ !BE U+00BE threequarters
185
+ !BF U+00BF questiondown
186
+ !C0 U+00C0 Agrave
187
+ !C1 U+00C1 Aacute
188
+ !C2 U+00C2 Acircumflex
189
+ !C3 U+00C3 Atilde
190
+ !C4 U+00C4 Adieresis
191
+ !C5 U+00C5 Aring
192
+ !C6 U+00C6 AE
193
+ !C7 U+00C7 Ccedilla
194
+ !C8 U+00C8 Egrave
195
+ !C9 U+00C9 Eacute
196
+ !CA U+00CA Ecircumflex
197
+ !CB U+00CB Edieresis
198
+ !CC U+00CC Igrave
199
+ !CD U+00CD Iacute
200
+ !CE U+00CE Icircumflex
201
+ !CF U+00CF Idieresis
202
+ !D0 U+011E Gbreve
203
+ !D1 U+00D1 Ntilde
204
+ !D2 U+00D2 Ograve
205
+ !D3 U+00D3 Oacute
206
+ !D4 U+00D4 Ocircumflex
207
+ !D5 U+00D5 Otilde
208
+ !D6 U+00D6 Odieresis
209
+ !D7 U+00D7 multiply
210
+ !D8 U+00D8 Oslash
211
+ !D9 U+00D9 Ugrave
212
+ !DA U+00DA Uacute
213
+ !DB U+00DB Ucircumflex
214
+ !DC U+00DC Udieresis
215
+ !DD U+0130 Idotaccent
216
+ !DE U+015E Scedilla
217
+ !DF U+00DF germandbls
218
+ !E0 U+00E0 agrave
219
+ !E1 U+00E1 aacute
220
+ !E2 U+00E2 acircumflex
221
+ !E3 U+00E3 atilde
222
+ !E4 U+00E4 adieresis
223
+ !E5 U+00E5 aring
224
+ !E6 U+00E6 ae
225
+ !E7 U+00E7 ccedilla
226
+ !E8 U+00E8 egrave
227
+ !E9 U+00E9 eacute
228
+ !EA U+00EA ecircumflex
229
+ !EB U+00EB edieresis
230
+ !EC U+00EC igrave
231
+ !ED U+00ED iacute
232
+ !EE U+00EE icircumflex
233
+ !EF U+00EF idieresis
234
+ !F0 U+011F gbreve
235
+ !F1 U+00F1 ntilde
236
+ !F2 U+00F2 ograve
237
+ !F3 U+00F3 oacute
238
+ !F4 U+00F4 ocircumflex
239
+ !F5 U+00F5 otilde
240
+ !F6 U+00F6 odieresis
241
+ !F7 U+00F7 divide
242
+ !F8 U+00F8 oslash
243
+ !F9 U+00F9 ugrave
244
+ !FA U+00FA uacute
245
+ !FB U+00FB ucircumflex
246
+ !FC U+00FC udieresis
247
+ !FD U+0131 dotlessi
248
+ !FE U+015F scedilla
249
+ !FF U+00FF ydieresis
lib/fpdf/font/makefont/cp1255.map ADDED
@@ -0,0 +1,233 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ !00 U+0000 .notdef
2
+ !01 U+0001 .notdef
3
+ !02 U+0002 .notdef
4
+ !03 U+0003 .notdef
5
+ !04 U+0004 .notdef
6
+ !05 U+0005 .notdef
7
+ !06 U+0006 .notdef
8
+ !07 U+0007 .notdef
9
+ !08 U+0008 .notdef
10
+ !09 U+0009 .notdef
11
+ !0A U+000A .notdef
12
+ !0B U+000B .notdef
13
+ !0C U+000C .notdef
14
+ !0D U+000D .notdef
15
+ !0E U+000E .notdef
16
+ !0F U+000F .notdef
17
+ !10 U+0010 .notdef
18
+ !11 U+0011 .notdef
19
+ !12 U+0012 .notdef
20
+ !13 U+0013 .notdef
21
+ !14 U+0014 .notdef
22
+ !15 U+0015 .notdef
23
+ !16 U+0016 .notdef
24
+ !17 U+0017 .notdef
25
+ !18 U+0018 .notdef
26
+ !19 U+0019 .notdef
27
+ !1A U+001A .notdef
28
+ !1B U+001B .notdef
29
+ !1C U+001C .notdef
30
+ !1D U+001D .notdef
31
+ !1E U+001E .notdef
32
+ !1F U+001F .notdef
33
+ !20 U+0020 space
34
+ !21 U+0021 exclam
35
+ !22 U+0022 quotedbl
36
+ !23 U+0023 numbersign
37
+ !24 U+0024 dollar
38
+ !25 U+0025 percent
39
+ !26 U+0026 ampersand
40
+ !27 U+0027 quotesingle
41
+ !28 U+0028 parenleft
42
+ !29 U+0029 parenright
43
+ !2A U+002A asterisk
44
+ !2B U+002B plus
45
+ !2C U+002C comma
46
+ !2D U+002D hyphen
47
+ !2E U+002E period
48
+ !2F U+002F slash
49
+ !30 U+0030 zero
50
+ !31 U+0031 one
51
+ !32 U+0032 two
52
+ !33 U+0033 three
53
+ !34 U+0034 four
54
+ !35 U+0035 five
55
+ !36 U+0036 six
56
+ !37 U+0037 seven
57
+ !38 U+0038 eight
58
+ !39 U+0039 nine
59
+ !3A U+003A colon
60
+ !3B U+003B semicolon
61
+ !3C U+003C less
62
+ !3D U+003D equal
63
+ !3E U+003E greater
64
+ !3F U+003F question
65
+ !40 U+0040 at
66
+ !41 U+0041 A
67
+ !42 U+0042 B
68
+ !43 U+0043 C
69
+ !44 U+0044 D
70
+ !45 U+0045 E
71
+ !46 U+0046 F
72
+ !47 U+0047 G
73
+ !48 U+0048 H
74
+ !49 U+0049 I
75
+ !4A U+004A J
76
+ !4B U+004B K
77
+ !4C U+004C L
78
+ !4D U+004D M
79
+ !4E U+004E N
80
+ !4F U+004F O
81
+ !50 U+0050 P
82
+ !51 U+0051 Q
83
+ !52 U+0052 R
84
+ !53 U+0053 S
85
+ !54 U+0054 T
86
+ !55 U+0055 U
87
+ !56 U+0056 V
88
+ !57 U+0057 W
89
+ !58 U+0058 X
90
+ !59 U+0059 Y
91
+ !5A U+005A Z
92
+ !5B U+005B bracketleft
93
+ !5C U+005C backslash
94
+ !5D U+005D bracketright
95
+ !5E U+005E asciicircum
96
+ !5F U+005F underscore
97
+ !60 U+0060 grave
98
+ !61 U+0061 a
99
+ !62 U+0062 b
100
+ !63 U+0063 c
101
+ !64 U+0064 d
102
+ !65 U+0065 e
103
+ !66 U+0066 f
104
+ !67 U+0067 g
105
+ !68 U+0068 h
106
+ !69 U+0069 i
107
+ !6A U+006A j
108
+ !6B U+006B k
109
+ !6C U+006C l
110
+ !6D U+006D m
111
+ !6E U+006E n
112
+ !6F U+006F o
113
+ !70 U+0070 p
114
+ !71 U+0071 q
115
+ !72 U+0072 r
116
+ !73 U+0073 s
117
+ !74 U+0074 t
118
+ !75 U+0075 u
119
+ !76 U+0076 v
120
+ !77 U+0077 w
121
+ !78 U+0078 x
122
+ !79 U+0079 y
123
+ !7A U+007A z
124
+ !7B U+007B braceleft
125
+ !7C U+007C bar
126
+ !7D U+007D braceright
127
+ !7E U+007E asciitilde
128
+ !7F U+007F .notdef
129
+ !80 U+20AC Euro
130
+ !82 U+201A quotesinglbase
131
+ !83 U+0192 florin
132
+ !84 U+201E quotedblbase
133
+ !85 U+2026 ellipsis
134
+ !86 U+2020 dagger
135
+ !87 U+2021 daggerdbl
136
+ !88 U+02C6 circumflex
137
+ !89 U+2030 perthousand
138
+ !8B U+2039 guilsinglleft
139
+ !91 U+2018 quoteleft
140
+ !92 U+2019 quoteright
141
+ !93 U+201C quotedblleft
142
+ !94 U+201D quotedblright
143
+ !95 U+2022 bullet
144
+ !96 U+2013 endash
145
+ !97 U+2014 emdash
146
+ !98 U+02DC tilde
147
+ !99 U+2122 trademark
148
+ !9B U+203A guilsinglright
149
+ !A0 U+00A0 space
150
+ !A1 U+00A1 exclamdown
151
+ !A2 U+00A2 cent
152
+ !A3 U+00A3 sterling
153
+ !A4 U+20AA afii57636
154
+ !A5 U+00A5 yen
155
+ !A6 U+00A6 brokenbar
156
+ !A7 U+00A7 section
157
+ !A8 U+00A8 dieresis
158
+ !A9 U+00A9 copyright
159
+ !AA U+00D7 multiply
160
+ !AB U+00AB guillemotleft
161
+ !AC U+00AC logicalnot
162
+ !AD U+00AD sfthyphen
163
+ !AE U+00AE registered
164
+ !AF U+00AF macron
165
+ !B0 U+00B0 degree
166
+ !B1 U+00B1 plusminus
167
+ !B2 U+00B2 twosuperior
168
+ !B3 U+00B3 threesuperior
169
+ !B4 U+00B4 acute
170
+ !B5 U+00B5 mu
171
+ !B6 U+00B6 paragraph
172
+ !B7 U+00B7 middot
173
+ !B8 U+00B8 cedilla
174
+ !B9 U+00B9 onesuperior
175
+ !BA U+00F7 divide
176
+ !BB U+00BB guillemotright
177
+ !BC U+00BC onequarter
178
+ !BD U+00BD onehalf
179
+ !BE U+00BE threequarters
180
+ !BF U+00BF questiondown
181
+ !C0 U+05B0 afii57799
182
+ !C1 U+05B1 afii57801
183
+ !C2 U+05B2 afii57800
184
+ !C3 U+05B3 afii57802
185
+ !C4 U+05B4 afii57793
186
+ !C5 U+05B5 afii57794
187
+ !C6 U+05B6 afii57795
188
+ !C7 U+05B7 afii57798
189
+ !C8 U+05B8 afii57797
190
+ !C9 U+05B9 afii57806
191
+ !CB U+05BB afii57796
192
+ !CC U+05BC afii57807
193
+ !CD U+05BD afii57839
194
+ !CE U+05BE afii57645
195
+ !CF U+05BF afii57841
196
+ !D0 U+05C0 afii57842
197
+ !D1 U+05C1 afii57804
198
+ !D2 U+05C2 afii57803
199
+ !D3 U+05C3 afii57658
200
+ !D4 U+05F0 afii57716
201
+ !D5 U+05F1 afii57717
202
+ !D6 U+05F2 afii57718
203
+ !D7 U+05F3 gereshhebrew
204
+ !D8 U+05F4 gershayimhebrew
205
+ !E0 U+05D0 afii57664
206
+ !E1 U+05D1 afii57665
207
+ !E2 U+05D2 afii57666
208
+ !E3 U+05D3 afii57667
209
+ !E4 U+05D4 afii57668
210
+ !E5 U+05D5 afii57669
211
+ !E6 U+05D6 afii57670
212
+ !E7 U+05D7 afii57671
213
+ !E8 U+05D8 afii57672
214
+ !E9 U+05D9 afii57673
215
+ !EA U+05DA afii57674
216
+ !EB U+05DB afii57675
217
+ !EC U+05DC afii57676
218
+ !ED U+05DD afii57677
219
+ !EE U+05DE afii57678
220
+ !EF U+05DF afii57679
221
+ !F0 U+05E0 afii57680
222
+ !F1 U+05E1 afii57681
223
+ !F2 U+05E2 afii57682
224
+ !F3 U+05E3 afii57683
225
+ !F4 U+05E4 afii57684
226
+ !F5 U+05E5 afii57685
227
+ !F6 U+05E6 afii57686
228
+ !F7 U+05E7 afii57687
229
+ !F8 U+05E8 afii57688
230
+ !F9 U+05E9 afii57689
231
+ !FA U+05EA afii57690
232
+ !FD U+200E afii299
233
+ !FE U+200F afii300
lib/fpdf/font/makefont/cp1257.map ADDED
@@ -0,0 +1,244 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ !00 U+0000 .notdef
2
+ !01 U+0001 .notdef
3
+ !02 U+0002 .notdef
4
+ !03 U+0003 .notdef
5
+ !04 U+0004 .notdef
6
+ !05 U+0005 .notdef
7
+ !06 U+0006 .notdef
8
+ !07 U+0007 .notdef
9
+ !08 U+0008 .notdef
10
+ !09 U+0009 .notdef
11
+ !0A U+000A .notdef
12
+ !0B U+000B .notdef
13
+ !0C U+000C .notdef
14
+ !0D U+000D .notdef
15
+ !0E U+000E .notdef
16
+ !0F U+000F .notdef
17
+ !10 U+0010 .notdef
18
+ !11 U+0011 .notdef
19
+ !12 U+0012 .notdef
20
+ !13 U+0013 .notdef
21
+ !14 U+0014 .notdef
22
+ !15 U+0015 .notdef
23
+ !16 U+0016 .notdef
24
+ !17 U+0017 .notdef
25
+ !18 U+0018 .notdef
26
+ !19 U+0019 .notdef
27
+ !1A U+001A .notdef
28
+ !1B U+001B .notdef
29
+ !1C U+001C .notdef
30
+ !1D U+001D .notdef
31
+ !1E U+001E .notdef
32
+ !1F U+001F .notdef
33
+ !20 U+0020 space
34
+ !21 U+0021 exclam
35
+ !22 U+0022 quotedbl
36
+ !23 U+0023 numbersign
37
+ !24 U+0024 dollar
38
+ !25 U+0025 percent
39
+ !26 U+0026 ampersand
40
+ !27 U+0027 quotesingle
41
+ !28 U+0028 parenleft
42
+ !29 U+0029 parenright
43
+ !2A U+002A asterisk
44
+ !2B U+002B plus
45
+ !2C U+002C comma
46
+ !2D U+002D hyphen
47
+ !2E U+002E period
48
+ !2F U+002F slash
49
+ !30 U+0030 zero
50
+ !31 U+0031 one
51
+ !32 U+0032 two
52
+ !33 U+0033 three
53
+ !34 U+0034 four
54
+ !35 U+0035 five
55
+ !36 U+0036 six
56
+ !37 U+0037 seven
57
+ !38 U+0038 eight
58
+ !39 U+0039 nine
59
+ !3A U+003A colon
60
+ !3B U+003B semicolon
61
+ !3C U+003C less
62
+ !3D U+003D equal
63
+ !3E U+003E greater
64
+ !3F U+003F question
65
+ !40 U+0040 at
66
+ !41 U+0041 A
67
+ !42 U+0042 B
68
+ !43 U+0043 C
69
+ !44 U+0044 D
70
+ !45 U+0045 E
71
+ !46 U+0046 F
72
+ !47 U+0047 G
73
+ !48 U+0048 H
74
+ !49 U+0049 I
75
+ !4A U+004A J
76
+ !4B U+004B K
77
+ !4C U+004C L
78
+ !4D U+004D M
79
+ !4E U+004E N
80
+ !4F U+004F O
81
+ !50 U+0050 P
82
+ !51 U+0051 Q
83
+ !52 U+0052 R
84
+ !53 U+0053 S
85
+ !54 U+0054 T
86
+ !55 U+0055 U
87
+ !56 U+0056 V
88
+ !57 U+0057 W
89
+ !58 U+0058 X
90
+ !59 U+0059 Y
91
+ !5A U+005A Z
92
+ !5B U+005B bracketleft
93
+ !5C U+005C backslash
94
+ !5D U+005D bracketright
95
+ !5E U+005E asciicircum
96
+ !5F U+005F underscore
97
+ !60 U+0060 grave
98
+ !61 U+0061 a
99
+ !62 U+0062 b
100
+ !63 U+0063 c
101
+ !64 U+0064 d
102
+ !65 U+0065 e
103
+ !66 U+0066 f
104
+ !67 U+0067 g
105
+ !68 U+0068 h
106
+ !69 U+0069 i
107
+ !6A U+006A j
108
+ !6B U+006B k
109
+ !6C U+006C l
110
+ !6D U+006D m
111
+ !6E U+006E n
112
+ !6F U+006F o
113
+ !70 U+0070 p
114
+ !71 U+0071 q
115
+ !72 U+0072 r
116
+ !73 U+0073 s
117
+ !74 U+0074 t
118
+ !75 U+0075 u
119
+ !76 U+0076 v
120
+ !77 U+0077 w
121
+ !78 U+0078 x
122
+ !79 U+0079 y
123
+ !7A U+007A z
124
+ !7B U+007B braceleft
125
+ !7C U+007C bar
126
+ !7D U+007D braceright
127
+ !7E U+007E asciitilde
128
+ !7F U+007F .notdef
129
+ !80 U+20AC Euro
130
+ !82 U+201A quotesinglbase
131
+ !84 U+201E quotedblbase
132
+ !85 U+2026 ellipsis
133
+ !86 U+2020 dagger
134
+ !87 U+2021 daggerdbl
135
+ !89 U+2030 perthousand
136
+ !8B U+2039 guilsinglleft
137
+ !8D U+00A8 dieresis
138
+ !8E U+02C7 caron
139
+ !8F U+00B8 cedilla
140
+ !91 U+2018 quoteleft
141
+ !92 U+2019 quoteright
142
+ !93 U+201C quotedblleft
143
+ !94 U+201D quotedblright
144
+ !95 U+2022 bullet
145
+ !96 U+2013 endash
146
+ !97 U+2014 emdash
147
+ !99 U+2122 trademark
148
+ !9B U+203A guilsinglright
149
+ !9D U+00AF macron
150
+ !9E U+02DB ogonek
151
+ !A0 U+00A0 space
152
+ !A2 U+00A2 cent
153
+ !A3 U+00A3 sterling
154
+ !A4 U+00A4 currency
155
+ !A6 U+00A6 brokenbar
156
+ !A7 U+00A7 section
157
+ !A8 U+00D8 Oslash
158
+ !A9 U+00A9 copyright
159
+ !AA U+0156 Rcommaaccent
160
+ !AB U+00AB guillemotleft
161
+ !AC U+00AC logicalnot
162
+ !AD U+00AD hyphen
163
+ !AE U+00AE registered
164
+ !AF U+00C6 AE
165
+ !B0 U+00B0 degree
166
+ !B1 U+00B1 plusminus
167
+ !B2 U+00B2 twosuperior
168
+ !B3 U+00B3 threesuperior
169
+ !B4 U+00B4 acute
170
+ !B5 U+00B5 mu
171
+ !B6 U+00B6 paragraph
172
+ !B7 U+00B7 periodcentered
173
+ !B8 U+00F8 oslash
174
+ !B9 U+00B9 onesuperior
175
+ !BA U+0157 rcommaaccent
176
+ !BB U+00BB guillemotright
177
+ !BC U+00BC onequarter
178
+ !BD U+00BD onehalf
179
+ !BE U+00BE threequarters
180
+ !BF U+00E6 ae
181
+ !C0 U+0104 Aogonek
182
+ !C1 U+012E Iogonek
183
+ !C2 U+0100 Amacron
184
+ !C3 U+0106 Cacute
185
+ !C4 U+00C4 Adieresis
186
+ !C5 U+00C5 Aring
187
+ !C6 U+0118 Eogonek
188
+ !C7 U+0112 Emacron
189
+ !C8 U+010C Ccaron
190
+ !C9 U+00C9 Eacute
191
+ !CA U+0179 Zacute
192
+ !CB U+0116 Edotaccent
193
+ !CC U+0122 Gcommaaccent
194
+ !CD U+0136 Kcommaaccent
195
+ !CE U+012A Imacron
196
+ !CF U+013B Lcommaaccent
197
+ !D0 U+0160 Scaron
198
+ !D1 U+0143 Nacute
199
+ !D2 U+0145 Ncommaaccent
200
+ !D3 U+00D3 Oacute
201
+ !D4 U+014C Omacron
202
+ !D5 U+00D5 Otilde
203
+ !D6 U+00D6 Odieresis
204
+ !D7 U+00D7 multiply
205
+ !D8 U+0172 Uogonek
206
+ !D9 U+0141 Lslash
207
+ !DA U+015A Sacute
208
+ !DB U+016A Umacron
209
+ !DC U+00DC Udieresis
210
+ !DD U+017B Zdotaccent
211
+ !DE U+017D Zcaron
212
+ !DF U+00DF germandbls
213
+ !E0 U+0105 aogonek
214
+ !E1 U+012F iogonek
215
+ !E2 U+0101 amacron
216
+ !E3 U+0107 cacute
217
+ !E4 U+00E4 adieresis
218
+ !E5 U+00E5 aring
219
+ !E6 U+0119 eogonek
220
+ !E7 U+0113 emacron
221
+ !E8 U+010D ccaron
222
+ !E9 U+00E9 eacute
223
+ !EA U+017A zacute
224
+ !EB U+0117 edotaccent
225
+ !EC U+0123 gcommaaccent
226
+ !ED U+0137 kcommaaccent
227
+ !EE U+012B imacron
228
+ !EF U+013C lcommaaccent
229
+ !F0 U+0161 scaron
230
+ !F1 U+0144 nacute
231
+ !F2 U+0146 ncommaaccent
232
+ !F3 U+00F3 oacute
233
+ !F4 U+014D omacron
234
+ !F5 U+00F5 otilde
235
+ !F6 U+00F6 odieresis
236
+ !F7 U+00F7 divide
237
+ !F8 U+0173 uogonek
238
+ !F9 U+0142 lslash
239
+ !FA U+015B sacute
240
+ !FB U+016B umacron
241
+ !FC U+00FC udieresis
242
+ !FD U+017C zdotaccent
243
+ !FE U+017E zcaron
244
+ !FF U+02D9 dotaccent
lib/fpdf/font/makefont/cp1258.map ADDED
@@ -0,0 +1,247 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ !00 U+0000 .notdef
2
+ !01 U+0001 .notdef
3
+ !02 U+0002 .notdef
4
+ !03 U+0003 .notdef
5
+ !04 U+0004 .notdef
6
+ !05 U+0005 .notdef
7
+ !06 U+0006 .notdef
8
+ !07 U+0007 .notdef
9
+ !08 U+0008 .notdef
10
+ !09 U+0009 .notdef
11
+ !0A U+000A .notdef
12
+ !0B U+000B .notdef
13
+ !0C U+000C .notdef
14
+ !0D U+000D .notdef
15
+ !0E U+000E .notdef
16
+ !0F U+000F .notdef
17
+ !10 U+0010 .notdef
18
+ !11 U+0011 .notdef
19
+ !12 U+0012 .notdef
20
+ !13 U+0013 .notdef
21
+ !14 U+0014 .notdef
22
+ !15 U+0015 .notdef
23
+ !16 U+0016 .notdef
24
+ !17 U+0017 .notdef
25
+ !18 U+0018 .notdef
26
+ !19 U+0019 .notdef
27
+ !1A U+001A .notdef
28
+ !1B U+001B .notdef
29
+ !1C U+001C .notdef
30
+ !1D U+001D .notdef
31
+ !1E U+001E .notdef
32
+ !1F U+001F .notdef
33
+ !20 U+0020 space
34
+ !21 U+0021 exclam
35
+ !22 U+0022 quotedbl
36
+ !23 U+0023 numbersign
37
+ !24 U+0024 dollar
38
+ !25 U+0025 percent
39
+ !26 U+0026 ampersand
40
+ !27 U+0027 quotesingle
41
+ !28 U+0028 parenleft
42
+ !29 U+0029 parenright
43
+ !2A U+002A asterisk
44
+ !2B U+002B plus
45
+ !2C U+002C comma
46
+ !2D U+002D hyphen
47
+ !2E U+002E period
48
+ !2F U+002F slash
49
+ !30 U+0030 zero
50
+ !31 U+0031 one
51
+ !32 U+0032 two
52
+ !33 U+0033 three
53
+ !34 U+0034 four
54
+ !35 U+0035 five
55
+ !36 U+0036 six
56
+ !37 U+0037 seven
57
+ !38 U+0038 eight
58
+ !39 U+0039 nine
59
+ !3A U+003A colon
60
+ !3B U+003B semicolon
61
+ !3C U+003C less
62
+ !3D U+003D equal
63
+ !3E U+003E greater
64
+ !3F U+003F question
65
+ !40 U+0040 at
66
+ !41 U+0041 A
67
+ !42 U+0042 B
68
+ !43 U+0043 C
69
+ !44 U+0044 D
70
+ !45 U+0045 E
71
+ !46 U+0046 F
72
+ !47 U+0047 G
73
+ !48 U+0048 H
74
+ !49 U+0049 I
75
+ !4A U+004A J
76
+ !4B U+004B K
77
+ !4C U+004C L
78
+ !4D U+004D M
79
+ !4E U+004E N
80
+ !4F U+004F O
81
+ !50 U+0050 P
82
+ !51 U+0051 Q
83
+ !52 U+0052 R
84
+ !53 U+0053 S
85
+ !54 U+0054 T
86
+ !55 U+0055 U
87
+ !56 U+0056 V
88
+ !57 U+0057 W
89
+ !58 U+0058 X
90
+ !59 U+0059 Y
91
+ !5A U+005A Z
92
+ !5B U+005B bracketleft
93
+ !5C U+005C backslash
94
+ !5D U+005D bracketright
95
+ !5E U+005E asciicircum
96
+ !5F U+005F underscore
97
+ !60 U+0060 grave
98
+ !61 U+0061 a
99
+ !62 U+0062 b
100
+ !63 U+0063 c
101
+ !64 U+0064 d
102
+ !65 U+0065 e
103
+ !66 U+0066 f
104
+ !67 U+0067 g
105
+ !68 U+0068 h
106
+ !69 U+0069 i
107
+ !6A U+006A j
108
+ !6B U+006B k
109
+ !6C U+006C l
110
+ !6D U+006D m
111
+ !6E U+006E n
112
+ !6F U+006F o
113
+ !70 U+0070 p
114
+ !71 U+0071 q
115
+ !72 U+0072 r
116
+ !73 U+0073 s
117
+ !74 U+0074 t
118
+ !75 U+0075 u
119
+ !76 U+0076 v
120
+ !77 U+0077 w
121
+ !78 U+0078 x
122
+ !79 U+0079 y
123
+ !7A U+007A z
124
+ !7B U+007B braceleft
125
+ !7C U+007C bar
126
+ !7D U+007D braceright
127
+ !7E U+007E asciitilde
128
+ !7F U+007F .notdef
129
+ !80 U+20AC Euro
130
+ !82 U+201A quotesinglbase
131
+ !83 U+0192 florin
132
+ !84 U+201E quotedblbase
133
+ !85 U+2026 ellipsis
134
+ !86 U+2020 dagger
135
+ !87 U+2021 daggerdbl
136
+ !88 U+02C6 circumflex
137
+ !89 U+2030 perthousand
138
+ !8B U+2039 guilsinglleft
139
+ !8C U+0152 OE
140
+ !91 U+2018 quoteleft
141
+ !92 U+2019 quoteright
142
+ !93 U+201C quotedblleft
143
+ !94 U+201D quotedblright
144
+ !95 U+2022 bullet
145
+ !96 U+2013 endash
146
+ !97 U+2014 emdash
147
+ !98 U+02DC tilde
148
+ !99 U+2122 trademark
149
+ !9B U+203A guilsinglright
150
+ !9C U+0153 oe
151
+ !9F U+0178 Ydieresis
152
+ !A0 U+00A0 space
153
+ !A1 U+00A1 exclamdown
154
+ !A2 U+00A2 cent
155
+ !A3 U+00A3 sterling
156
+ !A4 U+00A4 currency
157
+ !A5 U+00A5 yen
158
+ !A6 U+00A6 brokenbar
159
+ !A7 U+00A7 section
160
+ !A8 U+00A8 dieresis
161
+ !A9 U+00A9 copyright
162
+ !AA U+00AA ordfeminine
163
+ !AB U+00AB guillemotleft
164
+ !AC U+00AC logicalnot
165
+ !AD U+00AD hyphen
166
+ !AE U+00AE registered
167
+ !AF U+00AF macron
168
+ !B0 U+00B0 degree
169
+ !B1 U+00B1 plusminus
170
+ !B2 U+00B2 twosuperior
171
+ !B3 U+00B3 threesuperior
172
+ !B4 U+00B4 acute
173
+ !B5 U+00B5 mu
174
+ !B6 U+00B6 paragraph
175
+ !B7 U+00B7 periodcentered
176
+ !B8 U+00B8 cedilla
177
+ !B9 U+00B9 onesuperior
178
+ !BA U+00BA ordmasculine
179
+ !BB U+00BB guillemotright
180
+ !BC U+00BC onequarter
181
+ !BD U+00BD onehalf
182
+ !BE U+00BE threequarters
183
+ !BF U+00BF questiondown
184
+ !C0 U+00C0 Agrave
185
+ !C1 U+00C1 Aacute
186
+ !C2 U+00C2 Acircumflex
187
+ !C3 U+0102 Abreve
188
+ !C4 U+00C4 Adieresis
189
+ !C5 U+00C5 Aring
190
+ !C6 U+00C6 AE
191
+ !C7 U+00C7 Ccedilla
192
+ !C8 U+00C8 Egrave
193
+ !C9 U+00C9 Eacute
194
+ !CA U+00CA Ecircumflex
195
+ !CB U+00CB Edieresis
196
+ !CC U+0300 gravecomb
197
+ !CD U+00CD Iacute
198
+ !CE U+00CE Icircumflex
199
+ !CF U+00CF Idieresis
200
+ !D0 U+0110 Dcroat
201
+ !D1 U+00D1 Ntilde
202
+ !D2 U+0309 hookabovecomb
203
+ !D3 U+00D3 Oacute
204
+ !D4 U+00D4 Ocircumflex
205
+ !D5 U+01A0 Ohorn
206
+ !D6 U+00D6 Odieresis
207
+ !D7 U+00D7 multiply
208
+ !D8 U+00D8 Oslash
209
+ !D9 U+00D9 Ugrave
210
+ !DA U+00DA Uacute
211
+ !DB U+00DB Ucircumflex
212
+ !DC U+00DC Udieresis
213
+ !DD U+01AF Uhorn
214
+ !DE U+0303 tildecomb
215
+ !DF U+00DF germandbls
216
+ !E0 U+00E0 agrave
217
+ !E1 U+00E1 aacute
218
+ !E2 U+00E2 acircumflex
219
+ !E3 U+0103 abreve
220
+ !E4 U+00E4 adieresis
221
+ !E5 U+00E5 aring
222
+ !E6 U+00E6 ae
223
+ !E7 U+00E7 ccedilla
224
+ !E8 U+00E8 egrave
225
+ !E9 U+00E9 eacute
226
+ !EA U+00EA ecircumflex
227
+ !EB U+00EB edieresis
228
+ !EC U+0301 acutecomb
229
+ !ED U+00ED iacute
230
+ !EE U+00EE icircumflex
231
+ !EF U+00EF idieresis
232
+ !F0 U+0111 dcroat
233
+ !F1 U+00F1 ntilde
234
+ !F2 U+0323 dotbelowcomb
235
+ !F3 U+00F3 oacute
236
+ !F4 U+00F4 ocircumflex
237
+ !F5 U+01A1 ohorn
238
+ !F6 U+00F6 odieresis
239
+ !F7 U+00F7 divide
240
+ !F8 U+00F8 oslash
241
+ !F9 U+00F9 ugrave
242
+ !FA U+00FA uacute
243
+ !FB U+00FB ucircumflex
244
+ !FC U+00FC udieresis
245
+ !FD U+01B0 uhorn
246
+ !FE U+20AB dong
247
+ !FF U+00FF ydieresis
lib/fpdf/font/makefont/cp874.map ADDED
@@ -0,0 +1,225 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ !00 U+0000 .notdef
2
+ !01 U+0001 .notdef
3
+ !02 U+0002 .notdef
4
+ !03 U+0003 .notdef
5
+ !04 U+0004 .notdef
6
+ !05 U+0005 .notdef
7
+ !06 U+0006 .notdef
8
+ !07 U+0007 .notdef
9
+ !08 U+0008 .notdef
10
+ !09 U+0009 .notdef
11
+ !0A U+000A .notdef
12
+ !0B U+000B .notdef
13
+ !0C U+000C .notdef
14
+ !0D U+000D .notdef
15
+ !0E U+000E .notdef
16
+ !0F U+000F .notdef
17
+ !10 U+0010 .notdef
18
+ !11 U+0011 .notdef
19
+ !12 U+0012 .notdef
20
+ !13 U+0013 .notdef
21
+ !14 U+0014 .notdef
22
+ !15 U+0015 .notdef
23
+ !16 U+0016 .notdef
24
+ !17 U+0017 .notdef
25
+ !18 U+0018 .notdef
26
+ !19 U+0019 .notdef
27
+ !1A U+001A .notdef
28
+ !1B U+001B .notdef
29
+ !1C U+001C .notdef
30
+ !1D U+001D .notdef
31
+ !1E U+001E .notdef
32
+ !1F U+001F .notdef
33
+ !20 U+0020 space
34
+ !21 U+0021 exclam
35
+ !22 U+0022 quotedbl
36
+ !23 U+0023 numbersign
37
+ !24 U+0024 dollar
38
+ !25 U+0025 percent
39
+ !26 U+0026 ampersand
40
+ !27 U+0027 quotesingle
41
+ !28 U+0028 parenleft
42
+ !29 U+0029 parenright
43
+ !2A U+002A asterisk
44
+ !2B U+002B plus
45
+ !2C U+002C comma
46
+ !2D U+002D hyphen
47
+ !2E U+002E period
48
+ !2F U+002F slash
49
+ !30 U+0030 zero
50
+ !31 U+0031 one
51
+ !32 U+0032 two
52
+ !33 U+0033 three
53
+ !34 U+0034 four
54
+ !35 U+0035 five
55
+ !36 U+0036 six
56
+ !37 U+0037 seven
57
+ !38 U+0038 eight
58
+ !39 U+0039 nine
59
+ !3A U+003A colon
60
+ !3B U+003B semicolon
61
+ !3C U+003C less
62
+ !3D U+003D equal
63
+ !3E U+003E greater
64
+ !3F U+003F question
65
+ !40 U+0040 at
66
+ !41 U+0041 A
67
+ !42 U+0042 B
68
+ !43 U+0043 C
69
+ !44 U+0044 D
70
+ !45 U+0045 E
71
+ !46 U+0046 F
72
+ !47 U+0047 G
73
+ !48 U+0048 H
74
+ !49 U+0049 I
75
+ !4A U+004A J
76
+ !4B U+004B K
77
+ !4C U+004C L
78
+ !4D U+004D M
79
+ !4E U+004E N
80
+ !4F U+004F O
81
+ !50 U+0050 P
82
+ !51 U+0051 Q
83
+ !52 U+0052 R
84
+ !53 U+0053 S
85
+ !54 U+0054 T
86
+ !55 U+0055 U
87
+ !56 U+0056 V
88
+ !57 U+0057 W
89
+ !58 U+0058 X
90
+ !59 U+0059 Y
91
+ !5A U+005A Z
92
+ !5B U+005B bracketleft
93
+ !5C U+005C backslash
94
+ !5D U+005D bracketright
95
+ !5E U+005E asciicircum
96
+ !5F U+005F underscore
97
+ !60 U+0060 grave
98
+ !61 U+0061 a
99
+ !62 U+0062 b
100
+ !63 U+0063 c
101
+ !64 U+0064 d
102
+ !65 U+0065 e
103
+ !66 U+0066 f
104
+ !67 U+0067 g
105
+ !68 U+0068 h
106
+ !69 U+0069 i
107
+ !6A U+006A j
108
+ !6B U+006B k
109
+ !6C U+006C l
110
+ !6D U+006D m
111
+ !6E U+006E n
112
+ !6F U+006F o
113
+ !70 U+0070 p
114
+ !71 U+0071 q
115
+ !72 U+0072 r
116
+ !73 U+0073 s
117
+ !74 U+0074 t
118
+ !75 U+0075 u
119
+ !76 U+0076 v
120
+ !77 U+0077 w
121
+ !78 U+0078 x
122
+ !79 U+0079 y
123
+ !7A U+007A z
124
+ !7B U+007B braceleft
125
+ !7C U+007C bar
126
+ !7D U+007D braceright
127
+ !7E U+007E asciitilde
128
+ !7F U+007F .notdef
129
+ !80 U+20AC Euro
130
+ !85 U+2026 ellipsis
131
+ !91 U+2018 quoteleft
132
+ !92 U+2019 quoteright
133
+ !93 U+201C quotedblleft
134
+ !94 U+201D quotedblright
135
+ !95 U+2022 bullet
136
+ !96 U+2013 endash
137
+ !97 U+2014 emdash
138
+ !A0 U+00A0 space
139
+ !A1 U+0E01 kokaithai
140
+ !A2 U+0E02 khokhaithai
141
+ !A3 U+0E03 khokhuatthai
142
+ !A4 U+0E04 khokhwaithai
143
+ !A5 U+0E05 khokhonthai
144
+ !A6 U+0E06 khorakhangthai
145
+ !A7 U+0E07 ngonguthai
146
+ !A8 U+0E08 chochanthai
147
+ !A9 U+0E09 chochingthai
148
+ !AA U+0E0A chochangthai
149
+ !AB U+0E0B sosothai
150
+ !AC U+0E0C chochoethai
151
+ !AD U+0E0D yoyingthai
152
+ !AE U+0E0E dochadathai
153
+ !AF U+0E0F topatakthai
154
+ !B0 U+0E10 thothanthai
155
+ !B1 U+0E11 thonangmonthothai
156
+ !B2 U+0E12 thophuthaothai
157
+ !B3 U+0E13 nonenthai
158
+ !B4 U+0E14 dodekthai
159
+ !B5 U+0E15 totaothai
160
+ !B6 U+0E16 thothungthai
161
+ !B7 U+0E17 thothahanthai
162
+ !B8 U+0E18 thothongthai
163
+ !B9 U+0E19 nonuthai
164
+ !BA U+0E1A bobaimaithai
165
+ !BB U+0E1B poplathai
166
+ !BC U+0E1C phophungthai
167
+ !BD U+0E1D fofathai
168
+ !BE U+0E1E phophanthai
169
+ !BF U+0E1F fofanthai
170
+ !C0 U+0E20 phosamphaothai
171
+ !C1 U+0E21 momathai
172
+ !C2 U+0E22 yoyakthai
173
+ !C3 U+0E23 roruathai
174
+ !C4 U+0E24 ruthai
175
+ !C5 U+0E25 lolingthai
176
+ !C6 U+0E26 luthai
177
+ !C7 U+0E27 wowaenthai
178
+ !C8 U+0E28 sosalathai
179
+ !C9 U+0E29 sorusithai
180
+ !CA U+0E2A sosuathai
181
+ !CB U+0E2B hohipthai
182
+ !CC U+0E2C lochulathai
183
+ !CD U+0E2D oangthai
184
+ !CE U+0E2E honokhukthai
185
+ !CF U+0E2F paiyannoithai
186
+ !D0 U+0E30 saraathai
187
+ !D1 U+0E31 maihanakatthai
188
+ !D2 U+0E32 saraaathai
189
+ !D3 U+0E33 saraamthai
190
+ !D4 U+0E34 saraithai
191
+ !D5 U+0E35 saraiithai
192
+ !D6 U+0E36 sarauethai
193
+ !D7 U+0E37 saraueethai
194
+ !D8 U+0E38 sarauthai
195
+ !D9 U+0E39 sarauuthai
196
+ !DA U+0E3A phinthuthai
197
+ !DF U+0E3F bahtthai
198
+ !E0 U+0E40 saraethai
199
+ !E1 U+0E41 saraaethai
200
+ !E2 U+0E42 saraothai
201
+ !E3 U+0E43 saraaimaimuanthai
202
+ !E4 U+0E44 saraaimaimalaithai
203
+ !E5 U+0E45 lakkhangyaothai
204
+ !E6 U+0E46 maiyamokthai
205
+ !E7 U+0E47 maitaikhuthai
206
+ !E8 U+0E48 maiekthai
207
+ !E9 U+0E49 maithothai
208
+ !EA U+0E4A maitrithai
209
+ !EB U+0E4B maichattawathai
210
+ !EC U+0E4C thanthakhatthai
211
+ !ED U+0E4D nikhahitthai
212
+ !EE U+0E4E yamakkanthai
213
+ !EF U+0E4F fongmanthai
214
+ !F0 U+0E50 zerothai
215
+ !F1 U+0E51 onethai
216
+ !F2 U+0E52 twothai
217
+ !F3 U+0E53 threethai
218
+ !F4 U+0E54 fourthai
219
+ !F5 U+0E55 fivethai
220
+ !F6 U+0E56 sixthai
221
+ !F7 U+0E57 seventhai
222
+ !F8 U+0E58 eightthai
223
+ !F9 U+0E59 ninethai
224
+ !FA U+0E5A angkhankhuthai
225
+ !FB U+0E5B khomutthai
lib/fpdf/font/makefont/iso-8859-1.map ADDED
@@ -0,0 +1,256 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ !00 U+0000 .notdef
2
+ !01 U+0001 .notdef
3
+ !02 U+0002 .notdef
4
+ !03 U+0003 .notdef
5
+ !04 U+0004 .notdef
6
+ !05 U+0005 .notdef
7
+ !06 U+0006 .notdef
8
+ !07 U+0007 .notdef
9
+ !08 U+0008 .notdef
10
+ !09 U+0009 .notdef
11
+ !0A U+000A .notdef
12
+ !0B U+000B .notdef
13
+ !0C U+000C .notdef
14
+ !0D U+000D .notdef
15
+ !0E U+000E .notdef
16
+ !0F U+000F .notdef
17
+ !10 U+0010 .notdef
18
+ !11 U+0011 .notdef
19
+ !12 U+0012 .notdef
20
+ !13 U+0013 .notdef
21
+ !14 U+0014 .notdef
22
+ !15 U+0015 .notdef
23
+ !16 U+0016 .notdef
24
+ !17 U+0017 .notdef
25
+ !18 U+0018 .notdef
26
+ !19 U+0019 .notdef
27
+ !1A U+001A .notdef
28
+ !1B U+001B .notdef
29
+ !1C U+001C .notdef
30
+ !1D U+001D .notdef
31
+ !1E U+001E .notdef
32
+ !1F U+001F .notdef
33
+ !20 U+0020 space
34
+ !21 U+0021 exclam
35
+ !22 U+0022 quotedbl
36
+ !23 U+0023 numbersign
37
+ !24 U+0024 dollar
38
+ !25 U+0025 percent
39
+ !26 U+0026 ampersand
40
+ !27 U+0027 quotesingle
41
+ !28 U+0028 parenleft
42
+ !29 U+0029 parenright
43
+ !2A U+002A asterisk
44
+ !2B U+002B plus
45
+ !2C U+002C comma
46
+ !2D U+002D hyphen
47
+ !2E U+002E period
48
+ !2F U+002F slash
49
+ !30 U+0030 zero
50
+ !31 U+0031 one
51
+ !32 U+0032 two
52
+ !33 U+0033 three
53
+ !34 U+0034 four
54
+ !35 U+0035 five
55
+ !36 U+0036 six
56
+ !37 U+0037 seven
57
+ !38 U+0038 eight
58
+ !39 U+0039 nine
59
+ !3A U+003A colon
60
+ !3B U+003B semicolon
61
+ !3C U+003C less
62
+ !3D U+003D equal
63
+ !3E U+003E greater
64
+ !3F U+003F question
65
+ !40 U+0040 at
66
+ !41 U+0041 A
67
+ !42 U+0042 B
68
+ !43 U+0043 C
69
+ !44 U+0044 D
70
+ !45 U+0045 E
71
+ !46 U+0046 F
72
+ !47 U+0047 G
73
+ !48 U+0048 H
74
+ !49 U+0049 I
75
+ !4A U+004A J
76
+ !4B U+004B K
77
+ !4C U+004C L
78
+ !4D U+004D M
79
+ !4E U+004E N
80
+ !4F U+004F O
81
+ !50 U+0050 P
82
+ !51 U+0051 Q
83
+ !52 U+0052 R
84
+ !53 U+0053 S
85
+ !54 U+0054 T
86
+ !55 U+0055 U
87
+ !56 U+0056 V
88
+ !57 U+0057 W
89
+ !58 U+0058 X
90
+ !59 U+0059 Y
91
+ !5A U+005A Z
92
+ !5B U+005B bracketleft
93
+ !5C U+005C backslash
94
+ !5D U+005D bracketright
95
+ !5E U+005E asciicircum
96
+ !5F U+005F underscore
97
+ !60 U+0060 grave
98
+ !61 U+0061 a
99
+ !62 U+0062 b
100
+ !63 U+0063 c
101
+ !64 U+0064 d
102
+ !65 U+0065 e
103
+ !66 U+0066 f
104
+ !67 U+0067 g
105
+ !68 U+0068 h
106
+ !69 U+0069 i
107
+ !6A U+006A j
108
+ !6B U+006B k
109
+ !6C U+006C l
110
+ !6D U+006D m
111
+ !6E U+006E n
112
+ !6F U+006F o
113
+ !70 U+0070 p
114
+ !71 U+0071 q
115
+ !72 U+0072 r
116
+ !73 U+0073 s
117
+ !74 U+0074 t
118
+ !75 U+0075 u
119
+ !76 U+0076 v
120
+ !77 U+0077 w
121
+ !78 U+0078 x
122
+ !79 U+0079 y
123
+ !7A U+007A z
124
+ !7B U+007B braceleft
125
+ !7C U+007C bar
126
+ !7D U+007D braceright
127
+ !7E U+007E asciitilde
128
+ !7F U+007F .notdef
129
+ !80 U+0080 .notdef
130
+ !81 U+0081 .notdef
131
+ !82 U+0082 .notdef
132
+ !83 U+0083 .notdef
133
+ !84 U+0084 .notdef
134
+ !85 U+0085 .notdef
135
+ !86 U+0086 .notdef
136
+ !87 U+0087 .notdef
137
+ !88 U+0088 .notdef
138
+ !89 U+0089 .notdef
139
+ !8A U+008A .notdef
140
+ !8B U+008B .notdef
141
+ !8C U+008C .notdef
142
+ !8D U+008D .notdef
143
+ !8E U+008E .notdef
144
+ !8F U+008F .notdef
145
+ !90 U+0090 .notdef
146
+ !91 U+0091 .notdef
147
+ !92 U+0092 .notdef
148
+ !93 U+0093 .notdef
149
+ !94 U+0094 .notdef
150
+ !95 U+0095 .notdef
151
+ !96 U+0096 .notdef
152
+ !97 U+0097 .notdef
153
+ !98 U+0098 .notdef
154
+ !99 U+0099 .notdef
155
+ !9A U+009A .notdef
156
+ !9B U+009B .notdef
157
+ !9C U+009C .notdef
158
+ !9D U+009D .notdef
159
+ !9E U+009E .notdef
160
+ !9F U+009F .notdef
161
+ !A0 U+00A0 space
162
+ !A1 U+00A1 exclamdown
163
+ !A2 U+00A2 cent
164
+ !A3 U+00A3 sterling
165
+ !A4 U+00A4 currency
166
+ !A5 U+00A5 yen
167
+ !A6 U+00A6 brokenbar
168
+ !A7 U+00A7 section
169
+ !A8 U+00A8 dieresis
170
+ !A9 U+00A9 copyright
171
+ !AA U+00AA ordfeminine
172
+ !AB U+00AB guillemotleft
173
+ !AC U+00AC logicalnot
174
+ !AD U+00AD hyphen
175
+ !AE U+00AE registered
176
+ !AF U+00AF macron
177
+ !B0 U+00B0 degree
178
+ !B1 U+00B1 plusminus
179
+ !B2 U+00B2 twosuperior
180
+ !B3 U+00B3 threesuperior
181
+ !B4 U+00B4 acute
182
+ !B5 U+00B5 mu
183
+ !B6 U+00B6 paragraph
184
+ !B7 U+00B7 periodcentered
185
+ !B8 U+00B8 cedilla
186
+ !B9 U+00B9 onesuperior
187
+ !BA U+00BA ordmasculine
188
+ !BB U+00BB guillemotright
189
+ !BC U+00BC onequarter
190
+ !BD U+00BD onehalf
191
+ !BE U+00BE threequarters
192
+ !BF U+00BF questiondown
193
+ !C0 U+00C0 Agrave
194
+ !C1 U+00C1 Aacute
195
+ !C2 U+00C2 Acircumflex
196
+ !C3 U+00C3 Atilde
197
+ !C4 U+00C4 Adieresis
198
+ !C5 U+00C5 Aring
199
+ !C6 U+00C6 AE
200
+ !C7 U+00C7 Ccedilla
201
+ !C8 U+00C8 Egrave
202
+ !C9 U+00C9 Eacute
203
+ !CA U+00CA Ecircumflex
204
+ !CB U+00CB Edieresis
205
+ !CC U+00CC Igrave
206
+ !CD U+00CD Iacute
207
+ !CE U+00CE Icircumflex
208
+ !CF U+00CF Idieresis
209
+ !D0 U+00D0 Eth
210
+ !D1 U+00D1 Ntilde
211
+ !D2 U+00D2 Ograve
212
+ !D3 U+00D3 Oacute
213
+ !D4 U+00D4 Ocircumflex
214
+ !D5 U+00D5 Otilde
215
+ !D6 U+00D6 Odieresis
216
+ !D7 U+00D7 multiply
217
+ !D8 U+00D8 Oslash
218
+ !D9 U+00D9 Ugrave
219
+ !DA U+00DA Uacute
220
+ !DB U+00DB Ucircumflex
221
+ !DC U+00DC Udieresis
222
+ !DD U+00DD Yacute
223
+ !DE U+00DE Thorn
224
+ !DF U+00DF germandbls
225
+ !E0 U+00E0 agrave
226
+ !E1 U+00E1 aacute
227
+ !E2 U+00E2 acircumflex
228
+ !E3 U+00E3 atilde
229
+ !E4 U+00E4 adieresis
230
+ !E5 U+00E5 aring
231
+ !E6 U+00E6 ae
232
+ !E7 U+00E7 ccedilla
233
+ !E8 U+00E8 egrave
234
+ !E9 U+00E9 eacute
235
+ !EA U+00EA ecircumflex
236
+ !EB U+00EB edieresis
237
+ !EC U+00EC igrave
238
+ !ED U+00ED iacute
239
+ !EE U+00EE icircumflex
240
+ !EF U+00EF idieresis
241
+ !F0 U+00F0 eth
242
+ !F1 U+00F1 ntilde
243
+ !F2 U+00F2 ograve
244
+ !F3 U+00F3 oacute
245
+ !F4 U+00F4 ocircumflex
246
+ !F5 U+00F5 otilde
247
+ !F6 U+00F6 odieresis
248
+ !F7 U+00F7 divide
249
+ !F8 U+00F8 oslash
250
+ !F9 U+00F9 ugrave
251
+ !FA U+00FA uacute
252
+ !FB U+00FB ucircumflex
253
+ !FC U+00FC udieresis
254
+ !FD U+00FD yacute
255
+ !FE U+00FE thorn
256
+ !FF U+00FF ydieresis
lib/fpdf/font/makefont/iso-8859-11.map ADDED
@@ -0,0 +1,248 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ !00 U+0000 .notdef
2
+ !01 U+0001 .notdef
3
+ !02 U+0002 .notdef
4
+ !03 U+0003 .notdef
5
+ !04 U+0004 .notdef
6
+ !05 U+0005 .notdef
7
+ !06 U+0006 .notdef
8
+ !07 U+0007 .notdef
9
+ !08 U+0008 .notdef
10
+ !09 U+0009 .notdef
11
+ !0A U+000A .notdef
12
+ !0B U+000B .notdef
13
+ !0C U+000C .notdef
14
+ !0D U+000D .notdef
15
+ !0E U+000E .notdef
16
+ !0F U+000F .notdef
17
+ !10 U+0010 .notdef
18
+ !11 U+0011 .notdef
19
+ !12 U+0012 .notdef
20
+ !13 U+0013 .notdef
21
+ !14 U+0014 .notdef
22
+ !15 U+0015 .notdef
23
+ !16 U+0016 .notdef
24
+ !17 U+0017 .notdef
25
+ !18 U+0018 .notdef
26
+ !19 U+0019 .notdef
27
+ !1A U+001A .notdef
28
+ !1B U+001B .notdef
29
+ !1C U+001C .notdef
30
+ !1D U+001D .notdef
31
+ !1E U+001E .notdef
32
+ !1F U+001F .notdef
33
+ !20 U+0020 space
34
+ !21 U+0021 exclam
35
+ !22 U+0022 quotedbl
36
+ !23 U+0023 numbersign
37
+ !24 U+0024 dollar
38
+ !25 U+0025 percent
39
+ !26 U+0026 ampersand
40
+ !27 U+0027 quotesingle
41
+ !28 U+0028 parenleft
42
+ !29 U+0029 parenright
43
+ !2A U+002A asterisk
44
+ !2B U+002B plus
45
+ !2C U+002C comma
46
+ !2D U+002D hyphen
47
+ !2E U+002E period
48
+ !2F U+002F slash
49
+ !30 U+0030 zero
50
+ !31 U+0031 one
51
+ !32 U+0032 two
52
+ !33 U+0033 three
53
+ !34 U+0034 four
54
+ !35 U+0035 five
55
+ !36 U+0036 six
56
+ !37 U+0037 seven
57
+ !38 U+0038 eight
58
+ !39 U+0039 nine
59
+ !3A U+003A colon
60
+ !3B U+003B semicolon
61
+ !3C U+003C less
62
+ !3D U+003D equal
63
+ !3E U+003E greater
64
+ !3F U+003F question
65
+ !40 U+0040 at
66
+ !41 U+0041 A
67
+ !42 U+0042 B
68
+ !43 U+0043 C
69
+ !44 U+0044 D
70
+ !45 U+0045 E
71
+ !46 U+0046 F
72
+ !47 U+0047 G
73
+ !48 U+0048 H
74
+ !49 U+0049 I
75
+ !4A U+004A J
76
+ !4B U+004B K
77
+ !4C U+004C L
78
+ !4D U+004D M
79
+ !4E U+004E N
80
+ !4F U+004F O
81
+ !50 U+0050 P
82
+ !51 U+0051 Q
83
+ !52 U+0052 R
84
+ !53 U+0053 S
85
+ !54 U+0054 T
86
+ !55 U+0055 U
87
+ !56 U+0056 V
88
+ !57 U+0057 W
89
+ !58 U+0058 X
90
+ !59 U+0059 Y
91
+ !5A U+005A Z
92
+ !5B U+005B bracketleft
93
+ !5C U+005C backslash
94
+ !5D U+005D bracketright
95
+ !5E U+005E asciicircum
96
+ !5F U+005F underscore
97
+ !60 U+0060 grave
98
+ !61 U+0061 a
99
+ !62 U+0062 b
100
+ !63 U+0063 c
101
+ !64 U+0064 d
102
+ !65 U+0065 e
103
+ !66 U+0066 f
104
+ !67 U+0067 g
105
+ !68 U+0068 h
106
+ !69 U+0069 i
107
+ !6A U+006A j
108
+ !6B U+006B k
109
+ !6C U+006C l
110
+ !6D U+006D m
111
+ !6E U+006E n
112
+ !6F U+006F o
113
+ !70 U+0070 p
114
+ !71 U+0071 q
115
+ !72 U+0072 r
116
+ !73 U+0073 s
117
+ !74 U+0074 t
118
+ !75 U+0075 u
119
+ !76 U+0076 v
120
+ !77 U+0077 w
121
+ !78 U+0078 x
122
+ !79 U+0079 y
123
+ !7A U+007A z
124
+ !7B U+007B braceleft
125
+ !7C U+007C bar
126
+ !7D U+007D braceright
127
+ !7E U+007E asciitilde
128
+ !7F U+007F .notdef
129
+ !80 U+0080 .notdef
130
+ !81 U+0081 .notdef
131
+ !82 U+0082 .notdef
132
+ !83 U+0083 .notdef
133
+ !84 U+0084 .notdef
134
+ !85 U+0085 .notdef
135
+ !86 U+0086 .notdef
136
+ !87 U+0087 .notdef
137
+ !88 U+0088 .notdef
138
+ !89 U+0089 .notdef
139
+ !8A U+008A .notdef
140
+ !8B U+008B .notdef
141
+ !8C U+008C .notdef
142
+ !8D U+008D .notdef
143
+ !8E U+008E .notdef
144
+ !8F U+008F .notdef
145
+ !90 U+0090 .notdef
146
+ !91 U+0091 .notdef
147
+ !92 U+0092 .notdef
148
+ !93 U+0093 .notdef
149
+ !94 U+0094 .notdef
150
+ !95 U+0095 .notdef
151
+ !96 U+0096 .notdef
152
+ !97 U+0097 .notdef
153
+ !98 U+0098 .notdef
154
+ !99 U+0099 .notdef
155
+ !9A U+009A .notdef
156
+ !9B U+009B .notdef
157
+ !9C U+009C .notdef
158
+ !9D U+009D .notdef
159
+ !9E U+009E .notdef
160
+ !9F U+009F .notdef
161
+ !A0 U+00A0 space
162
+ !A1 U+0E01 kokaithai
163
+ !A2 U+0E02 khokhaithai
164
+ !A3 U+0E03 khokhuatthai
165
+ !A4 U+0E04 khokhwaithai
166
+ !A5 U+0E05 khokhonthai
167
+ !A6 U+0E06 khorakhangthai
168
+ !A7 U+0E07 ngonguthai
169
+ !A8 U+0E08 chochanthai
170
+ !A9 U+0E09 chochingthai
171
+ !AA U+0E0A chochangthai
172
+ !AB U+0E0B sosothai
173
+ !AC U+0E0C chochoethai
174
+ !AD U+0E0D yoyingthai
175
+ !AE U+0E0E dochadathai
176
+ !AF U+0E0F topatakthai
177
+ !B0 U+0E10 thothanthai
178
+ !B1 U+0E11 thonangmonthothai
179
+ !B2 U+0E12 thophuthaothai
180
+ !B3 U+0E13 nonenthai
181
+ !B4 U+0E14 dodekthai
182
+ !B5 U+0E15 totaothai
183
+ !B6 U+0E16 thothungthai
184
+ !B7 U+0E17 thothahanthai
185
+ !B8 U+0E18 thothongthai
186
+ !B9 U+0E19 nonuthai
187
+ !BA U+0E1A bobaimaithai
188
+ !BB U+0E1B poplathai
189
+ !BC U+0E1C phophungthai
190
+ !BD U+0E1D fofathai
191
+ !BE U+0E1E phophanthai
192
+ !BF U+0E1F fofanthai
193
+ !C0 U+0E20 phosamphaothai
194
+ !C1 U+0E21 momathai
195
+ !C2 U+0E22 yoyakthai
196
+ !C3 U+0E23 roruathai
197
+ !C4 U+0E24 ruthai
198
+ !C5 U+0E25 lolingthai
199
+ !C6 U+0E26 luthai
200
+ !C7 U+0E27 wowaenthai
201
+ !C8 U+0E28 sosalathai
202
+ !C9 U+0E29 sorusithai
203
+ !CA U+0E2A sosuathai
204
+ !CB U+0E2B hohipthai
205
+ !CC U+0E2C lochulathai
206
+ !CD U+0E2D oangthai
207
+ !CE U+0E2E honokhukthai
208
+ !CF U+0E2F paiyannoithai
209
+ !D0 U+0E30 saraathai
210
+ !D1 U+0E31 maihanakatthai
211
+ !D2 U+0E32 saraaathai
212
+ !D3 U+0E33 saraamthai
213
+ !D4 U+0E34 saraithai
214
+ !D5 U+0E35 saraiithai
215
+ !D6 U+0E36 sarauethai
216
+ !D7 U+0E37 saraueethai
217
+ !D8 U+0E38 sarauthai
218
+ !D9 U+0E39 sarauuthai
219
+ !DA U+0E3A phinthuthai
220
+ !DF U+0E3F bahtthai
221
+ !E0 U+0E40 saraethai
222
+ !E1 U+0E41 saraaethai
223
+ !E2 U+0E42 saraothai
224
+ !E3 U+0E43 saraaimaimuanthai
225
+ !E4 U+0E44 saraaimaimalaithai
226
+ !E5 U+0E45 lakkhangyaothai
227
+ !E6 U+0E46 maiyamokthai
228
+ !E7 U+0E47 maitaikhuthai
229
+ !E8 U+0E48 maiekthai
230
+ !E9 U+0E49 maithothai
231
+ !EA U+0E4A maitrithai
232
+ !EB U+0E4B maichattawathai
233
+ !EC U+0E4C thanthakhatthai
234
+ !ED U+0E4D nikhahitthai
235
+ !EE U+0E4E yamakkanthai
236
+ !EF U+0E4F fongmanthai
237
+ !F0 U+0E50 zerothai
238
+ !F1 U+0E51 onethai
239
+ !F2 U+0E52 twothai
240
+ !F3 U+0E53 threethai
241
+ !F4 U+0E54 fourthai
242
+ !F5 U+0E55 fivethai
243
+ !F6 U+0E56 sixthai
244
+ !F7 U+0E57 seventhai
245
+ !F8 U+0E58 eightthai
246
+ !F9 U+0E59 ninethai
247
+ !FA U+0E5A angkhankhuthai
248
+ !FB U+0E5B khomutthai
lib/fpdf/font/makefont/iso-8859-15.map ADDED
@@ -0,0 +1,256 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ !00 U+0000 .notdef
2
+ !01 U+0001 .notdef
3
+ !02 U+0002 .notdef
4
+ !03 U+0003 .notdef
5
+ !04 U+0004 .notdef
6
+ !05 U+0005 .notdef
7
+ !06 U+0006 .notdef
8
+ !07 U+0007 .notdef
9
+ !08 U+0008 .notdef
10
+ !09 U+0009 .notdef
11
+ !0A U+000A .notdef
12
+ !0B U+000B .notdef
13
+ !0C U+000C .notdef
14
+ !0D U+000D .notdef
15
+ !0E U+000E .notdef
16
+ !0F U+000F .notdef
17
+ !10 U+0010 .notdef
18
+ !11 U+0011 .notdef
19
+ !12 U+0012 .notdef
20
+ !13 U+0013 .notdef
21
+ !14 U+0014 .notdef
22
+ !15 U+0015 .notdef
23
+ !16 U+0016 .notdef
24
+ !17 U+0017 .notdef
25
+ !18 U+0018 .notdef
26
+ !19 U+0019 .notdef
27
+ !1A U+001A .notdef
28
+ !1B U+001B .notdef
29
+ !1C U+001C .notdef
30
+ !1D U+001D .notdef
31
+ !1E U+001E .notdef
32
+ !1F U+001F .notdef
33
+ !20 U+0020 space
34
+ !21 U+0021 exclam
35
+ !22 U+0022 quotedbl
36
+ !23 U+0023 numbersign
37
+ !24 U+0024 dollar
38
+ !25 U+0025 percent
39
+ !26 U+0026 ampersand
40
+ !27 U+0027 quotesingle
41
+ !28 U+0028 parenleft
42
+ !29 U+0029 parenright
43
+ !2A U+002A asterisk
44
+ !2B U+002B plus
45
+ !2C U+002C comma
46
+ !2D U+002D hyphen
47
+ !2E U+002E period
48
+ !2F U+002F slash
49
+ !30 U+0030 zero
50
+ !31 U+0031 one
51
+ !32 U+0032 two
52
+ !33 U+0033 three
53
+ !34 U+0034 four
54
+ !35 U+0035 five
55
+ !36 U+0036 six
56
+ !37 U+0037 seven
57
+ !38 U+0038 eight
58
+ !39 U+0039 nine
59
+ !3A U+003A colon
60
+ !3B U+003B semicolon
61
+ !3C U+003C less
62
+ !3D U+003D equal
63
+ !3E U+003E greater
64
+ !3F U+003F question
65
+ !40 U+0040 at
66
+ !41 U+0041 A
67
+ !42 U+0042 B
68
+ !43 U+0043 C
69
+ !44 U+0044 D
70
+ !45 U+0045 E
71
+ !46 U+0046 F
72
+ !47 U+0047 G
73
+ !48 U+0048 H
74
+ !49 U+0049 I
75
+ !4A U+004A J
76
+ !4B U+004B K
77
+ !4C U+004C L
78
+ !4D U+004D M
79
+ !4E U+004E N
80
+ !4F U+004F O
81
+ !50 U+0050 P
82
+ !51 U+0051 Q
83
+ !52 U+0052 R
84
+ !53 U+0053 S
85
+ !54 U+0054 T
86
+ !55 U+0055 U
87
+ !56 U+0056 V
88
+ !57 U+0057 W
89
+ !58 U+0058 X
90
+ !59 U+0059 Y
91
+ !5A U+005A Z
92
+ !5B U+005B bracketleft
93
+ !5C U+005C backslash
94
+ !5D U+005D bracketright
95
+ !5E U+005E asciicircum
96
+ !5F U+005F underscore
97
+ !60 U+0060 grave
98
+ !61 U+0061 a
99
+ !62 U+0062 b
100
+ !63 U+0063 c
101
+ !64 U+0064 d
102
+ !65 U+0065 e
103
+ !66 U+0066 f
104
+ !67 U+0067 g
105
+ !68 U+0068 h
106
+ !69 U+0069 i
107
+ !6A U+006A j
108
+ !6B U+006B k
109
+ !6C U+006C l
110
+ !6D U+006D m
111
+ !6E U+006E n
112
+ !6F U+006F o
113
+ !70 U+0070 p
114
+ !71 U+0071 q
115
+ !72 U+0072 r
116
+ !73 U+0073 s
117
+ !74 U+0074 t
118
+ !75 U+0075 u
119
+ !76 U+0076 v
120
+ !77 U+0077 w
121
+ !78 U+0078 x
122
+ !79 U+0079 y
123
+ !7A U+007A z
124
+ !7B U+007B braceleft
125
+ !7C U+007C bar
126
+ !7D U+007D braceright
127
+ !7E U+007E asciitilde
128
+ !7F U+007F .notdef
129
+ !80 U+0080 .notdef
130
+ !81 U+0081 .notdef
131
+ !82 U+0082 .notdef
132
+ !83 U+0083 .notdef
133
+ !84 U+0084 .notdef
134
+ !85 U+0085 .notdef
135
+ !86 U+0086 .notdef
136
+ !87 U+0087 .notdef
137
+ !88 U+0088 .notdef
138
+ !89 U+0089 .notdef
139
+ !8A U+008A .notdef
140
+ !8B U+008B .notdef
141
+ !8C U+008C .notdef
142
+ !8D U+008D .notdef
143
+ !8E U+008E .notdef
144
+ !8F U+008F .notdef
145
+ !90 U+0090 .notdef
146
+ !91 U+0091 .notdef
147
+ !92 U+0092 .notdef
148
+ !93 U+0093 .notdef
149
+ !94 U+0094 .notdef
150
+ !95 U+0095 .notdef
151
+ !96 U+0096 .notdef
152
+ !97 U+0097 .notdef
153
+ !98 U+0098 .notdef
154
+ !99 U+0099 .notdef
155
+ !9A U+009A .notdef
156
+ !9B U+009B .notdef
157
+ !9C U+009C .notdef
158
+ !9D U+009D .notdef
159
+ !9E U+009E .notdef
160
+ !9F U+009F .notdef
161
+ !A0 U+00A0 space
162
+ !A1 U+00A1 exclamdown
163
+ !A2 U+00A2 cent
164
+ !A3 U+00A3 sterling
165
+ !A4 U+20AC Euro
166
+ !A5 U+00A5 yen
167
+ !A6 U+0160 Scaron
168
+ !A7 U+00A7 section
169
+ !A8 U+0161 scaron
170
+ !A9 U+00A9 copyright
171
+ !AA U+00AA ordfeminine
172
+ !AB U+00AB guillemotleft
173
+ !AC U+00AC logicalnot
174
+ !AD U+00AD hyphen
175
+ !AE U+00AE registered
176
+ !AF U+00AF macron
177
+ !B0 U+00B0 degree
178
+ !B1 U+00B1 plusminus
179
+ !B2 U+00B2 twosuperior
180
+ !B3 U+00B3 threesuperior
181
+ !B4 U+017D Zcaron
182
+ !B5 U+00B5 mu
183
+ !B6 U+00B6 paragraph
184
+ !B7 U+00B7 periodcentered
185
+ !B8 U+017E zcaron
186
+ !B9 U+00B9 onesuperior
187
+ !BA U+00BA ordmasculine
188
+ !BB U+00BB guillemotright
189
+ !BC U+0152 OE
190
+ !BD U+0153 oe
191
+ !BE U+0178 Ydieresis
192
+ !BF U+00BF questiondown
193
+ !C0 U+00C0 Agrave
194
+ !C1 U+00C1 Aacute
195
+ !C2 U+00C2 Acircumflex
196
+ !C3 U+00C3 Atilde
197
+ !C4 U+00C4 Adieresis
198
+ !C5 U+00C5 Aring
199
+ !C6 U+00C6 AE
200
+ !C7 U+00C7 Ccedilla
201
+ !C8 U+00C8 Egrave
202
+ !C9 U+00C9 Eacute
203
+ !CA U+00CA Ecircumflex
204
+ !CB U+00CB Edieresis
205
+ !CC U+00CC Igrave
206
+ !CD U+00CD Iacute
207
+ !CE U+00CE Icircumflex
208
+ !CF U+00CF Idieresis
209
+ !D0 U+00D0 Eth
210
+ !D1 U+00D1 Ntilde
211
+ !D2 U+00D2 Ograve
212
+ !D3 U+00D3 Oacute
213
+ !D4 U+00D4 Ocircumflex
214
+ !D5 U+00D5 Otilde
215
+ !D6 U+00D6 Odieresis
216
+ !D7 U+00D7 multiply
217
+ !D8 U+00D8 Oslash
218
+ !D9 U+00D9 Ugrave
219
+ !DA U+00DA Uacute
220
+ !DB U+00DB Ucircumflex
221
+ !DC U+00DC Udieresis
222
+ !DD U+00DD Yacute
223
+ !DE U+00DE Thorn
224
+ !DF U+00DF germandbls
225
+ !E0 U+00E0 agrave
226
+ !E1 U+00E1 aacute
227
+ !E2 U+00E2 acircumflex
228
+ !E3 U+00E3 atilde
229
+ !E4 U+00E4 adieresis
230
+ !E5 U+00E5 aring
231
+ !E6 U+00E6 ae
232
+ !E7 U+00E7 ccedilla
233
+ !E8 U+00E8 egrave
234
+ !E9 U+00E9 eacute
235
+ !EA U+00EA ecircumflex
236
+ !EB U+00EB edieresis
237
+ !EC U+00EC igrave
238
+ !ED U+00ED iacute
239
+ !EE U+00EE icircumflex
240
+ !EF U+00EF idieresis
241
+ !F0 U+00F0 eth
242
+ !F1 U+00F1 ntilde
243
+ !F2 U+00F2 ograve
244
+ !F3 U+00F3 oacute
245
+ !F4 U+00F4 ocircumflex
246
+ !F5 U+00F5 otilde
247
+ !F6 U+00F6 odieresis
248
+ !F7 U+00F7 divide
249
+ !F8 U+00F8 oslash
250
+ !F9 U+00F9 ugrave
251
+ !FA U+00FA uacute
252
+ !FB U+00FB ucircumflex
253
+ !FC U+00FC udieresis
254
+ !FD U+00FD yacute
255
+ !FE U+00FE thorn
256
+ !FF U+00FF ydieresis
lib/fpdf/font/makefont/iso-8859-16.map ADDED
@@ -0,0 +1,256 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ !00 U+0000 .notdef
2
+ !01 U+0001 .notdef
3
+ !02 U+0002 .notdef
4
+ !03 U+0003 .notdef
5
+ !04 U+0004 .notdef
6
+ !05 U+0005 .notdef
7
+ !06 U+0006 .notdef
8
+ !07 U+0007 .notdef
9
+ !08 U+0008 .notdef
10
+ !09 U+0009 .notdef
11
+ !0A U+000A .notdef
12
+ !0B U+000B .notdef
13
+ !0C U+000C .notdef
14
+ !0D U+000D .notdef
15
+ !0E U+000E .notdef
16
+ !0F U+000F .notdef
17
+ !10 U+0010 .notdef
18
+ !11 U+0011 .notdef
19
+ !12 U+0012 .notdef
20
+ !13 U+0013 .notdef
21
+ !14 U+0014 .notdef
22
+ !15 U+0015 .notdef
23
+ !16 U+0016 .notdef
24
+ !17 U+0017 .notdef
25
+ !18 U+0018 .notdef
26
+ !19 U+0019 .notdef
27
+ !1A U+001A .notdef
28
+ !1B U+001B .notdef
29
+ !1C U+001C .notdef
30
+ !1D U+001D .notdef
31
+ !1E U+001E .notdef
32
+ !1F U+001F .notdef
33
+ !20 U+0020 space
34
+ !21 U+0021 exclam
35
+ !22 U+0022 quotedbl
36
+ !23 U+0023 numbersign
37
+ !24 U+0024 dollar
38
+ !25 U+0025 percent
39
+ !26 U+0026 ampersand
40
+ !27 U+0027 quotesingle
41
+ !28 U+0028 parenleft
42
+ !29 U+0029 parenright
43
+ !2A U+002A asterisk
44
+ !2B U+002B plus
45
+ !2C U+002C comma
46
+ !2D U+002D hyphen
47
+ !2E U+002E period
48
+ !2F U+002F slash
49
+ !30 U+0030 zero
50
+ !31 U+0031 one
51
+ !32 U+0032 two
52
+ !33 U+0033 three
53
+ !34 U+0034 four
54
+ !35 U+0035 five
55
+ !36 U+0036 six
56
+ !37 U+0037 seven
57
+ !38 U+0038 eight
58
+ !39 U+0039 nine
59
+ !3A U+003A colon
60
+ !3B U+003B semicolon
61
+ !3C U+003C less
62
+ !3D U+003D equal
63
+ !3E U+003E greater
64
+ !3F U+003F question
65
+ !40 U+0040 at
66
+ !41 U+0041 A
67
+ !42 U+0042 B
68
+ !43 U+0043 C
69
+ !44 U+0044 D
70
+ !45 U+0045 E
71
+ !46 U+0046 F
72
+ !47 U+0047 G
73
+ !48 U+0048 H
74
+ !49 U+0049 I
75
+ !4A U+004A J
76
+ !4B U+004B K
77
+ !4C U+004C L
78
+ !4D U+004D M
79
+ !4E U+004E N
80
+ !4F U+004F O
81
+ !50 U+0050 P
82
+ !51 U+0051 Q
83
+ !52 U+0052 R
84
+ !53 U+0053 S
85
+ !54 U+0054 T
86
+ !55 U+0055 U
87
+ !56 U+0056 V
88
+ !57 U+0057 W
89
+ !58 U+0058 X
90
+ !59 U+0059 Y
91
+ !5A U+005A Z
92
+ !5B U+005B bracketleft
93
+ !5C U+005C backslash
94
+ !5D U+005D bracketright
95
+ !5E U+005E asciicircum
96
+ !5F U+005F underscore
97
+ !60 U+0060 grave
98
+ !61 U+0061 a
99
+ !62 U+0062 b
100
+ !63 U+0063 c
101
+ !64 U+0064 d
102
+ !65 U+0065 e
103
+ !66 U+0066 f
104
+ !67 U+0067 g
105
+ !68 U+0068 h
106
+ !69 U+0069 i
107
+ !6A U+006A j
108
+ !6B U+006B k
109
+ !6C U+006C l
110
+ !6D U+006D m
111
+ !6E U+006E n
112
+ !6F U+006F o
113
+ !70 U+0070 p
114
+ !71 U+0071 q
115
+ !72 U+0072 r
116
+ !73 U+0073 s
117
+ !74 U+0074 t
118
+ !75 U+0075 u
119
+ !76 U+0076 v
120
+ !77 U+0077 w
121
+ !78 U+0078 x
122
+ !79 U+0079 y
123
+ !7A U+007A z
124
+ !7B U+007B braceleft
125
+ !7C U+007C bar
126
+ !7D U+007D braceright
127
+ !7E U+007E asciitilde
128
+ !7F U+007F .notdef
129
+ !80 U+0080 .notdef
130
+ !81 U+0081 .notdef
131
+ !82 U+0082 .notdef
132
+ !83 U+0083 .notdef
133
+ !84 U+0084 .notdef
134
+ !85 U+0085 .notdef
135
+ !86 U+0086 .notdef
136
+ !87 U+0087 .notdef
137
+ !88 U+0088 .notdef
138
+ !89 U+0089 .notdef
139
+ !8A U+008A .notdef
140
+ !8B U+008B .notdef
141
+ !8C U+008C .notdef
142
+ !8D U+008D .notdef
143
+ !8E U+008E .notdef
144
+ !8F U+008F .notdef
145
+ !90 U+0090 .notdef
146
+ !91 U+0091 .notdef
147
+ !92 U+0092 .notdef
148
+ !93 U+0093 .notdef
149
+ !94 U+0094 .notdef
150
+ !95 U+0095 .notdef
151
+ !96 U+0096 .notdef
152
+ !97 U+0097 .notdef
153
+ !98 U+0098 .notdef
154
+ !99 U+0099 .notdef
155
+ !9A U+009A .notdef
156
+ !9B U+009B .notdef
157
+ !9C U+009C .notdef
158
+ !9D U+009D .notdef
159
+ !9E U+009E .notdef
160
+ !9F U+009F .notdef
161
+ !A0 U+00A0 space
162
+ !A1 U+0104 Aogonek
163
+ !A2 U+0105 aogonek
164
+ !A3 U+0141 Lslash
165
+ !A4 U+20AC Euro
166
+ !A5 U+201E quotedblbase
167
+ !A6 U+0160 Scaron
168
+ !A7 U+00A7 section
169
+ !A8 U+0161 scaron
170
+ !A9 U+00A9 copyright
171
+ !AA U+0218 Scommaaccent
172
+ !AB U+00AB guillemotleft
173
+ !AC U+0179 Zacute
174
+ !AD U+00AD hyphen
175
+ !AE U+017A zacute
176
+ !AF U+017B Zdotaccent
177
+ !B0 U+00B0 degree
178
+ !B1 U+00B1 plusminus
179
+ !B2 U+010C Ccaron
180
+ !B3 U+0142 lslash
181
+ !B4 U+017D Zcaron
182
+ !B5 U+201D quotedblright
183
+ !B6 U+00B6 paragraph
184
+ !B7 U+00B7 periodcentered
185
+ !B8 U+017E zcaron
186
+ !B9 U+010D ccaron
187
+ !BA U+0219 scommaaccent
188
+ !BB U+00BB guillemotright
189
+ !BC U+0152 OE
190
+ !BD U+0153 oe
191
+ !BE U+0178 Ydieresis
192
+ !BF U+017C zdotaccent
193
+ !C0 U+00C0 Agrave
194
+ !C1 U+00C1 Aacute
195
+ !C2 U+00C2 Acircumflex
196
+ !C3 U+0102 Abreve
197
+ !C4 U+00C4 Adieresis
198
+ !C5 U+0106 Cacute
199
+ !C6 U+00C6 AE
200
+ !C7 U+00C7 Ccedilla
201
+ !C8 U+00C8 Egrave
202
+ !C9 U+00C9 Eacute
203
+ !CA U+00CA Ecircumflex
204
+ !CB U+00CB Edieresis
205
+ !CC U+00CC Igrave
206
+ !CD U+00CD Iacute
207
+ !CE U+00CE Icircumflex
208
+ !CF U+00CF Idieresis
209
+ !D0 U+0110 Dcroat
210
+ !D1 U+0143 Nacute
211
+ !D2 U+00D2 Ograve
212
+ !D3 U+00D3 Oacute
213
+ !D4 U+00D4 Ocircumflex
214
+ !D5 U+0150 Ohungarumlaut
215
+ !D6 U+00D6 Odieresis
216
+ !D7 U+015A Sacute
217
+ !D8 U+0170 Uhungarumlaut
218
+ !D9 U+00D9 Ugrave
219
+ !DA U+00DA Uacute
220
+ !DB U+00DB Ucircumflex
221
+ !DC U+00DC Udieresis
222
+ !DD U+0118 Eogonek
223
+ !DE U+021A Tcommaaccent
224
+ !DF U+00DF germandbls
225
+ !E0 U+00E0 agrave
226
+ !E1 U+00E1 aacute
227
+ !E2 U+00E2 acircumflex
228
+ !E3 U+0103 abreve
229
+ !E4 U+00E4 adieresis
230
+ !E5 U+0107 cacute
231
+ !E6 U+00E6 ae
232
+ !E7 U+00E7 ccedilla
233
+ !E8 U+00E8 egrave
234
+ !E9 U+00E9 eacute
235
+ !EA U+00EA ecircumflex
236
+ !EB U+00EB edieresis
237
+ !EC U+00EC igrave
238
+ !ED U+00ED iacute
239
+ !EE U+00EE icircumflex
240
+ !EF U+00EF idieresis
241
+ !F0 U+0111 dcroat
242
+ !F1 U+0144 nacute
243
+ !F2 U+00F2 ograve
244
+ !F3 U+00F3 oacute
245
+ !F4 U+00F4 ocircumflex
246
+ !F5 U+0151 ohungarumlaut
247
+ !F6 U+00F6 odieresis
248
+ !F7 U+015B sacute
249
+ !F8 U+0171 uhungarumlaut
250
+ !F9 U+00F9 ugrave
251
+ !FA U+00FA uacute
252
+ !FB U+00FB ucircumflex
253
+ !FC U+00FC udieresis
254
+ !FD U+0119 eogonek
255
+ !FE U+021B tcommaaccent
256
+ !FF U+00FF ydieresis
lib/fpdf/font/makefont/iso-8859-2.map ADDED
@@ -0,0 +1,256 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ !00 U+0000 .notdef
2
+ !01 U+0001 .notdef
3
+ !02 U+0002 .notdef
4
+ !03 U+0003 .notdef
5
+ !04 U+0004 .notdef
6
+ !05 U+0005 .notdef
7
+ !06 U+0006 .notdef
8
+ !07 U+0007 .notdef
9
+ !08 U+0008 .notdef
10
+ !09 U+0009 .notdef
11
+ !0A U+000A .notdef
12
+ !0B U+000B .notdef
13
+ !0C U+000C .notdef
14
+ !0D U+000D .notdef
15
+ !0E U+000E .notdef
16
+ !0F U+000F .notdef
17
+ !10 U+0010 .notdef
18
+ !11 U+0011 .notdef
19
+ !12 U+0012 .notdef
20
+ !13 U+0013 .notdef
21
+ !14 U+0014 .notdef
22
+ !15 U+0015 .notdef
23
+ !16 U+0016 .notdef
24
+ !17 U+0017 .notdef
25
+ !18 U+0018 .notdef
26
+ !19 U+0019 .notdef
27
+ !1A U+001A .notdef
28
+ !1B U+001B .notdef
29
+ !1C U+001C .notdef
30
+ !1D U+001D .notdef
31
+ !1E U+001E .notdef
32
+ !1F U+001F .notdef
33
+ !20 U+0020 space
34
+ !21 U+0021 exclam
35
+ !22 U+0022 quotedbl
36
+ !23 U+0023 numbersign
37
+ !24 U+0024 dollar
38
+ !25 U+0025 percent
39
+ !26 U+0026 ampersand
40
+ !27 U+0027 quotesingle
41
+ !28 U+0028 parenleft
42
+ !29 U+0029 parenright
43
+ !2A U+002A asterisk
44
+ !2B U+002B plus
45
+ !2C U+002C comma
46
+ !2D U+002D hyphen
47
+ !2E U+002E period
48
+ !2F U+002F slash
49
+ !30 U+0030 zero
50
+ !31 U+0031 one
51
+ !32 U+0032 two
52
+ !33 U+0033 three
53
+ !34 U+0034 four
54
+ !35 U+0035 five
55
+ !36 U+0036 six
56
+ !37 U+0037 seven
57
+ !38 U+0038 eight
58
+ !39 U+0039 nine
59
+ !3A U+003A colon
60
+ !3B U+003B semicolon
61
+ !3C U+003C less
62
+ !3D U+003D equal
63
+ !3E U+003E greater
64
+ !3F U+003F question
65
+ !40 U+0040 at
66
+ !41 U+0041 A
67
+ !42 U+0042 B
68
+ !43 U+0043 C
69
+ !44 U+0044 D
70
+ !45 U+0045 E
71
+ !46 U+0046 F
72
+ !47 U+0047 G
73
+ !48 U+0048 H
74
+ !49 U+0049 I
75
+ !4A U+004A J
76
+ !4B U+004B K
77
+ !4C U+004C L
78
+ !4D U+004D M
79
+ !4E U+004E N
80
+ !4F U+004F O
81
+ !50 U+0050 P
82
+ !51 U+0051 Q
83
+ !52 U+0052 R
84
+ !53 U+0053 S
85
+ !54 U+0054 T
86
+ !55 U+0055 U
87
+ !56 U+0056 V
88
+ !57 U+0057 W
89
+ !58 U+0058 X
90
+ !59 U+0059 Y
91
+ !5A U+005A Z
92
+ !5B U+005B bracketleft
93
+ !5C U+005C backslash
94
+ !5D U+005D bracketright
95
+ !5E U+005E asciicircum
96
+ !5F U+005F underscore
97
+ !60 U+0060 grave
98
+ !61 U+0061 a
99
+ !62 U+0062 b
100
+ !63 U+0063 c
101
+ !64 U+0064 d
102
+ !65 U+0065 e
103
+ !66 U+0066 f
104
+ !67 U+0067 g
105
+ !68 U+0068 h
106
+ !69 U+0069 i
107
+ !6A U+006A j
108
+ !6B U+006B k
109
+ !6C U+006C l
110
+ !6D U+006D m
111
+ !6E U+006E n
112
+ !6F U+006F o
113
+ !70 U+0070 p
114
+ !71 U+0071 q
115
+ !72 U+0072 r
116
+ !73 U+0073 s
117
+ !74 U+0074 t
118
+ !75 U+0075 u
119
+ !76 U+0076 v
120
+ !77 U+0077 w
121
+ !78 U+0078 x
122
+ !79 U+0079 y
123
+ !7A U+007A z
124
+ !7B U+007B braceleft
125
+ !7C U+007C bar
126
+ !7D U+007D braceright
127
+ !7E U+007E asciitilde
128
+ !7F U+007F .notdef
129
+ !80 U+0080 .notdef
130
+ !81 U+0081 .notdef
131
+ !82 U+0082 .notdef
132
+ !83 U+0083 .notdef
133
+ !84 U+0084 .notdef
134
+ !85 U+0085 .notdef
135
+ !86 U+0086 .notdef
136
+ !87 U+0087 .notdef
137
+ !88 U+0088 .notdef
138
+ !89 U+0089 .notdef
139
+ !8A U+008A .notdef
140
+ !8B U+008B .notdef
141
+ !8C U+008C .notdef
142
+ !8D U+008D .notdef
143
+ !8E U+008E .notdef
144
+ !8F U+008F .notdef
145
+ !90 U+0090 .notdef
146
+ !91 U+0091 .notdef
147
+ !92 U+0092 .notdef
148
+ !93 U+0093 .notdef
149
+ !94 U+0094 .notdef
150
+ !95 U+0095 .notdef
151
+ !96 U+0096 .notdef
152
+ !97 U+0097 .notdef
153
+ !98 U+0098 .notdef
154
+ !99 U+0099 .notdef
155
+ !9A U+009A .notdef
156
+ !9B U+009B .notdef
157
+ !9C U+009C .notdef
158
+ !9D U+009D .notdef
159
+ !9E U+009E .notdef
160
+ !9F U+009F .notdef
161
+ !A0 U+00A0 space
162
+ !A1 U+0104 Aogonek
163
+ !A2 U+02D8 breve
164
+ !A3 U+0141 Lslash
165
+ !A4 U+00A4 currency
166
+ !A5 U+013D Lcaron
167
+ !A6 U+015A Sacute
168
+ !A7 U+00A7 section
169
+ !A8 U+00A8 dieresis
170
+ !A9 U+0160 Scaron
171
+ !AA U+015E Scedilla
172
+ !AB U+0164 Tcaron
173
+ !AC U+0179 Zacute
174
+ !AD U+00AD hyphen
175
+ !AE U+017D Zcaron
176
+ !AF U+017B Zdotaccent
177
+ !B0 U+00B0 degree
178
+ !B1 U+0105 aogonek
179
+ !B2 U+02DB ogonek
180
+ !B3 U+0142 lslash
181
+ !B4 U+00B4 acute
182
+ !B5 U+013E lcaron
183
+ !B6 U+015B sacute
184
+ !B7 U+02C7 caron
185
+ !B8 U+00B8 cedilla
186
+ !B9 U+0161 scaron
187
+ !BA U+015F scedilla
188
+ !BB U+0165 tcaron
189
+ !BC U+017A zacute
190
+ !BD U+02DD hungarumlaut
191
+ !BE U+017E zcaron
192
+ !BF U+017C zdotaccent
193
+ !C0 U+0154 Racute
194
+ !C1 U+00C1 Aacute
195
+ !C2 U+00C2 Acircumflex
196
+ !C3 U+0102 Abreve
197
+ !C4 U+00C4 Adieresis
198
+ !C5 U+0139 Lacute
199
+ !C6 U+0106 Cacute
200
+ !C7 U+00C7 Ccedilla
201
+ !C8 U+010C Ccaron
202
+ !C9 U+00C9 Eacute
203
+ !CA U+0118 Eogonek
204
+ !CB U+00CB Edieresis
205
+ !CC U+011A Ecaron
206
+ !CD U+00CD Iacute
207
+ !CE U+00CE Icircumflex
208
+ !CF U+010E Dcaron
209
+ !D0 U+0110 Dcroat
210
+ !D1 U+0143 Nacute
211
+ !D2 U+0147 Ncaron
212
+ !D3 U+00D3 Oacute
213
+ !D4 U+00D4 Ocircumflex
214
+ !D5 U+0150 Ohungarumlaut
215
+ !D6 U+00D6 Odieresis
216
+ !D7 U+00D7 multiply
217
+ !D8 U+0158 Rcaron
218
+ !D9 U+016E Uring
219
+ !DA U+00DA Uacute
220
+ !DB U+0170 Uhungarumlaut
221
+ !DC U+00DC Udieresis
222
+ !DD U+00DD Yacute
223
+ !DE U+0162 Tcommaaccent
224
+ !DF U+00DF germandbls
225
+ !E0 U+0155 racute
226
+ !E1 U+00E1 aacute
227
+ !E2 U+00E2 acircumflex
228
+ !E3 U+0103 abreve
229
+ !E4 U+00E4 adieresis
230
+ !E5 U+013A lacute
231
+ !E6 U+0107 cacute
232
+ !E7 U+00E7 ccedilla
233
+ !E8 U+010D ccaron
234
+ !E9 U+00E9 eacute
235
+ !EA U+0119 eogonek
236
+ !EB U+00EB edieresis
237
+ !EC U+011B ecaron
238
+ !ED U+00ED iacute
239
+ !EE U+00EE icircumflex
240
+ !EF U+010F dcaron
241
+ !F0 U+0111 dcroat
242
+ !F1 U+0144 nacute
243
+ !F2 U+0148 ncaron
244
+ !F3 U+00F3 oacute
245
+ !F4 U+00F4 ocircumflex
246
+ !F5 U+0151 ohungarumlaut
247
+ !F6 U+00F6 odieresis
248
+ !F7 U+00F7 divide
249
+ !F8 U+0159 rcaron
250
+ !F9 U+016F uring
251
+ !FA U+00FA uacute
252
+ !FB U+0171 uhungarumlaut
253
+ !FC U+00FC udieresis
254
+ !FD U+00FD yacute
255
+ !FE U+0163 tcommaaccent
256
+ !FF U+02D9 dotaccent
lib/fpdf/font/makefont/iso-8859-4.map ADDED
@@ -0,0 +1,256 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ !00 U+0000 .notdef
2
+ !01 U+0001 .notdef
3
+ !02 U+0002 .notdef
4
+ !03 U+0003 .notdef
5
+ !04 U+0004 .notdef
6
+ !05 U+0005 .notdef
7
+ !06 U+0006 .notdef
8
+ !07 U+0007 .notdef
9
+ !08 U+0008 .notdef
10
+ !09 U+0009 .notdef
11
+ !0A U+000A .notdef
12
+ !0B U+000B .notdef
13
+ !0C U+000C .notdef
14
+ !0D U+000D .notdef
15
+ !0E U+000E .notdef
16
+ !0F U+000F .notdef
17
+ !10 U+0010 .notdef
18
+ !11 U+0011 .notdef
19
+ !12 U+0012 .notdef
20
+ !13 U+0013 .notdef
21
+ !14 U+0014 .notdef
22
+ !15 U+0015 .notdef
23
+ !16 U+0016 .notdef
24
+ !17 U+0017 .notdef
25
+ !18 U+0018 .notdef
26
+ !19 U+0019 .notdef
27
+ !1A U+001A .notdef
28
+ !1B U+001B .notdef
29
+ !1C U+001C .notdef
30
+ !1D U+001D .notdef
31
+ !1E U+001E .notdef
32
+ !1F U+001F .notdef
33
+ !20 U+0020 space
34
+ !21 U+0021 exclam
35
+ !22 U+0022 quotedbl
36
+ !23 U+0023 numbersign
37
+ !24 U+0024 dollar
38
+ !25 U+0025 percent
39
+ !26 U+0026 ampersand
40
+ !27 U+0027 quotesingle
41
+ !28 U+0028 parenleft
42
+ !29 U+0029 parenright
43
+ !2A U+002A asterisk
44
+ !2B U+002B plus
45
+ !2C U+002C comma
46
+ !2D U+002D hyphen
47
+ !2E U+002E period
48
+ !2F U+002F slash
49
+ !30 U+0030 zero
50
+ !31 U+0031 one
51
+ !32 U+0032 two
52
+ !33 U+0033 three
53
+ !34 U+0034 four
54
+ !35 U+0035 five
55
+ !36 U+0036 six
56
+ !37 U+0037 seven
57
+ !38 U+0038 eight
58
+ !39 U+0039 nine
59
+ !3A U+003A colon
60
+ !3B U+003B semicolon
61
+ !3C U+003C less
62
+ !3D U+003D equal
63
+ !3E U+003E greater
64
+ !3F U+003F question
65
+ !40 U+0040 at
66
+ !41 U+0041 A
67
+ !42 U+0042 B
68
+ !43 U+0043 C
69
+ !44 U+0044 D
70
+ !45 U+0045 E
71
+ !46 U+0046 F
72
+ !47 U+0047 G
73
+ !48 U+0048 H
74
+ !49 U+0049 I
75
+ !4A U+004A J
76
+ !4B U+004B K
77
+ !4C U+004C L
78
+ !4D U+004D M
79
+ !4E U+004E N
80
+ !4F U+004F O
81
+ !50 U+0050 P
82
+ !51 U+0051 Q
83
+ !52 U+0052 R
84
+ !53 U+0053 S
85
+ !54 U+0054 T
86
+ !55 U+0055 U
87
+ !56 U+0056 V
88
+ !57 U+0057 W
89
+ !58 U+0058 X
90
+ !59 U+0059 Y
91
+ !5A U+005A Z
92
+ !5B U+005B bracketleft
93
+ !5C U+005C backslash
94
+ !5D U+005D bracketright
95
+ !5E U+005E asciicircum
96
+ !5F U+005F underscore
97
+ !60 U+0060 grave
98
+ !61 U+0061 a
99
+ !62 U+0062 b
100
+ !63 U+0063 c
101
+ !64 U+0064 d
102
+ !65 U+0065 e
103
+ !66 U+0066 f
104
+ !67 U+0067 g
105
+ !68 U+0068 h
106
+ !69 U+0069 i
107
+ !6A U+006A j
108
+ !6B U+006B k
109
+ !6C U+006C l
110
+ !6D U+006D m
111
+ !6E U+006E n
112
+ !6F U+006F o
113
+ !70 U+0070 p
114
+ !71 U+0071 q
115
+ !72 U+0072 r
116
+ !73 U+0073 s
117
+ !74 U+0074 t
118
+ !75 U+0075 u
119
+ !76 U+0076 v
120
+ !77 U+0077 w
121
+ !78 U+0078 x
122
+ !79 U+0079 y
123
+ !7A U+007A z
124
+ !7B U+007B braceleft
125
+ !7C U+007C bar
126
+ !7D U+007D braceright
127
+ !7E U+007E asciitilde
128
+ !7F U+007F .notdef
129
+ !80 U+0080 .notdef
130
+ !81 U+0081 .notdef
131
+ !82 U+0082 .notdef
132
+ !83 U+0083 .notdef
133
+ !84 U+0084 .notdef
134
+ !85 U+0085 .notdef
135
+ !86 U+0086 .notdef
136
+ !87 U+0087 .notdef
137
+ !88 U+0088 .notdef
138
+ !89 U+0089 .notdef
139
+ !8A U+008A .notdef
140
+ !8B U+008B .notdef
141
+ !8C U+008C .notdef
142
+ !8D U+008D .notdef
143
+ !8E U+008E .notdef
144
+ !8F U+008F .notdef
145
+ !90 U+0090 .notdef
146
+ !91 U+0091 .notdef
147
+ !92 U+0092 .notdef
148
+ !93 U+0093 .notdef
149
+ !94 U+0094 .notdef
150
+ !95 U+0095 .notdef
151
+ !96 U+0096 .notdef
152
+ !97 U+0097 .notdef
153
+ !98 U+0098 .notdef
154
+ !99 U+0099 .notdef
155
+ !9A U+009A .notdef
156
+ !9B U+009B .notdef
157
+ !9C U+009C .notdef
158
+ !9D U+009D .notdef
159
+ !9E U+009E .notdef
160
+ !9F U+009F .notdef
161
+ !A0 U+00A0 space
162
+ !A1 U+0104 Aogonek
163
+ !A2 U+0138 kgreenlandic
164
+ !A3 U+0156 Rcommaaccent
165
+ !A4 U+00A4 currency
166
+ !A5 U+0128 Itilde
167
+ !A6 U+013B Lcommaaccent
168
+ !A7 U+00A7 section
169
+ !A8 U+00A8 dieresis
170
+ !A9 U+0160 Scaron
171
+ !AA U+0112 Emacron
172
+ !AB U+0122 Gcommaaccent
173
+ !AC U+0166 Tbar
174
+ !AD U+00AD hyphen
175
+ !AE U+017D Zcaron
176
+ !AF U+00AF macron
177
+ !B0 U+00B0 degree
178
+ !B1 U+0105 aogonek
179
+ !B2 U+02DB ogonek
180
+ !B3 U+0157 rcommaaccent
181
+ !B4 U+00B4 acute
182
+ !B5 U+0129 itilde
183
+ !B6 U+013C lcommaaccent
184
+ !B7 U+02C7 caron
185
+ !B8 U+00B8 cedilla
186
+ !B9 U+0161 scaron
187
+ !BA U+0113 emacron
188
+ !BB U+0123 gcommaaccent
189
+ !BC U+0167 tbar
190
+ !BD U+014A Eng
191
+ !BE U+017E zcaron
192
+ !BF U+014B eng
193
+ !C0 U+0100 Amacron
194
+ !C1 U+00C1 Aacute
195
+ !C2 U+00C2 Acircumflex
196
+ !C3 U+00C3 Atilde
197
+ !C4 U+00C4 Adieresis
198
+ !C5 U+00C5 Aring
199
+ !C6 U+00C6 AE
200
+ !C7 U+012E Iogonek
201
+ !C8 U+010C Ccaron
202
+ !C9 U+00C9 Eacute
203
+ !CA U+0118 Eogonek
204
+ !CB U+00CB Edieresis
205
+ !CC U+0116 Edotaccent
206
+ !CD U+00CD Iacute
207
+ !CE U+00CE Icircumflex
208
+ !CF U+012A Imacron
209
+ !D0 U+0110 Dcroat
210
+ !D1 U+0145 Ncommaaccent
211
+ !D2 U+014C Omacron
212
+ !D3 U+0136 Kcommaaccent
213
+ !D4 U+00D4 Ocircumflex
214
+ !D5 U+00D5 Otilde
215
+ !D6 U+00D6 Odieresis
216
+ !D7 U+00D7 multiply
217
+ !D8 U+00D8 Oslash
218
+ !D9 U+0172 Uogonek
219
+ !DA U+00DA Uacute
220
+ !DB U+00DB Ucircumflex
221
+ !DC U+00DC Udieresis
222
+ !DD U+0168 Utilde
223
+ !DE U+016A Umacron
224
+ !DF U+00DF germandbls
225
+ !E0 U+0101 amacron
226
+ !E1 U+00E1 aacute
227
+ !E2 U+00E2 acircumflex
228
+ !E3 U+00E3 atilde
229
+ !E4 U+00E4 adieresis
230
+ !E5 U+00E5 aring
231
+ !E6 U+00E6 ae
232
+ !E7 U+012F iogonek
233
+ !E8 U+010D ccaron
234
+ !E9 U+00E9 eacute
235
+ !EA U+0119 eogonek
236
+ !EB U+00EB edieresis
237
+ !EC U+0117 edotaccent
238
+ !ED U+00ED iacute
239
+ !EE U+00EE icircumflex
240
+ !EF U+012B imacron
241
+ !F0 U+0111 dcroat
242
+ !F1 U+0146 ncommaaccent
243
+ !F2 U+014D omacron
244
+ !F3 U+0137 kcommaaccent
245
+ !F4 U+00F4 ocircumflex
246
+ !F5 U+00F5 otilde
247
+ !F6 U+00F6 odieresis
248
+ !F7 U+00F7 divide
249
+ !F8 U+00F8 oslash
250
+ !F9 U+0173 uogonek
251
+ !FA U+00FA uacute
252
+ !FB U+00FB ucircumflex
253
+ !FC U+00FC udieresis
254
+ !FD U+0169 utilde
255
+ !FE U+016B umacron
256
+ !FF U+02D9 dotaccent
lib/fpdf/font/makefont/iso-8859-5.map ADDED
@@ -0,0 +1,256 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ !00 U+0000 .notdef
2
+ !01 U+0001 .notdef
3
+ !02 U+0002 .notdef
4
+ !03 U+0003 .notdef
5
+ !04 U+0004 .notdef
6
+ !05 U+0005 .notdef
7
+ !06 U+0006 .notdef
8
+ !07 U+0007 .notdef
9
+ !08 U+0008 .notdef
10
+ !09 U+0009 .notdef
11
+ !0A U+000A .notdef
12
+ !0B U+000B .notdef
13
+ !0C U+000C .notdef
14
+ !0D U+000D .notdef
15
+ !0E U+000E .notdef
16
+ !0F U+000F .notdef
17
+ !10 U+0010 .notdef
18
+ !11 U+0011 .notdef
19
+ !12 U+0012 .notdef
20
+ !13 U+0013 .notdef
21
+ !14 U+0014 .notdef
22
+ !15 U+0015 .notdef
23
+ !16 U+0016 .notdef
24
+ !17 U+0017 .notdef
25
+ !18 U+0018 .notdef
26
+ !19 U+0019 .notdef
27
+ !1A U+001A .notdef
28
+ !1B U+001B .notdef
29
+ !1C U+001C .notdef
30
+ !1D U+001D .notdef
31
+ !1E U+001E .notdef
32
+ !1F U+001F .notdef
33
+ !20 U+0020 space
34
+ !21 U+0021 exclam
35
+ !22 U+0022 quotedbl
36
+ !23 U+0023 numbersign
37
+ !24 U+0024 dollar
38
+ !25 U+0025 percent
39
+ !26 U+0026 ampersand
40
+ !27 U+0027 quotesingle
41
+ !28 U+0028 parenleft
42
+ !29 U+0029 parenright
43
+ !2A U+002A asterisk
44
+ !2B U+002B plus
45
+ !2C U+002C comma
46
+ !2D U+002D hyphen
47
+ !2E U+002E period
48
+ !2F U+002F slash
49
+ !30 U+0030 zero
50
+ !31 U+0031 one
51
+ !32 U+0032 two
52
+ !33 U+0033 three
53
+ !34 U+0034 four
54
+ !35 U+0035 five
55
+ !36 U+0036 six
56
+ !37 U+0037 seven
57
+ !38 U+0038 eight
58
+ !39 U+0039 nine
59
+ !3A U+003A colon
60
+ !3B U+003B semicolon
61
+ !3C U+003C less
62
+ !3D U+003D equal
63
+ !3E U+003E greater
64
+ !3F U+003F question
65
+ !40 U+0040 at
66
+ !41 U+0041 A
67
+ !42 U+0042 B
68
+ !43 U+0043 C
69
+ !44 U+0044 D
70
+ !45 U+0045 E
71
+ !46 U+0046 F
72
+ !47 U+0047 G
73
+ !48 U+0048 H
74
+ !49 U+0049 I
75
+ !4A U+004A J
76
+ !4B U+004B K
77
+ !4C U+004C L
78
+ !4D U+004D M
79
+ !4E U+004E N
80
+ !4F U+004F O
81
+ !50 U+0050 P
82
+ !51 U+0051 Q
83
+ !52 U+0052 R
84
+ !53 U+0053 S
85
+ !54 U+0054 T
86
+ !55 U+0055 U
87
+ !56 U+0056 V
88
+ !57 U+0057 W
89
+ !58 U+0058 X
90
+ !59 U+0059 Y
91
+ !5A U+005A Z
92
+ !5B U+005B bracketleft
93
+ !5C U+005C backslash
94
+ !5D U+005D bracketright
95
+ !5E U+005E asciicircum
96
+ !5F U+005F underscore
97
+ !60 U+0060 grave
98
+ !61 U+0061 a
99
+ !62 U+0062 b
100
+ !63 U+0063 c
101
+ !64 U+0064 d
102
+ !65 U+0065 e
103
+ !66 U+0066 f
104
+ !67 U+0067 g
105
+ !68 U+0068 h
106
+ !69 U+0069 i
107
+ !6A U+006A j
108
+ !6B U+006B k
109
+ !6C U+006C l
110
+ !6D U+006D m
111
+ !6E U+006E n
112
+ !6F U+006F o
113
+ !70 U+0070 p
114
+ !71 U+0071 q
115
+ !72 U+0072 r
116
+ !73 U+0073 s
117
+ !74 U+0074 t
118
+ !75 U+0075 u
119
+ !76 U+0076 v
120
+ !77 U+0077 w
121
+ !78 U+0078 x
122
+ !79 U+0079 y
123
+ !7A U+007A z
124
+ !7B U+007B braceleft
125
+ !7C U+007C bar
126
+ !7D U+007D braceright
127
+ !7E U+007E asciitilde
128
+ !7F U+007F .notdef
129
+ !80 U+0080 .notdef
130
+ !81 U+0081 .notdef
131
+ !82 U+0082 .notdef
132
+ !83 U+0083 .notdef
133
+ !84 U+0084 .notdef
134
+ !85 U+0085 .notdef
135
+ !86 U+0086 .notdef
136
+ !87 U+0087 .notdef
137
+ !88 U+0088 .notdef
138
+ !89 U+0089 .notdef
139
+ !8A U+008A .notdef
140
+ !8B U+008B .notdef
141
+ !8C U+008C .notdef
142
+ !8D U+008D .notdef
143
+ !8E U+008E .notdef
144
+ !8F U+008F .notdef
145
+ !90 U+0090 .notdef
146
+ !91 U+0091 .notdef
147
+ !92 U+0092 .notdef
148
+ !93 U+0093 .notdef
149
+ !94 U+0094 .notdef
150
+ !95 U+0095 .notdef
151
+ !96 U+0096 .notdef
152
+ !97 U+0097 .notdef
153
+ !98 U+0098 .notdef
154
+ !99 U+0099 .notdef
155
+ !9A U+009A .notdef
156
+ !9B U+009B .notdef
157
+ !9C U+009C .notdef
158
+ !9D U+009D .notdef
159
+ !9E U+009E .notdef
160
+ !9F U+009F .notdef
161
+ !A0 U+00A0 space
162
+ !A1 U+0401 afii10023
163
+ !A2 U+0402 afii10051
164
+ !A3 U+0403 afii10052
165
+ !A4 U+0404 afii10053
166
+ !A5 U+0405 afii10054
167
+ !A6 U+0406 afii10055
168
+ !A7 U+0407 afii10056
169
+ !A8 U+0408 afii10057
170
+ !A9 U+0409 afii10058
171
+ !AA U+040A afii10059
172
+ !AB U+040B afii10060
173
+ !AC U+040C afii10061
174
+ !AD U+00AD hyphen
175
+ !AE U+040E afii10062
176
+ !AF U+040F afii10145
177
+ !B0 U+0410 afii10017
178
+ !B1 U+0411 afii10018
179
+ !B2 U+0412 afii10019
180
+ !B3 U+0413 afii10020
181
+ !B4 U+0414 afii10021
182
+ !B5 U+0415 afii10022
183
+ !B6 U+0416 afii10024
184
+ !B7 U+0417 afii10025
185
+ !B8 U+0418 afii10026
186
+ !B9 U+0419 afii10027
187
+ !BA U+041A afii10028
188
+ !BB U+041B afii10029
189
+ !BC U+041C afii10030
190
+ !BD U+041D afii10031
191
+ !BE U+041E afii10032
192
+ !BF U+041F afii10033
193
+ !C0 U+0420 afii10034
194
+ !C1 U+0421 afii10035
195
+ !C2 U+0422 afii10036
196
+ !C3 U+0423 afii10037
197
+ !C4 U+0424 afii10038
198
+ !C5 U+0425 afii10039
199
+ !C6 U+0426 afii10040
200
+ !C7 U+0427 afii10041
201
+ !C8 U+0428 afii10042
202
+ !C9 U+0429 afii10043
203
+ !CA U+042A afii10044
204
+ !CB U+042B afii10045
205
+ !CC U+042C afii10046
206
+ !CD U+042D afii10047
207
+ !CE U+042E afii10048
208
+ !CF U+042F afii10049
209
+ !D0 U+0430 afii10065
210
+ !D1 U+0431 afii10066
211
+ !D2 U+0432 afii10067
212
+ !D3 U+0433 afii10068
213
+ !D4 U+0434 afii10069
214
+ !D5 U+0435 afii10070
215
+ !D6 U+0436 afii10072
216
+ !D7 U+0437 afii10073
217
+ !D8 U+0438 afii10074
218
+ !D9 U+0439 afii10075
219
+ !DA U+043A afii10076
220
+ !DB U+043B afii10077
221
+ !DC U+043C afii10078
222
+ !DD U+043D afii10079
223
+ !DE U+043E afii10080
224
+ !DF U+043F afii10081
225
+ !E0 U+0440 afii10082
226
+ !E1 U+0441 afii10083
227
+ !E2 U+0442 afii10084
228
+ !E3 U+0443 afii10085
229
+ !E4 U+0444 afii10086
230
+ !E5 U+0445 afii10087
231
+ !E6 U+0446 afii10088
232
+ !E7 U+0447 afii10089
233
+ !E8 U+0448 afii10090
234
+ !E9 U+0449 afii10091
235
+ !EA U+044A afii10092
236
+ !EB U+044B afii10093
237
+ !EC U+044C afii10094
238
+ !ED U+044D afii10095
239
+ !EE U+044E afii10096
240
+ !EF U+044F afii10097
241
+ !F0 U+2116 afii61352
242
+ !F1 U+0451 afii10071
243
+ !F2 U+0452 afii10099
244
+ !F3 U+0453 afii10100
245
+ !F4 U+0454 afii10101
246
+ !F5 U+0455 afii10102
247
+ !F6 U+0456 afii10103
248
+ !F7 U+0457 afii10104
249
+ !F8 U+0458 afii10105
250
+ !F9 U+0459 afii10106
251
+ !FA U+045A afii10107
252
+ !FB U+045B afii10108
253
+ !FC U+045C afii10109
254
+ !FD U+00A7 section
255
+ !FE U+045E afii10110
256
+ !FF U+045F afii10193
lib/fpdf/font/makefont/iso-8859-7.map ADDED
@@ -0,0 +1,250 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ !00 U+0000 .notdef
2
+ !01 U+0001 .notdef
3
+ !02 U+0002 .notdef
4
+ !03 U+0003 .notdef
5
+ !04 U+0004 .notdef
6
+ !05 U+0005 .notdef
7
+ !06 U+0006 .notdef
8
+ !07 U+0007 .notdef
9
+ !08 U+0008 .notdef
10
+ !09 U+0009 .notdef
11
+ !0A U+000A .notdef
12
+ !0B U+000B .notdef
13
+ !0C U+000C .notdef
14
+ !0D U+000D .notdef
15
+ !0E U+000E .notdef
16
+ !0F U+000F .notdef
17
+ !10 U+0010 .notdef
18
+ !11 U+0011 .notdef
19
+ !12 U+0012 .notdef
20
+ !13 U+0013 .notdef
21
+ !14 U+0014 .notdef
22
+ !15 U+0015 .notdef
23
+ !16 U+0016 .notdef
24
+ !17 U+0017 .notdef
25
+ !18 U+0018 .notdef
26
+ !19 U+0019 .notdef
27
+ !1A U+001A .notdef
28
+ !1B U+001B .notdef
29
+ !1C U+001C .notdef
30
+ !1D U+001D .notdef
31
+ !1E U+001E .notdef
32
+ !1F U+001F .notdef
33
+ !20 U+0020 space
34
+ !21 U+0021 exclam
35
+ !22 U+0022 quotedbl
36
+ !23 U+0023 numbersign
37
+ !24 U+0024 dollar
38
+ !25 U+0025 percent
39
+ !26 U+0026 ampersand
40
+ !27 U+0027 quotesingle
41
+ !28 U+0028 parenleft
42
+ !29 U+0029 parenright
43
+ !2A U+002A asterisk
44
+ !2B U+002B plus
45
+ !2C U+002C comma
46
+ !2D U+002D hyphen
47
+ !2E U+002E period
48
+ !2F U+002F slash
49
+ !30 U+0030 zero
50
+ !31 U+0031 one
51
+ !32 U+0032 two
52
+ !33 U+0033 three
53
+ !34 U+0034 four
54
+ !35 U+0035 five
55
+ !36 U+0036 six
56
+ !37 U+0037 seven
57
+ !38 U+0038 eight
58
+ !39 U+0039 nine
59
+ !3A U+003A colon
60
+ !3B U+003B semicolon
61
+ !3C U+003C less
62
+ !3D U+003D equal
63
+ !3E U+003E greater
64
+ !3F U+003F question
65
+ !40 U+0040 at
66
+ !41 U+0041 A
67
+ !42 U+0042 B
68
+ !43 U+0043 C
69
+ !44 U+0044 D
70
+ !45 U+0045 E
71
+ !46 U+0046 F
72
+ !47 U+0047 G
73
+ !48 U+0048 H
74
+ !49 U+0049 I
75
+ !4A U+004A J
76
+ !4B U+004B K
77
+ !4C U+004C L
78
+ !4D U+004D M
79
+ !4E U+004E N
80
+ !4F U+004F O
81
+ !50 U+0050 P
82
+ !51 U+0051 Q
83
+ !52 U+0052 R
84
+ !53 U+0053 S
85
+ !54 U+0054 T
86
+ !55 U+0055 U
87
+ !56 U+0056 V
88
+ !57 U+0057 W
89
+ !58 U+0058 X
90
+ !59 U+0059 Y
91
+ !5A U+005A Z
92
+ !5B U+005B bracketleft
93
+ !5C U+005C backslash
94
+ !5D U+005D bracketright
95
+ !5E U+005E asciicircum
96
+ !5F U+005F underscore
97
+ !60 U+0060 grave
98
+ !61 U+0061 a
99
+ !62 U+0062 b
100
+ !63 U+0063 c
101
+ !64 U+0064 d
102
+ !65 U+0065 e
103
+ !66 U+0066 f
104
+ !67 U+0067 g
105
+ !68 U+0068 h
106
+ !69 U+0069 i
107
+ !6A U+006A j
108
+ !6B U+006B k
109
+ !6C U+006C l
110
+ !6D U+006D m
111
+ !6E U+006E n
112
+ !6F U+006F o
113
+ !70 U+0070 p
114
+ !71 U+0071 q
115
+ !72 U+0072 r
116
+ !73 U+0073 s
117
+ !74 U+0074 t
118
+ !75 U+0075 u
119
+ !76 U+0076 v
120
+ !77 U+0077 w
121
+ !78 U+0078 x
122
+ !79 U+0079 y
123
+ !7A U+007A z
124
+ !7B U+007B braceleft
125
+ !7C U+007C bar
126
+ !7D U+007D braceright
127
+ !7E U+007E asciitilde
128
+ !7F U+007F .notdef
129
+ !80 U+0080 .notdef
130
+ !81 U+0081 .notdef
131
+ !82 U+0082 .notdef
132
+ !83 U+0083 .notdef
133
+ !84 U+0084 .notdef
134
+ !85 U+0085 .notdef
135
+ !86 U+0086 .notdef
136
+ !87 U+0087 .notdef
137
+ !88 U+0088 .notdef
138
+ !89 U+0089 .notdef
139
+ !8A U+008A .notdef
140
+ !8B U+008B .notdef
141
+ !8C U+008C .notdef
142
+ !8D U+008D .notdef
143
+ !8E U+008E .notdef
144
+ !8F U+008F .notdef
145
+ !90 U+0090 .notdef
146
+ !91 U+0091 .notdef
147
+ !92 U+0092 .notdef
148
+ !93 U+0093 .notdef
149
+ !94 U+0094 .notdef
150
+ !95 U+0095 .notdef
151
+ !96 U+0096 .notdef
152
+ !97 U+0097 .notdef
153
+ !98 U+0098 .notdef
154
+ !99 U+0099 .notdef
155
+ !9A U+009A .notdef
156
+ !9B U+009B .notdef
157
+ !9C U+009C .notdef
158
+ !9D U+009D .notdef
159
+ !9E U+009E .notdef
160
+ !9F U+009F .notdef
161
+ !A0 U+00A0 space
162
+ !A1 U+2018 quoteleft
163
+ !A2 U+2019 quoteright
164
+ !A3 U+00A3 sterling
165
+ !A6 U+00A6 brokenbar
166
+ !A7 U+00A7 section
167
+ !A8 U+00A8 dieresis
168
+ !A9 U+00A9 copyright
169
+ !AB U+00AB guillemotleft
170
+ !AC U+00AC logicalnot
171
+ !AD U+00AD hyphen
172
+ !AF U+2015 afii00208
173
+ !B0 U+00B0 degree
174
+ !B1 U+00B1 plusminus
175
+ !B2 U+00B2 twosuperior
176
+ !B3 U+00B3 threesuperior
177
+ !B4 U+0384 tonos
178
+ !B5 U+0385 dieresistonos
179
+ !B6 U+0386 Alphatonos
180
+ !B7 U+00B7 periodcentered
181
+ !B8 U+0388 Epsilontonos
182
+ !B9 U+0389 Etatonos
183
+ !BA U+038A Iotatonos
184
+ !BB U+00BB guillemotright
185
+ !BC U+038C Omicrontonos
186
+ !BD U+00BD onehalf
187
+ !BE U+038E Upsilontonos
188
+ !BF U+038F Omegatonos
189
+ !C0 U+0390 iotadieresistonos
190
+ !C1 U+0391 Alpha
191
+ !C2 U+0392 Beta
192
+ !C3 U+0393 Gamma
193
+ !C4 U+0394 Delta
194
+ !C5 U+0395 Epsilon
195
+ !C6 U+0396 Zeta
196
+ !C7 U+0397 Eta
197
+ !C8 U+0398 Theta
198
+ !C9 U+0399 Iota
199
+ !CA U+039A Kappa
200
+ !CB U+039B Lambda
201
+ !CC U+039C Mu
202
+ !CD U+039D Nu
203
+ !CE U+039E Xi
204
+ !CF U+039F Omicron
205
+ !D0 U+03A0 Pi
206
+ !D1 U+03A1 Rho
207
+ !D3 U+03A3 Sigma
208
+ !D4 U+03A4 Tau
209
+ !D5 U+03A5 Upsilon
210
+ !D6 U+03A6 Phi
211
+ !D7 U+03A7 Chi
212
+ !D8 U+03A8 Psi
213
+ !D9 U+03A9 Omega
214
+ !DA U+03AA Iotadieresis
215
+ !DB U+03AB Upsilondieresis
216
+ !DC U+03AC alphatonos
217
+ !DD U+03AD epsilontonos
218
+ !DE U+03AE etatonos
219
+ !DF U+03AF iotatonos
220
+ !E0 U+03B0 upsilondieresistonos
221
+ !E1 U+03B1 alpha
222
+ !E2 U+03B2 beta
223
+ !E3 U+03B3 gamma
224
+ !E4 U+03B4 delta
225
+ !E5 U+03B5 epsilon
226
+ !E6 U+03B6 zeta
227
+ !E7 U+03B7 eta
228
+ !E8 U+03B8 theta
229
+ !E9 U+03B9 iota
230
+ !EA U+03BA kappa
231
+ !EB U+03BB lambda
232
+ !EC U+03BC mu
233
+ !ED U+03BD nu
234
+ !EE U+03BE xi
235
+ !EF U+03BF omicron
236
+ !F0 U+03C0 pi
237
+ !F1 U+03C1 rho
238
+ !F2 U+03C2 sigma1
239
+ !F3 U+03C3 sigma
240
+ !F4 U+03C4 tau
241
+ !F5 U+03C5 upsilon
242
+ !F6 U+03C6 phi
243
+ !F7 U+03C7 chi
244
+ !F8 U+03C8 psi
245
+ !F9 U+03C9 omega
246
+ !FA U+03CA iotadieresis
247
+ !FB U+03CB upsilondieresis
248
+ !FC U+03CC omicrontonos
249
+ !FD U+03CD upsilontonos
250
+ !FE U+03CE omegatonos
lib/fpdf/font/makefont/iso-8859-9.map ADDED
@@ -0,0 +1,256 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ !00 U+0000 .notdef
2
+ !01 U+0001 .notdef
3
+ !02 U+0002 .notdef
4
+ !03 U+0003 .notdef
5
+ !04 U+0004 .notdef
6
+ !05 U+0005 .notdef
7
+ !06 U+0006 .notdef
8
+ !07 U+0007 .notdef
9
+ !08 U+0008 .notdef
10
+ !09 U+0009 .notdef
11
+ !0A U+000A .notdef
12
+ !0B U+000B .notdef
13
+ !0C U+000C .notdef
14
+ !0D U+000D .notdef
15
+ !0E U+000E .notdef
16
+ !0F U+000F .notdef
17
+ !10 U+0010 .notdef
18
+ !11 U+0011 .notdef
19
+ !12 U+0012 .notdef
20
+ !13 U+0013 .notdef
21
+ !14 U+0014 .notdef
22
+ !15 U+0015 .notdef
23
+ !16 U+0016 .notdef
24
+ !17 U+0017 .notdef
25
+ !18 U+0018 .notdef
26
+ !19 U+0019 .notdef
27
+ !1A U+001A .notdef
28
+ !1B U+001B .notdef
29
+ !1C U+001C .notdef
30
+ !1D U+001D .notdef
31
+ !1E U+001E .notdef
32
+ !1F U+001F .notdef
33
+ !20 U+0020 space
34
+ !21 U+0021 exclam
35
+ !22 U+0022 quotedbl
36
+ !23 U+0023 numbersign
37
+ !24 U+0024 dollar
38
+ !25 U+0025 percent
39
+ !26 U+0026 ampersand
40
+ !27 U+0027 quotesingle
41
+ !28 U+0028 parenleft
42
+ !29 U+0029 parenright
43
+ !2A U+002A asterisk
44
+ !2B U+002B plus
45
+ !2C U+002C comma
46
+ !2D U+002D hyphen
47
+ !2E U+002E period
48
+ !2F U+002F slash
49
+ !30 U+0030 zero
50
+ !31 U+0031 one
51
+ !32 U+0032 two
52
+ !33 U+0033 three
53
+ !34 U+0034 four
54
+ !35 U+0035 five
55
+ !36 U+0036 six
56
+ !37 U+0037 seven
57
+ !38 U+0038 eight
58
+ !39 U+0039 nine
59
+ !3A U+003A colon
60
+ !3B U+003B semicolon
61
+ !3C U+003C less
62
+ !3D U+003D equal
63
+ !3E U+003E greater
64
+ !3F U+003F question
65
+ !40 U+0040 at
66
+ !41 U+0041 A
67
+ !42 U+0042 B
68
+ !43 U+0043 C
69
+ !44 U+0044 D
70
+ !45 U+0045 E
71
+ !46 U+0046 F
72
+ !47 U+0047 G
73
+ !48 U+0048 H
74
+ !49 U+0049 I
75
+ !4A U+004A J
76
+ !4B U+004B K
77
+ !4C U+004C L
78
+ !4D U+004D M
79
+ !4E U+004E N
80
+ !4F U+004F O
81
+ !50 U+0050 P
82
+ !51 U+0051 Q
83
+ !52 U+0052 R
84
+ !53 U+0053 S
85
+ !54 U+0054 T
86
+ !55 U+0055 U
87
+ !56 U+0056 V
88
+ !57 U+0057 W
89
+ !58 U+0058 X
90
+ !59 U+0059 Y
91
+ !5A U+005A Z
92
+ !5B U+005B bracketleft
93
+ !5C U+005C backslash
94
+ !5D U+005D bracketright
95
+ !5E U+005E asciicircum
96
+ !5F U+005F underscore
97
+ !60 U+0060 grave
98
+ !61 U+0061 a
99
+ !62 U+0062 b
100
+ !63 U+0063 c
101
+ !64 U+0064 d
102
+ !65 U+0065 e
103
+ !66 U+0066 f
104
+ !67 U+0067 g
105
+ !68 U+0068 h
106
+ !69 U+0069 i
107
+ !6A U+006A j
108
+ !6B U+006B k
109
+ !6C U+006C l
110
+ !6D U+006D m
111
+ !6E U+006E n
112
+ !6F U+006F o
113
+ !70 U+0070 p
114
+ !71 U+0071 q
115
+ !72 U+0072 r
116
+ !73 U+0073 s
117
+ !74 U+0074 t
118
+ !75 U+0075 u
119
+ !76 U+0076 v
120
+ !77 U+0077 w
121
+ !78 U+0078 x
122
+ !79 U+0079 y
123
+ !7A U+007A z
124
+ !7B U+007B braceleft
125
+ !7C U+007C bar
126
+ !7D U+007D braceright
127
+ !7E U+007E asciitilde
128
+ !7F U+007F .notdef
129
+ !80 U+0080 .notdef
130
+ !81 U+0081 .notdef
131
+ !82 U+0082 .notdef
132
+ !83 U+0083 .notdef
133
+ !84 U+0084 .notdef
134
+ !85 U+0085 .notdef
135
+ !86 U+0086 .notdef
136
+ !87 U+0087 .notdef
137
+ !88 U+0088 .notdef
138
+ !89 U+0089 .notdef
139
+ !8A U+008A .notdef
140
+ !8B U+008B .notdef
141
+ !8C U+008C .notdef
142
+ !8D U+008D .notdef
143
+ !8E U+008E .notdef
144
+ !8F U+008F .notdef
145
+ !90 U+0090 .notdef
146
+ !91 U+0091 .notdef
147
+ !92 U+0092 .notdef
148
+ !93 U+0093 .notdef
149
+ !94 U+0094 .notdef
150
+ !95 U+0095 .notdef
151
+ !96 U+0096 .notdef
152
+ !97 U+0097 .notdef
153
+ !98 U+0098 .notdef
154
+ !99 U+0099 .notdef
155
+ !9A U+009A .notdef
156
+ !9B U+009B .notdef
157
+ !9C U+009C .notdef
158
+ !9D U+009D .notdef
159
+ !9E U+009E .notdef
160
+ !9F U+009F .notdef
161
+ !A0 U+00A0 space
162
+ !A1 U+00A1 exclamdown
163
+ !A2 U+00A2 cent
164
+ !A3 U+00A3 sterling
165
+ !A4 U+00A4 currency
166
+ !A5 U+00A5 yen
167
+ !A6 U+00A6 brokenbar
168
+ !A7 U+00A7 section
169
+ !A8 U+00A8 dieresis
170
+ !A9 U+00A9 copyright
171
+ !AA U+00AA ordfeminine
172
+ !AB U+00AB guillemotleft
173
+ !AC U+00AC logicalnot
174
+ !AD U+00AD hyphen
175
+ !AE U+00AE registered
176
+ !AF U+00AF macron
177
+ !B0 U+00B0 degree
178
+ !B1 U+00B1 plusminus
179
+ !B2 U+00B2 twosuperior
180
+ !B3 U+00B3 threesuperior
181
+ !B4 U+00B4 acute
182
+ !B5 U+00B5 mu
183
+ !B6 U+00B6 paragraph
184
+ !B7 U+00B7 periodcentered
185
+ !B8 U+00B8 cedilla
186
+ !B9 U+00B9 onesuperior
187
+ !BA U+00BA ordmasculine
188
+ !BB U+00BB guillemotright
189
+ !BC U+00BC onequarter
190
+ !BD U+00BD onehalf
191
+ !BE U+00BE threequarters
192
+ !BF U+00BF questiondown
193
+ !C0 U+00C0 Agrave
194
+ !C1 U+00C1 Aacute
195
+ !C2 U+00C2 Acircumflex
196
+ !C3 U+00C3 Atilde
197
+ !C4 U+00C4 Adieresis
198
+ !C5 U+00C5 Aring
199
+ !C6 U+00C6 AE
200
+ !C7 U+00C7 Ccedilla
201
+ !C8 U+00C8 Egrave
202
+ !C9 U+00C9 Eacute
203
+ !CA U+00CA Ecircumflex
204
+ !CB U+00CB Edieresis
205
+ !CC U+00CC Igrave
206
+ !CD U+00CD Iacute
207
+ !CE U+00CE Icircumflex
208
+ !CF U+00CF Idieresis
209
+ !D0 U+011E Gbreve
210
+ !D1 U+00D1 Ntilde
211
+ !D2 U+00D2 Ograve
212
+ !D3 U+00D3 Oacute
213
+ !D4 U+00D4 Ocircumflex
214
+ !D5 U+00D5 Otilde
215
+ !D6 U+00D6 Odieresis
216
+ !D7 U+00D7 multiply
217
+ !D8 U+00D8 Oslash
218
+ !D9 U+00D9 Ugrave
219
+ !DA U+00DA Uacute
220
+ !DB U+00DB Ucircumflex
221
+ !DC U+00DC Udieresis
222
+ !DD U+0130 Idotaccent
223
+ !DE U+015E Scedilla
224
+ !DF U+00DF germandbls
225
+ !E0 U+00E0 agrave
226
+ !E1 U+00E1 aacute
227
+ !E2 U+00E2 acircumflex
228
+ !E3 U+00E3 atilde
229
+ !E4 U+00E4 adieresis
230
+ !E5 U+00E5 aring
231
+ !E6 U+00E6 ae
232
+ !E7 U+00E7 ccedilla
233
+ !E8 U+00E8 egrave
234
+ !E9 U+00E9 eacute
235
+ !EA U+00EA ecircumflex
236
+ !EB U+00EB edieresis
237
+ !EC U+00EC igrave
238
+ !ED U+00ED iacute
239
+ !EE U+00EE icircumflex
240
+ !EF U+00EF idieresis
241
+ !F0 U+011F gbreve
242
+ !F1 U+00F1 ntilde
243
+ !F2 U+00F2 ograve
244
+ !F3 U+00F3 oacute
245
+ !F4 U+00F4 ocircumflex
246
+ !F5 U+00F5 otilde
247
+ !F6 U+00F6 odieresis
248
+ !F7 U+00F7 divide
249
+ !F8 U+00F8 oslash
250
+ !F9 U+00F9 ugrave
251
+ !FA U+00FA uacute
252
+ !FB U+00FB ucircumflex
253
+ !FC U+00FC udieresis
254
+ !FD U+0131 dotlessi
255
+ !FE U+015F scedilla
256
+ !FF U+00FF ydieresis
lib/fpdf/font/makefont/koi8-r.map ADDED
@@ -0,0 +1,256 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ !00 U+0000 .notdef
2
+ !01 U+0001 .notdef
3
+ !02 U+0002 .notdef
4
+ !03 U+0003 .notdef
5
+ !04 U+0004 .notdef
6
+ !05 U+0005 .notdef
7
+ !06 U+0006 .notdef
8
+ !07 U+0007 .notdef
9
+ !08 U+0008 .notdef
10
+ !09 U+0009 .notdef
11
+ !0A U+000A .notdef
12
+ !0B U+000B .notdef
13
+ !0C U+000C .notdef
14
+ !0D U+000D .notdef
15
+ !0E U+000E .notdef
16
+ !0F U+000F .notdef
17
+ !10 U+0010 .notdef
18
+ !11 U+0011 .notdef
19
+ !12 U+0012 .notdef
20
+ !13 U+0013 .notdef
21
+ !14 U+0014 .notdef
22
+ !15 U+0015 .notdef
23
+ !16 U+0016 .notdef
24
+ !17 U+0017 .notdef
25
+ !18 U+0018 .notdef
26
+ !19 U+0019 .notdef
27
+ !1A U+001A .notdef
28
+ !1B U+001B .notdef
29
+ !1C U+001C .notdef
30
+ !1D U+001D .notdef
31
+ !1E U+001E .notdef
32
+ !1F U+001F .notdef
33
+ !20 U+0020 space
34
+ !21 U+0021 exclam
35
+ !22 U+0022 quotedbl
36
+ !23 U+0023 numbersign
37
+ !24 U+0024 dollar
38
+ !25 U+0025 percent
39
+ !26 U+0026 ampersand
40
+ !27 U+0027 quotesingle
41
+ !28 U+0028 parenleft
42
+ !29 U+0029 parenright
43
+ !2A U+002A asterisk
44
+ !2B U+002B plus
45
+ !2C U+002C comma
46
+ !2D U+002D hyphen
47
+ !2E U+002E period
48
+ !2F U+002F slash
49
+ !30 U+0030 zero
50
+ !31 U+0031 one
51
+ !32 U+0032 two
52
+ !33 U+0033 three
53
+ !34 U+0034 four
54
+ !35 U+0035 five
55
+ !36 U+0036 six
56
+ !37 U+0037 seven
57
+ !38 U+0038 eight
58
+ !39 U+0039 nine
59
+ !3A U+003A colon
60
+ !3B U+003B semicolon
61
+ !3C U+003C less
62
+ !3D U+003D equal
63
+ !3E U+003E greater
64
+ !3F U+003F question
65
+ !40 U+0040 at
66
+ !41 U+0041 A
67
+ !42 U+0042 B
68
+ !43 U+0043 C
69
+ !44 U+0044 D
70
+ !45 U+0045 E
71
+ !46 U+0046 F
72
+ !47 U+0047 G
73
+ !48 U+0048 H
74
+ !49 U+0049 I
75
+ !4A U+004A J
76
+ !4B U+004B K
77
+ !4C U+004C L
78
+ !4D U+004D M
79
+ !4E U+004E N
80
+ !4F U+004F O
81
+ !50 U+0050 P
82
+ !51 U+0051 Q
83
+ !52 U+0052 R
84
+ !53 U+0053 S
85
+ !54 U+0054 T
86
+ !55 U+0055 U
87
+ !56 U+0056 V
88
+ !57 U+0057 W
89
+ !58 U+0058 X
90
+ !59 U+0059 Y
91
+ !5A U+005A Z
92
+ !5B U+005B bracketleft
93
+ !5C U+005C backslash
94
+ !5D U+005D bracketright
95
+ !5E U+005E asciicircum
96
+ !5F U+005F underscore
97
+ !60 U+0060 grave
98
+ !61 U+0061 a
99
+ !62 U+0062 b
100
+ !63 U+0063 c
101
+ !64 U+0064 d
102
+ !65 U+0065 e
103
+ !66 U+0066 f
104
+ !67 U+0067 g
105
+ !68 U+0068 h
106
+ !69 U+0069 i
107
+ !6A U+006A j
108
+ !6B U+006B k
109
+ !6C U+006C l
110
+ !6D U+006D m
111
+ !6E U+006E n
112
+ !6F U+006F o
113
+ !70 U+0070 p
114
+ !71 U+0071 q
115
+ !72 U+0072 r
116
+ !73 U+0073 s
117
+ !74 U+0074 t
118
+ !75 U+0075 u
119
+ !76 U+0076 v
120
+ !77 U+0077 w
121
+ !78 U+0078 x
122
+ !79 U+0079 y
123
+ !7A U+007A z
124
+ !7B U+007B braceleft
125
+ !7C U+007C bar
126
+ !7D U+007D braceright
127
+ !7E U+007E asciitilde
128
+ !7F U+007F .notdef
129
+ !80 U+2500 SF100000
130
+ !81 U+2502 SF110000
131
+ !82 U+250C SF010000
132
+ !83 U+2510 SF030000
133
+ !84 U+2514 SF020000
134
+ !85 U+2518 SF040000
135
+ !86 U+251C SF080000
136
+ !87 U+2524 SF090000
137
+ !88 U+252C SF060000
138
+ !89 U+2534 SF070000
139
+ !8A U+253C SF050000
140
+ !8B U+2580 upblock
141
+ !8C U+2584 dnblock
142
+ !8D U+2588 block
143
+ !8E U+258C lfblock
144
+ !8F U+2590 rtblock
145
+ !90 U+2591 ltshade
146
+ !91 U+2592 shade
147
+ !92 U+2593 dkshade
148
+ !93 U+2320 integraltp
149
+ !94 U+25A0 filledbox
150
+ !95 U+2219 periodcentered
151
+ !96 U+221A radical
152
+ !97 U+2248 approxequal
153
+ !98 U+2264 lessequal
154
+ !99 U+2265 greaterequal
155
+ !9A U+00A0 space
156
+ !9B U+2321 integralbt
157
+ !9C U+00B0 degree
158
+ !9D U+00B2 twosuperior
159
+ !9E U+00B7 periodcentered
160
+ !9F U+00F7 divide
161
+ !A0 U+2550 SF430000
162
+ !A1 U+2551 SF240000
163
+ !A2 U+2552 SF510000
164
+ !A3 U+0451 afii10071
165
+ !A4 U+2553 SF520000
166
+ !A5 U+2554 SF390000
167
+ !A6 U+2555 SF220000
168
+ !A7 U+2556 SF210000
169
+ !A8 U+2557 SF250000
170
+ !A9 U+2558 SF500000
171
+ !AA U+2559 SF490000
172
+ !AB U+255A SF380000
173
+ !AC U+255B SF280000
174
+ !AD U+255C SF270000
175
+ !AE U+255D SF260000
176
+ !AF U+255E SF360000
177
+ !B0 U+255F SF370000
178
+ !B1 U+2560 SF420000
179
+ !B2 U+2561 SF190000
180
+ !B3 U+0401 afii10023
181
+ !B4 U+2562 SF200000
182
+ !B5 U+2563 SF230000
183
+ !B6 U+2564 SF470000
184
+ !B7 U+2565 SF480000
185
+ !B8 U+2566 SF410000
186
+ !B9 U+2567 SF450000
187
+ !BA U+2568 SF460000
188
+ !BB U+2569 SF400000
189
+ !BC U+256A SF540000
190
+ !BD U+256B SF530000
191
+ !BE U+256C SF440000
192
+ !BF U+00A9 copyright
193
+ !C0 U+044E afii10096
194
+ !C1 U+0430 afii10065
195
+ !C2 U+0431 afii10066
196
+ !C3 U+0446 afii10088
197
+ !C4 U+0434 afii10069
198
+ !C5 U+0435 afii10070
199
+ !C6 U+0444 afii10086
200
+ !C7 U+0433 afii10068
201
+ !C8 U+0445 afii10087
202
+ !C9 U+0438 afii10074
203
+ !CA U+0439 afii10075
204
+ !CB U+043A afii10076
205
+ !CC U+043B afii10077
206
+ !CD U+043C afii10078
207
+ !CE U+043D afii10079
208
+ !CF U+043E afii10080
209
+ !D0 U+043F afii10081
210
+ !D1 U+044F afii10097
211
+ !D2 U+0440 afii10082
212
+ !D3 U+0441 afii10083
213
+ !D4 U+0442 afii10084
214
+ !D5 U+0443 afii10085
215
+ !D6 U+0436 afii10072
216
+ !D7 U+0432 afii10067
217
+ !D8 U+044C afii10094
218
+ !D9 U+044B afii10093
219
+ !DA U+0437 afii10073
220
+ !DB U+0448 afii10090
221
+ !DC U+044D afii10095
222
+ !DD U+0449 afii10091
223
+ !DE U+0447 afii10089
224
+ !DF U+044A afii10092
225
+ !E0 U+042E afii10048
226
+ !E1 U+0410 afii10017
227
+ !E2 U+0411 afii10018
228
+ !E3 U+0426 afii10040
229
+ !E4 U+0414 afii10021
230
+ !E5 U+0415 afii10022
231
+ !E6 U+0424 afii10038
232
+ !E7 U+0413 afii10020
233
+ !E8 U+0425 afii10039
234
+ !E9 U+0418 afii10026
235
+ !EA U+0419 afii10027
236
+ !EB U+041A afii10028
237
+ !EC U+041B afii10029
238
+ !ED U+041C afii10030
239
+ !EE U+041D afii10031
240
+ !EF U+041E afii10032
241
+ !F0 U+041F afii10033
242
+ !F1 U+042F afii10049
243
+ !F2 U+0420 afii10034
244
+ !F3 U+0421 afii10035
245
+ !F4 U+0422 afii10036
246
+ !F5 U+0423 afii10037
247
+ !F6 U+0416 afii10024
248
+ !F7 U+0412 afii10019
249
+ !F8 U+042C afii10046
250
+ !F9 U+042B afii10045
251
+ !FA U+0417 afii10025
252
+ !FB U+0428 afii10042
253
+ !FC U+042D afii10047
254
+ !FD U+0429 afii10043
255
+ !FE U+0427 afii10041
256
+ !FF U+042A afii10044
lib/fpdf/font/makefont/koi8-u.map ADDED
@@ -0,0 +1,256 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ !00 U+0000 .notdef
2
+ !01 U+0001 .notdef
3
+ !02 U+0002 .notdef
4
+ !03 U+0003 .notdef
5
+ !04 U+0004 .notdef
6
+ !05 U+0005 .notdef
7
+ !06 U+0006 .notdef
8
+ !07 U+0007 .notdef
9
+ !08 U+0008 .notdef
10
+ !09 U+0009 .notdef
11
+ !0A U+000A .notdef
12
+ !0B U+000B .notdef
13
+ !0C U+000C .notdef
14
+ !0D U+000D .notdef
15
+ !0E U+000E .notdef
16
+ !0F U+000F .notdef
17
+ !10 U+0010 .notdef
18
+ !11 U+0011 .notdef
19
+ !12 U+0012 .notdef
20
+ !13 U+0013 .notdef
21
+ !14 U+0014 .notdef
22
+ !15 U+0015 .notdef
23
+ !16 U+0016 .notdef
24
+ !17 U+0017 .notdef
25
+ !18 U+0018 .notdef
26
+ !19 U+0019 .notdef
27
+ !1A U+001A .notdef
28
+ !1B U+001B .notdef
29
+ !1C U+001C .notdef
30
+ !1D U+001D .notdef
31
+ !1E U+001E .notdef
32
+ !1F U+001F .notdef
33
+ !20 U+0020 space
34
+ !21 U+0021 exclam
35
+ !22 U+0022 quotedbl
36
+ !23 U+0023 numbersign
37
+ !24 U+0024 dollar
38
+ !25 U+0025 percent
39
+ !26 U+0026 ampersand
40
+ !27 U+0027 quotesingle
41
+ !28 U+0028 parenleft
42
+ !29 U+0029 parenright
43
+ !2A U+002A asterisk
44
+ !2B U+002B plus
45
+ !2C U+002C comma
46
+ !2D U+002D hyphen
47
+ !2E U+002E period
48
+ !2F U+002F slash
49
+ !30 U+0030 zero
50
+ !31 U+0031 one
51
+ !32 U+0032 two
52
+ !33 U+0033 three
53
+ !34 U+0034 four
54
+ !35 U+0035 five
55
+ !36 U+0036 six
56
+ !37 U+0037 seven
57
+ !38 U+0038 eight
58
+ !39 U+0039 nine
59
+ !3A U+003A colon
60
+ !3B U+003B semicolon
61
+ !3C U+003C less
62
+ !3D U+003D equal
63
+ !3E U+003E greater
64
+ !3F U+003F question
65
+ !40 U+0040 at
66
+ !41 U+0041 A
67
+ !42 U+0042 B
68
+ !43 U+0043 C
69
+ !44 U+0044 D
70
+ !45 U+0045 E
71
+ !46 U+0046 F
72
+ !47 U+0047 G
73
+ !48 U+0048 H
74
+ !49 U+0049 I
75
+ !4A U+004A J
76
+ !4B U+004B K
77
+ !4C U+004C L
78
+ !4D U+004D M
79
+ !4E U+004E N
80
+ !4F U+004F O
81
+ !50 U+0050 P
82
+ !51 U+0051 Q
83
+ !52 U+0052 R
84
+ !53 U+0053 S
85
+ !54 U+0054 T
86
+ !55 U+0055 U
87
+ !56 U+0056 V
88
+ !57 U+0057 W
89
+ !58 U+0058 X
90
+ !59 U+0059 Y
91
+ !5A U+005A Z
92
+ !5B U+005B bracketleft
93
+ !5C U+005C backslash
94
+ !5D U+005D bracketright
95
+ !5E U+005E asciicircum
96
+ !5F U+005F underscore
97
+ !60 U+0060 grave
98
+ !61 U+0061 a
99
+ !62 U+0062 b
100
+ !63 U+0063 c
101
+ !64 U+0064 d
102
+ !65 U+0065 e
103
+ !66 U+0066 f
104
+ !67 U+0067 g
105
+ !68 U+0068 h
106
+ !69 U+0069 i
107
+ !6A U+006A j
108
+ !6B U+006B k
109
+ !6C U+006C l
110
+ !6D U+006D m
111
+ !6E U+006E n
112
+ !6F U+006F o
113
+ !70 U+0070 p
114
+ !71 U+0071 q
115
+ !72 U+0072 r
116
+ !73 U+0073 s
117
+ !74 U+0074 t
118
+ !75 U+0075 u
119
+ !76 U+0076 v
120
+ !77 U+0077 w
121
+ !78 U+0078 x
122
+ !79 U+0079 y
123
+ !7A U+007A z
124
+ !7B U+007B braceleft
125
+ !7C U+007C bar
126
+ !7D U+007D braceright
127
+ !7E U+007E asciitilde
128
+ !7F U+007F .notdef
129
+ !80 U+2500 SF100000
130
+ !81 U+2502 SF110000
131
+ !82 U+250C SF010000
132
+ !83 U+2510 SF030000
133
+ !84 U+2514 SF020000
134
+ !85 U+2518 SF040000
135
+ !86 U+251C SF080000
136
+ !87 U+2524 SF090000
137
+ !88 U+252C SF060000
138
+ !89 U+2534 SF070000
139
+ !8A U+253C SF050000
140
+ !8B U+2580 upblock
141
+ !8C U+2584 dnblock
142
+ !8D U+2588 block
143
+ !8E U+258C lfblock
144
+ !8F U+2590 rtblock
145
+ !90 U+2591 ltshade
146
+ !91 U+2592 shade
147
+ !92 U+2593 dkshade
148
+ !93 U+2320 integraltp
149
+ !94 U+25A0 filledbox
150
+ !95 U+2022 bullet
151
+ !96 U+221A radical
152
+ !97 U+2248 approxequal
153
+ !98 U+2264 lessequal
154
+ !99 U+2265 greaterequal
155
+ !9A U+00A0 space
156
+ !9B U+2321 integralbt
157
+ !9C U+00B0 degree
158
+ !9D U+00B2 twosuperior
159
+ !9E U+00B7 periodcentered
160
+ !9F U+00F7 divide
161
+ !A0 U+2550 SF430000
162
+ !A1 U+2551 SF240000
163
+ !A2 U+2552 SF510000
164
+ !A3 U+0451 afii10071
165
+ !A4 U+0454 afii10101
166
+ !A5 U+2554 SF390000
167
+ !A6 U+0456 afii10103
168
+ !A7 U+0457 afii10104
169
+ !A8 U+2557 SF250000
170
+ !A9 U+2558 SF500000
171
+ !AA U+2559 SF490000
172
+ !AB U+255A SF380000
173
+ !AC U+255B SF280000
174
+ !AD U+0491 afii10098
175
+ !AE U+255D SF260000
176
+ !AF U+255E SF360000
177
+ !B0 U+255F SF370000
178
+ !B1 U+2560 SF420000
179
+ !B2 U+2561 SF190000
180
+ !B3 U+0401 afii10023
181
+ !B4 U+0404 afii10053
182
+ !B5 U+2563 SF230000
183
+ !B6 U+0406 afii10055
184
+ !B7 U+0407 afii10056
185
+ !B8 U+2566 SF410000
186
+ !B9 U+2567 SF450000
187
+ !BA U+2568 SF460000
188
+ !BB U+2569 SF400000
189
+ !BC U+256A SF540000
190
+ !BD U+0490 afii10050
191
+ !BE U+256C SF440000
192
+ !BF U+00A9 copyright
193
+ !C0 U+044E afii10096
194
+ !C1 U+0430 afii10065
195
+ !C2 U+0431 afii10066
196
+ !C3 U+0446 afii10088
197
+ !C4 U+0434 afii10069
198
+ !C5 U+0435 afii10070
199
+ !C6 U+0444 afii10086
200
+ !C7 U+0433 afii10068
201
+ !C8 U+0445 afii10087
202
+ !C9 U+0438 afii10074
203
+ !CA U+0439 afii10075
204
+ !CB U+043A afii10076
205
+ !CC U+043B afii10077
206
+ !CD U+043C afii10078
207
+ !CE U+043D afii10079
208
+ !CF U+043E afii10080
209
+ !D0 U+043F afii10081
210
+ !D1 U+044F afii10097
211
+ !D2 U+0440 afii10082
212
+ !D3 U+0441 afii10083
213
+ !D4 U+0442 afii10084
214
+ !D5 U+0443 afii10085
215
+ !D6 U+0436 afii10072
216
+ !D7 U+0432 afii10067
217
+ !D8 U+044C afii10094
218
+ !D9 U+044B afii10093
219
+ !DA U+0437 afii10073
220
+ !DB U+0448 afii10090
221
+ !DC U+044D afii10095
222
+ !DD U+0449 afii10091
223
+ !DE U+0447 afii10089
224
+ !DF U+044A afii10092
225
+ !E0 U+042E afii10048
226
+ !E1 U+0410 afii10017
227
+ !E2 U+0411 afii10018
228
+ !E3 U+0426 afii10040
229
+ !E4 U+0414 afii10021
230
+ !E5 U+0415 afii10022
231
+ !E6 U+0424 afii10038
232
+ !E7 U+0413 afii10020
233
+ !E8 U+0425 afii10039
234
+ !E9 U+0418 afii10026
235
+ !EA U+0419 afii10027
236
+ !EB U+041A afii10028
237
+ !EC U+041B afii10029
238
+ !ED U+041C afii10030
239
+ !EE U+041D afii10031
240
+ !EF U+041E afii10032
241
+ !F0 U+041F afii10033
242
+ !F1 U+042F afii10049
243
+ !F2 U+0420 afii10034
244
+ !F3 U+0421 afii10035
245
+ !F4 U+0422 afii10036
246
+ !F5 U+0423 afii10037
247
+ !F6 U+0416 afii10024
248
+ !F7 U+0412 afii10019
249
+ !F8 U+042C afii10046
250
+ !F9 U+042B afii10045
251
+ !FA U+0417 afii10025
252
+ !FB U+0428 afii10042
253
+ !FC U+042D afii10047
254
+ !FD U+0429 afii10043
255
+ !FE U+0427 afii10041
256
+ !FF U+042A afii10044
lib/fpdf/font/makefont/makefont.php ADDED
@@ -0,0 +1,419 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /*******************************************************************************
3
+ * Utility to generate font definition files *
4
+ * *
5
+ * Version: 1.14 *
6
+ * Date: 2008-08-03 *
7
+ * Author: Olivier PLATHEY *
8
+ *******************************************************************************/
9
+
10
+ function ReadMap($enc)
11
+ {
12
+ //Read a map file
13
+ $file=dirname(__FILE__).'/'.strtolower($enc).'.map';
14
+ $a=file($file);
15
+ if(empty($a))
16
+ die('<b>Error:</b> encoding not found: '.$enc);
17
+ $cc2gn=array();
18
+ foreach($a as $l)
19
+ {
20
+ if($l[0]=='!')
21
+ {
22
+ $e=preg_split('/[ \\t]+/',rtrim($l));
23
+ $cc=hexdec(substr($e[0],1));
24
+ $gn=$e[2];
25
+ $cc2gn[$cc]=$gn;
26
+ }
27
+ }
28
+ for($i=0;$i<=255;$i++)
29
+ {
30
+ if(!isset($cc2gn[$i]))
31
+ $cc2gn[$i]='.notdef';
32
+ }
33
+ return $cc2gn;
34
+ }
35
+
36
+ function ReadAFM($file, &$map)
37
+ {
38
+ //Read a font metric file
39
+ $a=file($file);
40
+ if(empty($a))
41
+ die('File not found');
42
+ $widths=array();
43
+ $fm=array();
44
+ $fix=array('Edot'=>'Edotaccent','edot'=>'edotaccent','Idot'=>'Idotaccent','Zdot'=>'Zdotaccent','zdot'=>'zdotaccent',
45
+ 'Odblacute'=>'Ohungarumlaut','odblacute'=>'ohungarumlaut','Udblacute'=>'Uhungarumlaut','udblacute'=>'uhungarumlaut',
46
+ 'Gcedilla'=>'Gcommaaccent','gcedilla'=>'gcommaaccent','Kcedilla'=>'Kcommaaccent','kcedilla'=>'kcommaaccent',
47
+ 'Lcedilla'=>'Lcommaaccent','lcedilla'=>'lcommaaccent','Ncedilla'=>'Ncommaaccent','ncedilla'=>'ncommaaccent',
48
+ 'Rcedilla'=>'Rcommaaccent','rcedilla'=>'rcommaaccent','Scedilla'=>'Scommaaccent','scedilla'=>'scommaaccent',
49
+ 'Tcedilla'=>'Tcommaaccent','tcedilla'=>'tcommaaccent','Dslash'=>'Dcroat','dslash'=>'dcroat','Dmacron'=>'Dcroat','dmacron'=>'dcroat',
50
+ 'combininggraveaccent'=>'gravecomb','combininghookabove'=>'hookabovecomb','combiningtildeaccent'=>'tildecomb',
51
+ 'combiningacuteaccent'=>'acutecomb','combiningdotbelow'=>'dotbelowcomb','dongsign'=>'dong');
52
+ foreach($a as $l)
53
+ {
54
+ $e=explode(' ',rtrim($l));
55
+ if(count($e)<2)
56
+ continue;
57
+ $code=$e[0];
58
+ $param=$e[1];
59
+ if($code=='C')
60
+ {
61
+ //Character metrics
62
+ $cc=(int)$e[1];
63
+ $w=$e[4];
64
+ $gn=$e[7];
65
+ if(substr($gn,-4)=='20AC')
66
+ $gn='Euro';
67
+ if(isset($fix[$gn]))
68
+ {
69
+ //Fix incorrect glyph name
70
+ foreach($map as $c=>$n)
71
+ {
72
+ if($n==$fix[$gn])
73
+ $map[$c]=$gn;
74
+ }
75
+ }
76
+ if(empty($map))
77
+ {
78
+ //Symbolic font: use built-in encoding
79
+ $widths[$cc]=$w;
80
+ }
81
+ else
82
+ {
83
+ $widths[$gn]=$w;
84
+ if($gn=='X')
85
+ $fm['CapXHeight']=$e[13];
86
+ }
87
+ if($gn=='.notdef')
88
+ $fm['MissingWidth']=$w;
89
+ }
90
+ elseif($code=='FontName')
91
+ $fm['FontName']=$param;
92
+ elseif($code=='Weight')
93
+ $fm['Weight']=$param;
94
+ elseif($code=='ItalicAngle')
95
+ $fm['ItalicAngle']=(double)$param;
96
+ elseif($code=='Ascender')
97
+ $fm['Ascender']=(int)$param;
98
+ elseif($code=='Descender')
99
+ $fm['Descender']=(int)$param;
100
+ elseif($code=='UnderlineThickness')
101
+ $fm['UnderlineThickness']=(int)$param;
102
+ elseif($code=='UnderlinePosition')
103
+ $fm['UnderlinePosition']=(int)$param;
104
+ elseif($code=='IsFixedPitch')
105
+ $fm['IsFixedPitch']=($param=='true');
106
+ elseif($code=='FontBBox')
107
+ $fm['FontBBox']=array($e[1],$e[2],$e[3],$e[4]);
108
+ elseif($code=='CapHeight')
109
+ $fm['CapHeight']=(int)$param;
110
+ elseif($code=='StdVW')
111
+ $fm['StdVW']=(int)$param;
112
+ }
113
+ if(!isset($fm['FontName']))
114
+ die('FontName not found');
115
+ if(!empty($map))
116
+ {
117
+ if(!isset($widths['.notdef']))
118
+ $widths['.notdef']=600;
119
+ if(!isset($widths['Delta']) && isset($widths['increment']))
120
+ $widths['Delta']=$widths['increment'];
121
+ //Order widths according to map
122
+ for($i=0;$i<=255;$i++)
123
+ {
124
+ if(!isset($widths[$map[$i]]))
125
+ {
126
+ echo '<b>Warning:</b> character '.$map[$i].' is missing<br>';
127
+ $widths[$i]=$widths['.notdef'];
128
+ }
129
+ else
130
+ $widths[$i]=$widths[$map[$i]];
131
+ }
132
+ }
133
+ $fm['Widths']=$widths;
134
+ return $fm;
135
+ }
136
+
137
+ function MakeFontDescriptor($fm, $symbolic)
138
+ {
139
+ //Ascent
140
+ $asc=(isset($fm['Ascender']) ? $fm['Ascender'] : 1000);
141
+ $fd="array('Ascent'=>".$asc;
142
+ //Descent
143
+ $desc=(isset($fm['Descender']) ? $fm['Descender'] : -200);
144
+ $fd.=",'Descent'=>".$desc;
145
+ //CapHeight
146
+ if(isset($fm['CapHeight']))
147
+ $ch=$fm['CapHeight'];
148
+ elseif(isset($fm['CapXHeight']))
149
+ $ch=$fm['CapXHeight'];
150
+ else
151
+ $ch=$asc;
152
+ $fd.=",'CapHeight'=>".$ch;
153
+ //Flags
154
+ $flags=0;
155
+ if(isset($fm['IsFixedPitch']) && $fm['IsFixedPitch'])
156
+ $flags+=1<<0;
157
+ if($symbolic)
158
+ $flags+=1<<2;
159
+ if(!$symbolic)
160
+ $flags+=1<<5;
161
+ if(isset($fm['ItalicAngle']) && $fm['ItalicAngle']!=0)
162
+ $flags+=1<<6;
163
+ $fd.=",'Flags'=>".$flags;
164
+ //FontBBox
165
+ if(isset($fm['FontBBox']))
166
+ $fbb=$fm['FontBBox'];
167
+ else
168
+ $fbb=array(0,$desc-100,1000,$asc+100);
169
+ $fd.=",'FontBBox'=>'[".$fbb[0].' '.$fbb[1].' '.$fbb[2].' '.$fbb[3]."]'";
170
+ //ItalicAngle
171
+ $ia=(isset($fm['ItalicAngle']) ? $fm['ItalicAngle'] : 0);
172
+ $fd.=",'ItalicAngle'=>".$ia;
173
+ //StemV
174
+ if(isset($fm['StdVW']))
175
+ $stemv=$fm['StdVW'];
176
+ elseif(isset($fm['Weight']) && preg_match('/bold|black/i',$fm['Weight']))
177
+ $stemv=120;
178
+ else
179
+ $stemv=70;
180
+ $fd.=",'StemV'=>".$stemv;
181
+ //MissingWidth
182
+ if(isset($fm['MissingWidth']))
183
+ $fd.=",'MissingWidth'=>".$fm['MissingWidth'];
184
+ $fd.=')';
185
+ return $fd;
186
+ }
187
+
188
+ function MakeWidthArray($fm)
189
+ {
190
+ //Make character width array
191
+ $s="array(\n\t";
192
+ $cw=$fm['Widths'];
193
+ for($i=0;$i<=255;$i++)
194
+ {
195
+ if(chr($i)=="'")
196
+ $s.="'\\''";
197
+ elseif(chr($i)=="\\")
198
+ $s.="'\\\\'";
199
+ elseif($i>=32 && $i<=126)
200
+ $s.="'".chr($i)."'";
201
+ else
202
+ $s.="chr($i)";
203
+ $s.='=>'.$fm['Widths'][$i];
204
+ if($i<255)
205
+ $s.=',';
206
+ if(($i+1)%22==0)
207
+ $s.="\n\t";
208
+ }
209
+ $s.=')';
210
+ return $s;
211
+ }
212
+
213
+ function MakeFontEncoding($map)
214
+ {
215
+ //Build differences from reference encoding
216
+ $ref=ReadMap('cp1252');
217
+ $s='';
218
+ $last=0;
219
+ for($i=32;$i<=255;$i++)
220
+ {
221
+ if($map[$i]!=$ref[$i])
222
+ {
223
+ if($i!=$last+1)
224
+ $s.=$i.' ';
225
+ $last=$i;
226
+ $s.='/'.$map[$i].' ';
227
+ }
228
+ }
229
+ return rtrim($s);
230
+ }
231
+
232
+ function SaveToFile($file, $s, $mode)
233
+ {
234
+ $f=fopen($file,'w'.$mode);
235
+ if(!$f)
236
+ die('Can\'t write to file '.$file);
237
+ fwrite($f,$s,strlen($s));
238
+ fclose($f);
239
+ }
240
+
241
+ function ReadShort($f)
242
+ {
243
+ $a=unpack('n1n',fread($f,2));
244
+ return $a['n'];
245
+ }
246
+
247
+ function ReadLong($f)
248
+ {
249
+ $a=unpack('N1N',fread($f,4));
250
+ return $a['N'];
251
+ }
252
+
253
+ function CheckTTF($file)
254
+ {
255
+ //Check if font license allows embedding
256
+ $f=fopen($file,'rb');
257
+ if(!$f)
258
+ die('<b>Error:</b> Can\'t open '.$file);
259
+ //Extract number of tables
260
+ fseek($f,4,SEEK_CUR);
261
+ $nb=ReadShort($f);
262
+ fseek($f,6,SEEK_CUR);
263
+ //Seek OS/2 table
264
+ $found=false;
265
+ for($i=0;$i<$nb;$i++)
266
+ {
267
+ if(fread($f,4)=='OS/2')
268
+ {
269
+ $found=true;
270
+ break;
271
+ }
272
+ fseek($f,12,SEEK_CUR);
273
+ }
274
+ if(!$found)
275
+ {
276
+ fclose($f);
277
+ return;
278
+ }
279
+ fseek($f,4,SEEK_CUR);
280
+ $offset=ReadLong($f);
281
+ fseek($f,$offset,SEEK_SET);
282
+ //Extract fsType flags
283
+ fseek($f,8,SEEK_CUR);
284
+ $fsType=ReadShort($f);
285
+ $rl=($fsType & 0x02)!=0;
286
+ $pp=($fsType & 0x04)!=0;
287
+ $e=($fsType & 0x08)!=0;
288
+ fclose($f);
289
+ if($rl && !$pp && !$e)
290
+ echo '<b>Warning:</b> font license does not allow embedding';
291
+ }
292
+
293
+ /*******************************************************************************
294
+ * fontfile: path to TTF file (or empty string if not to be embedded) *
295
+ * afmfile: path to AFM file *
296
+ * enc: font encoding (or empty string for symbolic fonts) *
297
+ * patch: optional patch for encoding *
298
+ * type: font type if fontfile is empty *
299
+ *******************************************************************************/
300
+ function MakeFont($fontfile, $afmfile, $enc='cp1252', $patch=array(), $type='TrueType')
301
+ {
302
+ //Generate a font definition file
303
+ if(get_magic_quotes_runtime())
304
+ @set_magic_quotes_runtime(0);
305
+ ini_set('auto_detect_line_endings','1');
306
+ if($enc)
307
+ {
308
+ $map=ReadMap($enc);
309
+ foreach($patch as $cc=>$gn)
310
+ $map[$cc]=$gn;
311
+ }
312
+ else
313
+ $map=array();
314
+ if(!file_exists($afmfile))
315
+ die('<b>Error:</b> AFM file not found: '.$afmfile);
316
+ $fm=ReadAFM($afmfile,$map);
317
+ if($enc)
318
+ $diff=MakeFontEncoding($map);
319
+ else
320
+ $diff='';
321
+ $fd=MakeFontDescriptor($fm,empty($map));
322
+ //Find font type
323
+ if($fontfile)
324
+ {
325
+ $ext=strtolower(substr($fontfile,-3));
326
+ if($ext=='ttf')
327
+ $type='TrueType';
328
+ elseif($ext=='pfb')
329
+ $type='Type1';
330
+ else
331
+ die('<b>Error:</b> unrecognized font file extension: '.$ext);
332
+ }
333
+ else
334
+ {
335
+ if($type!='TrueType' && $type!='Type1')
336
+ die('<b>Error:</b> incorrect font type: '.$type);
337
+ }
338
+ //Start generation
339
+ $s='<?php'."\n";
340
+ $s.='$type=\''.$type."';\n";
341
+ $s.='$name=\''.$fm['FontName']."';\n";
342
+ $s.='$desc='.$fd.";\n";
343
+ if(!isset($fm['UnderlinePosition']))
344
+ $fm['UnderlinePosition']=-100;
345
+ if(!isset($fm['UnderlineThickness']))
346
+ $fm['UnderlineThickness']=50;
347
+ $s.='$up='.$fm['UnderlinePosition'].";\n";
348
+ $s.='$ut='.$fm['UnderlineThickness'].";\n";
349
+ $w=MakeWidthArray($fm);
350
+ $s.='$cw='.$w.";\n";
351
+ $s.='$enc=\''.$enc."';\n";
352
+ $s.='$diff=\''.$diff."';\n";
353
+ $basename=substr(basename($afmfile),0,-4);
354
+ if($fontfile)
355
+ {
356
+ //Embedded font
357
+ if(!file_exists($fontfile))
358
+ die('<b>Error:</b> font file not found: '.$fontfile);
359
+ if($type=='TrueType')
360
+ CheckTTF($fontfile);
361
+ $f=fopen($fontfile,'rb');
362
+ if(!$f)
363
+ die('<b>Error:</b> Can\'t open '.$fontfile);
364
+ $file=fread($f,filesize($fontfile));
365
+ fclose($f);
366
+ if($type=='Type1')
367
+ {
368
+ //Find first two sections and discard third one
369
+ $header=(ord($file[0])==128);
370
+ if($header)
371
+ {
372
+ //Strip first binary header
373
+ $file=substr($file,6);
374
+ }
375
+ $pos=strpos($file,'eexec');
376
+ if(!$pos)
377
+ die('<b>Error:</b> font file does not seem to be valid Type1');
378
+ $size1=$pos+6;
379
+ if($header && ord($file[$size1])==128)
380
+ {
381
+ //Strip second binary header
382
+ $file=substr($file,0,$size1).substr($file,$size1+6);
383
+ }
384
+ $pos=strpos($file,'00000000');
385
+ if(!$pos)
386
+ die('<b>Error:</b> font file does not seem to be valid Type1');
387
+ $size2=$pos-$size1;
388
+ $file=substr($file,0,$size1+$size2);
389
+ }
390
+ if(function_exists('gzcompress'))
391
+ {
392
+ $cmp=$basename.'.z';
393
+ SaveToFile($cmp,gzcompress($file),'b');
394
+ $s.='$file=\''.$cmp."';\n";
395
+ echo 'Font file compressed ('.$cmp.')<br>';
396
+ }
397
+ else
398
+ {
399
+ $s.='$file=\''.basename($fontfile)."';\n";
400
+ echo '<b>Notice:</b> font file could not be compressed (zlib extension not available)<br>';
401
+ }
402
+ if($type=='Type1')
403
+ {
404
+ $s.='$size1='.$size1.";\n";
405
+ $s.='$size2='.$size2.";\n";
406
+ }
407
+ else
408
+ $s.='$originalsize='.filesize($fontfile).";\n";
409
+ }
410
+ else
411
+ {
412
+ //Not embedded font
413
+ $s.='$file='."'';\n";
414
+ }
415
+ $s.="?>\n";
416
+ SaveToFile($basename.'.php',$s,'t');
417
+ echo 'Font definition file generated ('.$basename.'.php'.')<br>';
418
+ }
419
+ ?>
lib/fpdf/font/symbol.php ADDED
@@ -0,0 +1,15 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ $fpdf_charwidths['symbol']=array(
3
+ chr(0)=>250,chr(1)=>250,chr(2)=>250,chr(3)=>250,chr(4)=>250,chr(5)=>250,chr(6)=>250,chr(7)=>250,chr(8)=>250,chr(9)=>250,chr(10)=>250,chr(11)=>250,chr(12)=>250,chr(13)=>250,chr(14)=>250,chr(15)=>250,chr(16)=>250,chr(17)=>250,chr(18)=>250,chr(19)=>250,chr(20)=>250,chr(21)=>250,
4
+ chr(22)=>250,chr(23)=>250,chr(24)=>250,chr(25)=>250,chr(26)=>250,chr(27)=>250,chr(28)=>250,chr(29)=>250,chr(30)=>250,chr(31)=>250,' '=>250,'!'=>333,'"'=>713,'#'=>500,'$'=>549,'%'=>833,'&'=>778,'\''=>439,'('=>333,')'=>333,'*'=>500,'+'=>549,
5
+ ','=>250,'-'=>549,'.'=>250,'/'=>278,'0'=>500,'1'=>500,'2'=>500,'3'=>500,'4'=>500,'5'=>500,'6'=>500,'7'=>500,'8'=>500,'9'=>500,':'=>278,';'=>278,'<'=>549,'='=>549,'>'=>549,'?'=>444,'@'=>549,'A'=>722,
6
+ 'B'=>667,'C'=>722,'D'=>612,'E'=>611,'F'=>763,'G'=>603,'H'=>722,'I'=>333,'J'=>631,'K'=>722,'L'=>686,'M'=>889,'N'=>722,'O'=>722,'P'=>768,'Q'=>741,'R'=>556,'S'=>592,'T'=>611,'U'=>690,'V'=>439,'W'=>768,
7
+ 'X'=>645,'Y'=>795,'Z'=>611,'['=>333,'\\'=>863,']'=>333,'^'=>658,'_'=>500,'`'=>500,'a'=>631,'b'=>549,'c'=>549,'d'=>494,'e'=>439,'f'=>521,'g'=>411,'h'=>603,'i'=>329,'j'=>603,'k'=>549,'l'=>549,'m'=>576,
8
+ 'n'=>521,'o'=>549,'p'=>549,'q'=>521,'r'=>549,'s'=>603,'t'=>439,'u'=>576,'v'=>713,'w'=>686,'x'=>493,'y'=>686,'z'=>494,'{'=>480,'|'=>200,'}'=>480,'~'=>549,chr(127)=>0,chr(128)=>0,chr(129)=>0,chr(130)=>0,chr(131)=>0,
9
+ chr(132)=>0,chr(133)=>0,chr(134)=>0,chr(135)=>0,chr(136)=>0,chr(137)=>0,chr(138)=>0,chr(139)=>0,chr(140)=>0,chr(141)=>0,chr(142)=>0,chr(143)=>0,chr(144)=>0,chr(145)=>0,chr(146)=>0,chr(147)=>0,chr(148)=>0,chr(149)=>0,chr(150)=>0,chr(151)=>0,chr(152)=>0,chr(153)=>0,
10
+ chr(154)=>0,chr(155)=>0,chr(156)=>0,chr(157)=>0,chr(158)=>0,chr(159)=>0,chr(160)=>750,chr(161)=>620,chr(162)=>247,chr(163)=>549,chr(164)=>167,chr(165)=>713,chr(166)=>500,chr(167)=>753,chr(168)=>753,chr(169)=>753,chr(170)=>753,chr(171)=>1042,chr(172)=>987,chr(173)=>603,chr(174)=>987,chr(175)=>603,
11
+ chr(176)=>400,chr(177)=>549,chr(178)=>411,chr(179)=>549,chr(180)=>549,chr(181)=>713,chr(182)=>494,chr(183)=>460,chr(184)=>549,chr(185)=>549,chr(186)=>549,chr(187)=>549,chr(188)=>1000,chr(189)=>603,chr(190)=>1000,chr(191)=>658,chr(192)=>823,chr(193)=>686,chr(194)=>795,chr(195)=>987,chr(196)=>768,chr(197)=>768,
12
+ chr(198)=>823,chr(199)=>768,chr(200)=>768,chr(201)=>713,chr(202)=>713,chr(203)=>713,chr(204)=>713,chr(205)=>713,chr(206)=>713,chr(207)=>713,chr(208)=>768,chr(209)=>713,chr(210)=>790,chr(211)=>790,chr(212)=>890,chr(213)=>823,chr(214)=>549,chr(215)=>250,chr(216)=>713,chr(217)=>603,chr(218)=>603,chr(219)=>1042,
13
+ chr(220)=>987,chr(221)=>603,chr(222)=>987,chr(223)=>603,chr(224)=>494,chr(225)=>329,chr(226)=>790,chr(227)=>790,chr(228)=>786,chr(229)=>713,chr(230)=>384,chr(231)=>384,chr(232)=>384,chr(233)=>384,chr(234)=>384,chr(235)=>384,chr(236)=>494,chr(237)=>494,chr(238)=>494,chr(239)=>494,chr(240)=>0,chr(241)=>329,
14
+ chr(242)=>274,chr(243)=>686,chr(244)=>686,chr(245)=>686,chr(246)=>384,chr(247)=>384,chr(248)=>384,chr(249)=>384,chr(250)=>384,chr(251)=>384,chr(252)=>494,chr(253)=>494,chr(254)=>494,chr(255)=>0);
15
+ ?>
lib/fpdf/font/times.php ADDED
@@ -0,0 +1,15 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ $fpdf_charwidths['times']=array(
3
+ chr(0)=>250,chr(1)=>250,chr(2)=>250,chr(3)=>250,chr(4)=>250,chr(5)=>250,chr(6)=>250,chr(7)=>250,chr(8)=>250,chr(9)=>250,chr(10)=>250,chr(11)=>250,chr(12)=>250,chr(13)=>250,chr(14)=>250,chr(15)=>250,chr(16)=>250,chr(17)=>250,chr(18)=>250,chr(19)=>250,chr(20)=>250,chr(21)=>250,
4
+ chr(22)=>250,chr(23)=>250,chr(24)=>250,chr(25)=>250,chr(26)=>250,chr(27)=>250,chr(28)=>250,chr(29)=>250,chr(30)=>250,chr(31)=>250,' '=>250,'!'=>333,'"'=>408,'#'=>500,'$'=>500,'%'=>833,'&'=>778,'\''=>180,'('=>333,')'=>333,'*'=>500,'+'=>564,
5
+ ','=>250,'-'=>333,'.'=>250,'/'=>278,'0'=>500,'1'=>500,'2'=>500,'3'=>500,'4'=>500,'5'=>500,'6'=>500,'7'=>500,'8'=>500,'9'=>500,':'=>278,';'=>278,'<'=>564,'='=>564,'>'=>564,'?'=>444,'@'=>921,'A'=>722,
6
+ 'B'=>667,'C'=>667,'D'=>722,'E'=>611,'F'=>556,'G'=>722,'H'=>722,'I'=>333,'J'=>389,'K'=>722,'L'=>611,'M'=>889,'N'=>722,'O'=>722,'P'=>556,'Q'=>722,'R'=>667,'S'=>556,'T'=>611,'U'=>722,'V'=>722,'W'=>944,
7
+ 'X'=>722,'Y'=>722,'Z'=>611,'['=>333,'\\'=>278,']'=>333,'^'=>469,'_'=>500,'`'=>333,'a'=>444,'b'=>500,'c'=>444,'d'=>500,'e'=>444,'f'=>333,'g'=>500,'h'=>500,'i'=>278,'j'=>278,'k'=>500,'l'=>278,'m'=>778,
8
+ 'n'=>500,'o'=>500,'p'=>500,'q'=>500,'r'=>333,'s'=>389,'t'=>278,'u'=>500,'v'=>500,'w'=>722,'x'=>500,'y'=>500,'z'=>444,'{'=>480,'|'=>200,'}'=>480,'~'=>541,chr(127)=>350,chr(128)=>500,chr(129)=>350,chr(130)=>333,chr(131)=>500,
9
+ chr(132)=>444,chr(133)=>1000,chr(134)=>500,chr(135)=>500,chr(136)=>333,chr(137)=>1000,chr(138)=>556,chr(139)=>333,chr(140)=>889,chr(141)=>350,chr(142)=>611,chr(143)=>350,chr(144)=>350,chr(145)=>333,chr(146)=>333,chr(147)=>444,chr(148)=>444,chr(149)=>350,chr(150)=>500,chr(151)=>1000,chr(152)=>333,chr(153)=>980,
10
+ chr(154)=>389,chr(155)=>333,chr(156)=>722,chr(157)=>350,chr(158)=>444,chr(159)=>722,chr(160)=>250,chr(161)=>333,chr(162)=>500,chr(163)=>500,chr(164)=>500,chr(165)=>500,chr(166)=>200,chr(167)=>500,chr(168)=>333,chr(169)=>760,chr(170)=>276,chr(171)=>500,chr(172)=>564,chr(173)=>333,chr(174)=>760,chr(175)=>333,
11
+ chr(176)=>400,chr(177)=>564,chr(178)=>300,chr(179)=>300,chr(180)=>333,chr(181)=>500,chr(182)=>453,chr(183)=>250,chr(184)=>333,chr(185)=>300,chr(186)=>310,chr(187)=>500,chr(188)=>750,chr(189)=>750,chr(190)=>750,chr(191)=>444,chr(192)=>722,chr(193)=>722,chr(194)=>722,chr(195)=>722,chr(196)=>722,chr(197)=>722,
12
+ chr(198)=>889,chr(199)=>667,chr(200)=>611,chr(201)=>611,chr(202)=>611,chr(203)=>611,chr(204)=>333,chr(205)=>333,chr(206)=>333,chr(207)=>333,chr(208)=>722,chr(209)=>722,chr(210)=>722,chr(211)=>722,chr(212)=>722,chr(213)=>722,chr(214)=>722,chr(215)=>564,chr(216)=>722,chr(217)=>722,chr(218)=>722,chr(219)=>722,
13
+ chr(220)=>722,chr(221)=>722,chr(222)=>556,chr(223)=>500,chr(224)=>444,chr(225)=>444,chr(226)=>444,chr(227)=>444,chr(228)=>444,chr(229)=>444,chr(230)=>667,chr(231)=>444,chr(232)=>444,chr(233)=>444,chr(234)=>444,chr(235)=>444,chr(236)=>278,chr(237)=>278,chr(238)=>278,chr(239)=>278,chr(240)=>500,chr(241)=>500,
14
+ chr(242)=>500,chr(243)=>500,chr(244)=>500,chr(245)=>500,chr(246)=>500,chr(247)=>564,chr(248)=>500,chr(249)=>500,chr(250)=>500,chr(251)=>500,chr(252)=>500,chr(253)=>500,chr(254)=>500,chr(255)=>500);
15
+ ?>
lib/fpdf/font/timesb.php ADDED
@@ -0,0 +1,15 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ $fpdf_charwidths['timesB']=array(
3
+ chr(0)=>250,chr(1)=>250,chr(2)=>250,chr(3)=>250,chr(4)=>250,chr(5)=>250,chr(6)=>250,chr(7)=>250,chr(8)=>250,chr(9)=>250,chr(10)=>250,chr(11)=>250,chr(12)=>250,chr(13)=>250,chr(14)=>250,chr(15)=>250,chr(16)=>250,chr(17)=>250,chr(18)=>250,chr(19)=>250,chr(20)=>250,chr(21)=>250,
4
+ chr(22)=>250,chr(23)=>250,chr(24)=>250,chr(25)=>250,chr(26)=>250,chr(27)=>250,chr(28)=>250,chr(29)=>250,chr(30)=>250,chr(31)=>250,' '=>250,'!'=>333,'"'=>555,'#'=>500,'$'=>500,'%'=>1000,'&'=>833,'\''=>278,'('=>333,')'=>333,'*'=>500,'+'=>570,
5
+ ','=>250,'-'=>333,'.'=>250,'/'=>278,'0'=>500,'1'=>500,'2'=>500,'3'=>500,'4'=>500,'5'=>500,'6'=>500,'7'=>500,'8'=>500,'9'=>500,':'=>333,';'=>333,'<'=>570,'='=>570,'>'=>570,'?'=>500,'@'=>930,'A'=>722,
6
+ 'B'=>667,'C'=>722,'D'=>722,'E'=>667,'F'=>611,'G'=>778,'H'=>778,'I'=>389,'J'=>500,'K'=>778,'L'=>667,'M'=>944,'N'=>722,'O'=>778,'P'=>611,'Q'=>778,'R'=>722,'S'=>556,'T'=>667,'U'=>722,'V'=>722,'W'=>1000,
7
+ 'X'=>722,'Y'=>722,'Z'=>667,'['=>333,'\\'=>278,']'=>333,'^'=>581,'_'=>500,'`'=>333,'a'=>500,'b'=>556,'c'=>444,'d'=>556,'e'=>444,'f'=>333,'g'=>500,'h'=>556,'i'=>278,'j'=>333,'k'=>556,'l'=>278,'m'=>833,
8
+ 'n'=>556,'o'=>500,'p'=>556,'q'=>556,'r'=>444,'s'=>389,'t'=>333,'u'=>556,'v'=>500,'w'=>722,'x'=>500,'y'=>500,'z'=>444,'{'=>394,'|'=>220,'}'=>394,'~'=>520,chr(127)=>350,chr(128)=>500,chr(129)=>350,chr(130)=>333,chr(131)=>500,
9
+ chr(132)=>500,chr(133)=>1000,chr(134)=>500,chr(135)=>500,chr(136)=>333,chr(137)=>1000,chr(138)=>556,chr(139)=>333,chr(140)=>1000,chr(141)=>350,chr(142)=>667,chr(143)=>350,chr(144)=>350,chr(145)=>333,chr(146)=>333,chr(147)=>500,chr(148)=>500,chr(149)=>350,chr(150)=>500,chr(151)=>1000,chr(152)=>333,chr(153)=>1000,
10
+ chr(154)=>389,chr(155)=>333,chr(156)=>722,chr(157)=>350,chr(158)=>444,chr(159)=>722,chr(160)=>250,chr(161)=>333,chr(162)=>500,chr(163)=>500,chr(164)=>500,chr(165)=>500,chr(166)=>220,chr(167)=>500,chr(168)=>333,chr(169)=>747,chr(170)=>300,chr(171)=>500,chr(172)=>570,chr(173)=>333,chr(174)=>747,chr(175)=>333,
11
+ chr(176)=>400,chr(177)=>570,chr(178)=>300,chr(179)=>300,chr(180)=>333,chr(181)=>556,chr(182)=>540,chr(183)=>250,chr(184)=>333,chr(185)=>300,chr(186)=>330,chr(187)=>500,chr(188)=>750,chr(189)=>750,chr(190)=>750,chr(191)=>500,chr(192)=>722,chr(193)=>722,chr(194)=>722,chr(195)=>722,chr(196)=>722,chr(197)=>722,
12
+ chr(198)=>1000,chr(199)=>722,chr(200)=>667,chr(201)=>667,chr(202)=>667,chr(203)=>667,chr(204)=>389,chr(205)=>389,chr(206)=>389,chr(207)=>389,chr(208)=>722,chr(209)=>722,chr(210)=>778,chr(211)=>778,chr(212)=>778,chr(213)=>778,chr(214)=>778,chr(215)=>570,chr(216)=>778,chr(217)=>722,chr(218)=>722,chr(219)=>722,
13
+ chr(220)=>722,chr(221)=>722,chr(222)=>611,chr(223)=>556,chr(224)=>500,chr(225)=>500,chr(226)=>500,chr(227)=>500,chr(228)=>500,chr(229)=>500,chr(230)=>722,chr(231)=>444,chr(232)=>444,chr(233)=>444,chr(234)=>444,chr(235)=>444,chr(236)=>278,chr(237)=>278,chr(238)=>278,chr(239)=>278,chr(240)=>500,chr(241)=>556,
14
+ chr(242)=>500,chr(243)=>500,chr(244)=>500,chr(245)=>500,chr(246)=>500,chr(247)=>570,chr(248)=>500,chr(249)=>556,chr(250)=>556,chr(251)=>556,chr(252)=>556,chr(253)=>500,chr(254)=>556,chr(255)=>500);
15
+ ?>
lib/fpdf/font/timesbi.php ADDED
@@ -0,0 +1,15 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ $fpdf_charwidths['timesBI']=array(
3
+ chr(0)=>250,chr(1)=>250,chr(2)=>250,chr(3)=>250,chr(4)=>250,chr(5)=>250,chr(6)=>250,chr(7)=>250,chr(8)=>250,chr(9)=>250,chr(10)=>250,chr(11)=>250,chr(12)=>250,chr(13)=>250,chr(14)=>250,chr(15)=>250,chr(16)=>250,chr(17)=>250,chr(18)=>250,chr(19)=>250,chr(20)=>250,chr(21)=>250,
4
+ chr(22)=>250,chr(23)=>250,chr(24)=>250,chr(25)=>250,chr(26)=>250,chr(27)=>250,chr(28)=>250,chr(29)=>250,chr(30)=>250,chr(31)=>250,' '=>250,'!'=>389,'"'=>555,'#'=>500,'$'=>500,'%'=>833,'&'=>778,'\''=>278,'('=>333,')'=>333,'*'=>500,'+'=>570,
5
+ ','=>250,'-'=>333,'.'=>250,'/'=>278,'0'=>500,'1'=>500,'2'=>500,'3'=>500,'4'=>500,'5'=>500,'6'=>500,'7'=>500,'8'=>500,'9'=>500,':'=>333,';'=>333,'<'=>570,'='=>570,'>'=>570,'?'=>500,'@'=>832,'A'=>667,
6
+ 'B'=>667,'C'=>667,'D'=>722,'E'=>667,'F'=>667,'G'=>722,'H'=>778,'I'=>389,'J'=>500,'K'=>667,'L'=>611,'M'=>889,'N'=>722,'O'=>722,'P'=>611,'Q'=>722,'R'=>667,'S'=>556,'T'=>611,'U'=>722,'V'=>667,'W'=>889,
7
+ 'X'=>667,'Y'=>611,'Z'=>611,'['=>333,'\\'=>278,']'=>333,'^'=>570,'_'=>500,'`'=>333,'a'=>500,'b'=>500,'c'=>444,'d'=>500,'e'=>444,'f'=>333,'g'=>500,'h'=>556,'i'=>278,'j'=>278,'k'=>500,'l'=>278,'m'=>778,
8
+ 'n'=>556,'o'=>500,'p'=>500,'q'=>500,'r'=>389,'s'=>389,'t'=>278,'u'=>556,'v'=>444,'w'=>667,'x'=>500,'y'=>444,'z'=>389,'{'=>348,'|'=>220,'}'=>348,'~'=>570,chr(127)=>350,chr(128)=>500,chr(129)=>350,chr(130)=>333,chr(131)=>500,
9
+ chr(132)=>500,chr(133)=>1000,chr(134)=>500,chr(135)=>500,chr(136)=>333,chr(137)=>1000,chr(138)=>556,chr(139)=>333,chr(140)=>944,chr(141)=>350,chr(142)=>611,chr(143)=>350,chr(144)=>350,chr(145)=>333,chr(146)=>333,chr(147)=>500,chr(148)=>500,chr(149)=>350,chr(150)=>500,chr(151)=>1000,chr(152)=>333,chr(153)=>1000,
10
+ chr(154)=>389,chr(155)=>333,chr(156)=>722,chr(157)=>350,chr(158)=>389,chr(159)=>611,chr(160)=>250,chr(161)=>389,chr(162)=>500,chr(163)=>500,chr(164)=>500,chr(165)=>500,chr(166)=>220,chr(167)=>500,chr(168)=>333,chr(169)=>747,chr(170)=>266,chr(171)=>500,chr(172)=>606,chr(173)=>333,chr(174)=>747,chr(175)=>333,
11
+ chr(176)=>400,chr(177)=>570,chr(178)=>300,chr(179)=>300,chr(180)=>333,chr(181)=>576,chr(182)=>500,chr(183)=>250,chr(184)=>333,chr(185)=>300,chr(186)=>300,chr(187)=>500,chr(188)=>750,chr(189)=>750,chr(190)=>750,chr(191)=>500,chr(192)=>667,chr(193)=>667,chr(194)=>667,chr(195)=>667,chr(196)=>667,chr(197)=>667,
12
+ chr(198)=>944,chr(199)=>667,chr(200)=>667,chr(201)=>667,chr(202)=>667,chr(203)=>667,chr(204)=>389,chr(205)=>389,chr(206)=>389,chr(207)=>389,chr(208)=>722,chr(209)=>722,chr(210)=>722,chr(211)=>722,chr(212)=>722,chr(213)=>722,chr(214)=>722,chr(215)=>570,chr(216)=>722,chr(217)=>722,chr(218)=>722,chr(219)=>722,
13
+ chr(220)=>722,chr(221)=>611,chr(222)=>611,chr(223)=>500,chr(224)=>500,chr(225)=>500,chr(226)=>500,chr(227)=>500,chr(228)=>500,chr(229)=>500,chr(230)=>722,chr(231)=>444,chr(232)=>444,chr(233)=>444,chr(234)=>444,chr(235)=>444,chr(236)=>278,chr(237)=>278,chr(238)=>278,chr(239)=>278,chr(240)=>500,chr(241)=>556,
14
+ chr(242)=>500,chr(243)=>500,chr(244)=>500,chr(245)=>500,chr(246)=>500,chr(247)=>570,chr(248)=>500,chr(249)=>556,chr(250)=>556,chr(251)=>556,chr(252)=>556,chr(253)=>444,chr(254)=>500,chr(255)=>444);
15
+ ?>
lib/fpdf/font/timesi.php ADDED
@@ -0,0 +1,15 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ $fpdf_charwidths['timesI']=array(
3
+ chr(0)=>250,chr(1)=>250,chr(2)=>250,chr(3)=>250,chr(4)=>250,chr(5)=>250,chr(6)=>250,chr(7)=>250,chr(8)=>250,chr(9)=>250,chr(10)=>250,chr(11)=>250,chr(12)=>250,chr(13)=>250,chr(14)=>250,chr(15)=>250,chr(16)=>250,chr(17)=>250,chr(18)=>250,chr(19)=>250,chr(20)=>250,chr(21)=>250,
4
+ chr(22)=>250,chr(23)=>250,chr(24)=>250,chr(25)=>250,chr(26)=>250,chr(27)=>250,chr(28)=>250,chr(29)=>250,chr(30)=>250,chr(31)=>250,' '=>250,'!'=>333,'"'=>420,'#'=>500,'$'=>500,'%'=>833,'&'=>778,'\''=>214,'('=>333,')'=>333,'*'=>500,'+'=>675,
5
+ ','=>250,'-'=>333,'.'=>250,'/'=>278,'0'=>500,'1'=>500,'2'=>500,'3'=>500,'4'=>500,'5'=>500,'6'=>500,'7'=>500,'8'=>500,'9'=>500,':'=>333,';'=>333,'<'=>675,'='=>675,'>'=>675,'?'=>500,'@'=>920,'A'=>611,
6
+ 'B'=>611,'C'=>667,'D'=>722,'E'=>611,'F'=>611,'G'=>722,'H'=>722,'I'=>333,'J'=>444,'K'=>667,'L'=>556,'M'=>833,'N'=>667,'O'=>722,'P'=>611,'Q'=>722,'R'=>611,'S'=>500,'T'=>556,'U'=>722,'V'=>611,'W'=>833,
7
+ 'X'=>611,'Y'=>556,'Z'=>556,'['=>389,'\\'=>278,']'=>389,'^'=>422,'_'=>500,'`'=>333,'a'=>500,'b'=>500,'c'=>444,'d'=>500,'e'=>444,'f'=>278,'g'=>500,'h'=>500,'i'=>278,'j'=>278,'k'=>444,'l'=>278,'m'=>722,
8
+ 'n'=>500,'o'=>500,'p'=>500,'q'=>500,'r'=>389,'s'=>389,'t'=>278,'u'=>500,'v'=>444,'w'=>667,'x'=>444,'y'=>444,'z'=>389,'{'=>400,'|'=>275,'}'=>400,'~'=>541,chr(127)=>350,chr(128)=>500,chr(129)=>350,chr(130)=>333,chr(131)=>500,
9
+ chr(132)=>556,chr(133)=>889,chr(134)=>500,chr(135)=>500,chr(136)=>333,chr(137)=>1000,chr(138)=>500,chr(139)=>333,chr(140)=>944,chr(141)=>350,chr(142)=>556,chr(143)=>350,chr(144)=>350,chr(145)=>333,chr(146)=>333,chr(147)=>556,chr(148)=>556,chr(149)=>350,chr(150)=>500,chr(151)=>889,chr(152)=>333,chr(153)=>980,
10
+ chr(154)=>389,chr(155)=>333,chr(156)=>667,chr(157)=>350,chr(158)=>389,chr(159)=>556,chr(160)=>250,chr(161)=>389,chr(162)=>500,chr(163)=>500,chr(164)=>500,chr(165)=>500,chr(166)=>275,chr(167)=>500,chr(168)=>333,chr(169)=>760,chr(170)=>276,chr(171)=>500,chr(172)=>675,chr(173)=>333,chr(174)=>760,chr(175)=>333,
11
+ chr(176)=>400,chr(177)=>675,chr(178)=>300,chr(179)=>300,chr(180)=>333,chr(181)=>500,chr(182)=>523,chr(183)=>250,chr(184)=>333,chr(185)=>300,chr(186)=>310,chr(187)=>500,chr(188)=>750,chr(189)=>750,chr(190)=>750,chr(191)=>500,chr(192)=>611,chr(193)=>611,chr(194)=>611,chr(195)=>611,chr(196)=>611,chr(197)=>611,
12
+ chr(198)=>889,chr(199)=>667,chr(200)=>611,chr(201)=>611,chr(202)=>611,chr(203)=>611,chr(204)=>333,chr(205)=>333,chr(206)=>333,chr(207)=>333,chr(208)=>722,chr(209)=>667,chr(210)=>722,chr(211)=>722,chr(212)=>722,chr(213)=>722,chr(214)=>722,chr(215)=>675,chr(216)=>722,chr(217)=>722,chr(218)=>722,chr(219)=>722,
13
+ chr(220)=>722,chr(221)=>556,chr(222)=>611,chr(223)=>500,chr(224)=>500,chr(225)=>500,chr(226)=>500,chr(227)=>500,chr(228)=>500,chr(229)=>500,chr(230)=>667,chr(231)=>444,chr(232)=>444,chr(233)=>444,chr(234)=>444,chr(235)=>444,chr(236)=>278,chr(237)=>278,chr(238)=>278,chr(239)=>278,chr(240)=>500,chr(241)=>500,
14
+ chr(242)=>500,chr(243)=>500,chr(244)=>500,chr(245)=>500,chr(246)=>500,chr(247)=>675,chr(248)=>500,chr(249)=>500,chr(250)=>500,chr(251)=>500,chr(252)=>500,chr(253)=>444,chr(254)=>500,chr(255)=>444);
15
+ ?>
lib/fpdf/font/zapfdingbats.php ADDED
@@ -0,0 +1,15 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ $fpdf_charwidths['zapfdingbats']=array(
3
+ chr(0)=>0,chr(1)=>0,chr(2)=>0,chr(3)=>0,chr(4)=>0,chr(5)=>0,chr(6)=>0,chr(7)=>0,chr(8)=>0,chr(9)=>0,chr(10)=>0,chr(11)=>0,chr(12)=>0,chr(13)=>0,chr(14)=>0,chr(15)=>0,chr(16)=>0,chr(17)=>0,chr(18)=>0,chr(19)=>0,chr(20)=>0,chr(21)=>0,
4
+ chr(22)=>0,chr(23)=>0,chr(24)=>0,chr(25)=>0,chr(26)=>0,chr(27)=>0,chr(28)=>0,chr(29)=>0,chr(30)=>0,chr(31)=>0,' '=>278,'!'=>974,'"'=>961,'#'=>974,'$'=>980,'%'=>719,'&'=>789,'\''=>790,'('=>791,')'=>690,'*'=>960,'+'=>939,
5
+ ','=>549,'-'=>855,'.'=>911,'/'=>933,'0'=>911,'1'=>945,'2'=>974,'3'=>755,'4'=>846,'5'=>762,'6'=>761,'7'=>571,'8'=>677,'9'=>763,':'=>760,';'=>759,'<'=>754,'='=>494,'>'=>552,'?'=>537,'@'=>577,'A'=>692,
6
+ 'B'=>786,'C'=>788,'D'=>788,'E'=>790,'F'=>793,'G'=>794,'H'=>816,'I'=>823,'J'=>789,'K'=>841,'L'=>823,'M'=>833,'N'=>816,'O'=>831,'P'=>923,'Q'=>744,'R'=>723,'S'=>749,'T'=>790,'U'=>792,'V'=>695,'W'=>776,
7
+ 'X'=>768,'Y'=>792,'Z'=>759,'['=>707,'\\'=>708,']'=>682,'^'=>701,'_'=>826,'`'=>815,'a'=>789,'b'=>789,'c'=>707,'d'=>687,'e'=>696,'f'=>689,'g'=>786,'h'=>787,'i'=>713,'j'=>791,'k'=>785,'l'=>791,'m'=>873,
8
+ 'n'=>761,'o'=>762,'p'=>762,'q'=>759,'r'=>759,'s'=>892,'t'=>892,'u'=>788,'v'=>784,'w'=>438,'x'=>138,'y'=>277,'z'=>415,'{'=>392,'|'=>392,'}'=>668,'~'=>668,chr(127)=>0,chr(128)=>390,chr(129)=>390,chr(130)=>317,chr(131)=>317,
9
+ chr(132)=>276,chr(133)=>276,chr(134)=>509,chr(135)=>509,chr(136)=>410,chr(137)=>410,chr(138)=>234,chr(139)=>234,chr(140)=>334,chr(141)=>334,chr(142)=>0,chr(143)=>0,chr(144)=>0,chr(145)=>0,chr(146)=>0,chr(147)=>0,chr(148)=>0,chr(149)=>0,chr(150)=>0,chr(151)=>0,chr(152)=>0,chr(153)=>0,
10
+ chr(154)=>0,chr(155)=>0,chr(156)=>0,chr(157)=>0,chr(158)=>0,chr(159)=>0,chr(160)=>0,chr(161)=>732,chr(162)=>544,chr(163)=>544,chr(164)=>910,chr(165)=>667,chr(166)=>760,chr(167)=>760,chr(168)=>776,chr(169)=>595,chr(170)=>694,chr(171)=>626,chr(172)=>788,chr(173)=>788,chr(174)=>788,chr(175)=>788,
11
+ chr(176)=>788,chr(177)=>788,chr(178)=>788,chr(179)=>788,chr(180)=>788,chr(181)=>788,chr(182)=>788,chr(183)=>788,chr(184)=>788,chr(185)=>788,chr(186)=>788,chr(187)=>788,chr(188)=>788,chr(189)=>788,chr(190)=>788,chr(191)=>788,chr(192)=>788,chr(193)=>788,chr(194)=>788,chr(195)=>788,chr(196)=>788,chr(197)=>788,
12
+ chr(198)=>788,chr(199)=>788,chr(200)=>788,chr(201)=>788,chr(202)=>788,chr(203)=>788,chr(204)=>788,chr(205)=>788,chr(206)=>788,chr(207)=>788,chr(208)=>788,chr(209)=>788,chr(210)=>788,chr(211)=>788,chr(212)=>894,chr(213)=>838,chr(214)=>1016,chr(215)=>458,chr(216)=>748,chr(217)=>924,chr(218)=>748,chr(219)=>918,
13
+ chr(220)=>927,chr(221)=>928,chr(222)=>928,chr(223)=>834,chr(224)=>873,chr(225)=>828,chr(226)=>924,chr(227)=>924,chr(228)=>917,chr(229)=>930,chr(230)=>931,chr(231)=>463,chr(232)=>883,chr(233)=>836,chr(234)=>836,chr(235)=>867,chr(236)=>867,chr(237)=>696,chr(238)=>696,chr(239)=>874,chr(240)=>0,chr(241)=>874,
14
+ chr(242)=>760,chr(243)=>946,chr(244)=>771,chr(245)=>865,chr(246)=>771,chr(247)=>888,chr(248)=>967,chr(249)=>888,chr(250)=>831,chr(251)=>873,chr(252)=>927,chr(253)=>970,chr(254)=>918,chr(255)=>0);
15
+ ?>
lib/fpdf/fpdf.css ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ body {font-family:"Times New Roman",serif}
2
+ h1 {font:bold 135% Arial,sans-serif; color:#4000A0; margin-bottom:0.9em}
3
+ h2 {font:bold 95% Arial,sans-serif; color:#900000; margin-top:1.5em; margin-bottom:1em}
4
+ dl.param dt {text-decoration:underline}
5
+ dl.param dd {margin-top:1em; margin-bottom:1em}
6
+ dl.param ul {margin-top:1em; margin-bottom:1em}
7
+ tt, code, kbd {font-family:"Courier New",Courier,monospace; font-size:82%}
8
+ div.source {margin-top:1.4em; margin-bottom:1.3em}
9
+ div.source pre {display:table; border:1px solid #24246A; width:100%; margin:0em; font-family:inherit; font-size:100%}
10
+ div.source code {display:block; border:1px solid #C5C5EC; background-color:#F0F5FF; padding:6px; color:#000000}
11
+ div.doc-source {margin-top:1.4em; margin-bottom:1.3em}
12
+ div.doc-source pre {display:table; width:100%; margin:0em; font-family:inherit; font-size:100%}
13
+ div.doc-source code {display:block; background-color:#E0E0E0; padding:4px}
14
+ .kw {color:#000080; font-weight:bold}
15
+ .str {color:#CC0000}
16
+ .cmt {color:#008000}
17
+ p.demo {text-align:center; margin-top:-0.9em}
18
+ a.demo {text-decoration:none; font-weight:bold; color:#0000CC}
19
+ a.demo:link {text-decoration:none; font-weight:bold; color:#0000CC}
20
+ a.demo:hover {text-decoration:none; font-weight:bold; color:#0000FF}
21
+ a.demo:active {text-decoration:none; font-weight:bold; color:#0000FF}
lib/fpdf/fpdf.php ADDED
@@ -0,0 +1,1736 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /*******************************************************************************
3
+ * FPDF *
4
+ * *
5
+ * Version: 1.6 *
6
+ * Date: 2008-08-03 *
7
+ * Author: Olivier PLATHEY *
8
+ *******************************************************************************/
9
+
10
+ define('FPDF_VERSION','1.6');
11
+
12
+ class FPDF
13
+ {
14
+ var $page; //current page number
15
+ var $n; //current object number
16
+ var $offsets; //array of object offsets
17
+ var $buffer; //buffer holding in-memory PDF
18
+ var $pages; //array containing pages
19
+ var $state; //current document state
20
+ var $compress; //compression flag
21
+ var $k; //scale factor (number of points in user unit)
22
+ var $DefOrientation; //default orientation
23
+ var $CurOrientation; //current orientation
24
+ var $PageFormats; //available page formats
25
+ var $DefPageFormat; //default page format
26
+ var $CurPageFormat; //current page format
27
+ var $PageSizes; //array storing non-default page sizes
28
+ var $wPt,$hPt; //dimensions of current page in points
29
+ var $w,$h; //dimensions of current page in user unit
30
+ var $lMargin; //left margin
31
+ var $tMargin; //top margin
32
+ var $rMargin; //right margin
33
+ var $bMargin; //page break margin
34
+ var $cMargin; //cell margin
35
+ var $x,$y; //current position in user unit
36
+ var $lasth; //height of last printed cell
37
+ var $LineWidth; //line width in user unit
38
+ var $CoreFonts; //array of standard font names
39
+ var $fonts; //array of used fonts
40
+ var $FontFiles; //array of font files
41
+ var $diffs; //array of encoding differences
42
+ var $FontFamily; //current font family
43
+ var $FontStyle; //current font style
44
+ var $underline; //underlining flag
45
+ var $CurrentFont; //current font info
46
+ var $FontSizePt; //current font size in points
47
+ var $FontSize; //current font size in user unit
48
+ var $DrawColor; //commands for drawing color
49
+ var $FillColor; //commands for filling color
50
+ var $TextColor; //commands for text color
51
+ var $ColorFlag; //indicates whether fill and text colors are different
52
+ var $ws; //word spacing
53
+ var $images; //array of used images
54
+ var $PageLinks; //array of links in pages
55
+ var $links; //array of internal links
56
+ var $AutoPageBreak; //automatic page breaking
57
+ var $PageBreakTrigger; //threshold used to trigger page breaks
58
+ var $InHeader; //flag set when processing header
59
+ var $InFooter; //flag set when processing footer
60
+ var $ZoomMode; //zoom display mode
61
+ var $LayoutMode; //layout display mode
62
+ var $title; //title
63
+ var $subject; //subject
64
+ var $author; //author
65
+ var $keywords; //keywords
66
+ var $creator; //creator
67
+ var $AliasNbPages; //alias for total number of pages
68
+ var $PDFVersion; //PDF version number
69
+
70
+ /*******************************************************************************
71
+ * *
72
+ * Public methods *
73
+ * *
74
+ *******************************************************************************/
75
+
76
+ function FPDF($orientation='L', $unit='mm', $format='A4')
77
+ {
78
+
79
+ //Some checks
80
+ $this->_dochecks();
81
+ //Initialization of properties
82
+ $this->page=0;
83
+ $this->n=2;
84
+ $this->buffer='';
85
+ $this->pages=array();
86
+ $this->PageSizes=array();
87
+ $this->state=0;
88
+ $this->fonts=array();
89
+ $this->FontFiles=array();
90
+ $this->diffs=array();
91
+ $this->images=array();
92
+ $this->links=array();
93
+ $this->InHeader=false;
94
+ $this->InFooter=false;
95
+ $this->lasth=0;
96
+ $this->FontFamily='';
97
+ $this->FontStyle='';
98
+ $this->FontSizePt=12;
99
+ $this->underline=false;
100
+ $this->DrawColor='0 G';
101
+ $this->FillColor='0 g';
102
+ $this->TextColor='0 g';
103
+ $this->ColorFlag=false;
104
+ $this->ws=0;
105
+ //Standard fonts
106
+ $this->CoreFonts=array('courier'=>'Courier', 'courierB'=>'Courier-Bold', 'courierI'=>'Courier-Oblique', 'courierBI'=>'Courier-BoldOblique',
107
+ 'helvetica'=>'Helvetica', 'helveticaB'=>'Helvetica-Bold', 'helveticaI'=>'Helvetica-Oblique', 'helveticaBI'=>'Helvetica-BoldOblique',
108
+ 'times'=>'Times-Roman', 'timesB'=>'Times-Bold', 'timesI'=>'Times-Italic', 'timesBI'=>'Times-BoldItalic',
109
+ 'symbol'=>'Symbol', 'zapfdingbats'=>'ZapfDingbats');
110
+ //Scale factor
111
+ if($unit=='pt')
112
+ $this->k=1;
113
+ elseif($unit=='mm')
114
+ $this->k=72/25.4;
115
+ elseif($unit=='cm')
116
+ $this->k=72/2.54;
117
+ elseif($unit=='in')
118
+ $this->k=72;
119
+ else
120
+ $this->Error('Incorrect unit: '.$unit);
121
+ //Page format
122
+ $this->PageFormats=array('a3'=>array(841.89,1190.55), 'a4'=>array(595.28,841.89), 'a5'=>array(420.94,595.28),
123
+ 'letter'=>array(612,792), 'legal'=>array(612,1008));
124
+ if(is_string($format))
125
+ $format=$this->_getpageformat($format);
126
+ $this->DefPageFormat=$format;
127
+ $this->CurPageFormat=$format;
128
+ //Page orientation
129
+ $orientation=strtolower($orientation);
130
+ if($orientation=='p' || $orientation=='portrait')
131
+ {
132
+ $this->DefOrientation='P';
133
+ $this->w=$this->DefPageFormat[0];
134
+ $this->h=$this->DefPageFormat[1];
135
+ }
136
+ elseif($orientation=='l' || $orientation=='landscape')
137
+ {
138
+ $this->DefOrientation='L';
139
+ $this->w=$this->DefPageFormat[1];
140
+ $this->h=$this->DefPageFormat[0];
141
+ }
142
+ else
143
+ $this->Error('Incorrect orientation: '.$orientation);
144
+ $this->CurOrientation=$this->DefOrientation;
145
+ $this->wPt=$this->w*$this->k;
146
+ $this->hPt=$this->h*$this->k;
147
+ //Page margins (1 cm)
148
+ $margin=28.35/$this->k;
149
+ $this->SetMargins($margin,$margin);
150
+ //Interior cell margin (1 mm)
151
+ $this->cMargin=$margin/10;
152
+ //Line width (0.2 mm)
153
+ $this->LineWidth=.567/$this->k;
154
+ //Automatic page break
155
+ $this->SetAutoPageBreak(true,2*$margin);
156
+ //Full width display mode
157
+ $this->SetDisplayMode('fullwidth');
158
+ //Enable compression
159
+ $this->SetCompression(true);
160
+ //Set default PDF version number
161
+ $this->PDFVersion='1.3';
162
+ }
163
+
164
+ function SetMargins($left, $top, $right=null)
165
+ {
166
+ //Set left, top and right margins
167
+ $this->lMargin=$left;
168
+ $this->tMargin=$top;
169
+ if($right===null)
170
+ $right=$left;
171
+ $this->rMargin=$right;
172
+ }
173
+
174
+ function SetLeftMargin($margin)
175
+ {
176
+ //Set left margin
177
+ $this->lMargin=$margin;
178
+ if($this->page>0 && $this->x<$margin)
179
+ $this->x=$margin;
180
+ }
181
+
182
+ function SetTopMargin($margin)
183
+ {
184
+ //Set top margin
185
+ $this->tMargin=$margin;
186
+ }
187
+
188
+ function SetRightMargin($margin)
189
+ {
190
+ //Set right margin
191
+ $this->rMargin=$margin;
192
+ }
193
+
194
+ function SetAutoPageBreak($auto, $margin=0)
195
+ {
196
+ //Set auto page break mode and triggering margin
197
+ $this->AutoPageBreak=$auto;
198
+ $this->bMargin=$margin;
199
+ $this->PageBreakTrigger=$this->h-$margin;
200
+ }
201
+
202
+ function SetDisplayMode($zoom, $layout='continuous')
203
+ {
204
+ //Set display mode in viewer
205
+ if($zoom=='fullpage' || $zoom=='fullwidth' || $zoom=='real' || $zoom=='default' || !is_string($zoom))
206
+ $this->ZoomMode=$zoom;
207
+ else
208
+ $this->Error('Incorrect zoom display mode: '.$zoom);
209
+ if($layout=='single' || $layout=='continuous' || $layout=='two' || $layout=='default')
210
+ $this->LayoutMode=$layout;
211
+ else
212
+ $this->Error('Incorrect layout display mode: '.$layout);
213
+ }
214
+
215
+ function SetCompression($compress)
216
+ {
217
+ //Set page compression
218
+ if(function_exists('gzcompress'))
219
+ $this->compress=$compress;
220
+ else
221
+ $this->compress=false;
222
+ }
223
+
224
+ function SetTitle($title, $isUTF8=false)
225
+ {
226
+ //Title of document
227
+ if($isUTF8)
228
+ $title=$this->_UTF8toUTF16($title);
229
+ $this->title=$title;
230
+ }
231
+
232
+ function SetSubject($subject, $isUTF8=false)
233
+ {
234
+ //Subject of document
235
+ if($isUTF8)
236
+ $subject=$this->_UTF8toUTF16($subject);
237
+ $this->subject=$subject;
238
+ }
239
+
240
+ function SetAuthor($author, $isUTF8=false)
241
+ {
242
+ //Author of document
243
+ if($isUTF8)
244
+ $author=$this->_UTF8toUTF16($author);
245
+ $this->author=$author;
246
+ }
247
+
248
+ function SetKeywords($keywords, $isUTF8=false)
249
+ {
250
+ //Keywords of document
251
+ if($isUTF8)
252
+ $keywords=$this->_UTF8toUTF16($keywords);
253
+ $this->keywords=$keywords;
254
+ }
255
+
256
+ function SetCreator($creator, $isUTF8=false)
257
+ {
258
+ //Creator of document
259
+ if($isUTF8)
260
+ $creator=$this->_UTF8toUTF16($creator);
261
+ $this->creator=$creator;
262
+ }
263
+
264
+ function AliasNbPages($alias='{nb}')
265
+ {
266
+ //Define an alias for total number of pages
267
+ $this->AliasNbPages=$alias;
268
+ }
269
+
270
+ function Error($msg)
271
+ {
272
+ //Fatal error
273
+ die('<b>FPDF error:</b> '.$msg);
274
+ }
275
+
276
+ function Open()
277
+ {
278
+ //Begin document
279
+ $this->state=1;
280
+ }
281
+
282
+ function Close()
283
+ {
284
+ //Terminate document
285
+ if($this->state==3)
286
+ return;
287
+ if($this->page==0)
288
+ $this->AddPage();
289
+ //Page footer
290
+ $this->InFooter=true;
291
+ $this->Footer();
292
+ $this->InFooter=false;
293
+ //Close page
294
+ $this->_endpage();
295
+ //Close document
296
+ $this->_enddoc();
297
+ }
298
+
299
+ function AddPage($orientation='', $format='')
300
+ {
301
+
302
+ //Start a new page
303
+ if($this->state==0)
304
+ $this->Open();
305
+ $family=$this->FontFamily;
306
+ $style=$this->FontStyle.($this->underline ? 'U' : '');
307
+ $size=$this->FontSizePt;
308
+ $lw=$this->LineWidth;
309
+ $dc=$this->DrawColor;
310
+ $fc=$this->FillColor;
311
+ $tc=$this->TextColor;
312
+ $cf=$this->ColorFlag;
313
+ if($this->page>0)
314
+ {
315
+ //Page footer
316
+ $this->InFooter=true;
317
+ $this->Footer();
318
+ $this->InFooter=false;
319
+ //Close page
320
+ $this->_endpage();
321
+ }
322
+ //Start new page
323
+
324
+ $this->_beginpage($orientation,$format);
325
+ //Set line cap style to square
326
+ $this->_out('2 J');
327
+ //Set line width
328
+ $this->LineWidth=$lw;
329
+ $this->_out(sprintf('%.2F w',$lw*$this->k));
330
+ //Set font
331
+ if($family)
332
+ $this->SetFont($family,$style,$size);
333
+ //Set colors
334
+ $this->DrawColor=$dc;
335
+ if($dc!='0 G')
336
+ $this->_out($dc);
337
+ $this->FillColor=$fc;
338
+ if($fc!='0 g')
339
+ $this->_out($fc);
340
+ $this->TextColor=$tc;
341
+ $this->ColorFlag=$cf;
342
+ //Page header
343
+ $this->InHeader=true;
344
+ $this->Header();
345
+ $this->InHeader=false;
346
+ //Restore line width
347
+ if($this->LineWidth!=$lw)
348
+ {
349
+ $this->LineWidth=$lw;
350
+ $this->_out(sprintf('%.2F w',$lw*$this->k));
351
+ }
352
+ //Restore font
353
+ if($family)
354
+ $this->SetFont($family,$style,$size);
355
+ //Restore colors
356
+ if($this->DrawColor!=$dc)
357
+ {
358
+ $this->DrawColor=$dc;
359
+ $this->_out($dc);
360
+ }
361
+ if($this->FillColor!=$fc)
362
+ {
363
+ $this->FillColor=$fc;
364
+ $this->_out($fc);
365
+ }
366
+ $this->TextColor=$tc;
367
+ $this->ColorFlag=$cf;
368
+ }
369
+
370
+ function Header()
371
+ {
372
+ //To be implemented in your own inherited class
373
+ }
374
+
375
+ function Footer()
376
+ {
377
+ //To be implemented in your own inherited class
378
+ }
379
+
380
+ function PageNo()
381
+ {
382
+ //Get current page number
383
+ return $this->page;
384
+ }
385
+
386
+ function SetDrawColor($r, $g=null, $b=null)
387
+ {
388
+ //Set color for all stroking operations
389
+ if(($r==0 && $g==0 && $b==0) || $g===null)
390
+ $this->DrawColor=sprintf('%.3F G',$r/255);
391
+ else
392
+ $this->DrawColor=sprintf('%.3F %.3F %.3F RG',$r/255,$g/255,$b/255);
393
+ if($this->page>0)
394
+ $this->_out($this->DrawColor);
395
+ }
396
+
397
+ function SetFillColor($r, $g=null, $b=null)
398
+ {
399
+ //Set color for all filling operations
400
+ if(($r==0 && $g==0 && $b==0) || $g===null)
401
+ $this->FillColor=sprintf('%.3F g',$r/255);
402
+ else
403
+ $this->FillColor=sprintf('%.3F %.3F %.3F rg',$r/255,$g/255,$b/255);
404
+ $this->ColorFlag=($this->FillColor!=$this->TextColor);
405
+ if($this->page>0)
406
+ $this->_out($this->FillColor);
407
+ }
408
+
409
+ function SetTextColor($r, $g=null, $b=null)
410
+ {
411
+ //Set color for text
412
+ if(($r==0 && $g==0 && $b==0) || $g===null)
413
+ $this->TextColor=sprintf('%.3F g',$r/255);
414
+ else
415
+ $this->TextColor=sprintf('%.3F %.3F %.3F rg',$r/255,$g/255,$b/255);
416
+ $this->ColorFlag=($this->FillColor!=$this->TextColor);
417
+ }
418
+
419
+ function GetStringWidth($s)
420
+ {
421
+ //Get width of a string in the current font
422
+ $s=(string)$s;
423
+ $cw=&$this->CurrentFont['cw'];
424
+ $w=0;
425
+ $l=strlen($s);
426
+ for($i=0;$i<$l;$i++)
427
+ $w+=$cw[$s[$i]];
428
+ return $w*$this->FontSize/1000;
429
+ }
430
+
431
+ function SetLineWidth($width)
432
+ {
433
+ //Set line width
434
+ $this->LineWidth=$width;
435
+ if($this->page>0)
436
+ $this->_out(sprintf('%.2F w',$width*$this->k));
437
+ }
438
+
439
+ function Line($x1, $y1, $x2, $y2)
440
+ {
441
+ //Draw a line
442
+ $this->_out(sprintf('%.2F %.2F m %.2F %.2F l S',$x1*$this->k,($this->h-$y1)*$this->k,$x2*$this->k,($this->h-$y2)*$this->k));
443
+ }
444
+
445
+ function Rect($x, $y, $w, $h, $style='')
446
+ {
447
+ //Draw a rectangle
448
+ if($style=='F')
449
+ $op='f';
450
+ elseif($style=='FD' || $style=='DF')
451
+ $op='B';
452
+ else
453
+ $op='S';
454
+ $this->_out(sprintf('%.2F %.2F %.2F %.2F re %s',$x*$this->k,($this->h-$y)*$this->k,$w*$this->k,-$h*$this->k,$op));
455
+ }
456
+
457
+ function AddFont($family, $style='', $file='')
458
+ {
459
+ //Add a TrueType or Type1 font
460
+ $family=strtolower($family);
461
+ if($file=='')
462
+ $file=str_replace(' ','',$family).strtolower($style).'.php';
463
+ if($family=='arial')
464
+ $family='helvetica';
465
+ $style=strtoupper($style);
466
+ if($style=='IB')
467
+ $style='BI';
468
+ $fontkey=$family.$style;
469
+ if(isset($this->fonts[$fontkey]))
470
+ return;
471
+ include($this->_getfontpath().$file);
472
+ if(!isset($name))
473
+ $this->Error('Could not include font definition file');
474
+ $i=count($this->fonts)+1;
475
+ $this->fonts[$fontkey]=array('i'=>$i, 'type'=>$type, 'name'=>$name, 'desc'=>$desc, 'up'=>$up, 'ut'=>$ut, 'cw'=>$cw, 'enc'=>$enc, 'file'=>$file);
476
+ if($diff)
477
+ {
478
+ //Search existing encodings
479
+ $d=0;
480
+ $nb=count($this->diffs);
481
+ for($i=1;$i<=$nb;$i++)
482
+ {
483
+ if($this->diffs[$i]==$diff)
484
+ {
485
+ $d=$i;
486
+ break;
487
+ }
488
+ }
489
+ if($d==0)
490
+ {
491
+ $d=$nb+1;
492
+ $this->diffs[$d]=$diff;
493
+ }
494
+ $this->fonts[$fontkey]['diff']=$d;
495
+ }
496
+ if($file)
497
+ {
498
+ if($type=='TrueType')
499
+ $this->FontFiles[$file]=array('length1'=>$originalsize);
500
+ else
501
+ $this->FontFiles[$file]=array('length1'=>$size1, 'length2'=>$size2);
502
+ }
503
+ }
504
+
505
+ function SetFont($family, $style='', $size=0)
506
+ {
507
+ //Select a font; size given in points
508
+ global $fpdf_charwidths;
509
+
510
+ $family=strtolower($family);
511
+ if($family=='')
512
+ $family=$this->FontFamily;
513
+ if($family=='arial')
514
+ $family='helvetica';
515
+ elseif($family=='symbol' || $family=='zapfdingbats')
516
+ $style='';
517
+ $style=strtoupper($style);
518
+ if(strpos($style,'U')!==false)
519
+ {
520
+ $this->underline=true;
521
+ $style=str_replace('U','',$style);
522
+ }
523
+ else
524
+ $this->underline=false;
525
+ if($style=='IB')
526
+ $style='BI';
527
+ if($size==0)
528
+ $size=$this->FontSizePt;
529
+ //Test if font is already selected
530
+ if($this->FontFamily==$family && $this->FontStyle==$style && $this->FontSizePt==$size)
531
+ return;
532
+ //Test if used for the first time
533
+ $fontkey=$family.$style;
534
+ if(!isset($this->fonts[$fontkey]))
535
+ {
536
+ //Check if one of the standard fonts
537
+ if(isset($this->CoreFonts[$fontkey]))
538
+ {
539
+ if(!isset($fpdf_charwidths[$fontkey]))
540
+ {
541
+ //Load metric file
542
+ $file=$family;
543
+ if($family=='times' || $family=='helvetica')
544
+ $file.=strtolower($style);
545
+ include($this->_getfontpath().$file.'.php');
546
+ if(!isset($fpdf_charwidths[$fontkey]))
547
+ $this->Error('Could not include font metric file');
548
+ }
549
+ $i=count($this->fonts)+1;
550
+ $name=$this->CoreFonts[$fontkey];
551
+ $cw=$fpdf_charwidths[$fontkey];
552
+ $this->fonts[$fontkey]=array('i'=>$i, 'type'=>'core', 'name'=>$name, 'up'=>-100, 'ut'=>50, 'cw'=>$cw);
553
+ }
554
+ else
555
+ $this->Error('Undefined font: '.$family.' '.$style);
556
+ }
557
+ //Select it
558
+ $this->FontFamily=$family;
559
+ $this->FontStyle=$style;
560
+ $this->FontSizePt=$size;
561
+ $this->FontSize=$size/$this->k;
562
+ $this->CurrentFont=&$this->fonts[$fontkey];
563
+ if($this->page>0)
564
+ $this->_out(sprintf('BT /F%d %.2F Tf ET',$this->CurrentFont['i'],$this->FontSizePt));
565
+ }
566
+
567
+ function SetFontSize($size)
568
+ {
569
+ //Set font size in points
570
+ if($this->FontSizePt==$size)
571
+ return;
572
+ $this->FontSizePt=$size;
573
+ $this->FontSize=$size/$this->k;
574
+ if($this->page>0)
575
+ $this->_out(sprintf('BT /F%d %.2F Tf ET',$this->CurrentFont['i'],$this->FontSizePt));
576
+ }
577
+
578
+ function AddLink()
579
+ {
580
+ //Create a new internal link
581
+ $n=count($this->links)+1;
582
+ $this->links[$n]=array(0, 0);
583
+ return $n;
584
+ }
585
+
586
+ function SetLink($link, $y=0, $page=-1)
587
+ {
588
+ //Set destination of internal link
589
+ if($y==-1)
590
+ $y=$this->y;
591
+ if($page==-1)
592
+ $page=$this->page;
593
+ $this->links[$link]=array($page, $y);
594
+ }
595
+
596
+ function Link($x, $y, $w, $h, $link)
597
+ {
598
+ //Put a link on the page
599
+ $this->PageLinks[$this->page][]=array($x*$this->k, $this->hPt-$y*$this->k, $w*$this->k, $h*$this->k, $link);
600
+ }
601
+
602
+ function Text($x, $y, $txt)
603
+ {
604
+ //Output a string
605
+ $s=sprintf('BT %.2F %.2F Td (%s) Tj ET',$x*$this->k,($this->h-$y)*$this->k,$this->_escape($txt));
606
+ if($this->underline && $txt!='')
607
+ $s.=' '.$this->_dounderline($x,$y,$txt);
608
+ if($this->ColorFlag)
609
+ $s='q '.$this->TextColor.' '.$s.' Q';
610
+ $this->_out($s);
611
+ }
612
+
613
+ function AcceptPageBreak()
614
+ {
615
+ //Accept automatic page break or not
616
+ return $this->AutoPageBreak;
617
+ }
618
+
619
+ function Cell($w, $h=0, $txt='', $border=0, $ln=0, $align='', $fill=false, $link='')
620
+ {
621
+ //Output a cell
622
+ $k=$this->k;
623
+ if($this->y+$h>$this->PageBreakTrigger && !$this->InHeader && !$this->InFooter && $this->AcceptPageBreak())
624
+ {
625
+ //Automatic page break
626
+ $x=$this->x;
627
+ $ws=$this->ws;
628
+ if($ws>0)
629
+ {
630
+ $this->ws=0;
631
+ $this->_out('0 Tw');
632
+ }
633
+ $this->AddPage($this->CurOrientation,$this->CurPageFormat);
634
+ $this->x=$x;
635
+ if($ws>0)
636
+ {
637
+ $this->ws=$ws;
638
+ $this->_out(sprintf('%.3F Tw',$ws*$k));
639
+ }
640
+ }
641
+ if($w==0)
642
+ $w=$this->w-$this->rMargin-$this->x;
643
+ $s='';
644
+ if($fill || $border==1)
645
+ {
646
+ if($fill)
647
+ $op=($border==1) ? 'B' : 'f';
648
+ else
649
+ $op='S';
650
+ $s=sprintf('%.2F %.2F %.2F %.2F re %s ',$this->x*$k,($this->h-$this->y)*$k,$w*$k,-$h*$k,$op);
651
+ }
652
+ if(is_string($border))
653
+ {
654
+ $x=$this->x;
655
+ $y=$this->y;
656
+ if(strpos($border,'L')!==false)
657
+ $s.=sprintf('%.2F %.2F m %.2F %.2F l S ',$x*$k,($this->h-$y)*$k,$x*$k,($this->h-($y+$h))*$k);
658
+ if(strpos($border,'T')!==false)
659
+ $s.=sprintf('%.2F %.2F m %.2F %.2F l S ',$x*$k,($this->h-$y)*$k,($x+$w)*$k,($this->h-$y)*$k);
660
+ if(strpos($border,'R')!==false)
661
+ $s.=sprintf('%.2F %.2F m %.2F %.2F l S ',($x+$w)*$k,($this->h-$y)*$k,($x+$w)*$k,($this->h-($y+$h))*$k);
662
+ if(strpos($border,'B')!==false)
663
+ $s.=sprintf('%.2F %.2F m %.2F %.2F l S ',$x*$k,($this->h-($y+$h))*$k,($x+$w)*$k,($this->h-($y+$h))*$k);
664
+ }
665
+ if($txt!=='')
666
+ {
667
+ if($align=='R')
668
+ $dx=$w-$this->cMargin-$this->GetStringWidth($txt);
669
+ elseif($align=='C')
670
+ $dx=($w-$this->GetStringWidth($txt))/2;
671
+ else
672
+ $dx=$this->cMargin;
673
+ if($this->ColorFlag)
674
+ $s.='q '.$this->TextColor.' ';
675
+ $txt2=str_replace(')','\\)',str_replace('(','\\(',str_replace('\\','\\\\',$txt)));
676
+ $s.=sprintf('BT %.2F %.2F Td (%s) Tj ET',($this->x+$dx)*$k,($this->h-($this->y+.5*$h+.3*$this->FontSize))*$k,$txt2);
677
+ if($this->underline)
678
+ $s.=' '.$this->_dounderline($this->x+$dx,$this->y+.5*$h+.3*$this->FontSize,$txt);
679
+ if($this->ColorFlag)
680
+ $s.=' Q';
681
+ if($link)
682
+ $this->Link($this->x+$dx,$this->y+.5*$h-.5*$this->FontSize,$this->GetStringWidth($txt),$this->FontSize,$link);
683
+ }
684
+ if($s)
685
+ $this->_out($s);
686
+ $this->lasth=$h;
687
+ if($ln>0)
688
+ {
689
+ //Go to next line
690
+ $this->y+=$h;
691
+ if($ln==1)
692
+ $this->x=$this->lMargin;
693
+ }
694
+ else
695
+ $this->x+=$w;
696
+ }
697
+
698
+ function MultiCell($w, $h, $txt, $border=0, $align='J', $fill=false)
699
+ {
700
+ //Output text with automatic or explicit line breaks
701
+ $cw=&$this->CurrentFont['cw'];
702
+ if($w==0)
703
+ $w=$this->w-$this->rMargin-$this->x;
704
+ $wmax=($w-2*$this->cMargin)*1000/$this->FontSize;
705
+ $s=str_replace("\r",'',$txt);
706
+ $nb=strlen($s);
707
+ if($nb>0 && $s[$nb-1]=="\n")
708
+ $nb--;
709
+ $b=0;
710
+ if($border)
711
+ {
712
+ if($border==1)
713
+ {
714
+ $border='LTRB';
715
+ $b='LRT';
716
+ $b2='LR';
717
+ }
718
+ else
719
+ {
720
+ $b2='';
721
+ if(strpos($border,'L')!==false)
722
+ $b2.='L';
723
+ if(strpos($border,'R')!==false)
724
+ $b2.='R';
725
+ $b=(strpos($border,'T')!==false) ? $b2.'T' : $b2;
726
+ }
727
+ }
728
+ $sep=-1;
729
+ $i=0;
730
+ $j=0;
731
+ $l=0;
732
+ $ns=0;
733
+ $nl=1;
734
+ while($i<$nb)
735
+ {
736
+ //Get next character
737
+ $c=$s[$i];
738
+ if($c=="\n")
739
+ {
740
+ //Explicit line break
741
+ if($this->ws>0)
742
+ {
743
+ $this->ws=0;
744
+ $this->_out('0 Tw');
745
+ }
746
+ $this->Cell($w,$h,substr($s,$j,$i-$j),$b,2,$align,$fill);
747
+ $i++;
748
+ $sep=-1;
749
+ $j=$i;
750
+ $l=0;
751
+ $ns=0;
752
+ $nl++;
753
+ if($border && $nl==2)
754
+ $b=$b2;
755
+ continue;
756
+ }
757
+ if($c==' ')
758
+ {
759
+ $sep=$i;
760
+ $ls=$l;
761
+ $ns++;
762
+ }
763
+ $l+=$cw[$c];
764
+ if($l>$wmax)
765
+ {
766
+ //Automatic line break
767
+ if($sep==-1)
768
+ {
769
+ if($i==$j)
770
+ $i++;
771
+ if($this->ws>0)
772
+ {
773
+ $this->ws=0;
774
+ $this->_out('0 Tw');
775
+ }
776
+ $this->Cell($w,$h,substr($s,$j,$i-$j),$b,2,$align,$fill);
777
+ }
778
+ else
779
+ {
780
+ if($align=='J')
781
+ {
782
+ $this->ws=($ns>1) ? ($wmax-$ls)/1000*$this->FontSize/($ns-1) : 0;
783
+ $this->_out(sprintf('%.3F Tw',$this->ws*$this->k));
784
+ }
785
+ $this->Cell($w,$h,substr($s,$j,$sep-$j),$b,2,$align,$fill);
786
+ $i=$sep+1;
787
+ }
788
+ $sep=-1;
789
+ $j=$i;
790
+ $l=0;
791
+ $ns=0;
792
+ $nl++;
793
+ if($border && $nl==2)
794
+ $b=$b2;
795
+ }
796
+ else
797
+ $i++;
798
+ }
799
+ //Last chunk
800
+ if($this->ws>0)
801
+ {
802
+ $this->ws=0;
803
+ $this->_out('0 Tw');
804
+ }
805
+ if($border && strpos($border,'B')!==false)
806
+ $b.='B';
807
+ $this->Cell($w,$h,substr($s,$j,$i-$j),$b,2,$align,$fill);
808
+ $this->x=$this->lMargin;
809
+ }
810
+
811
+ function Write($h, $txt, $link='')
812
+ {
813
+ //Output text in flowing mode
814
+ $cw=&$this->CurrentFont['cw'];
815
+ $w=$this->w-$this->rMargin-$this->x;
816
+ $wmax=($w-2*$this->cMargin)*1000/$this->FontSize;
817
+ $s=str_replace("\r",'',$txt);
818
+ $nb=strlen($s);
819
+ $sep=-1;
820
+ $i=0;
821
+ $j=0;
822
+ $l=0;
823
+ $nl=1;
824
+ while($i<$nb)
825
+ {
826
+ //Get next character
827
+ $c=$s[$i];
828
+ if($c=="\n")
829
+ {
830
+ //Explicit line break
831
+ $this->Cell($w,$h,substr($s,$j,$i-$j),0,2,'',0,$link);
832
+ $i++;
833
+ $sep=-1;
834
+ $j=$i;
835
+ $l=0;
836
+ if($nl==1)
837
+ {
838
+ $this->x=$this->lMargin;
839
+ $w=$this->w-$this->rMargin-$this->x;
840
+ $wmax=($w-2*$this->cMargin)*1000/$this->FontSize;
841
+ }
842
+ $nl++;
843
+ continue;
844
+ }
845
+ if($c==' ')
846
+ $sep=$i;
847
+ $l+=$cw[$c];
848
+ if($l>$wmax)
849
+ {
850
+ //Automatic line break
851
+ if($sep==-1)
852
+ {
853
+ if($this->x>$this->lMargin)
854
+ {
855
+ //Move to next line
856
+ $this->x=$this->lMargin;
857
+ $this->y+=$h;
858
+ $w=$this->w-$this->rMargin-$this->x;
859
+ $wmax=($w-2*$this->cMargin)*1000/$this->FontSize;
860
+ $i++;
861
+ $nl++;
862
+ continue;
863
+ }
864
+ if($i==$j)
865
+ $i++;
866
+ $this->Cell($w,$h,substr($s,$j,$i-$j),0,2,'',0,$link);
867
+ }
868
+ else
869
+ {
870
+ $this->Cell($w,$h,substr($s,$j,$sep-$j),0,2,'',0,$link);
871
+ $i=$sep+1;
872
+ }
873
+ $sep=-1;
874
+ $j=$i;
875
+ $l=0;
876
+ if($nl==1)
877
+ {
878
+ $this->x=$this->lMargin;
879
+ $w=$this->w-$this->rMargin-$this->x;
880
+ $wmax=($w-2*$this->cMargin)*1000/$this->FontSize;
881
+ }
882
+ $nl++;
883
+ }
884
+ else
885
+ $i++;
886
+ }
887
+ //Last chunk
888
+ if($i!=$j)
889
+ $this->Cell($l/1000*$this->FontSize,$h,substr($s,$j),0,0,'',0,$link);
890
+ }
891
+
892
+ function Ln($h=null)
893
+ {
894
+ //Line feed; default value is last cell height
895
+ $this->x=$this->lMargin;
896
+ if($h===null)
897
+ $this->y+=$this->lasth;
898
+ else
899
+ $this->y+=$h;
900
+ }
901
+
902
+ function Image($file, $x=null, $y=null, $w=0, $h=0, $type='', $link='')
903
+ {
904
+ //Put an image on the page
905
+ if(!isset($this->images[$file]))
906
+ {
907
+ //First use of this image, get info
908
+ if($type=='')
909
+ {
910
+ $pos=strrpos($file,'.');
911
+ if(!$pos)
912
+ $this->Error('Image file has no extension and no type was specified: '.$file);
913
+ $type=substr($file,$pos+1);
914
+ }
915
+ $type=strtolower($type);
916
+ if($type=='jpeg')
917
+ $type='jpg';
918
+ $mtd='_parse'.$type;
919
+ if(!method_exists($this,$mtd))
920
+ $this->Error('Unsupported image type: '.$type);
921
+ $info=$this->$mtd($file);
922
+ $info['i']=count($this->images)+1;
923
+ $this->images[$file]=$info;
924
+ }
925
+ else
926
+ $info=$this->images[$file];
927
+ //Automatic width and height calculation if needed
928
+ if($w==0 && $h==0)
929
+ {
930
+ //Put image at 72 dpi
931
+ $w=$info['w']/$this->k;
932
+ $h=$info['h']/$this->k;
933
+ }
934
+ elseif($w==0)
935
+ $w=$h*$info['w']/$info['h'];
936
+ elseif($h==0)
937
+ $h=$w*$info['h']/$info['w'];
938
+ //Flowing mode
939
+ if($y===null)
940
+ {
941
+ if($this->y+$h>$this->PageBreakTrigger && !$this->InHeader && !$this->InFooter && $this->AcceptPageBreak())
942
+ {
943
+ //Automatic page break
944
+ $x2=$this->x;
945
+ $this->AddPage($this->CurOrientation,$this->CurPageFormat);
946
+ $this->x=$x2;
947
+ }
948
+ $y=$this->y;
949
+ $this->y+=$h;
950
+ }
951
+ if($x===null)
952
+ $x=$this->x;
953
+ $this->_out(sprintf('q %.2F 0 0 %.2F %.2F %.2F cm /I%d Do Q',$w*$this->k,$h*$this->k,$x*$this->k,($this->h-($y+$h))*$this->k,$info['i']));
954
+ if($link)
955
+ $this->Link($x,$y,$w,$h,$link);
956
+ }
957
+
958
+ function GetX()
959
+ {
960
+ //Get x position
961
+ return $this->x;
962
+ }
963
+
964
+ function SetX($x)
965
+ {
966
+ //Set x position
967
+ if($x>=0)
968
+ $this->x=$x;
969
+ else
970
+ $this->x=$this->w+$x;
971
+ }
972
+
973
+ function GetY()
974
+ {
975
+ //Get y position
976
+ return $this->y;
977
+ }
978
+
979
+ function SetY($y)
980
+ {
981
+ //Set y position and reset x
982
+ $this->x=$this->lMargin;
983
+ if($y>=0)
984
+ $this->y=$y;
985
+ else
986
+ $this->y=$this->h+$y;
987
+ }
988
+
989
+ function SetXY($x, $y)
990
+ {
991
+ //Set x and y positions
992
+ $this->SetY($y);
993
+ $this->SetX($x);
994
+ }
995
+
996
+ function Output($name='', $dest='')
997
+ {
998
+ //Output PDF to some destination
999
+ if($this->state<3)
1000
+ $this->Close();
1001
+ $dest=strtoupper($dest);
1002
+ if($dest=='')
1003
+ {
1004
+ if($name=='')
1005
+ {
1006
+ $name='doc.pdf';
1007
+ $dest='I';
1008
+ }
1009
+ else
1010
+ $dest='F';
1011
+ }
1012
+ switch($dest)
1013
+ {
1014
+ case 'I':
1015
+ //Send to standard output
1016
+ if(ob_get_length())
1017
+ $this->Error('Some data has already been output, can\'t send PDF file');
1018
+ if(php_sapi_name()!='cli')
1019
+ {
1020
+ //We send to a browser
1021
+ header('Content-Type: application/pdf');
1022
+ if(headers_sent())
1023
+ $this->Error('Some data has already been output, can\'t send PDF file');
1024
+ header('Content-Length: '.strlen($this->buffer));
1025
+ header('Content-Disposition: inline; filename="'.$name.'"');
1026
+ header('Cache-Control: private, max-age=0, must-revalidate');
1027
+ header('Pragma: public');
1028
+ ini_set('zlib.output_compression','0');
1029
+ }
1030
+ echo $this->buffer;
1031
+ break;
1032
+ case 'D':
1033
+ //Download file
1034
+ if(ob_get_length())
1035
+ $this->Error('Some data has already been output, can\'t send PDF file');
1036
+ header('Content-Type: application/x-download');
1037
+ if(headers_sent())
1038
+ $this->Error('Some data has already been output, can\'t send PDF file');
1039
+ header('Content-Length: '.strlen($this->buffer));
1040
+ header('Content-Disposition: attachment; filename="'.$name.'"');
1041
+ header('Cache-Control: private, max-age=0, must-revalidate');
1042
+ header('Pragma: public');
1043
+ ini_set('zlib.output_compression','0');
1044
+ echo $this->buffer;
1045
+ break;
1046
+ case 'F':
1047
+ //Save to local file
1048
+ $f=fopen($name,'wb');
1049
+ if(!$f)
1050
+ $this->Error('Unable to create output file: '.$name);
1051
+ fwrite($f,$this->buffer,strlen($this->buffer));
1052
+ fclose($f);
1053
+ break;
1054
+ case 'S':
1055
+ //Return as a string
1056
+ return $this->buffer;
1057
+ default:
1058
+ $this->Error('Incorrect output destination: '.$dest);
1059
+ }
1060
+ return '';
1061
+ }
1062
+
1063
+ /*******************************************************************************
1064
+ * *
1065
+ * Protected methods *
1066
+ * *
1067
+ *******************************************************************************/
1068
+ function _dochecks()
1069
+ {
1070
+ //Check availability of %F
1071
+ if(sprintf('%.1F',1.0)!='1.0')
1072
+ $this->Error('This version of PHP is not supported');
1073
+ //Check mbstring overloading
1074
+ if(ini_get('mbstring.func_overload') & 2)
1075
+ $this->Error('mbstring overloading must be disabled');
1076
+ //Disable runtime magic quotes
1077
+ if(get_magic_quotes_runtime())
1078
+ @set_magic_quotes_runtime(0);
1079
+ }
1080
+
1081
+ function _getpageformat($format)
1082
+ {
1083
+ $format=strtolower($format);
1084
+ if(!isset($this->PageFormats[$format]))
1085
+ $this->Error('Unknown page format: '.$format);
1086
+ $a=$this->PageFormats[$format];
1087
+ return array($a[0]/$this->k, $a[1]/$this->k);
1088
+ }
1089
+
1090
+ function _getfontpath()
1091
+ {
1092
+ if(!defined('FPDF_FONTPATH') && is_dir(dirname(__FILE__).'/font'))
1093
+ define('FPDF_FONTPATH',dirname(__FILE__).'/font/');
1094
+ return defined('FPDF_FONTPATH') ? FPDF_FONTPATH : '';
1095
+ }
1096
+
1097
+ function _beginpage($orientation, $format)
1098
+ {
1099
+ $this->page++;
1100
+ $this->pages[$this->page]='';
1101
+ $this->state=2;
1102
+ $this->x=$this->lMargin;
1103
+ $this->y=$this->tMargin;
1104
+ $this->FontFamily='';
1105
+ //Check page size
1106
+ if($orientation=='')
1107
+ $orientation=$this->DefOrientation;
1108
+ else
1109
+ $orientation=strtoupper($orientation[0]);
1110
+ if($format=='')
1111
+ $format=$this->DefPageFormat;
1112
+ else
1113
+ {
1114
+ if(is_string($format))
1115
+ $format=$this->_getpageformat($format);
1116
+ }
1117
+ if($orientation!=$this->CurOrientation || $format[0]!=$this->CurPageFormat[0] || $format[1]!=$this->CurPageFormat[1])
1118
+ {
1119
+ //New size
1120
+ if($orientation=='P')
1121
+ {
1122
+ $this->w=$format[0];
1123
+ $this->h=$format[1];
1124
+ }
1125
+ else
1126
+ {
1127
+ $this->w=$format[1];
1128
+ $this->h=$format[0];
1129
+ }
1130
+ $this->wPt=$this->w*$this->k;
1131
+ $this->hPt=$this->h*$this->k;
1132
+ $this->PageBreakTrigger=$this->h-$this->bMargin;
1133
+ $this->CurOrientation=$orientation;
1134
+ $this->CurPageFormat=$format;
1135
+ }
1136
+ if($orientation!=$this->DefOrientation || $format[0]!=$this->DefPageFormat[0] || $format[1]!=$this->DefPageFormat[1])
1137
+ $this->PageSizes[$this->page]=array($this->wPt, $this->hPt);
1138
+ }
1139
+
1140
+ function _endpage()
1141
+ {
1142
+ $this->state=1;
1143
+ }
1144
+
1145
+ function _escape($s)
1146
+ {
1147
+ //Escape special characters in strings
1148
+ $s=str_replace('\\','\\\\',$s);
1149
+ $s=str_replace('(','\\(',$s);
1150
+ $s=str_replace(')','\\)',$s);
1151
+ $s=str_replace("\r",'\\r',$s);
1152
+ return $s;
1153
+ }
1154
+
1155
+ function _textstring($s)
1156
+ {
1157
+ //Format a text string
1158
+ return '('.$this->_escape($s).')';
1159
+ }
1160
+
1161
+ function _UTF8toUTF16($s)
1162
+ {
1163
+ //Convert UTF-8 to UTF-16BE with BOM
1164
+ $res="\xFE\xFF";
1165
+ $nb=strlen($s);
1166
+ $i=0;
1167
+ while($i<$nb)
1168
+ {
1169
+ $c1=ord($s[$i++]);
1170
+ if($c1>=224)
1171
+ {
1172
+ //3-byte character
1173
+ $c2=ord($s[$i++]);
1174
+ $c3=ord($s[$i++]);
1175
+ $res.=chr((($c1 & 0x0F)<<4) + (($c2 & 0x3C)>>2));
1176
+ $res.=chr((($c2 & 0x03)<<6) + ($c3 & 0x3F));
1177
+ }
1178
+ elseif($c1>=192)
1179
+ {
1180
+ //2-byte character
1181
+ $c2=ord($s[$i++]);
1182
+ $res.=chr(($c1 & 0x1C)>>2);
1183
+ $res.=chr((($c1 & 0x03)<<6) + ($c2 & 0x3F));
1184
+ }
1185
+ else
1186
+ {
1187
+ //Single-byte character
1188
+ $res.="\0".chr($c1);
1189
+ }
1190
+ }
1191
+ return $res;
1192
+ }
1193
+
1194
+ function _dounderline($x, $y, $txt)
1195
+ {
1196
+ //Underline text
1197
+ $up=$this->CurrentFont['up'];
1198
+ $ut=$this->CurrentFont['ut'];
1199
+ $w=$this->GetStringWidth($txt)+$this->ws*substr_count($txt,' ');
1200
+ return sprintf('%.2F %.2F %.2F %.2F re f',$x*$this->k,($this->h-($y-$up/1000*$this->FontSize))*$this->k,$w*$this->k,-$ut/1000*$this->FontSizePt);
1201
+ }
1202
+
1203
+ function _parsejpg($file)
1204
+ {
1205
+ //Extract info from a JPEG file
1206
+ $a=GetImageSize($file);
1207
+ if(!$a)
1208
+ $this->Error('Missing or incorrect image file: '.$file);
1209
+ if($a[2]!=2)
1210
+ $this->Error('Not a JPEG file: '.$file);
1211
+ if(!isset($a['channels']) || $a['channels']==3)
1212
+ $colspace='DeviceRGB';
1213
+ elseif($a['channels']==4)
1214
+ $colspace='DeviceCMYK';
1215
+ else
1216
+ $colspace='DeviceGray';
1217
+ $bpc=isset($a['bits']) ? $a['bits'] : 8;
1218
+ //Read whole file
1219
+ $f=fopen($file,'rb');
1220
+ $data='';
1221
+ while(!feof($f))
1222
+ $data.=fread($f,8192);
1223
+ fclose($f);
1224
+ return array('w'=>$a[0], 'h'=>$a[1], 'cs'=>$colspace, 'bpc'=>$bpc, 'f'=>'DCTDecode', 'data'=>$data);
1225
+ }
1226
+
1227
+ function _parsepng($file)
1228
+ {
1229
+ //Extract info from a PNG file
1230
+ $f=fopen($file,'rb');
1231
+ if(!$f)
1232
+ $this->Error('Can\'t open image file: '.$file);
1233
+ //Check signature
1234
+ if($this->_readstream($f,8)!=chr(137).'PNG'.chr(13).chr(10).chr(26).chr(10))
1235
+ $this->Error('Not a PNG file: '.$file);
1236
+ //Read header chunk
1237
+ $this->_readstream($f,4);
1238
+ if($this->_readstream($f,4)!='IHDR')
1239
+ $this->Error('Incorrect PNG file: '.$file);
1240
+ $w=$this->_readint($f);
1241
+ $h=$this->_readint($f);
1242
+ $bpc=ord($this->_readstream($f,1));
1243
+ if($bpc>8)
1244
+ $this->Error('16-bit depth not supported: '.$file);
1245
+ $ct=ord($this->_readstream($f,1));
1246
+ if($ct==0)
1247
+ $colspace='DeviceGray';
1248
+ elseif($ct==2)
1249
+ $colspace='DeviceRGB';
1250
+ elseif($ct==3)
1251
+ $colspace='Indexed';
1252
+ else
1253
+ $this->Error('Alpha channel not supported: '.$file);
1254
+ if(ord($this->_readstream($f,1))!=0)
1255
+ $this->Error('Unknown compression method: '.$file);
1256
+ if(ord($this->_readstream($f,1))!=0)
1257
+ $this->Error('Unknown filter method: '.$file);
1258
+ if(ord($this->_readstream($f,1))!=0)
1259
+ $this->Error('Interlacing not supported: '.$file);
1260
+ $this->_readstream($f,4);
1261
+ $parms='/DecodeParms <</Predictor 15 /Colors '.($ct==2 ? 3 : 1).' /BitsPerComponent '.$bpc.' /Columns '.$w.'>>';
1262
+ //Scan chunks looking for palette, transparency and image data
1263
+ $pal='';
1264
+ $trns='';
1265
+ $data='';
1266
+ do
1267
+ {
1268
+ $n=$this->_readint($f);
1269
+ $type=$this->_readstream($f,4);
1270
+ if($type=='PLTE')
1271
+ {
1272
+ //Read palette
1273
+ $pal=$this->_readstream($f,$n);
1274
+ $this->_readstream($f,4);
1275
+ }
1276
+ elseif($type=='tRNS')
1277
+ {
1278
+ //Read transparency info
1279
+ $t=$this->_readstream($f,$n);
1280
+ if($ct==0)
1281
+ $trns=array(ord(substr($t,1,1)));
1282
+ elseif($ct==2)
1283
+ $trns=array(ord(substr($t,1,1)), ord(substr($t,3,1)), ord(substr($t,5,1)));
1284
+ else
1285
+ {
1286
+ $pos=strpos($t,chr(0));
1287
+ if($pos!==false)
1288
+ $trns=array($pos);
1289
+ }
1290
+ $this->_readstream($f,4);
1291
+ }
1292
+ elseif($type=='IDAT')
1293
+ {
1294
+ //Read image data block
1295
+ $data.=$this->_readstream($f,$n);
1296
+ $this->_readstream($f,4);
1297
+ }
1298
+ elseif($type=='IEND')
1299
+ break;
1300
+ else
1301
+ $this->_readstream($f,$n+4);
1302
+ }
1303
+ while($n);
1304
+ if($colspace=='Indexed' && empty($pal))
1305
+ $this->Error('Missing palette in '.$file);
1306
+ fclose($f);
1307
+ return array('w'=>$w, 'h'=>$h, 'cs'=>$colspace, 'bpc'=>$bpc, 'f'=>'FlateDecode', 'parms'=>$parms, 'pal'=>$pal, 'trns'=>$trns, 'data'=>$data);
1308
+ }
1309
+
1310
+ function _readstream($f, $n)
1311
+ {
1312
+ //Read n bytes from stream
1313
+ $res='';
1314
+ while($n>0 && !feof($f))
1315
+ {
1316
+ $s=fread($f,$n);
1317
+ if($s===false)
1318
+ $this->Error('Error while reading stream');
1319
+ $n-=strlen($s);
1320
+ $res.=$s;
1321
+ }
1322
+ if($n>0)
1323
+ $this->Error('Unexpected end of stream');
1324
+ return $res;
1325
+ }
1326
+
1327
+ function _readint($f)
1328
+ {
1329
+ //Read a 4-byte integer from stream
1330
+ $a=unpack('Ni',$this->_readstream($f,4));
1331
+ return $a['i'];
1332
+ }
1333
+
1334
+ function _parsegif($file)
1335
+ {
1336
+ //Extract info from a GIF file (via PNG conversion)
1337
+ if(!function_exists('imagepng'))
1338
+ $this->Error('GD extension is required for GIF support');
1339
+ if(!function_exists('imagecreatefromgif'))
1340
+ $this->Error('GD has no GIF read support');
1341
+ $im=imagecreatefromgif($file);
1342
+ if(!$im)
1343
+ $this->Error('Missing or incorrect image file: '.$file);
1344
+ imageinterlace($im,0);
1345
+ $tmp=tempnam('.','gif');
1346
+ if(!$tmp)
1347
+ $this->Error('Unable to create a temporary file');
1348
+ if(!imagepng($im,$tmp))
1349
+ $this->Error('Error while saving to temporary file');
1350
+ imagedestroy($im);
1351
+ $info=$this->_parsepng($tmp);
1352
+ unlink($tmp);
1353
+ return $info;
1354
+ }
1355
+
1356
+ function _newobj()
1357
+ {
1358
+ //Begin a new object
1359
+ $this->n++;
1360
+ $this->offsets[$this->n]=strlen($this->buffer);
1361
+ $this->_out($this->n.' 0 obj');
1362
+ }
1363
+
1364
+ function _putstream($s)
1365
+ {
1366
+ $this->_out('stream');
1367
+ $this->_out($s);
1368
+ $this->_out('endstream');
1369
+ }
1370
+
1371
+ function _out($s)
1372
+ {
1373
+ //Add a line to the document
1374
+ if($this->state==2)
1375
+ $this->pages[$this->page].=$s."\n";
1376
+ else
1377
+ $this->buffer.=$s."\n";
1378
+ }
1379
+
1380
+ function _putpages()
1381
+ {
1382
+ $nb=$this->page;
1383
+ if(!empty($this->AliasNbPages))
1384
+ {
1385
+ //Replace number of pages
1386
+ for($n=1;$n<=$nb;$n++)
1387
+ $this->pages[$n]=str_replace($this->AliasNbPages,$nb,$this->pages[$n]);
1388
+ }
1389
+ if($this->DefOrientation=='P')
1390
+ {
1391
+ $wPt=$this->DefPageFormat[0]*$this->k;
1392
+ $hPt=$this->DefPageFormat[1]*$this->k;
1393
+ }
1394
+ else
1395
+ {
1396
+ $wPt=$this->DefPageFormat[1]*$this->k;
1397
+ $hPt=$this->DefPageFormat[0]*$this->k;
1398
+ }
1399
+ $filter=($this->compress) ? '/Filter /FlateDecode ' : '';
1400
+ for($n=1;$n<=$nb;$n++)
1401
+ {
1402
+ //Page
1403
+ $this->_newobj();
1404
+ $this->_out('<</Type /Page');
1405
+ $this->_out('/Parent 1 0 R');
1406
+ if(isset($this->PageSizes[$n]))
1407
+ $this->_out(sprintf('/MediaBox [0 0 %.2F %.2F]',$this->PageSizes[$n][0],$this->PageSizes[$n][1]));
1408
+ $this->_out('/Resources 2 0 R');
1409
+ if(isset($this->PageLinks[$n]))
1410
+ {
1411
+ //Links
1412
+ $annots='/Annots [';
1413
+ foreach($this->PageLinks[$n] as $pl)
1414
+ {
1415
+ $rect=sprintf('%.2F %.2F %.2F %.2F',$pl[0],$pl[1],$pl[0]+$pl[2],$pl[1]-$pl[3]);
1416
+ $annots.='<</Type /Annot /Subtype /Link /Rect ['.$rect.'] /Border [0 0 0] ';
1417
+ if(is_string($pl[4]))
1418
+ $annots.='/A <</S /URI /URI '.$this->_textstring($pl[4]).'>>>>';
1419
+ else
1420
+ {
1421
+ $l=$this->links[$pl[4]];
1422
+ $h=isset($this->PageSizes[$l[0]]) ? $this->PageSizes[$l[0]][1] : $hPt;
1423
+ $annots.=sprintf('/Dest [%d 0 R /XYZ 0 %.2F null]>>',1+2*$l[0],$h-$l[1]*$this->k);
1424
+ }
1425
+ }
1426
+ $this->_out($annots.']');
1427
+ }
1428
+ $this->_out('/Contents '.($this->n+1).' 0 R>>');
1429
+ $this->_out('endobj');
1430
+ //Page content
1431
+ $p=($this->compress) ? gzcompress($this->pages[$n]) : $this->pages[$n];
1432
+ $this->_newobj();
1433
+ $this->_out('<<'.$filter.'/Length '.strlen($p).'>>');
1434
+ $this->_putstream($p);
1435
+ $this->_out('endobj');
1436
+ }
1437
+ //Pages root
1438
+ $this->offsets[1]=strlen($this->buffer);
1439
+ $this->_out('1 0 obj');
1440
+ $this->_out('<</Type /Pages');
1441
+ $kids='/Kids [';
1442
+ for($i=0;$i<$nb;$i++)
1443
+ $kids.=(3+2*$i).' 0 R ';
1444
+ $this->_out($kids.']');
1445
+ $this->_out('/Count '.$nb);
1446
+ $this->_out(sprintf('/MediaBox [0 0 %.2F %.2F]',$wPt,$hPt));
1447
+ $this->_out('>>');
1448
+ $this->_out('endobj');
1449
+ }
1450
+
1451
+ function _putfonts()
1452
+ {
1453
+ $nf=$this->n;
1454
+ foreach($this->diffs as $diff)
1455
+ {
1456
+ //Encodings
1457
+ $this->_newobj();
1458
+ $this->_out('<</Type /Encoding /BaseEncoding /WinAnsiEncoding /Differences ['.$diff.']>>');
1459
+ $this->_out('endobj');
1460
+ }
1461
+ foreach($this->FontFiles as $file=>$info)
1462
+ {
1463
+ //Font file embedding
1464
+ $this->_newobj();
1465
+ $this->FontFiles[$file]['n']=$this->n;
1466
+ $font='';
1467
+ $f=fopen($this->_getfontpath().$file,'rb',1);
1468
+ if(!$f)
1469
+ $this->Error('Font file not found');
1470
+ while(!feof($f))
1471
+ $font.=fread($f,8192);
1472
+ fclose($f);
1473
+ $compressed=(substr($file,-2)=='.z');
1474
+ if(!$compressed && isset($info['length2']))
1475
+ {
1476
+ $header=(ord($font[0])==128);
1477
+ if($header)
1478
+ {
1479
+ //Strip first binary header
1480
+ $font=substr($font,6);
1481
+ }
1482
+ if($header && ord($font[$info['length1']])==128)
1483
+ {
1484
+ //Strip second binary header
1485
+ $font=substr($font,0,$info['length1']).substr($font,$info['length1']+6);
1486
+ }
1487
+ }
1488
+ $this->_out('<</Length '.strlen($font));
1489
+ if($compressed)
1490
+ $this->_out('/Filter /FlateDecode');
1491
+ $this->_out('/Length1 '.$info['length1']);
1492
+ if(isset($info['length2']))
1493
+ $this->_out('/Length2 '.$info['length2'].' /Length3 0');
1494
+ $this->_out('>>');
1495
+ $this->_putstream($font);
1496
+ $this->_out('endobj');
1497
+ }
1498
+ foreach($this->fonts as $k=>$font)
1499
+ {
1500
+ //Font objects
1501
+ $this->fonts[$k]['n']=$this->n+1;
1502
+ $type=$font['type'];
1503
+ $name=$font['name'];
1504
+ if($type=='core')
1505
+ {
1506
+ //Standard font
1507
+ $this->_newobj();
1508
+ $this->_out('<</Type /Font');
1509
+ $this->_out('/BaseFont /'.$name);
1510
+ $this->_out('/Subtype /Type1');
1511
+ if($name!='Symbol' && $name!='ZapfDingbats')
1512
+ $this->_out('/Encoding /WinAnsiEncoding');
1513
+ $this->_out('>>');
1514
+ $this->_out('endobj');
1515
+ }
1516
+ elseif($type=='Type1' || $type=='TrueType')
1517
+ {
1518
+ //Additional Type1 or TrueType font
1519
+ $this->_newobj();
1520
+ $this->_out('<</Type /Font');
1521
+ $this->_out('/BaseFont /'.$name);
1522
+ $this->_out('/Subtype /'.$type);
1523
+ $this->_out('/FirstChar 32 /LastChar 255');
1524
+ $this->_out('/Widths '.($this->n+1).' 0 R');
1525
+ $this->_out('/FontDescriptor '.($this->n+2).' 0 R');
1526
+ if($font['enc'])
1527
+ {
1528
+ if(isset($font['diff']))
1529
+ $this->_out('/Encoding '.($nf+$font['diff']).' 0 R');
1530
+ else
1531
+ $this->_out('/Encoding /WinAnsiEncoding');
1532
+ }
1533
+ $this->_out('>>');
1534
+ $this->_out('endobj');
1535
+ //Widths
1536
+ $this->_newobj();
1537
+ $cw=&$font['cw'];
1538
+ $s='[';
1539
+ for($i=32;$i<=255;$i++)
1540
+ $s.=$cw[chr($i)].' ';
1541
+ $this->_out($s.']');
1542
+ $this->_out('endobj');
1543
+ //Descriptor
1544
+ $this->_newobj();
1545
+ $s='<</Type /FontDescriptor /FontName /'.$name;
1546
+ foreach($font['desc'] as $k=>$v)
1547
+ $s.=' /'.$k.' '.$v;
1548
+ $file=$font['file'];
1549
+ if($file)
1550
+ $s.=' /FontFile'.($type=='Type1' ? '' : '2').' '.$this->FontFiles[$file]['n'].' 0 R';
1551
+ $this->_out($s.'>>');
1552
+ $this->_out('endobj');
1553
+ }
1554
+ else
1555
+ {
1556
+ //Allow for additional types
1557
+ $mtd='_put'.strtolower($type);
1558
+ if(!method_exists($this,$mtd))
1559
+ $this->Error('Unsupported font type: '.$type);
1560
+ $this->$mtd($font);
1561
+ }
1562
+ }
1563
+ }
1564
+
1565
+ function _putimages()
1566
+ {
1567
+ $filter=($this->compress) ? '/Filter /FlateDecode ' : '';
1568
+ reset($this->images);
1569
+ while(list($file,$info)=each($this->images))
1570
+ {
1571
+ $this->_newobj();
1572
+ $this->images[$file]['n']=$this->n;
1573
+ $this->_out('<</Type /XObject');
1574
+ $this->_out('/Subtype /Image');
1575
+ $this->_out('/Width '.$info['w']);
1576
+ $this->_out('/Height '.$info['h']);
1577
+ if($info['cs']=='Indexed')
1578
+ $this->_out('/ColorSpace [/Indexed /DeviceRGB '.(strlen($info['pal'])/3-1).' '.($this->n+1).' 0 R]');
1579
+ else
1580
+ {
1581
+ $this->_out('/ColorSpace /'.$info['cs']);
1582
+ if($info['cs']=='DeviceCMYK')
1583
+ $this->_out('/Decode [1 0 1 0 1 0 1 0]');
1584
+ }
1585
+ $this->_out('/BitsPerComponent '.$info['bpc']);
1586
+ if(isset($info['f']))
1587
+ $this->_out('/Filter /'.$info['f']);
1588
+ if(isset($info['parms']))
1589
+ $this->_out($info['parms']);
1590
+ if(isset($info['trns']) && is_array($info['trns']))
1591
+ {
1592
+ $trns='';
1593
+ for($i=0;$i<count($info['trns']);$i++)
1594
+ $trns.=$info['trns'][$i].' '.$info['trns'][$i].' ';
1595
+ $this->_out('/Mask ['.$trns.']');
1596
+ }
1597
+ $this->_out('/Length '.strlen($info['data']).'>>');
1598
+ $this->_putstream($info['data']);
1599
+ unset($this->images[$file]['data']);
1600
+ $this->_out('endobj');
1601
+ //Palette
1602
+ if($info['cs']=='Indexed')
1603
+ {
1604
+ $this->_newobj();
1605
+ $pal=($this->compress) ? gzcompress($info['pal']) : $info['pal'];
1606
+ $this->_out('<<'.$filter.'/Length '.strlen($pal).'>>');
1607
+ $this->_putstream($pal);
1608
+ $this->_out('endobj');
1609
+ }
1610
+ }
1611
+ }
1612
+
1613
+ function _putxobjectdict()
1614
+ {
1615
+ foreach($this->images as $image)
1616
+ $this->_out('/I'.$image['i'].' '.$image['n'].' 0 R');
1617
+ }
1618
+
1619
+ function _putresourcedict()
1620
+ {
1621
+ $this->_out('/ProcSet [/PDF /Text /ImageB /ImageC /ImageI]');
1622
+ $this->_out('/Font <<');
1623
+ foreach($this->fonts as $font)
1624
+ $this->_out('/F'.$font['i'].' '.$font['n'].' 0 R');
1625
+ $this->_out('>>');
1626
+ $this->_out('/XObject <<');
1627
+ $this->_putxobjectdict();
1628
+ $this->_out('>>');
1629
+ }
1630
+
1631
+ function _putresources()
1632
+ {
1633
+ $this->_putfonts();
1634
+ $this->_putimages();
1635
+ //Resource dictionary
1636
+ $this->offsets[2]=strlen($this->buffer);
1637
+ $this->_out('2 0 obj');
1638
+ $this->_out('<<');
1639
+ $this->_putresourcedict();
1640
+ $this->_out('>>');
1641
+ $this->_out('endobj');
1642
+ }
1643
+
1644
+ function _putinfo()
1645
+ {
1646
+ $this->_out('/Producer '.$this->_textstring('FPDF '.FPDF_VERSION));
1647
+ if(!empty($this->title))
1648
+ $this->_out('/Title '.$this->_textstring($this->title));
1649
+ if(!empty($this->subject))
1650
+ $this->_out('/Subject '.$this->_textstring($this->subject));
1651
+ if(!empty($this->author))
1652
+ $this->_out('/Author '.$this->_textstring($this->author));
1653
+ if(!empty($this->keywords))
1654
+ $this->_out('/Keywords '.$this->_textstring($this->keywords));
1655
+ if(!empty($this->creator))
1656
+ $this->_out('/Creator '.$this->_textstring($this->creator));
1657
+ $this->_out('/CreationDate '.$this->_textstring('D:'.@date('YmdHis')));
1658
+ }
1659
+
1660
+ function _putcatalog()
1661
+ {
1662
+ $this->_out('/Type /Catalog');
1663
+ $this->_out('/Pages 1 0 R');
1664
+ if($this->ZoomMode=='fullpage')
1665
+ $this->_out('/OpenAction [3 0 R /Fit]');
1666
+ elseif($this->ZoomMode=='fullwidth')
1667
+ $this->_out('/OpenAction [3 0 R /FitH null]');
1668
+ elseif($this->ZoomMode=='real')
1669
+ $this->_out('/OpenAction [3 0 R /XYZ null null 1]');
1670
+ elseif(!is_string($this->ZoomMode))
1671
+ $this->_out('/OpenAction [3 0 R /XYZ null null '.($this->ZoomMode/100).']');
1672
+ if($this->LayoutMode=='single')
1673
+ $this->_out('/PageLayout /SinglePage');
1674
+ elseif($this->LayoutMode=='continuous')
1675
+ $this->_out('/PageLayout /OneColumn');
1676
+ elseif($this->LayoutMode=='two')
1677
+ $this->_out('/PageLayout /TwoColumnLeft');
1678
+ }
1679
+
1680
+ function _putheader()
1681
+ {
1682
+ $this->_out('%PDF-'.$this->PDFVersion);
1683
+ }
1684
+
1685
+ function _puttrailer()
1686
+ {
1687
+ $this->_out('/Size '.($this->n+1));
1688
+ $this->_out('/Root '.$this->n.' 0 R');
1689
+ $this->_out('/Info '.($this->n-1).' 0 R');
1690
+ }
1691
+
1692
+ function _enddoc()
1693
+ {
1694
+ $this->_putheader();
1695
+ $this->_putpages();
1696
+ $this->_putresources();
1697
+ //Info
1698
+ $this->_newobj();
1699
+ $this->_out('<<');
1700
+ $this->_putinfo();
1701
+ $this->_out('>>');
1702
+ $this->_out('endobj');
1703
+ //Catalog
1704
+ $this->_newobj();
1705
+ $this->_out('<<');
1706
+ $this->_putcatalog();
1707
+ $this->_out('>>');
1708
+ $this->_out('endobj');
1709
+ //Cross-ref
1710
+ $o=strlen($this->buffer);
1711
+ $this->_out('xref');
1712
+ $this->_out('0 '.($this->n+1));
1713
+ $this->_out('0000000000 65535 f ');
1714
+ for($i=1;$i<=$this->n;$i++)
1715
+ $this->_out(sprintf('%010d 00000 n ',$this->offsets[$i]));
1716
+ //Trailer
1717
+ $this->_out('trailer');
1718
+ $this->_out('<<');
1719
+ $this->_puttrailer();
1720
+ $this->_out('>>');
1721
+ $this->_out('startxref');
1722
+ $this->_out($o);
1723
+ $this->_out('%%EOF');
1724
+ $this->state=3;
1725
+ }
1726
+ //End of class
1727
+ }
1728
+
1729
+ //Handle special IE contype request
1730
+ if(isset($_SERVER['HTTP_USER_AGENT']) && $_SERVER['HTTP_USER_AGENT']=='contype')
1731
+ {
1732
+ header('Content-Type: application/pdf');
1733
+ exit;
1734
+ }
1735
+
1736
+ ?>
lib/fpdf/license.txt ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
1
+ Permission is hereby granted, free of charge, to any person obtaining a copy
2
+ of this software to use, copy, modify, distribute, sublicense, and/or sell
3
+ copies of the software, and to permit persons to whom the software is furnished
4
+ to do so.
5
+
6
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED.
lib/fpdi/filters/FilterASCII85.php ADDED
@@ -0,0 +1,98 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ //
3
+ // FPDI - Version 1.3.1
4
+ //
5
+ // Copyright 2004-2009 Setasign - Jan Slabon
6
+ //
7
+ // Licensed under the Apache License, Version 2.0 (the "License");
8
+ // you may not use this file except in compliance with the License.
9
+ // You may obtain a copy of the License at
10
+ //
11
+ // http://www.apache.org/licenses/LICENSE-2.0
12
+ //
13
+ // Unless required by applicable law or agreed to in writing, software
14
+ // distributed under the License is distributed on an "AS IS" BASIS,
15
+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16
+ // See the License for the specific language governing permissions and
17
+ // limitations under the License.
18
+ //
19
+
20
+ if (!defined('ORD_z'))
21
+ define('ORD_z',ord('z'));
22
+ if (!defined('ORD_exclmark'))
23
+ define('ORD_exclmark', ord('!'));
24
+ if (!defined('ORD_u'))
25
+ define('ORD_u', ord('u'));
26
+ if (!defined('ORD_tilde'))
27
+ define('ORD_tilde', ord('~'));
28
+
29
+ class FilterASCII85 {
30
+
31
+ function error($msg) {
32
+ die($msg);
33
+ }
34
+
35
+ function decode($in) {
36
+ $out = '';
37
+ $state = 0;
38
+ $chn = null;
39
+
40
+ $l = strlen($in);
41
+
42
+ for ($k = 0; $k < $l; ++$k) {
43
+ $ch = ord($in[$k]) & 0xff;
44
+
45
+ if ($ch == ORD_tilde) {
46
+ break;
47
+ }
48
+ if (preg_match('/^\s$/',chr($ch))) {
49
+ continue;
50
+ }
51
+ if ($ch == ORD_z && $state == 0) {
52
+ $out .= chr(0).chr(0).chr(0).chr(0);
53
+ continue;
54
+ }
55
+ if ($ch < ORD_exclmark || $ch > ORD_u) {
56
+ $this->error('Illegal character in ASCII85Decode.');
57
+ }
58
+
59
+ $chn[$state++] = $ch - ORD_exclmark;
60
+
61
+ if ($state == 5) {
62
+ $state = 0;
63
+ $r = 0;
64
+ for ($j = 0; $j < 5; ++$j)
65
+ $r = $r * 85 + $chn[$j];
66
+ $out .= chr($r >> 24);
67
+ $out .= chr($r >> 16);
68
+ $out .= chr($r >> 8);
69
+ $out .= chr($r);
70
+ }
71
+ }
72
+ $r = 0;
73
+
74
+ if ($state == 1)
75
+ $this->error('Illegal length in ASCII85Decode.');
76
+ if ($state == 2) {
77
+ $r = $chn[0] * 85 * 85 * 85 * 85 + ($chn[1]+1) * 85 * 85 * 85;
78
+ $out .= chr($r >> 24);
79
+ }
80
+ else if ($state == 3) {
81
+ $r = $chn[0] * 85 * 85 * 85 * 85 + $chn[1] * 85 * 85 * 85 + ($chn[2]+1) * 85 * 85;
82
+ $out .= chr($r >> 24);
83
+ $out .= chr($r >> 16);
84
+ }
85
+ else if ($state == 4) {
86
+ $r = $chn[0] * 85 * 85 * 85 * 85 + $chn[1] * 85 * 85 * 85 + $chn[2] * 85 * 85 + ($chn[3]+1) * 85 ;
87
+ $out .= chr($r >> 24);
88
+ $out .= chr($r >> 16);
89
+ $out .= chr($r >> 8);
90
+ }
91
+
92
+ return $out;
93
+ }
94
+
95
+ function encode($in) {
96
+ $this->error("ASCII85 encoding not implemented.");
97
+ }
98
+ }
lib/fpdi/filters/FilterASCII85_FPDI.php ADDED
@@ -0,0 +1,33 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ //
3
+ // FPDI - Version 1.3.1
4
+ //
5
+ // Copyright 2004-2009 Setasign - Jan Slabon
6
+ //
7
+ // Licensed under the Apache License, Version 2.0 (the "License");
8
+ // you may not use this file except in compliance with the License.
9
+ // You may obtain a copy of the License at
10
+ //
11
+ // http://www.apache.org/licenses/LICENSE-2.0
12
+ //
13
+ // Unless required by applicable law or agreed to in writing, software
14
+ // distributed under the License is distributed on an "AS IS" BASIS,
15
+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16
+ // See the License for the specific language governing permissions and
17
+ // limitations under the License.
18
+ //
19
+
20
+ require_once('FilterASCII85.php');
21
+
22
+ class FilterASCII85_FPDI extends FilterASCII85 {
23
+
24
+ var $fpdi;
25
+
26
+ function FPDI_FilterASCII85(&$fpdi) {
27
+ $this->fpdi =& $fpdi;
28
+ }
29
+
30
+ function error($msg) {
31
+ $this->fpdi->error($msg);
32
+ }
33
+ }
lib/fpdi/filters/FilterLZW.php ADDED
@@ -0,0 +1,154 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ //
3
+ // FPDI - Version 1.3.1
4
+ //
5
+ // Copyright 2004-2009 Setasign - Jan Slabon
6
+ //
7
+ // Licensed under the Apache License, Version 2.0 (the "License");
8
+ // you may not use this file except in compliance with the License.
9
+ // You may obtain a copy of the License at
10
+ //
11
+ // http://www.apache.org/licenses/LICENSE-2.0
12
+ //
13
+ // Unless required by applicable law or agreed to in writing, software
14
+ // distributed under the License is distributed on an "AS IS" BASIS,
15
+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16
+ // See the License for the specific language governing permissions and
17
+ // limitations under the License.
18
+ //
19
+
20
+ class FilterLZW {
21
+
22
+ var $sTable = array();
23
+ var $data = null;
24
+ var $dataLength = 0;
25
+ var $tIdx;
26
+ var $bitsToGet = 9;
27
+ var $bytePointer;
28
+ var $bitPointer;
29
+ var $nextData = 0;
30
+ var $nextBits = 0;
31
+ var $andTable = array(511, 1023, 2047, 4095);
32
+
33
+ function error($msg) {
34
+ die($msg);
35
+ }
36
+
37
+ /**
38
+ * Method to decode LZW compressed data.
39
+ *
40
+ * @param string data The compressed data.
41
+ */
42
+ function decode($data) {
43
+
44
+ if($data[0] == 0x00 && $data[1] == 0x01) {
45
+ $this->error('LZW flavour not supported.');
46
+ }
47
+
48
+ $this->initsTable();
49
+
50
+ $this->data = $data;
51
+ $this->dataLength = strlen($data);
52
+
53
+ // Initialize pointers
54
+ $this->bytePointer = 0;
55
+ $this->bitPointer = 0;
56
+
57
+ $this->nextData = 0;
58
+ $this->nextBits = 0;
59
+
60
+ $oldCode = 0;
61
+
62
+ $string = '';
63
+ $uncompData = '';
64
+
65
+ while (($code = $this->getNextCode()) != 257) {
66
+ if ($code == 256) {
67
+ $this->initsTable();
68
+ $code = $this->getNextCode();
69
+
70
+ if ($code == 257) {
71
+ break;
72
+ }
73
+
74
+ $uncompData .= $this->sTable[$code];
75
+ $oldCode = $code;
76
+
77
+ } else {
78
+
79
+ if ($code < $this->tIdx) {
80
+ $string = $this->sTable[$code];
81
+ $uncompData .= $string;
82
+
83
+ $this->addStringToTable($this->sTable[$oldCode], $string[0]);
84
+ $oldCode = $code;
85
+ } else {
86
+ $string = $this->sTable[$oldCode];
87
+ $string = $string.$string[0];
88
+ $uncompData .= $string;
89
+
90
+ $this->addStringToTable($string);
91
+ $oldCode = $code;
92
+ }
93
+ }
94
+ }
95
+
96
+ return $uncompData;
97
+ }
98
+
99
+
100
+ /**
101
+ * Initialize the string table.
102
+ */
103
+ function initsTable() {
104
+ $this->sTable = array();
105
+
106
+ for ($i = 0; $i < 256; $i++)
107
+ $this->sTable[$i] = chr($i);
108
+
109
+ $this->tIdx = 258;
110
+ $this->bitsToGet = 9;
111
+ }
112
+
113
+ /**
114
+ * Add a new string to the string table.
115
+ */
116
+ function addStringToTable ($oldString, $newString='') {
117
+ $string = $oldString.$newString;
118
+
119
+ // Add this new String to the table
120
+ $this->sTable[$this->tIdx++] = $string;
121
+
122
+ if ($this->tIdx == 511) {
123
+ $this->bitsToGet = 10;
124
+ } else if ($this->tIdx == 1023) {
125
+ $this->bitsToGet = 11;
126
+ } else if ($this->tIdx == 2047) {
127
+ $this->bitsToGet = 12;
128
+ }
129
+ }
130
+
131
+ // Returns the next 9, 10, 11 or 12 bits
132
+ function getNextCode() {
133
+ if ($this->bytePointer == $this->dataLength) {
134
+ return 257;
135
+ }
136
+
137
+ $this->nextData = ($this->nextData << 8) | (ord($this->data[$this->bytePointer++]) & 0xff);
138
+ $this->nextBits += 8;
139
+
140
+ if ($this->nextBits < $this->bitsToGet) {
141
+ $this->nextData = ($this->nextData << 8) | (ord($this->data[$this->bytePointer++]) & 0xff);
142
+ $this->nextBits += 8;
143
+ }
144
+
145
+ $code = ($this->nextData >> ($this->nextBits - $this->bitsToGet)) & $this->andTable[$this->bitsToGet-9];
146
+ $this->nextBits -= $this->bitsToGet;
147
+
148
+ return $code;
149
+ }
150
+
151
+ function encode($in) {
152
+ $this->error("LZW encoding not implemented.");
153
+ }
154
+ }
lib/fpdi/filters/FilterLZW_FPDI.php ADDED
@@ -0,0 +1,33 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ //
3
+ // FPDI - Version 1.3.1
4
+ //
5
+ // Copyright 2004-2009 Setasign - Jan Slabon
6
+ //
7
+ // Licensed under the Apache License, Version 2.0 (the "License");
8
+ // you may not use this file except in compliance with the License.
9
+ // You may obtain a copy of the License at
10
+ //
11
+ // http://www.apache.org/licenses/LICENSE-2.0
12
+ //
13
+ // Unless required by applicable law or agreed to in writing, software
14
+ // distributed under the License is distributed on an "AS IS" BASIS,
15
+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16
+ // See the License for the specific language governing permissions and
17
+ // limitations under the License.
18
+ //
19
+
20
+ require_once('FilterLZW.php');
21
+
22
+ class FilterLZW_FPDI extends FilterLZW {
23
+
24
+ var $fpdi;
25
+
26
+ function FilterLZW_FPDI(&$fpdi) {
27
+ $this->fpdi =& $fpdi;
28
+ }
29
+
30
+ function error($msg) {
31
+ $this->fpdi->error($msg);
32
+ }
33
+ }
lib/fpdi/fpdf_tpl.php ADDED
@@ -0,0 +1,410 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ //
3
+ // FPDF_TPL - Version 1.1.3
4
+ //
5
+ // Copyright 2004-2009 Setasign - Jan Slabon
6
+ //
7
+ // Licensed under the Apache License, Version 2.0 (the "License");
8
+ // you may not use this file except in compliance with the License.
9
+ // You may obtain a copy of the License at
10
+ //
11
+ // http://www.apache.org/licenses/LICENSE-2.0
12
+ //
13
+ // Unless required by applicable law or agreed to in writing, software
14
+ // distributed under the License is distributed on an "AS IS" BASIS,
15
+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16
+ // See the License for the specific language governing permissions and
17
+ // limitations under the License.
18
+ //
19
+
20
+ class FPDF_TPL extends FPDF {
21
+ /**
22
+ * Array of Tpl-Data
23
+ * @var array
24
+ */
25
+ var $tpls = array();
26
+
27
+ /**
28
+ * Current Template-ID
29
+ * @var int
30
+ */
31
+ var $tpl = 0;
32
+
33
+ /**
34
+ * "In Template"-Flag
35
+ * @var boolean
36
+ */
37
+ var $_intpl = false;
38
+
39
+ /**
40
+ * Nameprefix of Templates used in Resources-Dictonary
41
+ * @var string A String defining the Prefix used as Template-Object-Names. Have to beginn with an /
42
+ */
43
+ var $tplprefix = "/TPL";
44
+
45
+ /**
46
+ * Resources used By Templates and Pages
47
+ * @var array
48
+ */
49
+ var $_res = array();
50
+
51
+ /**
52
+ * Last used Template data
53
+ *
54
+ * @var array
55
+ */
56
+ var $lastUsedTemplateData = array();
57
+
58
+ /**
59
+ * Start a Template
60
+ *
61
+ * This method starts a template. You can give own coordinates to build an own sized
62
+ * Template. Pay attention, that the margins are adapted to the new templatesize.
63
+ * If you want to write outside the template, for example to build a clipped Template,
64
+ * you have to set the Margins and "Cursor"-Position manual after beginTemplate-Call.
65
+ *
66
+ * If no parameter is given, the template uses the current page-size.
67
+ * The Method returns an ID of the current Template. This ID is used later for using this template.
68
+ * Warning: A created Template is used in PDF at all events. Still if you don't use it after creation!
69
+ *
70
+ * @param int $x The x-coordinate given in user-unit
71
+ * @param int $y The y-coordinate given in user-unit
72
+ * @param int $w The width given in user-unit
73
+ * @param int $h The height given in user-unit
74
+ * @return int The ID of new created Template
75
+ */
76
+
77
+ function beginTemplate($x=null, $y=null, $w=null, $h=null) {
78
+ if ($this->page <= 0)
79
+ $this->error("You have to add a page to fpdf first!");
80
+
81
+ if ($x == null)
82
+ $x = 0;
83
+ if ($y == null)
84
+ $y = 0;
85
+ if ($w == null)
86
+ $w = $this->w;
87
+ if ($h == null)
88
+ $h = $this->h;
89
+
90
+ // Save settings
91
+ $this->tpl++;
92
+ $tpl =& $this->tpls[$this->tpl];
93
+ $tpl = array(
94
+ 'o_x' => $this->x,
95
+ 'o_y' => $this->y,
96
+ 'o_AutoPageBreak' => $this->AutoPageBreak,
97
+ 'o_bMargin' => $this->bMargin,
98
+ 'o_tMargin' => $this->tMargin,
99
+ 'o_lMargin' => $this->lMargin,
100
+ 'o_rMargin' => $this->rMargin,
101
+ 'o_h' => $this->h,
102
+ 'o_w' => $this->w,
103
+ 'buffer' => '',
104
+ 'x' => $x,
105
+ 'y' => $y,
106
+ 'w' => $w,
107
+ 'h' => $h
108
+ );
109
+
110
+ $this->SetAutoPageBreak(false);
111
+
112
+ // Define own high and width to calculate possitions correct
113
+ $this->h = $h;
114
+ $this->w = $w;
115
+
116
+ $this->_intpl = true;
117
+ $this->SetXY($x+$this->lMargin, $y+$this->tMargin);
118
+ $this->SetRightMargin($this->w-$w+$this->rMargin);
119
+
120
+ return $this->tpl;
121
+ }
122
+
123
+ /**
124
+ * End Template
125
+ *
126
+ * This method ends a template and reset initiated variables on beginTemplate.
127
+ *
128
+ * @return mixed If a template is opened, the ID is returned. If not a false is returned.
129
+ */
130
+ function endTemplate() {
131
+ if ($this->_intpl) {
132
+ $this->_intpl = false;
133
+ $tpl =& $this->tpls[$this->tpl];
134
+ $this->SetXY($tpl['o_x'], $tpl['o_y']);
135
+ $this->tMargin = $tpl['o_tMargin'];
136
+ $this->lMargin = $tpl['o_lMargin'];
137
+ $this->rMargin = $tpl['o_rMargin'];
138
+ $this->h = $tpl['o_h'];
139
+ $this->w = $tpl['o_w'];
140
+ $this->SetAutoPageBreak($tpl['o_AutoPageBreak'], $tpl['o_bMargin']);
141
+
142
+ return $this->tpl;
143
+ } else {
144
+ return false;
145
+ }
146
+ }
147
+
148
+ /**
149
+ * Use a Template in current Page or other Template
150
+ *
151
+ * You can use a template in a page or in another template.
152
+ * You can give the used template a new size like you use the Image()-method.
153
+ * All parameters are optional. The width or height is calculated automaticaly
154
+ * if one is given. If no parameter is given the origin size as defined in
155
+ * beginTemplate() is used.
156
+ * The calculated or used width and height are returned as an array.
157
+ *
158
+ * @param int $tplidx A valid template-Id
159
+ * @param int $_x The x-position
160
+ * @param int $_y The y-position
161
+ * @param int $_w The new width of the template
162
+ * @param int $_h The new height of the template
163
+ * @retrun array The height and width of the template
164
+ */
165
+ function useTemplate($tplidx, $_x=null, $_y=null, $_w=0, $_h=0) {
166
+ if ($this->page <= 0)
167
+ $this->error("You have to add a page to fpdf first!");
168
+
169
+ if (!isset($this->tpls[$tplidx]))
170
+ $this->error("Template does not exist!");
171
+
172
+ if ($this->_intpl) {
173
+ $this->_res['tpl'][$this->tpl]['tpls'][$tplidx] =& $this->tpls[$tplidx];
174
+ }
175
+
176
+ $tpl =& $this->tpls[$tplidx];
177
+ $w = $tpl['w'];
178
+ $h = $tpl['h'];
179
+
180
+ if ($_x == null)
181
+ $_x = 0;
182
+ if ($_y == null)
183
+ $_y = 0;
184
+
185
+ $_x += $tpl['x'];
186
+ $_y += $tpl['y'];
187
+
188
+ $wh = $this->getTemplateSize($tplidx, $_w, $_h);
189
+ $_w = $wh['w'];
190
+ $_h = $wh['h'];
191
+
192
+ $tData = array(
193
+ 'x' => $this->x,
194
+ 'y' => $this->y,
195
+ 'w' => $_w,
196
+ 'h' => $_h,
197
+ 'scaleX' => ($_w/$w),
198
+ 'scaleY' => ($_h/$h),
199
+ 'tx' => $_x,
200
+ 'ty' => ($this->h-$_y-$_h),
201
+ 'lty' => ($this->h-$_y-$_h) - ($this->h-$h) * ($_h/$h)
202
+ );
203
+
204
+ $this->_out(sprintf("q %.4F 0 0 %.4F %.4F %.4F cm", $tData['scaleX'], $tData['scaleY'], $tData['tx']*$this->k, $tData['ty']*$this->k)); // Translate
205
+ $this->_out(sprintf('%s%d Do Q', $this->tplprefix, $tplidx));
206
+
207
+ $this->lastUsedTemplateData = $tData;
208
+ return array("w" => $_w, "h" => $_h);
209
+ }
210
+
211
+ /**
212
+ * Get The calculated Size of a Template
213
+ *
214
+ * If one size is given, this method calculates the other one.
215
+ *
216
+ * @param int $tplidx A valid template-Id
217
+ * @param int $_w The width of the template
218
+ * @param int $_h The height of the template
219
+ * @return array The height and width of the template
220
+ */
221
+ function getTemplateSize($tplidx, $_w=0, $_h=0) {
222
+ if (!$this->tpls[$tplidx])
223
+ return false;
224
+
225
+ $tpl =& $this->tpls[$tplidx];
226
+ $w = $tpl['w'];
227
+ $h = $tpl['h'];
228
+
229
+ if ($_w == 0 and $_h == 0) {
230
+ $_w = $w;
231
+ $_h = $h;
232
+ }
233
+
234
+ if($_w==0)
235
+ $_w = $_h*$w/$h;
236
+ if($_h==0)
237
+ $_h = $_w*$h/$w;
238
+
239
+ return array("w" => $_w, "h" => $_h);
240
+ }
241
+
242
+ /**
243
+ * See FPDF/TCPDF-Documentation ;-)
244
+ */
245
+ function SetFont($family, $style='', $size=0, $fontfile='') {
246
+ if (!is_subclass_of($this, 'TCPDF') && func_num_args() > 3) {
247
+ $this->Error('More than 3 arguments for the SetFont method are only available in TCPDF.');
248
+ }
249
+ /**
250
+ * force the resetting of font changes in a template
251
+ */
252
+ if ($this->_intpl)
253
+ $this->FontFamily = '';
254
+
255
+ parent::SetFont($family, $style, $size, $fontfile);
256
+
257
+ $fontkey = $this->FontFamily.$this->FontStyle;
258
+
259
+ if ($this->_intpl) {
260
+ $this->_res['tpl'][$this->tpl]['fonts'][$fontkey] =& $this->fonts[$fontkey];
261
+ } else {
262
+ $this->_res['page'][$this->page]['fonts'][$fontkey] =& $this->fonts[$fontkey];
263
+ }
264
+ }
265
+
266
+ /**
267
+ * See FPDF/TCPDF-Documentation ;-)
268
+ */
269
+ function Image($file, $x, $y, $w=0, $h=0, $type='', $link='', $align='', $resize=false, $dpi=300, $palign='', $ismask=false, $imgmask=false, $border=0) {
270
+ if (!is_subclass_of($this, 'TCPDF') && func_num_args() > 7) {
271
+ $this->Error('More than 7 arguments for the Image method are only available in TCPDF.');
272
+ }
273
+
274
+ parent::Image($file, $x, $y, $w, $h, $type, $link, $align, $resize, $dpi, $palign, $ismask, $imgmask, $border);
275
+ if ($this->_intpl) {
276
+ $this->_res['tpl'][$this->tpl]['images'][$file] =& $this->images[$file];
277
+ } else {
278
+ $this->_res['page'][$this->page]['images'][$file] =& $this->images[$file];
279
+ }
280
+ }
281
+
282
+ /**
283
+ * See FPDF-Documentation ;-)
284
+ *
285
+ * AddPage is not available when you're "in" a template.
286
+ */
287
+ function AddPage($orientation='', $format='') {
288
+
289
+ if ($this->_intpl)
290
+ $this->Error('Adding pages in templates isn\'t possible!');
291
+ parent::AddPage($orientation, $format);
292
+ }
293
+
294
+ /**
295
+ * Preserve adding Links in Templates ...won't work
296
+ */
297
+ function Link($x, $y, $w, $h, $link, $spaces=0) {
298
+ if (!is_subclass_of($this, 'TCPDF') && func_num_args() > 5) {
299
+ $this->Error('More than 7 arguments for the Image method are only available in TCPDF.');
300
+ }
301
+
302
+ if ($this->_intpl)
303
+ $this->Error('Using links in templates aren\'t possible!');
304
+ parent::Link($x, $y, $w, $h, $link, $spaces);
305
+ }
306
+
307
+ function AddLink() {
308
+ if ($this->_intpl)
309
+ $this->Error('Adding links in templates aren\'t possible!');
310
+ return parent::AddLink();
311
+ }
312
+
313
+ function SetLink($link, $y=0, $page=-1) {
314
+ if ($this->_intpl)
315
+ $this->Error('Setting links in templates aren\'t possible!');
316
+ parent::SetLink($link, $y, $page);
317
+ }
318
+
319
+ /**
320
+ * Private Method that writes the form xobjects
321
+ */
322
+ function _putformxobjects() {
323
+ $filter=($this->compress) ? '/Filter /FlateDecode ' : '';
324
+ reset($this->tpls);
325
+ foreach($this->tpls AS $tplidx => $tpl) {
326
+
327
+ $p=($this->compress) ? gzcompress($tpl['buffer']) : $tpl['buffer'];
328
+ $this->_newobj();
329
+ $this->tpls[$tplidx]['n'] = $this->n;
330
+ $this->_out('<<'.$filter.'/Type /XObject');
331
+ $this->_out('/Subtype /Form');
332
+ $this->_out('/FormType 1');
333
+ $this->_out(sprintf('/BBox [%.2F %.2F %.2F %.2F]',
334
+ // llx
335
+ $tpl['x'],
336
+ // lly
337
+ -$tpl['y'],
338
+ // urx
339
+ ($tpl['w']+$tpl['x'])*$this->k,
340
+ // ury
341
+ ($tpl['h']-$tpl['y'])*$this->k
342
+ ));
343
+
344
+ if ($tpl['x'] != 0 || $tpl['y'] != 0) {
345
+ $this->_out(sprintf('/Matrix [1 0 0 1 %.5F %.5F]',
346
+ -$tpl['x']*$this->k*2, $tpl['y']*$this->k*2
347
+ ));
348
+ }
349
+
350
+ $this->_out('/Resources ');
351
+
352
+ $this->_out('<</ProcSet [/PDF /Text /ImageB /ImageC /ImageI]');
353
+ if (isset($this->_res['tpl'][$tplidx]['fonts']) && count($this->_res['tpl'][$tplidx]['fonts'])) {
354
+ $this->_out('/Font <<');
355
+ foreach($this->_res['tpl'][$tplidx]['fonts'] as $font)
356
+ $this->_out('/F'.$font['i'].' '.$font['n'].' 0 R');
357
+ $this->_out('>>');
358
+ }
359
+ if(isset($this->_res['tpl'][$tplidx]['images']) && count($this->_res['tpl'][$tplidx]['images']) ||
360
+ isset($this->_res['tpl'][$tplidx]['tpls']) && count($this->_res['tpl'][$tplidx]['tpls']))
361
+ {
362
+ $this->_out('/XObject <<');
363
+ if (isset($this->_res['tpl'][$tplidx]['images']) && count($this->_res['tpl'][$tplidx]['images'])) {
364
+ foreach($this->_res['tpl'][$tplidx]['images'] as $image)
365
+ $this->_out('/I'.$image['i'].' '.$image['n'].' 0 R');
366
+ }
367
+ if (isset($this->_res['tpl'][$tplidx]['tpls']) && count($this->_res['tpl'][$tplidx]['tpls'])) {
368
+ foreach($this->_res['tpl'][$tplidx]['tpls'] as $i => $tpl)
369
+ $this->_out($this->tplprefix.$i.' '.$tpl['n'].' 0 R');
370
+ }
371
+ $this->_out('>>');
372
+ }
373
+ $this->_out('>>');
374
+
375
+ $this->_out('/Length '.strlen($p).' >>');
376
+ $this->_putstream($p);
377
+ $this->_out('endobj');
378
+ }
379
+ }
380
+
381
+ /**
382
+ * Overwritten to add _putformxobjects() after _putimages()
383
+ *
384
+ */
385
+ function _putimages() {
386
+ parent::_putimages();
387
+ $this->_putformxobjects();
388
+ }
389
+
390
+ function _putxobjectdict() {
391
+ parent::_putxobjectdict();
392
+
393
+ if (count($this->tpls)) {
394
+ foreach($this->tpls as $tplidx => $tpl) {
395
+ $this->_out(sprintf('%s%d %d 0 R', $this->tplprefix, $tplidx, $tpl['n']));
396
+ }
397
+ }
398
+ }
399
+
400
+ /**
401
+ * Private Method
402
+ */
403
+ function _out($s) {
404
+ if ($this->state==2 && $this->_intpl) {
405
+ $this->tpls[$this->tpl]['buffer'] .= $s."\n";
406
+ } else {
407
+ parent::_out($s);
408
+ }
409
+ }
410
+ }
lib/fpdi/fpdi.php ADDED
@@ -0,0 +1,521 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ //
3
+ // FPDI - Version 1.3.1
4
+ //
5
+ // Copyright 2004-2009 Setasign - Jan Slabon
6
+ //
7
+ // Licensed under the Apache License, Version 2.0 (the "License");
8
+ // you may not use this file except in compliance with the License.
9
+ // You may obtain a copy of the License at
10
+ //
11
+ // http://www.apache.org/licenses/LICENSE-2.0
12
+ //
13
+ // Unless required by applicable law or agreed to in writing, software
14
+ // distributed under the License is distributed on an "AS IS" BASIS,
15
+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16
+ // See the License for the specific language governing permissions and
17
+ // limitations under the License.
18
+ //
19
+
20
+ define('FPDI_VERSION','1.3.1');
21
+
22
+ // Check for TCPDF and remap TCPDF to FPDF
23
+ if (class_exists('TCPDF')) {
24
+ require_once('fpdi2tcpdf_bridge.php');
25
+ }
26
+
27
+ require_once('fpdf_tpl.php');
28
+ require_once('fpdi_pdf_parser.php');
29
+
30
+
31
+ class FPDI extends FPDF_TPL {
32
+ /**
33
+ * Actual filename
34
+ * @var string
35
+ */
36
+ var $current_filename;
37
+
38
+ /**
39
+ * Parser-Objects
40
+ * @var array
41
+ */
42
+ var $parsers;
43
+
44
+ /**
45
+ * Current parser
46
+ * @var object
47
+ */
48
+ var $current_parser;
49
+
50
+ /**
51
+ * object stack
52
+ * @var array
53
+ */
54
+ var $_obj_stack;
55
+
56
+ /**
57
+ * done object stack
58
+ * @var array
59
+ */
60
+ var $_don_obj_stack;
61
+
62
+ /**
63
+ * Current Object Id.
64
+ * @var integer
65
+ */
66
+ var $_current_obj_id;
67
+
68
+ /**
69
+ * The name of the last imported page box
70
+ * @var string
71
+ */
72
+ var $lastUsedPageBox;
73
+
74
+ var $_importedPages = array();
75
+
76
+
77
+ /**
78
+ * Set a source-file
79
+ *
80
+ * @param string $filename a valid filename
81
+ * @return int number of available pages
82
+ */
83
+ function setSourceFile($filename) {
84
+ $this->current_filename = $filename;
85
+ $fn =& $this->current_filename;
86
+
87
+ if (!isset($this->parsers[$fn]))
88
+ $this->parsers[$fn] =& new fpdi_pdf_parser($fn, $this);
89
+ $this->current_parser =& $this->parsers[$fn];
90
+
91
+ return $this->parsers[$fn]->getPageCount();
92
+ }
93
+
94
+ /**
95
+ * Import a page
96
+ *
97
+ * @param int $pageno pagenumber
98
+ * @return int Index of imported page - to use with fpdf_tpl::useTemplate()
99
+ */
100
+ function importPage($pageno, $label, $boxName='/CropBox') {
101
+ if ($this->_intpl) {
102
+ return $this->error('Please import the desired pages before creating a new template.');
103
+ }
104
+
105
+ $fn =& $this->current_filename;
106
+
107
+ // check if page already imported
108
+ $pageKey = $fn.((int)$pageno).$boxName;
109
+ if (isset($this->_importedPages[$pageKey]))
110
+ return $this->_importedPages[$pageKey];
111
+
112
+ $parser =& $this->parsers[$fn];
113
+ $parser->setPageno($pageno);
114
+
115
+ $this->tpl++;
116
+ $this->tpls[$this->tpl] = array();
117
+ $tpl =& $this->tpls[$this->tpl];
118
+ $tpl['parser'] =& $parser;
119
+ $tpl['resources'] = $parser->getPageResources();
120
+ $tpl['buffer'] = $parser->getContent();
121
+
122
+ if (!in_array($boxName, $parser->availableBoxes))
123
+ return $this->Error(sprintf('Unknown box: %s', $boxName));
124
+ $pageboxes = $parser->getPageBoxes($pageno);
125
+
126
+ /**
127
+ * MediaBox
128
+ * CropBox: Default -> MediaBox
129
+ * BleedBox: Default -> CropBox
130
+ * TrimBox: Default -> CropBox
131
+ * ArtBox: Default -> CropBox
132
+ */
133
+ if (!isset($pageboxes[$boxName]) && ($boxName == '/BleedBox' || $boxName == '/TrimBox' || $boxName == '/ArtBox'))
134
+ $boxName = '/CropBox';
135
+ if (!isset($pageboxes[$boxName]) && $boxName == '/CropBox')
136
+ $boxName = '/MediaBox';
137
+
138
+ if (!isset($pageboxes[$boxName]))
139
+ return false;
140
+ $this->lastUsedPageBox = $boxName;
141
+
142
+ $box = $pageboxes[$boxName];
143
+ $tpl['box'] = $box;
144
+
145
+ // To build an array that can be used by PDF_TPL::useTemplate()
146
+ $this->tpls[$this->tpl] = array_merge($this->tpls[$this->tpl],$box);
147
+
148
+ // An imported page will start at 0,0 everytime. Translation will be set in _putformxobjects()
149
+
150
+ if($label == 1) {
151
+ $tpl['x'] = 0;
152
+ $tpl['y'] = 0;
153
+ } elseif($label == 2) {
154
+ $tpl['x'] = 140;
155
+ $tpl['y'] = 0;
156
+ } elseif($label == 3) {
157
+ $tpl['x'] = 0;
158
+ $tpl['y'] = 100;
159
+ } elseif($label == 4) {
160
+ $tpl['x'] = 140;
161
+ $tpl['y'] = 100;
162
+ }
163
+
164
+
165
+ $page =& $parser->pages[$parser->pageno];
166
+
167
+ // handle rotated pages
168
+ $rotation = $parser->getPageRotation($pageno);
169
+ $tpl['_rotationAngle'] = 0;
170
+ if (isset($rotation[1]) && ($angle = $rotation[1] % 360) != 0) {
171
+ $steps = $angle / 90;
172
+
173
+ $_w = $tpl['w'];
174
+ $_h = $tpl['h'];
175
+ $tpl['w'] = $steps % 2 == 0 ? $_w : $_h;
176
+ $tpl['h'] = $steps % 2 == 0 ? $_h : $_w;
177
+
178
+ $tpl['_rotationAngle'] = $angle*-1;
179
+ }
180
+ $this->_importedPages[$pageKey] = $this->tpl;
181
+
182
+ return $this->tpl;
183
+ }
184
+
185
+ function getLastUsedPageBox() {
186
+ return $this->lastUsedPageBox;
187
+ }
188
+
189
+ function useTemplate($tplidx, $_x=null, $_y=null, $_w=0, $_h=0, $adjustPageSize=false) {
190
+ if ($adjustPageSize == true && is_null($_x) && is_null($_y)) {
191
+ $size = $this->getTemplateSize($tplidx, $_w, $_h);
192
+
193
+ $format = array($size['w'], $size['h']);
194
+ if ($format[0]!=$this->CurPageFormat[0] || $format[1]!=$this->CurPageFormat[1]) {
195
+ $this->w=$format[0];
196
+ $this->h=$format[1];
197
+ $this->wPt=$this->w*$this->k;
198
+ $this->hPt=$this->h*$this->k;
199
+ $this->PageBreakTrigger=$this->h-$this->bMargin;
200
+ $this->CurPageFormat=$format;
201
+ $this->PageSizes[$this->page]=array($this->wPt, $this->hPt);
202
+
203
+ }
204
+
205
+ }
206
+
207
+ $this->_out('q 0 J 1 w 0 j 0 G 0 g'); // reset standard values
208
+
209
+ $s = parent::useTemplate($tplidx, $_x, $_y, $_w, $_h);
210
+ $this->_out('Q');
211
+ return $s;
212
+ }
213
+
214
+ /**
215
+ * Private method, that rebuilds all needed objects of source files
216
+ */
217
+ function _putimportedobjects() {
218
+ if (is_array($this->parsers) && count($this->parsers) > 0) {
219
+ foreach($this->parsers AS $filename => $p) {
220
+ $this->current_parser =& $this->parsers[$filename];
221
+ if (isset($this->_obj_stack[$filename]) && is_array($this->_obj_stack[$filename])) {
222
+ while(($n = key($this->_obj_stack[$filename])) !== null) {
223
+ $nObj = $this->current_parser->pdf_resolve_object($this->current_parser->c,$this->_obj_stack[$filename][$n][1]);
224
+
225
+ $this->_newobj($this->_obj_stack[$filename][$n][0]);
226
+
227
+ if ($nObj[0] == PDF_TYPE_STREAM) {
228
+ $this->pdf_write_value ($nObj);
229
+ } else {
230
+ $this->pdf_write_value ($nObj[1]);
231
+ }
232
+
233
+ $this->_out('endobj');
234
+ $this->_obj_stack[$filename][$n] = null; // free memory
235
+ unset($this->_obj_stack[$filename][$n]);
236
+ reset($this->_obj_stack[$filename]);
237
+ }
238
+ }
239
+ }
240
+ }
241
+ }
242
+
243
+
244
+ /**
245
+ * Private Method that writes the form xobjects
246
+ */
247
+ function _putformxobjects() {
248
+ $filter=($this->compress) ? '/Filter /FlateDecode ' : '';
249
+ reset($this->tpls);
250
+ foreach($this->tpls AS $tplidx => $tpl) {
251
+ $p=($this->compress) ? gzcompress($tpl['buffer']) : $tpl['buffer'];
252
+ $this->_newobj();
253
+ $cN = $this->n; // TCPDF/Protection: rem current "n"
254
+
255
+ $this->tpls[$tplidx]['n'] = $this->n;
256
+ $this->_out('<<'.$filter.'/Type /XObject');
257
+ $this->_out('/Subtype /Form');
258
+ $this->_out('/FormType 1');
259
+
260
+ $this->_out(sprintf('/BBox [%.2F %.2F %.2F %.2F]',
261
+ (isset($tpl['box']['llx']) ? $tpl['box']['llx'] : $tpl['x'])*$this->k,
262
+ (isset($tpl['box']['lly']) ? $tpl['box']['lly'] : -$tpl['y'])*$this->k,
263
+ (isset($tpl['box']['urx']) ? $tpl['box']['urx'] : $tpl['w'] + $tpl['x'])*$this->k,
264
+ (isset($tpl['box']['ury']) ? $tpl['box']['ury'] : $tpl['h']-$tpl['y'])*$this->k
265
+ ));
266
+
267
+ $c = 1;
268
+ $s = 0;
269
+ $tx = 0;
270
+ $ty = 0;
271
+
272
+ if (isset($tpl['box'])) {
273
+ $tx = -$tpl['box']['llx'];
274
+ $ty = -$tpl['box']['lly'];
275
+
276
+ if ($tpl['_rotationAngle'] <> 0) {
277
+ $angle = $tpl['_rotationAngle'] * M_PI/180;
278
+ $c=cos($angle);
279
+ $s=sin($angle);
280
+
281
+ switch($tpl['_rotationAngle']) {
282
+ case -90:
283
+ $tx = -$tpl['box']['lly'];
284
+ $ty = $tpl['box']['urx'];
285
+ break;
286
+ case -180:
287
+ $tx = $tpl['box']['urx'];
288
+ $ty = $tpl['box']['ury'];
289
+ break;
290
+ case -270:
291
+ $tx = $tpl['box']['ury'];
292
+ $ty = 0;
293
+ break;
294
+ }
295
+ }
296
+ } else if ($tpl['x'] != 0 || $tpl['y'] != 0) {
297
+ $tx = -$tpl['x']*2;
298
+ $ty = $tpl['y']*2;
299
+ }
300
+
301
+ $tx *= $this->k;
302
+ $ty *= $this->k;
303
+
304
+ if ($c != 1 || $s != 0 || $tx != 0 || $ty != 0) {
305
+ $this->_out(sprintf('/Matrix [%.5F %.5F %.5F %.5F %.5F %.5F]',
306
+ $c, $s, -$s, $c, $tx, $ty
307
+ ));
308
+ }
309
+
310
+ $this->_out('/Resources ');
311
+
312
+ if (isset($tpl['resources'])) {
313
+ $this->current_parser =& $tpl['parser'];
314
+ $this->pdf_write_value($tpl['resources']); // "n" will be changed
315
+ } else {
316
+ $this->_out('<</ProcSet [/PDF /Text /ImageB /ImageC /ImageI]');
317
+ if (isset($this->_res['tpl'][$tplidx]['fonts']) && count($this->_res['tpl'][$tplidx]['fonts'])) {
318
+ $this->_out('/Font <<');
319
+ foreach($this->_res['tpl'][$tplidx]['fonts'] as $font)
320
+ $this->_out('/F'.$font['i'].' '.$font['n'].' 0 R');
321
+ $this->_out('>>');
322
+ }
323
+ if(isset($this->_res['tpl'][$tplidx]['images']) && count($this->_res['tpl'][$tplidx]['images']) ||
324
+ isset($this->_res['tpl'][$tplidx]['tpls']) && count($this->_res['tpl'][$tplidx]['tpls']))
325
+ {
326
+ $this->_out('/XObject <<');
327
+ if (isset($this->_res['tpl'][$tplidx]['images']) && count($this->_res['tpl'][$tplidx]['images'])) {
328
+ foreach($this->_res['tpl'][$tplidx]['images'] as $image)
329
+ $this->_out('/I'.$image['i'].' '.$image['n'].' 0 R');
330
+ }
331
+ if (isset($this->_res['tpl'][$tplidx]['tpls']) && count($this->_res['tpl'][$tplidx]['tpls'])) {
332
+ foreach($this->_res['tpl'][$tplidx]['tpls'] as $i => $tpl)
333
+ $this->_out($this->tplprefix.$i.' '.$tpl['n'].' 0 R');
334
+ }
335
+ $this->_out('>>');
336
+ }
337
+ $this->_out('>>');
338
+ }
339
+
340
+ $nN = $this->n; // TCPDF: rem new "n"
341
+ $this->n = $cN; // TCPDF: reset to current "n"
342
+ $this->_out('/Length '.strlen($p).' >>');
343
+ $this->_putstream($p);
344
+ $this->_out('endobj');
345
+ $this->n = $nN; // TCPDF: reset to new "n"
346
+ }
347
+
348
+ $this->_putimportedobjects();
349
+ }
350
+
351
+ /**
352
+ * Rewritten to handle existing own defined objects
353
+ */
354
+ function _newobj($obj_id=false,$onlynewobj=false) {
355
+ if (!$obj_id) {
356
+ $obj_id = ++$this->n;
357
+ }
358
+
359
+ //Begin a new object
360
+ if (!$onlynewobj) {
361
+ $this->offsets[$obj_id] = is_subclass_of($this, 'TCPDF') ? $this->bufferlen : strlen($this->buffer);
362
+ $this->_out($obj_id.' 0 obj');
363
+ $this->_current_obj_id = $obj_id; // for later use with encryption
364
+ }
365
+ return $obj_id;
366
+ }
367
+
368
+ /**
369
+ * Writes a value
370
+ * Needed to rebuild the source document
371
+ *
372
+ * @param mixed $value A PDF-Value. Structure of values see cases in this method
373
+ */
374
+ function pdf_write_value(&$value)
375
+ {
376
+ if (is_subclass_of($this, 'TCPDF')) {
377
+ parent::pdf_write_value($value);
378
+ }
379
+
380
+ switch ($value[0]) {
381
+
382
+ case PDF_TYPE_TOKEN :
383
+ $this->_straightOut($value[1] . ' ');
384
+ break;
385
+ case PDF_TYPE_NUMERIC :
386
+ case PDF_TYPE_REAL :
387
+ if (is_float($value[1]) && $value[1] != 0) {
388
+ $this->_straightOut(rtrim(rtrim(sprintf('%F', $value[1]), '0'), '.') .' ');
389
+ } else {
390
+ $this->_straightOut($value[1] . ' ');
391
+ }
392
+ break;
393
+
394
+ case PDF_TYPE_ARRAY :
395
+
396
+ // An array. Output the proper
397
+ // structure and move on.
398
+
399
+ $this->_straightOut('[');
400
+ for ($i = 0; $i < count($value[1]); $i++) {
401
+ $this->pdf_write_value($value[1][$i]);
402
+ }
403
+
404
+ $this->_out(']');
405
+ break;
406
+
407
+ case PDF_TYPE_DICTIONARY :
408
+
409
+ // A dictionary.
410
+ $this->_straightOut('<<');
411
+
412
+ reset ($value[1]);
413
+
414
+ while (list($k, $v) = each($value[1])) {
415
+ $this->_straightOut($k . ' ');
416
+ $this->pdf_write_value($v);
417
+ }
418
+
419
+ $this->_straightOut('>>');
420
+ break;
421
+
422
+ case PDF_TYPE_OBJREF :
423
+
424
+ // An indirect object reference
425
+ // Fill the object stack if needed
426
+ $cpfn =& $this->current_parser->filename;
427
+
428
+ if (!isset($this->_don_obj_stack[$cpfn][$value[1]])) {
429
+ $this->_newobj(false,true);
430
+ $this->_obj_stack[$cpfn][$value[1]] = array($this->n, $value);
431
+ $this->_don_obj_stack[$cpfn][$value[1]] = array($this->n, $value); // Value is maybee obsolete!!!
432
+ }
433
+ $objid = $this->_don_obj_stack[$cpfn][$value[1]][0];
434
+
435
+ $this->_out($objid.' 0 R');
436
+ break;
437
+
438
+ case PDF_TYPE_STRING :
439
+
440
+ // A string.
441
+ $this->_straightOut('('.$value[1].')');
442
+
443
+ break;
444
+
445
+ case PDF_TYPE_STREAM :
446
+
447
+ // A stream. First, output the
448
+ // stream dictionary, then the
449
+ // stream data itself.
450
+ $this->pdf_write_value($value[1]);
451
+ $this->_out('stream');
452
+ $this->_out($value[2][1]);
453
+ $this->_out('endstream');
454
+ break;
455
+ case PDF_TYPE_HEX :
456
+ $this->_straightOut('<'.$value[1].'>');
457
+ break;
458
+
459
+ case PDF_TYPE_BOOLEAN :
460
+ $this->_straightOut($value[1] ? 'true ' : 'false ');
461
+ break;
462
+
463
+ case PDF_TYPE_NULL :
464
+ // The null object.
465
+
466
+ $this->_straightOut('null ');
467
+ break;
468
+ }
469
+ }
470
+
471
+
472
+ /**
473
+ * Modified so not each call will add a newline to the output.
474
+ */
475
+ function _straightOut($s) {
476
+ if (!is_subclass_of($this, 'TCPDF')) {
477
+ if($this->state==2)
478
+ $this->pages[$this->page] .= $s;
479
+ else
480
+ $this->buffer .= $s;
481
+ } else {
482
+ if ($this->state == 2) {
483
+ if (isset($this->footerlen[$this->page]) AND ($this->footerlen[$this->page] > 0)) {
484
+ // puts data before page footer
485
+ $page = substr($this->getPageBuffer($this->page), 0, -$this->footerlen[$this->page]);
486
+ $footer = substr($this->getPageBuffer($this->page), -$this->footerlen[$this->page]);
487
+ $this->setPageBuffer($this->page, $page.' '.$s."\n".$footer);
488
+ } else {
489
+ $this->setPageBuffer($this->page, $s, true);
490
+ }
491
+ } else {
492
+ $this->setBuffer($s);
493
+ }
494
+ }
495
+ }
496
+
497
+ /**
498
+ * rewritten to close opened parsers
499
+ *
500
+ */
501
+ function _enddoc() {
502
+ parent::_enddoc();
503
+ $this->_closeParsers();
504
+ }
505
+
506
+ /**
507
+ * close all files opened by parsers
508
+ */
509
+ function _closeParsers() {
510
+ if ($this->state > 2 && count($this->parsers) > 0) {
511
+ foreach ($this->parsers as $k => $_){
512
+ $this->parsers[$k]->closeFile();
513
+ $this->parsers[$k] = null;
514
+ unset($this->parsers[$k]);
515
+ }
516
+ return true;
517
+ }
518
+ return false;
519
+ }
520
+
521
+ }
lib/fpdi/fpdi2tcpdf_bridge.php ADDED
@@ -0,0 +1,171 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ //
3
+ // FPDI - Version 1.3.1
4
+ //
5
+ // Copyright 2004-2009 Setasign - Jan Slabon
6
+ //
7
+ // Licensed under the Apache License, Version 2.0 (the "License");
8
+ // you may not use this file except in compliance with the License.
9
+ // You may obtain a copy of the License at
10
+ //
11
+ // http://www.apache.org/licenses/LICENSE-2.0
12
+ //
13
+ // Unless required by applicable law or agreed to in writing, software
14
+ // distributed under the License is distributed on an "AS IS" BASIS,
15
+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16
+ // See the License for the specific language governing permissions and
17
+ // limitations under the License.
18
+ //
19
+
20
+ /**
21
+ * This class is used as a bridge between TCPDF and FPDI
22
+ * and will create the possibility to use both FPDF and TCPDF
23
+ * via one FPDI version.
24
+ *
25
+ * We'll simply remap TCPDF to FPDF again.
26
+ *
27
+ * It'll be loaded and extended by FPDF_TPL.
28
+ */
29
+ class FPDF extends TCPDF {
30
+
31
+ function __get($name) {
32
+ switch ($name) {
33
+ case 'PDFVersion':
34
+ return $this->PDFVersion;
35
+ case 'k':
36
+ return $this->k;
37
+ default:
38
+ // Error handling
39
+ $this->Error('Cannot access protected property '.get_class($this).':$'.$name.' / Undefined property: '.get_class($this).'::$'.$name);
40
+ }
41
+ }
42
+
43
+ function __set($name, $value) {
44
+ switch ($name) {
45
+ case 'PDFVersion':
46
+ $this->PDFVersion = $value;
47
+ break;
48
+ default:
49
+ // Error handling
50
+ $this->Error('Cannot access protected property '.get_class($this).':$'.$name.' / Undefined property: '.get_class($this).'::$'.$name);
51
+ }
52
+ }
53
+
54
+ /**
55
+ * Encryption of imported data by FPDI
56
+ *
57
+ * @param array $value
58
+ */
59
+ function pdf_write_value(&$value) {
60
+ switch ($value[0]) {
61
+ case PDF_TYPE_STRING :
62
+ if ($this->encrypted) {
63
+ $value[1] = $this->_unescape($value[1]);
64
+ $value[1] = $this->_RC4($this->_objectkey($this->_current_obj_id), $value[1]);
65
+ $value[1] = $this->_escape($value[1]);
66
+ }
67
+ break;
68
+
69
+ case PDF_TYPE_STREAM :
70
+ if ($this->encrypted) {
71
+ $value[2][1] = $this->_RC4($this->_objectkey($this->_current_obj_id), $value[2][1]);
72
+ }
73
+ break;
74
+
75
+ case PDF_TYPE_HEX :
76
+ if ($this->encrypted) {
77
+ $value[1] = $this->hex2str($value[1]);
78
+ $value[1] = $this->_RC4($this->_objectkey($this->_current_obj_id), $value[1]);
79
+
80
+ // remake hexstring of encrypted string
81
+ $value[1] = $this->str2hex($value[1]);
82
+ }
83
+ break;
84
+ }
85
+ }
86
+
87
+ /**
88
+ * Unescapes a PDF string
89
+ *
90
+ * @param string $s
91
+ * @return string
92
+ */
93
+ function _unescape($s) {
94
+ $out = '';
95
+ for ($count = 0, $n = strlen($s); $count < $n; $count++) {
96
+ if ($s[$count] != '\\' || $count == $n-1) {
97
+ $out .= $s[$count];
98
+ } else {
99
+ switch ($s[++$count]) {
100
+ case ')':
101
+ case '(':
102
+ case '\\':
103
+ $out .= $s[$count];
104
+ break;
105
+ case 'f':
106
+ $out .= chr(0x0C);
107
+ break;
108
+ case 'b':
109
+ $out .= chr(0x08);
110
+ break;
111
+ case 't':
112
+ $out .= chr(0x09);
113
+ break;
114
+ case 'r':
115
+ $out .= chr(0x0D);
116
+ break;
117
+ case 'n':
118
+ $out .= chr(0x0A);
119
+ break;
120
+ case "\r":
121
+ if ($count != $n-1 && $s[$count+1] == "\n")
122
+ $count++;
123
+ break;
124
+ case "\n":
125
+ break;
126
+ default:
127
+ // Octal-Values
128
+ if (ord($s[$count]) >= ord('0') &&
129
+ ord($s[$count]) <= ord('9')) {
130
+ $oct = ''. $s[$count];
131
+
132
+ if (ord($s[$count+1]) >= ord('0') &&
133
+ ord($s[$count+1]) <= ord('9')) {
134
+ $oct .= $s[++$count];
135
+
136
+ if (ord($s[$count+1]) >= ord('0') &&
137
+ ord($s[$count+1]) <= ord('9')) {
138
+ $oct .= $s[++$count];
139
+ }
140
+ }
141
+
142
+ $out .= chr(octdec($oct));
143
+ } else {
144
+ $out .= $s[$count];
145
+ }
146
+ }
147
+ }
148
+ }
149
+ return $out;
150
+ }
151
+
152
+ /**
153
+ * Hexadecimal to string
154
+ *
155
+ * @param string $hex
156
+ * @return string
157
+ */
158
+ function hex2str($hex) {
159
+ return pack('H*', str_replace(array("\r", "\n", ' '), '', $hex));
160
+ }
161
+
162
+ /**
163
+ * String to hexadecimal
164
+ *
165
+ * @param string $str
166
+ * @return string
167
+ */
168
+ function str2hex($str) {
169
+ return current(unpack('H*', $str));
170
+ }
171
+ }
lib/fpdi/fpdi_pdf_parser.php ADDED
@@ -0,0 +1,384 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ //
3
+ // FPDI - Version 1.3.1
4
+ //
5
+ // Copyright 2004-2009 Setasign - Jan Slabon
6
+ //
7
+ // Licensed under the Apache License, Version 2.0 (the "License");
8
+ // you may not use this file except in compliance with the License.
9
+ // You may obtain a copy of the License at
10
+ //
11
+ // http://www.apache.org/licenses/LICENSE-2.0
12
+ //
13
+ // Unless required by applicable law or agreed to in writing, software
14
+ // distributed under the License is distributed on an "AS IS" BASIS,
15
+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16
+ // See the License for the specific language governing permissions and
17
+ // limitations under the License.
18
+ //
19
+
20
+ require_once('pdf_parser.php');
21
+
22
+ class fpdi_pdf_parser extends pdf_parser {
23
+
24
+ /**
25
+ * Pages
26
+ * Index beginns at 0
27
+ *
28
+ * @var array
29
+ */
30
+ var $pages;
31
+
32
+ /**
33
+ * Page count
34
+ * @var integer
35
+ */
36
+ var $page_count;
37
+
38
+ /**
39
+ * actual page number
40
+ * @var integer
41
+ */
42
+ var $pageno;
43
+
44
+ /**
45
+ * PDF Version of imported Document
46
+ * @var string
47
+ */
48
+ var $pdfVersion;
49
+
50
+ /**
51
+ * FPDI Reference
52
+ * @var object
53
+ */
54
+ var $fpdi;
55
+
56
+ /**
57
+ * Available BoxTypes
58
+ *
59
+ * @var array
60
+ */
61
+ var $availableBoxes = array('/MediaBox', '/CropBox', '/BleedBox', '/TrimBox', '/ArtBox');
62
+
63
+ /**
64
+ * Constructor
65
+ *
66
+ * @param string $filename Source-Filename
67
+ * @param object $fpdi Object of type fpdi
68
+ */
69
+ function fpdi_pdf_parser($filename, &$fpdi) {
70
+ $this->fpdi =& $fpdi;
71
+
72
+ parent::pdf_parser($filename);
73
+
74
+ // resolve Pages-Dictonary
75
+ $pages = $this->pdf_resolve_object($this->c, $this->root[1][1]['/Pages']);
76
+
77
+ // Read pages
78
+ $this->read_pages($this->c, $pages, $this->pages);
79
+
80
+ // count pages;
81
+ $this->page_count = count($this->pages);
82
+ }
83
+
84
+ /**
85
+ * Overwrite parent::error()
86
+ *
87
+ * @param string $msg Error-Message
88
+ */
89
+ function error($msg) {
90
+ $this->fpdi->error($msg);
91
+ }
92
+
93
+ /**
94
+ * Get pagecount from sourcefile
95
+ *
96
+ * @return int
97
+ */
98
+ function getPageCount() {
99
+ return $this->page_count;
100
+ }
101
+
102
+
103
+ /**
104
+ * Set pageno
105
+ *
106
+ * @param int $pageno Pagenumber to use
107
+ */
108
+ function setPageno($pageno) {
109
+ $pageno = ((int) $pageno) - 1;
110
+
111
+ if ($pageno < 0 || $pageno >= $this->getPageCount()) {
112
+ $this->fpdi->error('Pagenumber is wrong!');
113
+ }
114
+
115
+ $this->pageno = $pageno;
116
+ }
117
+
118
+ /**
119
+ * Get page-resources from current page
120
+ *
121
+ * @return array
122
+ */
123
+ function getPageResources() {
124
+ return $this->_getPageResources($this->pages[$this->pageno]);
125
+ }
126
+
127
+ /**
128
+ * Get page-resources from /Page
129
+ *
130
+ * @param array $obj Array of pdf-data
131
+ */
132
+ function _getPageResources ($obj) { // $obj = /Page
133
+ $obj = $this->pdf_resolve_object($this->c, $obj);
134
+
135
+ // If the current object has a resources
136
+ // dictionary associated with it, we use
137
+ // it. Otherwise, we move back to its
138
+ // parent object.
139
+ if (isset ($obj[1][1]['/Resources'])) {
140
+ $res = $this->pdf_resolve_object($this->c, $obj[1][1]['/Resources']);
141
+ if ($res[0] == PDF_TYPE_OBJECT)
142
+ return $res[1];
143
+ return $res;
144
+ } else {
145
+ if (!isset ($obj[1][1]['/Parent'])) {
146
+ return false;
147
+ } else {
148
+ $res = $this->_getPageResources($obj[1][1]['/Parent']);
149
+ if ($res[0] == PDF_TYPE_OBJECT)
150
+ return $res[1];
151
+ return $res;
152
+ }
153
+ }
154
+ }
155
+
156
+
157
+ /**
158
+ * Get content of current page
159
+ *
160
+ * If more /Contents is an array, the streams are concated
161
+ *
162
+ * @return string
163
+ */
164
+ function getContent() {
165
+ $buffer = '';
166
+
167
+ if (isset($this->pages[$this->pageno][1][1]['/Contents'])) {
168
+ $contents = $this->_getPageContent($this->pages[$this->pageno][1][1]['/Contents']);
169
+ foreach($contents AS $tmp_content) {
170
+ $buffer .= $this->_rebuildContentStream($tmp_content).' ';
171
+ }
172
+ }
173
+
174
+ return $buffer;
175
+ }
176
+
177
+
178
+ /**
179
+ * Resolve all content-objects
180
+ *
181
+ * @param array $content_ref
182
+ * @return array
183
+ */
184
+ function _getPageContent($content_ref) {
185
+ $contents = array();
186
+
187
+ if ($content_ref[0] == PDF_TYPE_OBJREF) {
188
+ $content = $this->pdf_resolve_object($this->c, $content_ref);
189
+ if ($content[1][0] == PDF_TYPE_ARRAY) {
190
+ $contents = $this->_getPageContent($content[1]);
191
+ } else {
192
+ $contents[] = $content;
193
+ }
194
+ } else if ($content_ref[0] == PDF_TYPE_ARRAY) {
195
+ foreach ($content_ref[1] AS $tmp_content_ref) {
196
+ $contents = array_merge($contents,$this->_getPageContent($tmp_content_ref));
197
+ }
198
+ }
199
+
200
+ return $contents;
201
+ }
202
+
203
+
204
+ /**
205
+ * Rebuild content-streams
206
+ *
207
+ * @param array $obj
208
+ * @return string
209
+ */
210
+ function _rebuildContentStream($obj) {
211
+ $filters = array();
212
+
213
+ if (isset($obj[1][1]['/Filter'])) {
214
+ $_filter = $obj[1][1]['/Filter'];
215
+
216
+ if ($_filter[0] == PDF_TYPE_TOKEN) {
217
+ $filters[] = $_filter;
218
+ } else if ($_filter[0] == PDF_TYPE_ARRAY) {
219
+ $filters = $_filter[1];
220
+ }
221
+ }
222
+
223
+ $stream = $obj[2][1];
224
+
225
+ foreach ($filters AS $_filter) {
226
+ switch ($_filter[1]) {
227
+ case '/FlateDecode':
228
+ if (function_exists('gzuncompress')) {
229
+ $stream = (strlen($stream) > 0) ? @gzuncompress($stream) : '';
230
+ } else {
231
+ $this->error(sprintf('To handle %s filter, please compile php with zlib support.',$_filter[1]));
232
+ }
233
+ if ($stream === false) {
234
+ $this->error('Error while decompressing stream.');
235
+ }
236
+ break;
237
+ case '/LZWDecode':
238
+ include_once('filters/FilterLZW_FPDI.php');
239
+ $decoder =& new FilterLZW_FPDI($this->fpdi);
240
+ $stream = $decoder->decode($stream);
241
+ break;
242
+ case '/ASCII85Decode':
243
+ include_once('filters/FilterASCII85_FPDI.php');
244
+ $decoder =& new FilterASCII85_FPDI($this->fpdi);
245
+ $stream = $decoder->decode($stream);
246
+ break;
247
+ case null:
248
+ $stream = $stream;
249
+ break;
250
+ default:
251
+ $this->error(sprintf('Unsupported Filter: %s',$_filter[1]));
252
+ }
253
+ }
254
+
255
+ return $stream;
256
+ }
257
+
258
+
259
+ /**
260
+ * Get a Box from a page
261
+ * Arrayformat is same as used by fpdf_tpl
262
+ *
263
+ * @param array $page a /Page
264
+ * @param string $box_index Type of Box @see $availableBoxes
265
+ * @return array
266
+ */
267
+ function getPageBox($page, $box_index) {
268
+ $page = $this->pdf_resolve_object($this->c,$page);
269
+ $box = null;
270
+ if (isset($page[1][1][$box_index]))
271
+ $box =& $page[1][1][$box_index];
272
+
273
+ if (!is_null($box) && $box[0] == PDF_TYPE_OBJREF) {
274
+ $tmp_box = $this->pdf_resolve_object($this->c,$box);
275
+ $box = $tmp_box[1];
276
+ }
277
+
278
+ if (!is_null($box) && $box[0] == PDF_TYPE_ARRAY) {
279
+ $b =& $box[1];
280
+ return array('x' => $b[0][1]/$this->fpdi->k,
281
+ 'y' => $b[1][1]/$this->fpdi->k,
282
+ 'w' => abs($b[0][1]-$b[2][1])/$this->fpdi->k,
283
+ 'h' => abs($b[1][1]-$b[3][1])/$this->fpdi->k,
284
+ 'llx' => min($b[0][1], $b[2][1])/$this->fpdi->k,
285
+ 'lly' => min($b[1][1], $b[3][1])/$this->fpdi->k,
286
+ 'urx' => max($b[0][1], $b[2][1])/$this->fpdi->k,
287
+ 'ury' => max($b[1][1], $b[3][1])/$this->fpdi->k,
288
+ );
289
+ } else if (!isset ($page[1][1]['/Parent'])) {
290
+ return false;
291
+ } else {
292
+ return $this->getPageBox($this->pdf_resolve_object($this->c, $page[1][1]['/Parent']), $box_index);
293
+ }
294
+ }
295
+
296
+ function getPageBoxes($pageno) {
297
+ return $this->_getPageBoxes($this->pages[$pageno-1]);
298
+ }
299
+
300
+ /**
301
+ * Get all Boxes from /Page
302
+ *
303
+ * @param array a /Page
304
+ * @return array
305
+ */
306
+ function _getPageBoxes($page) {
307
+ $boxes = array();
308
+
309
+ foreach($this->availableBoxes AS $box) {
310
+ if ($_box = $this->getPageBox($page,$box)) {
311
+ $boxes[$box] = $_box;
312
+ }
313
+ }
314
+
315
+ return $boxes;
316
+ }
317
+
318
+ /**
319
+ * Get the page rotation by pageno
320
+ *
321
+ * @param integer $pageno
322
+ * @return array
323
+ */
324
+ function getPageRotation($pageno) {
325
+ return $this->_getPageRotation($this->pages[$pageno-1]);
326
+ }
327
+
328
+ function _getPageRotation ($obj) { // $obj = /Page
329
+ $obj = $this->pdf_resolve_object($this->c, $obj);
330
+ if (isset ($obj[1][1]['/Rotate'])) {
331
+ $res = $this->pdf_resolve_object($this->c, $obj[1][1]['/Rotate']);
332
+ if ($res[0] == PDF_TYPE_OBJECT)
333
+ return $res[1];
334
+ return $res;
335
+ } else {
336
+ if (!isset ($obj[1][1]['/Parent'])) {
337
+ return false;
338
+ } else {
339
+ $res = $this->_getPageRotation($obj[1][1]['/Parent']);
340
+ if ($res[0] == PDF_TYPE_OBJECT)
341
+ return $res[1];
342
+ return $res;
343
+ }
344
+ }
345
+ }
346
+
347
+ /**
348
+ * Read all /Page(es)
349
+ *
350
+ * @param object pdf_context
351
+ * @param array /Pages
352
+ * @param array the result-array
353
+ */
354
+ function read_pages (&$c, &$pages, &$result) {
355
+ // Get the kids dictionary
356
+ $kids = $this->pdf_resolve_object ($c, $pages[1][1]['/Kids']);
357
+
358
+ if (!is_array($kids))
359
+ $this->error('Cannot find /Kids in current /Page-Dictionary');
360
+ foreach ($kids[1] as $v) {
361
+ $pg = $this->pdf_resolve_object ($c, $v);
362
+ if ($pg[1][1]['/Type'][1] === '/Pages') {
363
+ // If one of the kids is an embedded
364
+ // /Pages array, resolve it as well.
365
+ $this->read_pages ($c, $pg, $result);
366
+ } else {
367
+ $result[] = $pg;
368
+ }
369
+ }
370
+ }
371
+
372
+
373
+
374
+ /**
375
+ * Get PDF-Version
376
+ *
377
+ * And reset the PDF Version used in FPDI if needed
378
+ */
379
+ function getPDFVersion() {
380
+ parent::getPDFVersion();
381
+ $this->fpdi->PDFVersion = max($this->fpdi->PDFVersion, $this->pdfVersion);
382
+ }
383
+
384
+ }
lib/fpdi/pdf_context.php ADDED
@@ -0,0 +1,97 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ //
3
+ // FPDI - Version 1.3.1
4
+ //
5
+ // Copyright 2004-2009 Setasign - Jan Slabon
6
+ //
7
+ // Licensed under the Apache License, Version 2.0 (the "License");
8
+ // you may not use this file except in compliance with the License.
9
+ // You may obtain a copy of the License at
10
+ //
11
+ // http://www.apache.org/licenses/LICENSE-2.0
12
+ //
13
+ // Unless required by applicable law or agreed to in writing, software
14
+ // distributed under the License is distributed on an "AS IS" BASIS,
15
+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16
+ // See the License for the specific language governing permissions and
17
+ // limitations under the License.
18
+ //
19
+
20
+ class pdf_context {
21
+
22
+ /**
23
+ * Modi
24
+ *
25
+ * @var integer 0 = file | 1 = string
26
+ */
27
+ var $_mode = 0;
28
+
29
+ var $file;
30
+ var $buffer;
31
+ var $offset;
32
+ var $length;
33
+
34
+ var $stack;
35
+
36
+ // Constructor
37
+
38
+ function pdf_context(&$f) {
39
+ $this->file =& $f;
40
+ if (is_string($this->file))
41
+ $this->_mode = 1;
42
+ $this->reset();
43
+ }
44
+
45
+ // Optionally move the file
46
+ // pointer to a new location
47
+ // and reset the buffered data
48
+
49
+ function reset($pos = null, $l = 100) {
50
+ if ($this->_mode == 0) {
51
+ if (!is_null ($pos)) {
52
+ fseek ($this->file, $pos);
53
+ }
54
+
55
+ $this->buffer = $l > 0 ? fread($this->file, $l) : '';
56
+ $this->length = strlen($this->buffer);
57
+ if ($this->length < $l)
58
+ $this->increase_length($l - $this->length);
59
+ } else {
60
+ $this->buffer = $this->file;
61
+ $this->length = strlen($this->buffer);
62
+ }
63
+ $this->offset = 0;
64
+ $this->stack = array();
65
+ }
66
+
67
+ // Make sure that there is at least one
68
+ // character beyond the current offset in
69
+ // the buffer to prevent the tokenizer
70
+ // from attempting to access data that does
71
+ // not exist
72
+
73
+ function ensure_content() {
74
+ if ($this->offset >= $this->length - 1) {
75
+ return $this->increase_length();
76
+ } else {
77
+ return true;
78
+ }
79
+ }
80
+
81
+ // Forcefully read more data into the buffer
82
+
83
+ function increase_length($l=100) {
84
+ if ($this->_mode == 0 && feof($this->file)) {
85
+ return false;
86
+ } else if ($this->_mode == 0) {
87
+ $totalLength = $this->length + $l;
88
+ do {
89
+ $this->buffer .= fread($this->file, $totalLength-$this->length);
90
+ } while ((($this->length = strlen($this->buffer)) != $totalLength) && !feof($this->file));
91
+
92
+ return true;
93
+ } else {
94
+ return false;
95
+ }
96
+ }
97
+ }
lib/fpdi/pdf_parser.php ADDED
@@ -0,0 +1,706 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ //
3
+ // FPDI - Version 1.3.1
4
+ //
5
+ // Copyright 2004-2009 Setasign - Jan Slabon
6
+ //
7
+ // Licensed under the Apache License, Version 2.0 (the "License");
8
+ // you may not use this file except in compliance with the License.
9
+ // You may obtain a copy of the License at
10
+ //
11
+ // http://www.apache.org/licenses/LICENSE-2.0
12
+ //
13
+ // Unless required by applicable law or agreed to in writing, software
14
+ // distributed under the License is distributed on an "AS IS" BASIS,
15
+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16
+ // See the License for the specific language governing permissions and
17
+ // limitations under the License.
18
+ //
19
+
20
+ if (!defined ('PDF_TYPE_NULL'))
21
+ define ('PDF_TYPE_NULL', 0);
22
+ if (!defined ('PDF_TYPE_NUMERIC'))
23
+ define ('PDF_TYPE_NUMERIC', 1);
24
+ if (!defined ('PDF_TYPE_TOKEN'))
25
+ define ('PDF_TYPE_TOKEN', 2);
26
+ if (!defined ('PDF_TYPE_HEX'))
27
+ define ('PDF_TYPE_HEX', 3);
28
+ if (!defined ('PDF_TYPE_STRING'))
29
+ define ('PDF_TYPE_STRING', 4);
30
+ if (!defined ('PDF_TYPE_DICTIONARY'))
31
+ define ('PDF_TYPE_DICTIONARY', 5);
32
+ if (!defined ('PDF_TYPE_ARRAY'))
33
+ define ('PDF_TYPE_ARRAY', 6);
34
+ if (!defined ('PDF_TYPE_OBJDEC'))
35
+ define ('PDF_TYPE_OBJDEC', 7);
36
+ if (!defined ('PDF_TYPE_OBJREF'))
37
+ define ('PDF_TYPE_OBJREF', 8);
38
+ if (!defined ('PDF_TYPE_OBJECT'))
39
+ define ('PDF_TYPE_OBJECT', 9);
40
+ if (!defined ('PDF_TYPE_STREAM'))
41
+ define ('PDF_TYPE_STREAM', 10);
42
+ if (!defined ('PDF_TYPE_BOOLEAN'))
43
+ define ('PDF_TYPE_BOOLEAN', 11);
44
+ if (!defined ('PDF_TYPE_REAL'))
45
+ define ('PDF_TYPE_REAL', 12);
46
+
47
+ require_once('pdf_context.php');
48
+
49
+ if (!class_exists('pdf_parser')) {
50
+
51
+ class pdf_parser {
52
+
53
+ /**
54
+ * Filename
55
+ * @var string
56
+ */
57
+ var $filename;
58
+
59
+ /**
60
+ * File resource
61
+ * @var resource
62
+ */
63
+ var $f;
64
+
65
+ /**
66
+ * PDF Context
67
+ * @var object pdf_context-Instance
68
+ */
69
+ var $c;
70
+
71
+ /**
72
+ * xref-Data
73
+ * @var array
74
+ */
75
+ var $xref;
76
+
77
+ /**
78
+ * root-Object
79
+ * @var array
80
+ */
81
+ var $root;
82
+
83
+ /**
84
+ * PDF version of the loaded document
85
+ * @var string
86
+ */
87
+ var $pdfVersion;
88
+
89
+ /**
90
+ * Constructor
91
+ *
92
+ * @param string $filename Source-Filename
93
+ */
94
+ function pdf_parser($filename) {
95
+ $this->filename = $filename;
96
+
97
+ $this->f = @fopen($this->filename, 'rb');
98
+
99
+ if (!$this->f)
100
+ $this->error(sprintf('Cannot open %s !', $filename));
101
+
102
+ $this->getPDFVersion();
103
+
104
+ $this->c =& new pdf_context($this->f);
105
+
106
+ // Read xref-Data
107
+ $this->xref = array();
108
+ $this->pdf_read_xref($this->xref, $this->pdf_find_xref());
109
+
110
+ // Check for Encryption
111
+ $this->getEncryption();
112
+
113
+ // Read root
114
+ $this->pdf_read_root();
115
+ }
116
+
117
+ /**
118
+ * Close the opened file
119
+ */
120
+ function closeFile() {
121
+ if (isset($this->f) && is_resource($this->f)) {
122
+ fclose($this->f);
123
+ unset($this->f);
124
+ }
125
+ }
126
+
127
+ /**
128
+ * Print Error and die
129
+ *
130
+ * @param string $msg Error-Message
131
+ */
132
+ function error($msg) {
133
+ die('<b>PDF-Parser Error:</b> '.$msg);
134
+ }
135
+
136
+ /**
137
+ * Check Trailer for Encryption
138
+ */
139
+ function getEncryption() {
140
+ if (isset($this->xref['trailer'][1]['/Encrypt'])) {
141
+ $this->error('File is encrypted!');
142
+ }
143
+ }
144
+
145
+ /**
146
+ * Find/Return /Root
147
+ *
148
+ * @return array
149
+ */
150
+ function pdf_find_root() {
151
+ if ($this->xref['trailer'][1]['/Root'][0] != PDF_TYPE_OBJREF) {
152
+ $this->error('Wrong Type of Root-Element! Must be an indirect reference');
153
+ }
154
+
155
+ return $this->xref['trailer'][1]['/Root'];
156
+ }
157
+
158
+ /**
159
+ * Read the /Root
160
+ */
161
+ function pdf_read_root() {
162
+ // read root
163
+ $this->root = $this->pdf_resolve_object($this->c, $this->pdf_find_root());
164
+ }
165
+
166
+ /**
167
+ * Get PDF-Version
168
+ *
169
+ * And reset the PDF Version used in FPDI if needed
170
+ */
171
+ function getPDFVersion() {
172
+ fseek($this->f, 0);
173
+ preg_match('/\d\.\d/',fread($this->f,16),$m);
174
+ if (isset($m[0]))
175
+ $this->pdfVersion = $m[0];
176
+ return $this->pdfVersion;
177
+ }
178
+
179
+ /**
180
+ * Find the xref-Table
181
+ */
182
+ function pdf_find_xref() {
183
+ $toRead = 1500;
184
+
185
+ $stat = fseek ($this->f, -$toRead, SEEK_END);
186
+ if ($stat === -1) {
187
+ fseek ($this->f, 0);
188
+ }
189
+ $data = fread($this->f, $toRead);
190
+
191
+ $pos = strlen($data) - strpos(strrev($data), strrev('startxref'));
192
+ $data = substr($data, $pos);
193
+
194
+ if (!preg_match('/\s*(\d+).*$/s', $data, $matches)) {
195
+ $this->error('Unable to find pointer to xref table');
196
+ }
197
+
198
+ return (int) $matches[1];
199
+ }
200
+
201
+ /**
202
+ * Read xref-table
203
+ *
204
+ * @param array $result Array of xref-table
205
+ * @param integer $offset of xref-table
206
+ */
207
+ function pdf_read_xref(&$result, $offset) {
208
+
209
+ fseek($this->f, $o_pos = $offset-20); // set some bytes backwards to fetch errorious docs
210
+
211
+ $data = fread($this->f, 100);
212
+
213
+ $xrefPos = strrpos($data, 'xref');
214
+
215
+ if ($xrefPos === false) {
216
+ fseek($this->f, $offset);
217
+ $c =& new pdf_context($this->f);
218
+ $xrefStreamObjDec = $this->pdf_read_value($c);
219
+
220
+ if (is_array($xrefStreamObjDec) && isset($xrefStreamObjDec[0]) && $xrefStreamObjDec[0] == PDF_TYPE_OBJDEC) {
221
+ $this->error(sprintf('This document (%s) probably uses a compression technique which is not supported by the free parser shipped with FPDI.', $this->filename));
222
+ } else {
223
+ $this->error('Unable to find xref table.');
224
+ }
225
+ }
226
+
227
+ if (!isset($result['xref_location'])) {
228
+ $result['xref_location'] = $o_pos+$xrefPos;
229
+ $result['max_object'] = 0;
230
+ }
231
+
232
+ $cylces = -1;
233
+ $bytesPerCycle = 100;
234
+
235
+ fseek($this->f, $o_pos = $o_pos+$xrefPos+4); // set the handle directly after the "xref"-keyword
236
+ $data = fread($this->f, $bytesPerCycle);
237
+
238
+ while (($trailerPos = strpos($data, 'trailer', max($bytesPerCycle*$cylces++, 0))) === false && !feof($this->f)) {
239
+ $data .= fread($this->f, $bytesPerCycle);
240
+ }
241
+
242
+ if ($trailerPos === false) {
243
+ $this->error('Trailer keyword not found after xref table');
244
+ }
245
+
246
+ $data = substr($data, 0, $trailerPos);
247
+
248
+ // get Line-Ending
249
+ preg_match_all("/(\r\n|\n|\r)/", substr($data, 0, 100), $m); // check the first 100 bytes for linebreaks
250
+
251
+ $differentLineEndings = count(array_unique($m[0]));
252
+ if ($differentLineEndings > 1) {
253
+ $lines = preg_split("/(\r\n|\n|\r)/", $data, -1, PREG_SPLIT_NO_EMPTY);
254
+ } else {
255
+ $lines = explode($m[0][1], $data);
256
+ }
257
+
258
+ $data = $differentLineEndings = $m = null;
259
+ unset($data, $differentLineEndings, $m);
260
+
261
+ $linesCount = count($lines);
262
+
263
+ $start = 1;
264
+
265
+ for ($i = 0; $i < $linesCount; $i++) {
266
+ $line = trim($lines[$i]);
267
+ if ($line) {
268
+ $pieces = explode(' ', $line);
269
+ $c = count($pieces);
270
+ switch($c) {
271
+ case 2:
272
+ $start = (int)$pieces[0];
273
+ $end = $start+(int)$pieces[1];
274
+ if ($end > $result['max_object'])
275
+ $result['max_object'] = $end;
276
+ break;
277
+ case 3:
278
+ if (!isset($result['xref'][$start]))
279
+ $result['xref'][$start] = array();
280
+
281
+ if (!array_key_exists($gen = (int) $pieces[1], $result['xref'][$start])) {
282
+ $result['xref'][$start][$gen] = $pieces[2] == 'n' ? (int) $pieces[0] : null;
283
+ }
284
+ $start++;
285
+ break;
286
+ default:
287
+ $this->error('Unexpected data in xref table');
288
+ }
289
+ }
290
+ }
291
+
292
+ $lines = $pieces = $line = $start = $end = $gen = null;
293
+ unset($lines, $pieces, $line, $start, $end, $gen);
294
+
295
+ fseek($this->f, $o_pos+$trailerPos+7);
296
+
297
+ $c =& new pdf_context($this->f);
298
+ $trailer = $this->pdf_read_value($c);
299
+
300
+ $c = null;
301
+ unset($c);
302
+
303
+ if (!isset($result['trailer'])) {
304
+ $result['trailer'] = $trailer;
305
+ }
306
+
307
+ if (isset($trailer[1]['/Prev'])) {
308
+ $this->pdf_read_xref($result, $trailer[1]['/Prev'][1]);
309
+ }
310
+
311
+ $trailer = null;
312
+ unset($trailer);
313
+
314
+ return true;
315
+ }
316
+
317
+ /**
318
+ * Reads an Value
319
+ *
320
+ * @param object $c pdf_context
321
+ * @param string $token a Token
322
+ * @return mixed
323
+ */
324
+ function pdf_read_value(&$c, $token = null) {
325
+ if (is_null($token)) {
326
+ $token = $this->pdf_read_token($c);
327
+ }
328
+
329
+ if ($token === false) {
330
+ return false;
331
+ }
332
+
333
+ switch ($token) {
334
+ case '<':
335
+ // This is a hex string.
336
+ // Read the value, then the terminator
337
+
338
+ $pos = $c->offset;
339
+
340
+ while(1) {
341
+
342
+ $match = strpos ($c->buffer, '>', $pos);
343
+
344
+ // If you can't find it, try
345
+ // reading more data from the stream
346
+
347
+ if ($match === false) {
348
+ if (!$c->increase_length()) {
349
+ return false;
350
+ } else {
351
+ continue;
352
+ }
353
+ }
354
+
355
+ $result = substr ($c->buffer, $c->offset, $match - $c->offset);
356
+ $c->offset = $match + 1;
357
+
358
+ return array (PDF_TYPE_HEX, $result);
359
+ }
360
+
361
+ break;
362
+ case '<<':
363
+ // This is a dictionary.
364
+
365
+ $result = array();
366
+
367
+ // Recurse into this function until we reach
368
+ // the end of the dictionary.
369
+ while (($key = $this->pdf_read_token($c)) !== '>>') {
370
+ if ($key === false) {
371
+ return false;
372
+ }
373
+
374
+ if (($value = $this->pdf_read_value($c)) === false) {
375
+ return false;
376
+ }
377
+
378
+ // Catch missing value
379
+ if ($value[0] == PDF_TYPE_TOKEN && $value[1] == '>>') {
380
+ $result[$key] = array(PDF_TYPE_NULL);
381
+ break;
382
+ }
383
+
384
+ $result[$key] = $value;
385
+ }
386
+
387
+ return array (PDF_TYPE_DICTIONARY, $result);
388
+
389
+ case '[':
390
+ // This is an array.
391
+
392
+ $result = array();
393
+
394
+ // Recurse into this function until we reach
395
+ // the end of the array.
396
+ while (($token = $this->pdf_read_token($c)) !== ']') {
397
+ if ($token === false) {
398
+ return false;
399
+ }
400
+
401
+ if (($value = $this->pdf_read_value($c, $token)) === false) {
402
+ return false;
403
+ }
404
+
405
+ $result[] = $value;
406
+ }
407
+
408
+ return array (PDF_TYPE_ARRAY, $result);
409
+
410
+ case '(' :
411
+ // This is a string
412
+ $pos = $c->offset;
413
+
414
+ $openBrackets = 1;
415
+ do {
416
+ for (; $openBrackets != 0 && $pos < $c->length; $pos++) {
417
+ switch (ord($c->buffer[$pos])) {
418
+ case 0x28: // '('
419
+ $openBrackets++;
420
+ break;
421
+ case 0x29: // ')'
422
+ $openBrackets--;
423
+ break;
424
+ case 0x5C: // backslash
425
+ $pos++;
426
+ }
427
+ }
428
+ } while($openBrackets != 0 && $c->increase_length());
429
+
430
+ $result = substr($c->buffer, $c->offset, $pos - $c->offset - 1);
431
+ $c->offset = $pos;
432
+
433
+ return array (PDF_TYPE_STRING, $result);
434
+
435
+ case 'stream':
436
+ $o_pos = ftell($c->file)-strlen($c->buffer);
437
+ $o_offset = $c->offset;
438
+
439
+ $c->reset($startpos = $o_pos + $o_offset);
440
+
441
+ $e = 0; // ensure line breaks in front of the stream
442
+ if ($c->buffer[0] == chr(10) || $c->buffer[0] == chr(13))
443
+ $e++;
444
+ if ($c->buffer[1] == chr(10) && $c->buffer[0] != chr(10))
445
+ $e++;
446
+
447
+ if ($this->actual_obj[1][1]['/Length'][0] == PDF_TYPE_OBJREF) {
448
+ $tmp_c =& new pdf_context($this->f);
449
+ $tmp_length = $this->pdf_resolve_object($tmp_c,$this->actual_obj[1][1]['/Length']);
450
+ $length = $tmp_length[1][1];
451
+ } else {
452
+ $length = $this->actual_obj[1][1]['/Length'][1];
453
+ }
454
+
455
+ if ($length > 0) {
456
+ $c->reset($startpos+$e,$length);
457
+ $v = $c->buffer;
458
+ } else {
459
+ $v = '';
460
+ }
461
+ $c->reset($startpos+$e+$length+9); // 9 = strlen("endstream")
462
+
463
+ return array(PDF_TYPE_STREAM, $v);
464
+
465
+ default :
466
+ if (is_numeric ($token)) {
467
+ // A numeric token. Make sure that
468
+ // it is not part of something else.
469
+ if (($tok2 = $this->pdf_read_token ($c)) !== false) {
470
+ if (is_numeric ($tok2)) {
471
+
472
+ // Two numeric tokens in a row.
473
+ // In this case, we're probably in
474
+ // front of either an object reference
475
+ // or an object specification.
476
+ // Determine the case and return the data
477
+ if (($tok3 = $this->pdf_read_token ($c)) !== false) {
478
+ switch ($tok3) {
479
+ case 'obj' :
480
+ return array (PDF_TYPE_OBJDEC, (int) $token, (int) $tok2);
481
+ case 'R' :
482
+ return array (PDF_TYPE_OBJREF, (int) $token, (int) $tok2);
483
+ }
484
+ // If we get to this point, that numeric value up
485
+ // there was just a numeric value. Push the extra
486
+ // tokens back into the stack and return the value.
487
+ array_push ($c->stack, $tok3);
488
+ }
489
+ }
490
+
491
+ array_push ($c->stack, $tok2);
492
+ }
493
+
494
+ if ($token === (string)((int)$token))
495
+ return array (PDF_TYPE_NUMERIC, (int)$token);
496
+ else
497
+ return array (PDF_TYPE_REAL, (float)$token);
498
+ } else if ($token == 'true' || $token == 'false') {
499
+ return array (PDF_TYPE_BOOLEAN, $token == 'true');
500
+ } else if ($token == 'null') {
501
+ return array (PDF_TYPE_NULL);
502
+ } else {
503
+ // Just a token. Return it.
504
+ return array (PDF_TYPE_TOKEN, $token);
505
+ }
506
+ }
507
+ }
508
+
509
+ /**
510
+ * Resolve an object
511
+ *
512
+ * @param object $c pdf_context
513
+ * @param array $obj_spec The object-data
514
+ * @param boolean $encapsulate Must set to true, cause the parsing and fpdi use this method only without this para
515
+ */
516
+ function pdf_resolve_object(&$c, $obj_spec, $encapsulate = true) {
517
+ // Exit if we get invalid data
518
+ if (!is_array($obj_spec)) {
519
+ $ret = false;
520
+ return $ret;
521
+ }
522
+
523
+ if ($obj_spec[0] == PDF_TYPE_OBJREF) {
524
+
525
+ // This is a reference, resolve it
526
+ if (isset($this->xref['xref'][$obj_spec[1]][$obj_spec[2]])) {
527
+
528
+ // Save current file position
529
+ // This is needed if you want to resolve
530
+ // references while you're reading another object
531
+ // (e.g.: if you need to determine the length
532
+ // of a stream)
533
+
534
+ $old_pos = ftell($c->file);
535
+
536
+ // Reposition the file pointer and
537
+ // load the object header.
538
+
539
+ $c->reset($this->xref['xref'][$obj_spec[1]][$obj_spec[2]]);
540
+
541
+ $header = $this->pdf_read_value($c);
542
+
543
+ if ($header[0] != PDF_TYPE_OBJDEC || $header[1] != $obj_spec[1] || $header[2] != $obj_spec[2]) {
544
+ $this->error("Unable to find object ({$obj_spec[1]}, {$obj_spec[2]}) at expected location");
545
+ }
546
+
547
+ // If we're being asked to store all the information
548
+ // about the object, we add the object ID and generation
549
+ // number for later use
550
+ $result = array();
551
+ $this->actual_obj =& $result;
552
+ if ($encapsulate) {
553
+ $result = array (
554
+ PDF_TYPE_OBJECT,
555
+ 'obj' => $obj_spec[1],
556
+ 'gen' => $obj_spec[2]
557
+ );
558
+ }
559
+
560
+ // Now simply read the object data until
561
+ // we encounter an end-of-object marker
562
+ while(1) {
563
+ $value = $this->pdf_read_value($c);
564
+ if ($value === false || count($result) > 4) {
565
+ // in this case the parser coudn't find an endobj so we break here
566
+ break;
567
+ }
568
+
569
+ if ($value[0] == PDF_TYPE_TOKEN && $value[1] === 'endobj') {
570
+ break;
571
+ }
572
+
573
+ $result[] = $value;
574
+ }
575
+
576
+ $c->reset($old_pos);
577
+
578
+ if (isset($result[2][0]) && $result[2][0] == PDF_TYPE_STREAM) {
579
+ $result[0] = PDF_TYPE_STREAM;
580
+ }
581
+
582
+ return $result;
583
+ }
584
+ } else {
585
+ return $obj_spec;
586
+ }
587
+ }
588
+
589
+
590
+
591
+ /**
592
+ * Reads a token from the file
593
+ *
594
+ * @param object $c pdf_context
595
+ * @return mixed
596
+ */
597
+ function pdf_read_token(&$c)
598
+ {
599
+ // If there is a token available
600
+ // on the stack, pop it out and
601
+ // return it.
602
+
603
+ if (count($c->stack)) {
604
+ return array_pop($c->stack);
605
+ }
606
+
607
+ // Strip away any whitespace
608
+
609
+ do {
610
+ if (!$c->ensure_content()) {
611
+ return false;
612
+ }
613
+ $c->offset += strspn($c->buffer, " \n\r\t", $c->offset);
614
+ } while ($c->offset >= $c->length - 1);
615
+
616
+ // Get the first character in the stream
617
+
618
+ $char = $c->buffer[$c->offset++];
619
+
620
+ switch ($char) {
621
+
622
+ case '[':
623
+ case ']':
624
+ case '(':
625
+ case ')':
626
+
627
+ // This is either an array or literal string
628
+ // delimiter, Return it
629
+
630
+ return $char;
631
+
632
+ case '<':
633
+ case '>':
634
+
635
+ // This could either be a hex string or
636
+ // dictionary delimiter. Determine the
637
+ // appropriate case and return the token
638
+
639
+ if ($c->buffer[$c->offset] == $char) {
640
+ if (!$c->ensure_content()) {
641
+ return false;
642
+ }
643
+ $c->offset++;
644
+ return $char . $char;
645
+ } else {
646
+ return $char;
647
+ }
648
+
649
+ case '%':
650
+
651
+ // This is a comment - jump over it!
652
+
653
+ $pos = $c->offset;
654
+ while(1) {
655
+ $match = preg_match("/(\r\n|\r|\n)/", $c->buffer, $m, PREG_OFFSET_CAPTURE, $pos);
656
+ if ($match === 0) {
657
+ if (!$c->increase_length()) {
658
+ return false;
659
+ } else {
660
+ continue;
661
+ }
662
+ }
663
+
664
+ $c->offset = $m[0][1]+strlen($m[0][0]);
665
+
666
+ return $this->pdf_read_token($c);
667
+ }
668
+
669
+ default:
670
+
671
+ // This is "another" type of token (probably
672
+ // a dictionary entry or a numeric value)
673
+ // Find the end and return it.
674
+
675
+ if (!$c->ensure_content()) {
676
+ return false;
677
+ }
678
+
679
+ while(1) {
680
+
681
+ // Determine the length of the token
682
+
683
+ $pos = strcspn($c->buffer, " %[]<>()\r\n\t/", $c->offset);
684
+
685
+ if ($c->offset + $pos <= $c->length - 1) {
686
+ break;
687
+ } else {
688
+ // If the script reaches this point,
689
+ // the token may span beyond the end
690
+ // of the current buffer. Therefore,
691
+ // we increase the size of the buffer
692
+ // and try again--just to be safe.
693
+
694
+ $c->increase_length();
695
+ }
696
+ }
697
+
698
+ $result = substr($c->buffer, $c->offset - 1, $pos + 1);
699
+
700
+ $c->offset += $pos;
701
+ return $result;
702
+ }
703
+ }
704
+ }
705
+
706
+ }
package.xml CHANGED
@@ -1,18 +1,23 @@
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Ydral_Correos</name>
4
- <version>1.0.3</version>
5
  <stability>stable</stability>
6
  <license uri="http://opensource.org/licenses/osl-3.0.php">OSL 3.0</license>
7
  <channel>community</channel>
8
  <extends/>
9
  <summary>Modulo para Magento para integrar Correos.</summary>
10
  <description>Modulo para Magento para integrar Correos.</description>
11
- <notes>Correos</notes>
 
 
 
 
 
12
  <authors><author><name>Ydral</name><user>Ydral</user><email>webmaster@ydral.com</email></author></authors>
13
- <date>2013-02-13</date>
14
- <time>17:58:14</time>
15
- <contents><target name="magelocal"><dir name="Ydral"><dir name="Correos"><dir><dir name="Block"><file name="Correos.php" hash="1b0b7449fe4fc1a490beb2731d808833"/><dir name="Onepage"><dir name="Shipping"><dir name="Method"><file name="Available.php" hash="f3eee1d370e15385a7ad0660388318e8"/></dir></dir></dir><dir name="Order"><file name="Info.php" hash="e91c0bbf5f12c5417aaa7cb9a016d53e"/><file name="Shipment.php" hash="92af0ea6e466b5c3ba3e03d87099676b"/><file name="View.php" hash="2ba78931ba3627861a4c3a0b313eeeea"/></dir><dir name="System"><dir name="Export"><file name="Envio.php" hash="bcbf6fd994d10dd15252e8e0cd1137d9"/><file name="Recoger.php" hash="8ab14c0214077967088913a050eac011"/></dir></dir><dir name="Tracking"><file name="Popup.php" hash="90ad75e9c0f8d59093f6c0f10c2c403d"/></dir></dir><dir name="Helper"><file name="Data.php" hash="d5142bf6837fcee9fa6b95363397af3f"/><file name="Onestepcheckout.php" hash="73c35d649ba8a1982059049b2069d37c"/></dir><dir name="Model"><file name="Correos.php" hash="7d7329d6e15391e58d01eb68b1cc1f34"/><dir name="Mysql4"><dir name="Carrier"><dir name="Correos"><file name="Collection.php" hash="8acd4f14cbbfa3266672f80df90dd8eb"/></dir><file name="Correos.php" hash="67a8a823c9f9164780e50e4592b4113f"/></dir><dir name="Correos"><file name="Collection.php" hash="5d3d9c496b804a813aba6d4b8ada21b4"/></dir><file name="Correos.php" hash="2a7507d51e478a42404dc3da39caec0f"/></dir><file name="Pesos.php" hash="5a0eb95ca645de30602fa2ab96bd468b"/><dir name="Quote"><dir name="Address"><dir name="Total"><file name="Shipping.php" hash="d9e5185a891d850f6d8aaa56a6f89c06"/></dir></dir></dir><dir name="System"><dir name="Config"><dir name="Backend"><dir name="Shipping"><file name="Correos.php" hash="19b624f09bde0493ff1da9c8d7032756"/><file name="Recoger.php" hash="7fa2ecf29152181778df237c377adaa5"/></dir></dir></dir></dir><dir name="Type"><file name="Onepage.php" hash="bccdfd5d4fcedaf4f6564a31634ad8f6"/></dir><dir name="Ydral"><file name="Correos.php" hash="32b9596c9903b43c2571e411a791b83f"/><file name="Recogeroficina.php" hash="143959a68ec994587d9d4fa1684b456d"/><file name="Shipment.php" hash="3131929853c48313da7d7fb2df6f1970"/></dir></dir><dir name="controllers"><file name="IndexController.php" hash="45abd73fe238454c2426460d39afefed"/><dir name="Sales"><dir name="Order"><file name="ShipmentController.php" hash="e3b714b819b870a931d037b2b5668dcb"/></dir></dir><file name="TrackingController.php" hash="ec71e387dc85055ba34c19a07c4aad78"/></dir><dir name="etc"><file name="config.xml" hash="f2ebc69266a0a30ef11888b60b937959"/><file name="system.xml" hash="7ccbf79ef19675932c0b0352c575aba4"/></dir><dir name="sql"><dir name="correos_setup"><file name="mysql4-install-0.1.0.php" hash="4e95daa44dbacf3ba1d02bb73018786e"/><file name="mysql4-upgrade-0.1.0-0.2.0.php" hash="a91ac4d35130ff6d11d876c711f810e2"/><file name="mysql4-upgrade-0.2.0-0.3.0.php" hash="a91ac4d35130ff6d11d876c711f810e2"/></dir></dir></dir><file name="log.txt" hash="fa236e6e523e9d696a222fb7f5f51ae1"/></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Ydral_Correos.xml" hash="0958431d8cb3d9423baa51c3e10baf48"/></dir></target><target name="mageskin"><dir name="frontend"><dir name="default"><dir name="default"><dir name="css"><file name="correos.css" hash="d6fde38ba7d7f768dea0b161b190d5ab"/></dir><dir name="js"><file name="correos.js" hash="9488e274935706a07bd5ab2df45000d8"/></dir><dir name="images"><file name="correos_4872.png" hash="06096525a173118a8f3199c402688c48"/><file name="logo_entregadomicilio.jpg" hash="0d2b9aa305b92a7ea53bd2d6f2daa9e3"/><file name="logo_recogeroficina.jpg" hash="50a6906d1a4ef364e21f838a0cd5ade6"/></dir></dir></dir><dir name="base"><dir name="default"><dir name="css"><file name="correos.css" hash="d6fde38ba7d7f768dea0b161b190d5ab"/></dir><dir name="js"><file name="correos.js" hash="437470394526c567639e29d16244cd75"/></dir><dir name="images"><file name="logo_entregadomicilio.jpg" hash="0d2b9aa305b92a7ea53bd2d6f2daa9e3"/><file name="logo_recogeroficina.jpg" hash="50a6906d1a4ef364e21f838a0cd5ade6"/><file name="correos_4872.png" hash="06096525a173118a8f3199c402688c48"/></dir></dir></dir></dir><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="images"><file name="correos-section.png" hash="6715309b92e7dc1599cc043975272624"/></dir><file name="correos.css" hash="e27bc86c5ea27d00c13e5c2589fd89e4"/></dir></dir></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="correos.xml" hash="c1d4ca19d9c9d3eee7c8f8367113d1b4"/></dir><dir name="template"><dir name="correos"><file name="tab_info.phtml" hash="fc7ba70d82c60497fe5c01068fdb2a3c"/></dir></dir></dir></dir></dir><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="correos.xml" hash="a654a2a7e05d4c17242c5e546dd9a357"/></dir><dir name="template"><dir name="correos"><file name="head.phtml" hash="34ba4373fd627f763e71ce75386c80b7"/><file name="order_info.phtml" hash="ca29af9d43da164b17e7c59cb7d5c577"/><file name="order_shipment.phtml" hash="ddef55d58d33c172d7b497efb24cceef"/><file name="order_shipment_items.phtml" hash="d250b704263f57791e5d1dd30f53f9a8"/><file name="order_view.phtml" hash="74d03f2e4e9479d2fd46b8ebd8edec68"/><file name="popup.phtml" hash="98621c39582463a00292c871b6d37d82"/></dir></dir></dir></dir></dir></target></contents>
16
  <compatible/>
17
  <dependencies><required><php><min>5.2.0</min><max>6.0.0</max></php></required></dependencies>
18
  </package>
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Ydral_Correos</name>
4
+ <version>2.0.2</version>
5
  <stability>stable</stability>
6
  <license uri="http://opensource.org/licenses/osl-3.0.php">OSL 3.0</license>
7
  <channel>community</channel>
8
  <extends/>
9
  <summary>Modulo para Magento para integrar Correos.</summary>
10
  <description>Modulo para Magento para integrar Correos.</description>
11
+ <notes>- Corregido bug de visualizaci&#xF3;n de m&#xFA;ltiples p&#xE1;ginas con m&#xFA;ltiples etiquetas.&#xD;
12
+ - Corregido bug de mostrar m&#xE9;todo de env&#xED;o en la informaci&#xF3;n de pedido con html.&#xD;
13
+ - Corregido bug en tiendas con https&#xD;
14
+ - Corregido bug en librer&#xED;a js&#xD;
15
+ - Actualizada la opci&#xF3;n de env&#xED;o en el backend&#xD;
16
+ - Cambios generales</notes>
17
  <authors><author><name>Ydral</name><user>Ydral</user><email>webmaster@ydral.com</email></author></authors>
18
+ <date>2013-10-01</date>
19
+ <time>22:00:12</time>
20
+ <contents><target name="magelocal"><dir name="Ydral"><dir name="Correos"><dir><dir name="Block"><dir name="Adminhtml"><dir name="Sales"><dir name="Order"><dir name="Create"><dir name="Shipping"><dir name="Method"><file name="Form.php" hash="30af1e436abad8ed575bdf4a579d9589"/></dir></dir></dir><file name="Grid.php" hash="ab16fe6e2304a123193baebd8a59b6e8"/><dir name="View"><dir name="Tab"><file name="Info.php" hash="a247fe7618649a8919b884292e192a41"/></dir></dir></dir></dir><dir name="Shipping"><dir name="Carrier"><dir name="Tablerate"><file name="Grid.php" hash="762b0ef65532e9b5d0543cf698da5162"/></dir></dir></dir></dir><file name="Correos.php" hash="1b0b7449fe4fc1a490beb2731d808833"/><dir name="Onepage"><file name="Progress.php" hash="ec21861e209fe67cc50c83849e975c17"/><dir name="Shipping"><dir name="Method"><file name="Available.php" hash="aacfb81c7dfaf9301df856aabc4dfdde"/></dir></dir><file name="Tax.php" hash="92b5aa1cde1acb2d5a2354cc15ce0416"/></dir><file name="Onestepcheckout.php" hash="8e600e0d7d51e1b3e398386485fbc498"/><dir name="Order"><file name="Info.php" hash="a2a37e3fa4a589932ecc4d04b5ad4601"/><file name="Shipment.php" hash="816f905f255d3f9dcc1b26d293996390"/><file name="View.php" hash="a6d18f4ffb1e00c81cfc7e33adc37342"/></dir><dir name="System"><dir name="Config"><file name="About.php" hash="6d04cc5ffd12f0bd368f9f8b6376b90d"/><file name="Infosender.php" hash="a6d53fba6b6ca68aa931bde1462a3478"/></dir><dir name="Export"><file name="Envio.php" hash="53153a1f8215116dfbcb0d3256e3921a"/><file name="Internacional.php" hash="3a4bb80f038cce682ca39b53c7642dbb"/><file name="Recoger.php" hash="31a78966809c72dc772df0e4eeab918d"/></dir></dir><dir name="Tracking"><file name="Popup.php" hash="90ad75e9c0f8d59093f6c0f10c2c403d"/></dir></dir><dir name="Helper"><file name="Data.php" hash="2f62bf100b6a382d9a4a254ed2b5ca4e"/><file name="Etiqueta.php" hash="63c6dadce8bc3d14c52f9d81cbf17ea8"/><file name="Onestepcheckout.php" hash="73c35d649ba8a1982059049b2069d37c"/><file name="Preregistro.php" hash="e9b5506d98fe9f70fc4db853aa252002"/><file name="Seguimiento.php" hash="0ef2d7f4bc7b5d92e23c05efc25849bb"/></dir><dir name="Model"><file name="Correos.php" hash="5ef992ca03427c652d7eec64955d7e78"/><file name="Observer.php" hash="c2bb47adebcef08ab42bfb2339c59ab3"/><file name="Oficinas.php" hash="863531eb045185342b862cdc62530596"/><file name="Pdfmerger.php" hash="3bfb273755c4654c148c35e0b76a96b0"/><dir name="Quote"><dir name="Address"><dir name="Total"><file name="Shipping.php" hash="d9e5185a891d850f6d8aaa56a6f89c06"/></dir></dir></dir><file name="Recoger.php" hash="1648f2f57278078a500c9c7d6519b669"/><file name="Remitente.php" hash="c6d4860c41ebcbb0502b3d2b41e5512a"/><dir name="Resource"><dir name="Carrier"><dir name="Correos"><file name="Collection.php" hash="00c57008b4df29ac653b9f5d1dc728ad"/></dir><file name="Correos.php" hash="af6543821a1dd5f5c959dc050a6f0d06"/></dir><dir name="Recoger"><file name="Collection.php" hash="5ce7f35e8e26d89a38db49373e4c93bb"/></dir><file name="Recoger.php" hash="d047ab25eb8d4a9045e9e3734443389f"/><dir name="Remitente"><file name="Collection.php" hash="657742a1cd2b40fa7cbe3345ca502a42"/></dir><file name="Remitente.php" hash="a3a4ead632ed76ca3656e1b8248fcb9a"/></dir><file name="Seguimiento.php" hash="c3031dc36122e9a240dd2a1fd1372825"/><dir name="System"><dir name="Config"><dir name="Backend"><dir name="Shipping"><file name="Correos.php" hash="4ad09e645ea17c3e16cd79808c8a05e0"/><file name="Internacional.php" hash="1de4fe2252bde99e652bbacd56cedab4"/><file name="Multiremitente.php" hash="25a3e64297d7e2c4e65b2cb9b424e285"/><file name="Recoger.php" hash="c58ba31de49227374df9416c2e693136"/></dir></dir><dir name="Source"><file name="Pesos.php" hash="6f9cd231df2c49c47da882813a1a77e4"/></dir></dir></dir><dir name="Type"><file name="Onepage.php" hash="7cd6dfe548703a43d0cb0dc3f77ed7e3"/></dir><dir name="Ydral"><file name="Correos.php" hash="00a66d3a3c665be8184b226f9c9ec1e0"/><file name="Correosinter.php" hash="11457c065336b3feaa7fa81d1429bcc0"/><file name="Recogeroficina.php" hash="6343d4c771297d339421c1b34d5c7b01"/><file name="Shipment.php" hash="2ba136e7954494b775b1df9647717018"/></dir></dir><dir name="controllers"><dir name="Adminhtml"><file name="DownloadController.php" hash="f8309221a8541001d347e410a9955fa4"/><file name="ExportController.php" hash="21d75584c1ad62558706cb27eda89248"/><file name="PdfController.php" hash="90fbb7c0461ef479caef3a2b74244be8"/></dir><file name="CheckoutController.php" hash="eae17603c59e798c3ffdd485b05383a5"/><file name="IndexController.php" hash="e5ef44ec54835893a4fc544f872c006a"/><dir name="Sales"><dir name="Order"><file name="ShipmentController.php" hash="e3b714b819b870a931d037b2b5668dcb"/></dir></dir><file name="TrackingController.php" hash="ec71e387dc85055ba34c19a07c4aad78"/></dir><dir name="etc"><file name="config.xml" hash="154e2fac9fcd0fa7ae0362af62e613ce"/><file name="system.xml" hash="aad3351bcb3e4dc588363e551fab7cee"/></dir><dir name="sql"><dir name="correos_setup"><file name="mysql4-install-0.1.0.php" hash="4e95daa44dbacf3ba1d02bb73018786e"/><file name="mysql4-upgrade-0.1.0-0.2.0.php" hash="a91ac4d35130ff6d11d876c711f810e2"/><file name="mysql4-upgrade-0.2.0-0.3.0.php" hash="a91ac4d35130ff6d11d876c711f810e2"/><file name="mysql4-upgrade-0.3.0-0.4.0.php" hash="a91ac4d35130ff6d11d876c711f810e2"/><file name="mysql4-upgrade-0.4.0-1.5.0.php" hash="735057b1d99543e56bfed4109624dcdb"/><file name="mysql4-upgrade-1.5.0-2.0.0.php" hash="e1f90c7007beb8f536cc965b6e43360f"/></dir></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Ydral_Correos.xml" hash="0958431d8cb3d9423baa51c3e10baf48"/></dir></target><target name="mageskin"><dir name="frontend"><dir name="default"><dir name="default"><dir name="css"><file name="correos.css" hash="9f5baa8a0c82c44244b4926dd23627c6"/></dir><dir name="images"><file name="correos_4872.png" hash="06096525a173118a8f3199c402688c48"/><file name="logo_entregadomicilio.jpg" hash="0d2b9aa305b92a7ea53bd2d6f2daa9e3"/><file name="logo_recogeroficina.jpg" hash="50a6906d1a4ef364e21f838a0cd5ade6"/><dir name="correos"><file name="correos.png" hash="74e7b3891d4155c27e2657eb1ad49c51"/><file name="correos.psd" hash="efe36a87a705a07f8d2c60c02ba7b616"/><file name="correos2.psd" hash="6dfef2a49356b1deb4cf7720e0546297"/><file name="globo.png" hash="029bdaeb8e13c4144e2be44b8f08e788"/><file name="globosombra.png" hash="1a50fd383f17fe25cc74da661ddd6b5a"/><file name="logo_entregadomicilio.jpg" hash="0d2b9aa305b92a7ea53bd2d6f2daa9e3"/><file name="logo_recogeroficina.jpg" hash="50a6906d1a4ef364e21f838a0cd5ade6"/><file name="red-rounded01.psd" hash="dc132e1b6f6701fa2b59c2770585860d"/></dir></dir></dir></dir><dir name="base"><dir name="default"><dir name="css"><file name="correos.css" hash="9f5baa8a0c82c44244b4926dd23627c6"/></dir><dir name="images"><file name="logo_entregadomicilio.jpg" hash="0d2b9aa305b92a7ea53bd2d6f2daa9e3"/><file name="logo_recogeroficina.jpg" hash="50a6906d1a4ef364e21f838a0cd5ade6"/><file name="correos_4872.png" hash="06096525a173118a8f3199c402688c48"/></dir></dir></dir></dir><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="images"><file name="correos-section.png" hash="6715309b92e7dc1599cc043975272624"/><dir name="correos"><file name="correos.png" hash="74e7b3891d4155c27e2657eb1ad49c51"/></dir></dir><file name="correos.css" hash="bc076605b256d311f0ceed8864cd39bf"/></dir></dir></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="correos.xml" hash="6da415b467e85d22ba75e846c505e294"/></dir><dir name="template"><dir name="correos"><file name="head.phtml" hash="ca8c76e4b6bc5cad5c7d9a6eeeab46ed"/><file name="sales_order_shipment_create_items.phtml" hash="ab65c67c01ba07e2a3196cc05d890fc1"/><file name="tab_info.phtml" hash="c1d3ec6df2b1be61f74e7f86f30a9c11"/></dir></dir></dir></dir></dir><dir name="frontend"><dir name="base"><dir name="default"><dir name="template"><dir name="correos"><file name="available.phtml" hash="9cec40327d8b175259419b5c713f553c"/><file name="head.phtml" hash="2a1e8a41908528059dc188e09e0314f7"/><file name="order_info.phtml" hash="59c67336f114939819c193eda1f67535"/><file name="order_shipment.phtml" hash="ddef55d58d33c172d7b497efb24cceef"/><file name="order_shipment_items.phtml" hash="d250b704263f57791e5d1dd30f53f9a8"/><file name="order_view.phtml" hash="74d03f2e4e9479d2fd46b8ebd8edec68"/><file name="popup.phtml" hash="1b510ea59bb448eb05f122825007710d"/></dir></dir><dir name="layout"><file name="correos.xml" hash="9f73bdb3522d248480c67201025fbf4e"/></dir></dir></dir></dir></target><target name="magelib"><dir name="fpdf"><dir name="font"><file name="courier.php" hash="fc24409ed4079afe5a49dc21bfc18dc6"/><file name="desktop.ini" hash="c8595cf1e4e6603719df1cfc48d43fa4"/><file name="helvetica.php" hash="18a86c71e4288c7cfe6ad5116fe097c3"/><file name="helveticab.php" hash="536316f08a186e84a7c43cad3c09a1a5"/><file name="helveticabi.php" hash="8ebacb40c1a5f8a65cb311d6bd131216"/><file name="helveticai.php" hash="54e8686215214fc28e4a1eb9e9a3b05b"/><dir name="makefont"><file name="cp1250.map" hash="8a021bf2c9796273f4b2c3824efefc1d"/><file name="cp1251.map" hash="ee2f10b8198819a33d4aa566a7df4ec6"/><file name="cp1252.map" hash="8d7358daa8b750747694e822111898f9"/><file name="cp1253.map" hash="907301f283e7457d037fee0adb5ce187"/><file name="cp1254.map" hash="46e48666d54b3bc0d7eba59e1fc768f3"/><file name="cp1255.map" hash="c469cfdac7010e50b7fbcabaaf1393b1"/><file name="cp1257.map" hash="fe87c493f46ddfd8b57212cbc52e25ac"/><file name="cp1258.map" hash="86a4dee852783cc5b85ac83a82729d47"/><file name="cp874.map" hash="4fbafebd9ea29f4e10889749ec414113"/><file name="iso-8859-1.map" hash="53bffea6677269f073516bb10d28de02"/><file name="iso-8859-11.map" hash="83ecaf01ee009dc60c74e4fdaff0aa26"/><file name="iso-8859-15.map" hash="3d09f07dd446c6a2fc13a609c084e854"/><file name="iso-8859-16.map" hash="b56b0749d1ac137491e3714039009960"/><file name="iso-8859-2.map" hash="47507c221cb986421905861794102889"/><file name="iso-8859-4.map" hash="0355d40c58aa1db273ced4e7697b15b0"/><file name="iso-8859-5.map" hash="82a2003dbd3b5e359ea6b19898d4bc89"/><file name="iso-8859-7.map" hash="d0712d80739797b3495f67490d328d08"/><file name="iso-8859-9.map" hash="8647a52d390b37e26ed05e5ed6793b76"/><file name="koi8-r.map" hash="04f520a75d940d47dec77f1cc0539fbb"/><file name="koi8-u.map" hash="9046b7222af56cb6bbc349cac9dbabdf"/><file name="makefont.php" hash="fd9cb1c061b332b05bfa4ba8fde0ca3f"/></dir><file name="symbol.php" hash="56b0bdc3e447810455731272a60bb343"/><file name="times.php" hash="bbf949b03a5c8e5095b8c712de28856d"/><file name="timesb.php" hash="6704a156b70e2c1cca70b2764563b934"/><file name="timesbi.php" hash="72952b50ab13815c82aa984d76516e13"/><file name="timesi.php" hash="4ff5b220d7c754e2150c2d0ab7f7a499"/><file name="zapfdingbats.php" hash="05296fa60133b7a415237b2083f1a748"/></dir><file name="fpdf.css" hash="84befac49464a9aac54aa511bc1fd754"/><file name="fpdf.php" hash="11849ec6b91bc1edb30c51e1969670c0"/><file name="license.txt" hash="fb784726cfe3615da38bc23a3cac445b"/></dir><dir name="fpdi"><dir name="filters"><file name="FilterASCII85.php" hash="f02caf5a17552956eee4c0968ee95130"/><file name="FilterASCII85_FPDI.php" hash="7c6922b62cdcc6716bfc620da4751bce"/><file name="FilterLZW.php" hash="a47ae27863ce33faf8f6ac004aa560bf"/><file name="FilterLZW_FPDI.php" hash="a0990e9aff5b3a0c11c437dd7219c5ac"/></dir><file name="fpdf_tpl.php" hash="dfc851b960ddc9957e8016b9e6d89351"/><file name="fpdi.php" hash="136be47e11990ba1dd9cd96819812829"/><file name="fpdi2tcpdf_bridge.php" hash="b3641b867dab85cc4fe21c792c0e2ce6"/><file name="fpdi_pdf_parser.php" hash="a6828c73ca802d99433757da43578a63"/><file name="pdf_context.php" hash="9e7ab87525caf2032f27ed600f8e3ea2"/><file name="pdf_parser.php" hash="044940832b2c46b392a70c0c33b425e7"/></dir></target><target name="magelocale"><dir name="es_ES"><file name="Ydral_Correos.csv" hash="fa6ebb599d9137cb684159175f6cf498"/></dir></target><target name="mageweb"><dir><dir name="js"><dir name="correos"><file name="correos.js" hash="816995402e52b9f9b110f01473a98807"/><file name="proj4js-compressed.js" hash="87fdd389aec9749f4a0a1cfa2ed30be4"/></dir></dir></dir></target></contents>
21
  <compatible/>
22
  <dependencies><required><php><min>5.2.0</min><max>6.0.0</max></php></required></dependencies>
23
  </package>
skin/adminhtml/default/default/correos.css CHANGED
@@ -2,4 +2,7 @@ ul.tabs a.correos-section,
2
  ul.tabs a.correos-section:hover { background-color: #FDD116; padding:0.5em 0.5em 0.28em 1.5em; }
3
  ul.tabs a.correos-section:hover { background-color:#FDD116; }
4
  ul.tabs a.correos-section span,
5
- ul.tabs a.correos-section:hover span { background:url(images/correos-section.png) no-repeat 0 0; height:0; overflow:hidden; padding:14px 0 0; width:103px; }
 
 
 
2
  ul.tabs a.correos-section:hover { background-color: #FDD116; padding:0.5em 0.5em 0.28em 1.5em; }
3
  ul.tabs a.correos-section:hover { background-color:#FDD116; }
4
  ul.tabs a.correos-section span,
5
+ ul.tabs a.correos-section:hover span { background:url(images/correos-section.png) no-repeat 0 0; height:0; overflow:hidden; padding:14px 0 0; width:103px; }
6
+ .order-totals-correos { padding: 0; }
7
+ .multiremitente { padding: 10px; }
8
+ .multiremitente label { font-weight: bold; }
skin/adminhtml/default/default/images/correos/correos.png ADDED
Binary file
skin/frontend/base/default/css/correos.css CHANGED
@@ -1,3 +1,6 @@
1
  label[for=s_method_recogeroficina_recogeroficina] { line-height: 40px; }
2
  label[for=s_method_envio4872_envio4872] { line-height: 40px; }
3
- .title_correos_method { display: none; }
 
 
 
1
  label[for=s_method_recogeroficina_recogeroficina] { line-height: 40px; }
2
  label[for=s_method_envio4872_envio4872] { line-height: 40px; }
3
+ .title_correos_method { display: none; }
4
+ #correos_info_map { float: left; border: 1px solid #ccc; width: 350px; height: 180px; margin-right: 10px; margin-top: 15px; }
5
+ #correos_info_time { float: left; width: 240px; height: 180px; margin-top: 15px; }
6
+ .sp-methods dt { clear: both; font-weight: bold; margin: 13px 0 5px; }
skin/frontend/base/default/js/correos.js DELETED
@@ -1,161 +0,0 @@
1
-
2
- var clicked = false;
3
-
4
- PuntosCorreos = Class.create();
5
- PuntosCorreos.prototype = {
6
-
7
- initialize: function()
8
- {
9
- this.correosResultados = '';
10
- this.codigoPostalVal = '';
11
-
12
- Event.observe(window, 'load', function()
13
- {
14
-
15
-
16
- $$('.main').invoke('observe', 'click', function(e)
17
- {
18
-
19
- var element = e.element();
20
- if (element.getValue())
21
- {
22
- if (element.getValue() == 'recogeroficina_recogeroficina')
23
- {
24
- if (!clicked)
25
- {
26
- clicked = true;
27
- PuntosCorreos.getPuntosCorreos();
28
- }
29
- }
30
- }
31
- });
32
- });
33
-
34
- },
35
-
36
- validaRadio:function()
37
- {
38
- var radioValue = Form.getInputs('co-shipping-method-form','radio','shipping_method').find(function(radio) { return radio.checked; }).value;
39
- if (radioValue == 'recogeroficina_recogeroficina')
40
- {
41
- this.getPuntosCorreos();
42
- }
43
- },
44
-
45
- getPuntosCorreos:function()
46
- {
47
-
48
- var codPostal = '';
49
-
50
- if ($('cp_oficina_correos') != undefined)
51
- {
52
- codPostal = $('cp_oficina_correos').value;
53
- this.codigoPostalVal = codPostal;
54
- //$('cp_search').value = codPostal;
55
- }
56
-
57
- if ($('content_puntos_correos') != undefined)
58
- {
59
- $('content_puntos_correos').remove();
60
- }
61
-
62
-
63
- if ($('shipping-method-please-wait'))
64
- {
65
- Element.show('shipping-method-please-wait');
66
- }
67
-
68
- this.reloadurl = '/correos/index/getdata/';
69
- new Ajax.Request(this.reloadurl, {
70
- method: 'post',
71
- parameters: {codigoPostal: codPostal},
72
- onComplete: this.reloadChildren.bind(this)
73
- });
74
-
75
- },
76
-
77
- reloadChildren: function(transport)
78
- {
79
- if ($('shipping-method-please-wait'))
80
- {
81
- Element.hide('shipping-method-please-wait');
82
- }
83
- clicked = false;
84
- var htmlInicial = '<div id="content_puntos_correos" style="margin-left: 15px; clear: both; "><b>Introduce el c&oacute;digo postal para buscar oficina: </b><input type="text" name="cp_oficina_correos" id="cp_oficina_correos" value="" /><input type="hidden" name="cp_search" value="'+this.codigoPostalVal+'" id="cp_search" /><input type="button" value="Buscar" onClick="PuntosCorreos.getPuntosCorreos(); return false; " /><br />La oficina de Correos te avisar&aacute; cuando el paquete est&eacute; listo en sus oficinas:<br /><div id="oficinas_correos_content"><select id="oficinas_correos_content_select" name="oficinas_correos_content_select" onchange="PuntosCorreos.correosInfo();"></select></div><div id="correos_info_time" style="display: none; "></div></div>';
85
-
86
- $('s_method_recogeroficina_recogeroficina').next().insert({after: htmlInicial})
87
-
88
- var jsonResponse = transport.responseText.evalJSON(true);
89
- this.correosResultados = jsonResponse;
90
-
91
-
92
- this.fillDropDownCorreos ($('oficinas_correos_content_select'), this.correosResultados);
93
-
94
- },
95
-
96
- fillDropDownCorreos:function (field, data)
97
- {
98
- /*
99
- var htmlRadio = '';
100
- data.each(
101
- function(e) {
102
- htmlRadio+= '<input type="radio" value="'+e.unidad+'" name="oficinas_correos" />&nbsp;<label>'+e.nombre+' - '+e.direccion+" - "+e.cp+' '+e.cp+'</label><br />';
103
- }
104
- );
105
-
106
- $(field).update(htmlRadio);
107
- */
108
-
109
-
110
- for(i=field.options.length-1;i>=0;i--) { field.remove(i); }
111
-
112
- data.each(
113
- function(e) {
114
- //field.options.add(new Option(e.nombre+' - ('+e.direccion+") - ("+e.cp+') ('+e.localidad+')',e.unidad));
115
- field.options.add(new Option(e.direccion+" - "+e.cp+' - '+e.localidad,e.unidad));
116
- }
117
- );
118
-
119
- this.correosInfo()
120
-
121
-
122
- },
123
-
124
- correosInfo:function()
125
- {
126
-
127
- var puntoActual = $('oficinas_correos_content_select').value;
128
- this.correosResultados.each(
129
- function(e) {
130
- if (e.unidad == puntoActual)
131
- {
132
- $('correos_info_time').setStyle({display: 'block'});
133
-
134
- // info del punto
135
- this.infoHorarios(e);
136
-
137
- }
138
- }.bind(this));
139
-
140
- },
141
-
142
- infoHorarios: function (e)
143
- {
144
-
145
- var tablaHorarios = '<ol>';
146
- tablaHorarios += '<li><strong>Oficina</strong></li>';
147
- tablaHorarios += '<li>'+e.nombre+'<li>';
148
- tablaHorarios += '<li><strong>Horarios</strong></li>';
149
- tablaHorarios += '<li>Horario de Lunes a Viernes: '+e.horariolv+'</li>';
150
- tablaHorarios += '<li>Horario de S&aacute;bados: '+e.horarios+'</li>';
151
- tablaHorarios += '<li>Horario de Festivos: '+e.horariof+'</li>';
152
- tablaHorarios += '</ol>';
153
-
154
- $('correos_info_time').update(tablaHorarios);
155
-
156
- }
157
-
158
- }
159
-
160
- var PuntosCorreos = new PuntosCorreos();
161
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
skin/frontend/default/default/css/correos.css CHANGED
@@ -1,3 +1,6 @@
1
  label[for=s_method_recogeroficina_recogeroficina] { line-height: 40px; }
2
  label[for=s_method_envio4872_envio4872] { line-height: 40px; }
3
- .title_correos_method { display: none; }
 
 
 
1
  label[for=s_method_recogeroficina_recogeroficina] { line-height: 40px; }
2
  label[for=s_method_envio4872_envio4872] { line-height: 40px; }
3
+ .title_correos_method { display: none; }
4
+ #correos_info_map { float: left; border: 1px solid #ccc; width: 350px; height: 180px; margin-right: 10px; margin-top: 15px; }
5
+ #correos_info_time { float: left; width: 240px; height: 180px; margin-top: 15px; }
6
+ .sp-methods dt { clear: both; font-weight: bold; margin: 13px 0 5px; }
skin/frontend/default/default/images/correos/correos.png ADDED
Binary file
skin/frontend/default/default/images/correos/correos.psd ADDED
Binary file
skin/frontend/default/default/images/correos/correos2.psd ADDED
Binary file
skin/frontend/default/default/images/correos/globo.png ADDED
Binary file
skin/frontend/default/default/images/correos/globosombra.png ADDED
Binary file
skin/frontend/default/default/images/correos/logo_entregadomicilio.jpg ADDED
Binary file
skin/frontend/default/default/images/correos/logo_recogeroficina.jpg ADDED
Binary file
skin/frontend/default/default/images/correos/red-rounded01.psd ADDED
Binary file
skin/frontend/default/default/js/correos.js DELETED
@@ -1,162 +0,0 @@
1
-
2
- var clicked = false;
3
-
4
- PuntosCorreos = Class.create();
5
- PuntosCorreos.prototype = {
6
-
7
- initialize: function()
8
- {
9
- this.correosResultados = '';
10
- this.codigoPostalVal = '';
11
-
12
- Event.observe(window, 'load', function()
13
- {
14
-
15
-
16
- $$('.main').invoke('observe', 'click', function(e)
17
- {
18
-
19
- var element = e.element();
20
- if (element.getValue())
21
- {
22
- if (element.getValue() == 'recogeroficina_recogeroficina')
23
- {
24
- if (!clicked)
25
- {
26
- clicked = true;
27
- PuntosCorreos.getPuntosCorreos();
28
- }
29
- }
30
- }
31
- });
32
- });
33
-
34
- },
35
-
36
- validaRadio:function()
37
- {
38
- var radioValue = Form.getInputs('co-shipping-method-form','radio','shipping_method').find(function(radio) { return radio.checked; }).value;
39
- if (radioValue == 'recogeroficina_recogeroficina')
40
- {
41
- this.getPuntosCorreos();
42
- }
43
- },
44
-
45
- getPuntosCorreos:function()
46
- {
47
-
48
- var codPostal = '';
49
-
50
- if ($('cp_oficina_correos') != undefined)
51
- {
52
- codPostal = $('cp_oficina_correos').value;
53
- this.codigoPostalVal = codPostal;
54
- //$('cp_search').value = codPostal;
55
- }
56
-
57
- if ($('content_puntos_correos') != undefined)
58
- {
59
- $('content_puntos_correos').remove();
60
- }
61
-
62
-
63
- if ($('shipping-method-please-wait'))
64
- {
65
- Element.show('shipping-method-please-wait');
66
- }
67
-
68
-
69
- this.reloadurl = BASE_URL_CORREOS+'/correos/index/getdata/';
70
- new Ajax.Request(this.reloadurl, {
71
- method: 'post',
72
- parameters: {codigoPostal: codPostal},
73
- onComplete: this.reloadChildren.bind(this)
74
- });
75
-
76
- },
77
-
78
- reloadChildren: function(transport)
79
- {
80
- if ($('shipping-method-please-wait'))
81
- {
82
- Element.hide('shipping-method-please-wait');
83
- }
84
- clicked = false;
85
- var htmlInicial = '<div id="content_puntos_correos" style="margin-left: 15px; clear: both; "><b>Introduce el c&oacute;digo postal para buscar oficina: </b><input type="text" name="cp_oficina_correos" id="cp_oficina_correos" value="" /><input type="hidden" name="cp_search" value="'+this.codigoPostalVal+'" id="cp_search" /><input type="button" value="Buscar" onClick="PuntosCorreos.getPuntosCorreos(); return false; " /><br />La oficina de Correos te avisar&aacute; cuando el paquete est&eacute; listo en sus oficinas:<br /><div id="oficinas_correos_content"><select id="oficinas_correos_content_select" name="oficinas_correos_content_select" onchange="PuntosCorreos.correosInfo();"></select></div><div id="correos_info_time" style="display: none; "></div></div>';
86
-
87
- $('s_method_recogeroficina_recogeroficina').next().insert({after: htmlInicial})
88
-
89
- var jsonResponse = transport.responseText.evalJSON(true);
90
- this.correosResultados = jsonResponse;
91
-
92
-
93
- this.fillDropDownCorreos ($('oficinas_correos_content_select'), this.correosResultados);
94
-
95
- },
96
-
97
- fillDropDownCorreos:function (field, data)
98
- {
99
- /*
100
- var htmlRadio = '';
101
- data.each(
102
- function(e) {
103
- htmlRadio+= '<input type="radio" value="'+e.unidad+'" name="oficinas_correos" />&nbsp;<label>'+e.nombre+' - '+e.direccion+" - "+e.cp+' '+e.cp+'</label><br />';
104
- }
105
- );
106
-
107
- $(field).update(htmlRadio);
108
- */
109
-
110
-
111
- for(i=field.options.length-1;i>=0;i--) { field.remove(i); }
112
-
113
- data.each(
114
- function(e) {
115
- //field.options.add(new Option(e.nombre+' - ('+e.direccion+") - ("+e.cp+') ('+e.localidad+')',e.unidad));
116
- field.options.add(new Option(e.direccion+" - "+e.cp+' - '+e.localidad,e.unidad));
117
- }
118
- );
119
-
120
- this.correosInfo()
121
-
122
-
123
- },
124
-
125
- correosInfo:function()
126
- {
127
-
128
- var puntoActual = $('oficinas_correos_content_select').value;
129
- this.correosResultados.each(
130
- function(e) {
131
- if (e.unidad == puntoActual)
132
- {
133
- $('correos_info_time').setStyle({display: 'block'});
134
-
135
- // info del punto
136
- this.infoHorarios(e);
137
-
138
- }
139
- }.bind(this));
140
-
141
- },
142
-
143
- infoHorarios: function (e)
144
- {
145
-
146
- var tablaHorarios = '<ol>';
147
- tablaHorarios += '<li><strong>Oficina</strong></li>';
148
- tablaHorarios += '<li>'+e.nombre+'<li>';
149
- tablaHorarios += '<li><strong>Horarios</strong></li>';
150
- tablaHorarios += '<li>Horario de Lunes a Viernes: '+e.horariolv+'</li>';
151
- tablaHorarios += '<li>Horario de S&aacute;bados: '+e.horarios+'</li>';
152
- tablaHorarios += '<li>Horario de Festivos: '+e.horariof+'</li>';
153
- tablaHorarios += '</ol>';
154
-
155
- $('correos_info_time').update(tablaHorarios);
156
-
157
- }
158
-
159
- }
160
-
161
- var PuntosCorreos = new PuntosCorreos();
162
-