ltsecurityinc安防产品在线商城代码
This commit is contained in:
+37
@@ -0,0 +1,37 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
/**
|
||||
* @author Amasty Team
|
||||
* @copyright Copyright (c) Amasty (https://www.amasty.com)
|
||||
* @package Admin Actions Log for Magento 2
|
||||
*/
|
||||
|
||||
namespace Amasty\AdminActionsLog\Logging\Entity\SaveHandler\Sales;
|
||||
|
||||
use Amasty\AdminActionsLog\Api\Logging\MetadataInterface;
|
||||
use Amasty\AdminActionsLog\Logging\Entity\SaveHandler\Common;
|
||||
use Amasty\AdminActionsLog\Model\LogEntry\LogEntry;
|
||||
use Amasty\AdminActionsLog\Model\OptionSource\LogEntryTypes;
|
||||
|
||||
class Creditmemo extends Common
|
||||
{
|
||||
public const CATEGORY = 'sales/order_creditmemo/view';
|
||||
|
||||
public function getLogMetadata(MetadataInterface $metadata): array
|
||||
{
|
||||
/** @var \Magento\Sales\Model\Order\Creditmemo $creditMemo */
|
||||
$creditMemo = $metadata->getObject();
|
||||
$type = $creditMemo->getOrigData() === null ? LogEntryTypes::TYPE_NEW : LogEntryTypes::TYPE_EDIT;
|
||||
|
||||
return [
|
||||
LogEntry::TYPE => $type,
|
||||
LogEntry::ITEM => __('Credit Memo for Order #%1', $creditMemo->getOrder()->getRealOrderId()),
|
||||
LogEntry::CATEGORY => self::CATEGORY,
|
||||
LogEntry::CATEGORY_NAME => __('Credit Memo'),
|
||||
LogEntry::ELEMENT_ID => (int)$creditMemo->getId(),
|
||||
LogEntry::PARAMETER_NAME => 'creditmemo_id'
|
||||
];
|
||||
}
|
||||
}
|
||||
+37
@@ -0,0 +1,37 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
/**
|
||||
* @author Amasty Team
|
||||
* @copyright Copyright (c) Amasty (https://www.amasty.com)
|
||||
* @package Admin Actions Log for Magento 2
|
||||
*/
|
||||
|
||||
namespace Amasty\AdminActionsLog\Logging\Entity\SaveHandler\Sales;
|
||||
|
||||
use Amasty\AdminActionsLog\Api\Logging\MetadataInterface;
|
||||
use Amasty\AdminActionsLog\Logging\Entity\SaveHandler\Common;
|
||||
use Amasty\AdminActionsLog\Model\LogEntry\LogEntry;
|
||||
use Amasty\AdminActionsLog\Model\OptionSource\LogEntryTypes;
|
||||
|
||||
class Invoice extends Common
|
||||
{
|
||||
public const CATEGORY = 'sales/order_invoice/view';
|
||||
|
||||
public function getLogMetadata(MetadataInterface $metadata): array
|
||||
{
|
||||
/** @var \Magento\Sales\Model\Order\Invoice $invoice */
|
||||
$invoice = $metadata->getObject();
|
||||
$type = $invoice->getOrigData() === null ? LogEntryTypes::TYPE_NEW : LogEntryTypes::TYPE_EDIT;
|
||||
|
||||
return [
|
||||
LogEntry::TYPE => $type,
|
||||
LogEntry::ITEM => __('Invoice for Order #%1', $invoice->getOrder()->getRealOrderId()),
|
||||
LogEntry::CATEGORY => self::CATEGORY,
|
||||
LogEntry::CATEGORY_NAME => __('Invoice'),
|
||||
LogEntry::ELEMENT_ID => (int)$invoice->getId(),
|
||||
LogEntry::PARAMETER_NAME => 'invoice_id'
|
||||
];
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
/**
|
||||
* @author Amasty Team
|
||||
* @copyright Copyright (c) Amasty (https://www.amasty.com)
|
||||
* @package Admin Actions Log for Magento 2
|
||||
*/
|
||||
|
||||
namespace Amasty\AdminActionsLog\Logging\Entity\SaveHandler\Sales;
|
||||
|
||||
use Amasty\AdminActionsLog\Api\Logging\MetadataInterface;
|
||||
use Amasty\AdminActionsLog\Logging\Entity\SaveHandler\Common;
|
||||
use Amasty\AdminActionsLog\Model\LogEntry\LogEntry;
|
||||
use Amasty\AdminActionsLog\Model\OptionSource\LogEntryTypes;
|
||||
|
||||
class Order extends Common
|
||||
{
|
||||
public const CATEGORY = 'sales/order/view';
|
||||
|
||||
public function getLogMetadata(MetadataInterface $metadata): array
|
||||
{
|
||||
/** @var \Magento\Sales\Model\Order $order */
|
||||
$order = $metadata->getObject();
|
||||
$type = $order->getOrigData() === null ? LogEntryTypes::TYPE_NEW : LogEntryTypes::TYPE_EDIT;
|
||||
|
||||
return [
|
||||
LogEntry::TYPE => $type,
|
||||
LogEntry::ITEM => __('Order #%1', $order->getRealOrderId()),
|
||||
LogEntry::CATEGORY => self::CATEGORY,
|
||||
LogEntry::CATEGORY_NAME => __('Order'),
|
||||
LogEntry::ELEMENT_ID => (int)$order->getId(),
|
||||
LogEntry::PARAMETER_NAME => 'order_id'
|
||||
];
|
||||
}
|
||||
}
|
||||
+49
@@ -0,0 +1,49 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
/**
|
||||
* @author Amasty Team
|
||||
* @copyright Copyright (c) Amasty (https://www.amasty.com)
|
||||
* @package Admin Actions Log for Magento 2
|
||||
*/
|
||||
|
||||
namespace Amasty\AdminActionsLog\Logging\Entity\SaveHandler\Sales;
|
||||
|
||||
use Amasty\AdminActionsLog\Api\Logging\MetadataInterface;
|
||||
use Amasty\AdminActionsLog\Logging\Entity\SaveHandler\Common;
|
||||
use Amasty\AdminActionsLog\Model\LogEntry\LogEntry;
|
||||
use Amasty\AdminActionsLog\Model\OptionSource\LogEntryTypes;
|
||||
|
||||
class OrderAddress extends Common
|
||||
{
|
||||
public const CATEGORY = 'sales/order/address';
|
||||
|
||||
/**
|
||||
* @var string[]
|
||||
*/
|
||||
protected $dataKeysIgnoreList = [
|
||||
'form_key',
|
||||
'region_code'
|
||||
];
|
||||
|
||||
public function getLogMetadata(MetadataInterface $metadata): array
|
||||
{
|
||||
/** @var \Magento\Sales\Model\Order\Address $address */
|
||||
$address = $metadata->getObject();
|
||||
$type = $address->getOrigData() === null ? LogEntryTypes::TYPE_NEW : LogEntryTypes::TYPE_EDIT;
|
||||
|
||||
return [
|
||||
LogEntry::TYPE => $type,
|
||||
LogEntry::ITEM => __(
|
||||
'%1 Address for Order #%2',
|
||||
ucfirst($address->getAddressType()),
|
||||
$address->getOrder()->getRealOrderId()
|
||||
),
|
||||
LogEntry::CATEGORY => self::CATEGORY,
|
||||
LogEntry::CATEGORY_NAME => __('Order Address'),
|
||||
LogEntry::ELEMENT_ID => (int)$address->getId(),
|
||||
LogEntry::PARAMETER_NAME => 'address_id'
|
||||
];
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
/**
|
||||
* @author Amasty Team
|
||||
* @copyright Copyright (c) Amasty (https://www.amasty.com)
|
||||
* @package Admin Actions Log for Magento 2
|
||||
*/
|
||||
|
||||
namespace Amasty\AdminActionsLog\Logging\Entity\SaveHandler\Sales;
|
||||
|
||||
use Amasty\AdminActionsLog\Api\Logging\MetadataInterface;
|
||||
use Amasty\AdminActionsLog\Logging\Entity\SaveHandler\Common;
|
||||
use Amasty\AdminActionsLog\Model\LogEntry\LogEntry;
|
||||
|
||||
class Rma extends Common
|
||||
{
|
||||
public const CATEGORY = 'admin/rma/edit';
|
||||
|
||||
/**
|
||||
* @param MetadataInterface $metadata
|
||||
* @return array
|
||||
*/
|
||||
public function getLogMetadata(MetadataInterface $metadata): array
|
||||
{
|
||||
/** @var \Magento\Rma\Model\Rma $rma */
|
||||
$rma = $metadata->getObject();
|
||||
|
||||
return [
|
||||
LogEntry::ITEM => __('Return Request #%1', $rma->getId()),
|
||||
LogEntry::CATEGORY => self::CATEGORY,
|
||||
LogEntry::CATEGORY_NAME => __('RMA'),
|
||||
LogEntry::ELEMENT_ID => (int)$rma->getId()
|
||||
];
|
||||
}
|
||||
}
|
||||
+37
@@ -0,0 +1,37 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
/**
|
||||
* @author Amasty Team
|
||||
* @copyright Copyright (c) Amasty (https://www.amasty.com)
|
||||
* @package Admin Actions Log for Magento 2
|
||||
*/
|
||||
|
||||
namespace Amasty\AdminActionsLog\Logging\Entity\SaveHandler\Sales;
|
||||
|
||||
use Amasty\AdminActionsLog\Api\Logging\MetadataInterface;
|
||||
use Amasty\AdminActionsLog\Logging\Entity\SaveHandler\Common;
|
||||
use Amasty\AdminActionsLog\Model\LogEntry\LogEntry;
|
||||
use Amasty\AdminActionsLog\Model\OptionSource\LogEntryTypes;
|
||||
|
||||
class Shipment extends Common
|
||||
{
|
||||
public const CATEGORY = 'sales/shipment/view';
|
||||
|
||||
public function getLogMetadata(MetadataInterface $metadata): array
|
||||
{
|
||||
/** @var \Magento\Sales\Model\Order\Shipment $shipment */
|
||||
$shipment = $metadata->getObject();
|
||||
$type = $shipment->getOrigData() === null ? LogEntryTypes::TYPE_NEW : LogEntryTypes::TYPE_EDIT;
|
||||
|
||||
return [
|
||||
LogEntry::TYPE => $type,
|
||||
LogEntry::ITEM => __('Shipment for Order #%1', $shipment->getOrder()->getRealOrderId()),
|
||||
LogEntry::CATEGORY => self::CATEGORY,
|
||||
LogEntry::CATEGORY_NAME => __('Shipment'),
|
||||
LogEntry::ELEMENT_ID => (int)$shipment->getId(),
|
||||
LogEntry::PARAMETER_NAME => 'shipment_id'
|
||||
];
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user