Skip to content

Commit

Permalink
Merged develop into master
Browse files Browse the repository at this point in the history
  • Loading branch information
mbe1987 committed Feb 3, 2023
2 parents bcb5a7e + 7a3ea6e commit a4ef75c
Show file tree
Hide file tree
Showing 9 changed files with 60 additions and 117 deletions.
5 changes: 5 additions & 0 deletions Changelog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Changelog

## 1.6.9
* removed unused DHL products
* bugfix for Ident in GKV API
* split name of sender and return receiver in name1, name2 and name3 for custom labels

## 1.6.8
* bugfix: improved PHP 8.1 compatibility
* fixed country value not being sent in form
Expand Down
2 changes: 1 addition & 1 deletion project.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"pathToModule": "copy_this/modules/mo/mo_dhl",
"prefix": "mo_",
"suffix": "",
"version": "1.6.8",
"version": "1.6.9",
"compatibility": {
"minimumVersion": "6.0",
"maximumVersion": null,
Expand Down
8 changes: 4 additions & 4 deletions src/modules/mo/mo_dhl/Adapter/GKVCustomShipmentBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public function toCustomizableParametersArray(ShipmentOrderType $shipmentOrder):
'total' => ['weight' => $shipmentOrder->getShipment()->getShipmentDetails()->getShipmentItem()->getWeightInKG(), 'title' => Registry::getLang()->translateString('GENERAL_ATALL')],
], $this->getExportDocPositionWeights($shipmentOrder)),
'shipper' => [
'name' => $shipper->getName()->getName1() . $shipper->getName()->getName2() . $shipper->getName()->getName3(),
'name' => $shipper->getName(),
'address' => $shipper->getAddress(),
],
'receiver' => [
Expand All @@ -57,7 +57,7 @@ public function toCustomizableParametersArray(ShipmentOrderType $shipmentOrder):
'communication' => $receiver->getCommunication(),
],
'returnReceiver' => [
'name' => $returnReceiver->getName()->getName1() . $returnReceiver->getName()->getName2() . $returnReceiver->getName()->getName3(),
'name' => $returnReceiver->getName(),
'address' => $returnReceiver->getAddress(),
],
'services' => [
Expand Down Expand Up @@ -118,7 +118,7 @@ protected function useCustomWeightData(ShipmentOrderType $shipmentOrder, $weight
protected function useCustomShipper(ShipmentOrderType $shipmentOrder, $shipperData)
{
$shipper = $shipmentOrder->getShipment()->getShipper();
$shipper->getName()->setName1($shipperData['name']);
$shipper->getName()->setName1($shipperData['name1'])->setName2($shipperData['name2'])->setName3($shipperData['name3']);
$shipperData['Origin'] = new CountryType($shipperData['country']);
$shipper->getAddress()->assign($shipperData);
}
Expand All @@ -130,7 +130,7 @@ protected function useCustomShipper(ShipmentOrderType $shipmentOrder, $shipperDa
protected function useCustomReturnReceiver(ShipmentOrderType $shipmentOrder, $returnReceiverData)
{
$returnReceiver = $shipmentOrder->getShipment()->getReturnReceiver();
$returnReceiver->getName()->setName1($returnReceiverData['name']);
$returnReceiver->getName()->setName1($returnReceiverData['name1'])->setName2($returnReceiverData['name2'])->setName3($returnReceiverData['name3']);
$returnReceiverData['Origin'] = new CountryType($returnReceiverData['country']);
$returnReceiver->getAddress()->assign($returnReceiverData);
}
Expand Down
1 change: 0 additions & 1 deletion src/modules/mo/mo_dhl/Api/GKV.php
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,6 @@ class GKV extends \SoapClient
'ShipperType' => 'Mediaopt\\DHL\\Api\\GKV\\ShipperType',
'ReceiverTypeType' => 'Mediaopt\\DHL\\Api\\GKV\\ReceiverTypeType',
'ReceiverType' => 'Mediaopt\\DHL\\Api\\GKV\\ReceiverType',
'Ident' => 'Mediaopt\\DHL\\Api\\GKV\\Ident',
'ShipmentDetailsType' => 'Mediaopt\\DHL\\Api\\GKV\\ShipmentDetailsType',
'ShipmentDetailsTypeType' => 'Mediaopt\\DHL\\Api\\GKV\\ShipmentDetailsTypeType',
'ShipmentItemType' => 'Mediaopt\\DHL\\Api\\GKV\\ShipmentItemType',
Expand Down
87 changes: 0 additions & 87 deletions src/modules/mo/mo_dhl/Shipment/Process.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,33 +13,11 @@ class Process
*/
const PAKET = 'PAKET';

/**
* @var string DHL Paket PRIO
*/
const PAKET_PRIO = 'PAKET_PRIO';

/**
* @var string DHL Paket Taggleich
*/
const PAKET_TAGGLEICH = 'PAKET_TAGGLEICH';

/**
* @var string DHL Retoure für DHL Paket
*/
const RETOURE_FUER_PAKET = 'RETOURE_FUER_PAKET';

/**
* @var string DHL Retoure für DHL Paket Taggleich
*/
const RETOURE_FUER_PAKET_TAGGLEICH = 'RETOURE_FUER_PAKET_TAGGLEICH';
/**
* @var string DHL Retoure für DHL Paket Austria
*/
const RETOURE_FUER_PAKET_AT = 'RETOURE_FUER_PAKET_AT';
/**
* @var string DHL Retoure für DHL Paket Connect
*/
const RETOURE_FUER_PAKET_CONNECT = 'RETOURE_FUER_PAKET_CONNECT';
/**
* @var string DHL Paket International
*/
Expand All @@ -50,26 +28,6 @@ class Process
*/
const EUROPAKET = 'EUROPAKET';

/**
* @var string DHL Paket Connect
*/
const PAKET_CONNECT = 'PAKET_CONNECT';

/**
* @var string DHL Paket Austria
*/
const PAKET_AT = 'PAKET_AT';

/**
* @var string DHL Paket Connect (Austria)
*/
const PAKET_CONNECT_AT = 'PAKET_CONNECT_AT';

/**
* @var string DHL Paket International (Austria)
*/
const PAKET_INTERNATIONAL_AT = 'PAKET_INTERNATIONAL_AT';

/**
* @var string Warenpost national
*/
Expand Down Expand Up @@ -188,19 +146,6 @@ class Process
self::SERVICE_BULKY_GOOD,
self::SERVICE_CASH_ON_DELIVERY,
],
self::PAKET_PRIO => [
self::SERVICE_PREFERRED_NEIGHBOUR,
self::SERVICE_PREFERRED_LOCATION,
self::SERVICE_NOTIFICATION,
self::SERVICE_PREFERRED_DAY,
self::SERVICE_GO_GREEN,
self::SERVICE_PARCEL_OUTLET_ROUTING,
self::SERVICE_DHL_RETOURE,
self::SERVICE_VISUAL_AGE_CHECK,
self::SERVICE_IDENT_CHECK,
self::SERVICE_ADDITIONAL_INSURANCE,
self::SERVICE_CASH_ON_DELIVERY,
],
self::PAKET_INTERNATIONAL => [
self::SERVICE_NOTIFICATION,
self::SERVICE_GO_GREEN,
Expand All @@ -217,13 +162,6 @@ class Process
self::SERVICE_GO_GREEN,
self::SERVICE_ADDITIONAL_INSURANCE,
],
self::PAKET_CONNECT => [
self::SERVICE_NOTIFICATION,
self::SERVICE_GO_GREEN,
self::SERVICE_DHL_RETOURE,
self::SERVICE_ADDITIONAL_INSURANCE,
self::SERVICE_BULKY_GOOD,
],
self::WARENPOST => [
self::SERVICE_PREFERRED_NEIGHBOUR,
self::SERVICE_PREFERRED_LOCATION,
Expand Down Expand Up @@ -300,20 +238,11 @@ public function __toString()
/** @var string[] $identifierToNumber */
$identifierToNumber = [
self::PAKET => '01',
self::PAKET_PRIO => '01',
self::PAKET_TAGGLEICH => '06',
self::PAKET_INTERNATIONAL => '53',
self::EUROPAKET => '54',
self::PAKET_CONNECT => '55',
self::WARENPOST => '62',
self::WARENPOST_INTERNATIONAL => '66',
self::PAKET_AT => '86',
self::PAKET_CONNECT_AT => '87',
self::PAKET_INTERNATIONAL_AT => '82',
self::RETOURE_FUER_PAKET => '07',
self::RETOURE_FUER_PAKET_TAGGLEICH => '07',
self::RETOURE_FUER_PAKET_CONNECT => '85',
self::RETOURE_FUER_PAKET_AT => '85',
];

return $identifierToNumber[$this->identifier];
Expand Down Expand Up @@ -455,20 +384,11 @@ public function getServiceIdentifier()
{
$identifierToService = [
self::PAKET => 'V01PAK',
self::PAKET_PRIO => 'V01PRIO',
self::PAKET_TAGGLEICH => 'V06PAK',
self::PAKET_INTERNATIONAL => 'V53WPAK',
self::EUROPAKET => 'V54EPAK',
self::PAKET_CONNECT => 'V55PAK',
self::WARENPOST => 'V62WP',
self::WARENPOST_INTERNATIONAL => 'V66WPI',
self::PAKET_AT => 'V86PARCEL',
self::PAKET_CONNECT_AT => 'V87PARCEL',
self::PAKET_INTERNATIONAL_AT => 'V82PARCEL',
self::RETOURE_FUER_PAKET => 'V01PAK',
self::RETOURE_FUER_PAKET_TAGGLEICH => 'V06PAK',
self::RETOURE_FUER_PAKET_CONNECT => 'V87PARCEL',
self::RETOURE_FUER_PAKET_AT => 'V86PARCEL',
];

return $identifierToService[$this->identifier];
Expand Down Expand Up @@ -497,7 +417,6 @@ public function isInternational()
{
return in_array($this->identifier, [
self::PAKET_INTERNATIONAL,
self::PAKET_INTERNATIONAL_AT,
self::WARENPOST_INTERNATIONAL,
]);
}
Expand All @@ -517,14 +436,8 @@ public static function getAvailableProcesses()
{
return [
'PAKET' => 'DHL Paket',
'PAKET_PRIO' => 'DHL Paket PRIO',
'PAKET_TAGGLEICH' => 'DHL Paket Taggleich',
'PAKET_INTERNATIONAL' => 'DHL Paket International',
'EUROPAKET' => 'DHL Europaket (B2B)',
'PAKET_CONNECT' => 'DHL Paket Connect',
'PAKET_AT' => 'DHL Paket Austria',
'PAKET_CONNECT_AT' => 'DHL Paket Connect (Austria)',
'PAKET_INTERNATIONAL_AT' => 'DHL Paket International (Austria)',
'WARENPOST' => 'Warenpost national',
'INTERNETMARKE' => 'Internetmarke',
'WARENPOST_INTERNATIONAL'=> 'Warenpost International',
Expand Down
2 changes: 1 addition & 1 deletion src/modules/mo/mo_dhl/metadata.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
'en' => '<p>Enable features providing Post & Paket Delivery to your OXID shop.</p>' . '<p><a href="https://projects.mediaopt.de/projects/mopt-postp-ua/wiki" target="_blank">Handbook</a></p>',
],
'thumbnail' => 'logo.png',
'version' => '1.6.8',
'version' => '1.6.9',
'author' => '<a href="http://www.mediaopt.de" target="_blank">mediaopt.</a>',
'url' => 'http://www.mediaopt.de',
'email' => '[email protected]',
Expand Down
60 changes: 49 additions & 11 deletions src/modules/mo/mo_dhl/views/admin/tpl/order_dhl_custom_label.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -198,13 +198,32 @@
<b>[{oxmultilang ident='MO_DHL__CUSTOM_LABEL_SHIPPER'}]</b>
</td>
</tr>
[{assign var="name" value=$shipmentOrder.shipper.name}]
<tr>
<td>
[{oxmultilang ident='MO_DHL__CUSTOM_LABEL_NAME'}]
[{oxmultilang ident='SHOP_MODULE_mo_dhl__sender_line1'}]
</td>
<td>
<input type="text" name="data[shipper][name1]"
value="[{$name->getName1()}]">
</td>
</tr>
<tr>
<td>
[{oxmultilang ident='SHOP_MODULE_mo_dhl__sender_line2'}]
</td>
<td>
<input type="text" name="data[shipper][name2]"
value="[{$name->getName2()}]">
</td>
</tr>
<tr>
<td>
[{oxmultilang ident='SHOP_MODULE_mo_dhl__sender_line3'}]
</td>
<td>
<input type="text" name="data[shipper][name]"
value="[{$shipmentOrder.shipper.name}]">
<input type="text" name="data[shipper][name3]"
value="[{$name->getName3()}]">
</td>
</tr>
[{assign var="address" value=$shipmentOrder.shipper.address}]
Expand Down Expand Up @@ -264,13 +283,32 @@
<b>[{oxmultilang ident='MO_DHL__CUSTOM_LABEL_RETURN_RECEIVER'}]</b>
</td>
</tr>
[{assign var="name" value=$shipmentOrder.returnReceiver.name}]
<tr>
<td>
[{oxmultilang ident='MO_DHL__CUSTOM_LABEL_NAME'}]
[{oxmultilang ident='SHOP_MODULE_mo_dhl__retoure_receiver_line1'}]
</td>
<td>
<input type="text" name="data[returnReceiver][name1]"
value="[{$name->getName1()}]">
</td>
</tr>
<tr>
<td>
[{oxmultilang ident='SHOP_MODULE_mo_dhl__retoure_receiver_line2'}]
</td>
<td>
<input type="text" name="data[returnReceiver][name2]"
value="[{$name->getName2()}]">
</td>
</tr>
<tr>
<td>
[{oxmultilang ident='SHOP_MODULE_mo_dhl__retoure_receiver_line3'}]
</td>
<td>
<input type="text" name="data[returnReceiver][name]"
value="[{$shipmentOrder.returnReceiver.name}]">
<input type="text" name="data[returnReceiver][name3]"
value="[{$name->getName3()}]">
</td>
</tr>
[{assign var="address" value=$shipmentOrder.returnReceiver.address}]
Expand Down Expand Up @@ -432,7 +470,7 @@
</td>
<td>
<input type="text" name="data[services][identCheck][surname]"
value="[{if $identDetails}][{$identDetails->surname}][{/if}]">
value="[{if $identDetails}][{$identDetails->getSurname()}][{/if}]">
</td>
</tr>
<tr>
Expand All @@ -441,7 +479,7 @@
</td>
<td>
<input type="text" name="data[services][identCheck][givenName]"
value="[{if $identDetails}][{$identDetails->givenName}][{/if}]">
value="[{if $identDetails}][{$identDetails->getGivenName()}][{/if}]">
</td>
</tr>
<tr>
Expand All @@ -450,7 +488,7 @@
</td>
<td>
<input type="text" name="data[services][identCheck][dateOfBirth]"
value="[{if $identDetails}][{$identDetails->dateOfBirth}][{/if}]">
value="[{if $identDetails}][{$identDetails->getDateOfBirth()}][{/if}]">
</td>
</tr>
<tr>
Expand All @@ -460,8 +498,8 @@
<td>
<select name="data[services][identCheck][minimumAge]">
<option value="">-</option>
<option value="16" [{if $identDetails && $identDetails->minimumAge === 'A16'}] selected[{/if}]>16</option>
<option value="18" [{if $identDetails && $identDetails->minimumAge === 'A18'}] selected[{/if}]>18</option>
<option value="16" [{if $identDetails && $identDetails->getMinimumAge() === 'A16'}] selected[{/if}]>16</option>
<option value="18" [{if $identDetails && $identDetails->getMinimumAge() === 'A18'}] selected[{/if}]>18</option>
</select>
</td>
</tr>
Expand Down
6 changes: 0 additions & 6 deletions tests/Export/CsvExporterTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,8 @@ class CsvExporterTest extends PHPUnit_Framework_TestCase
{
const PROCESS_IDENTIFIERS = [
Process::PAKET,
Process::PAKET_PRIO,
Process::PAKET_TAGGLEICH,
Process::PAKET_INTERNATIONAL,
Process::EUROPAKET,
Process::PAKET_CONNECT,
Process::PAKET_INTERNATIONAL_AT,
Process::PAKET_AT,
Process::PAKET_CONNECT_AT,
];

const EXPECTED_ROW = [
Expand Down
6 changes: 0 additions & 6 deletions tests/Shipment/ProcessTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,8 @@ class ProcessTest extends PHPUnit_Framework_TestCase

const PROCESS_IDENTIFIERS = [
Process::PAKET,
Process::PAKET_PRIO,
Process::PAKET_TAGGLEICH,
Process::PAKET_INTERNATIONAL,
Process::EUROPAKET,
Process::PAKET_CONNECT,
Process::PAKET_INTERNATIONAL_AT,
Process::PAKET_AT,
Process::PAKET_CONNECT_AT,
Process::WARENPOST,
];

Expand Down

0 comments on commit a4ef75c

Please sign in to comment.