-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #19 from olivertar/master
Hacer editable el source de tipos de documento
- Loading branch information
Showing
12 changed files
with
224 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
<?php | ||
namespace Mugar\CustomerIdentificationDocument\Block\Adminhtml\Order\View; | ||
|
||
use Magento\Backend\Block\Template\Context; | ||
use Magento\Framework\Registry; | ||
use Magento\Sales\Helper\Admin; | ||
use Mugar\CustomerIdentificationDocument\Api\CidFieldsRepositoryInterface; | ||
|
||
class CidFields extends \Magento\Sales\Block\Adminhtml\Order\AbstractOrder | ||
{ | ||
/** | ||
* ContactType constructor. | ||
* @param \Magento\Backend\Block\Template\Context $context | ||
* @param \Magento\Framework\Registry $registry | ||
* @param \Magento\Sales\Helper\Admin $adminHelper | ||
* @param array $data | ||
*/ | ||
public function __construct( | ||
Context $context, | ||
Registry $registry, | ||
Admin $adminHelper, | ||
CidFieldsRepositoryInterface $cidFieldsRepository, | ||
array $data = [] | ||
) { | ||
$this->cidFieldsRepository = $cidFieldsRepository; | ||
parent::__construct($context, $registry, $adminHelper, $data); | ||
} | ||
|
||
public function getCidFields() | ||
{ | ||
return $this->cidFieldsRepository->getCidFields($this->getOrder()); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
<?php | ||
/** | ||
* Customer Identification Document | ||
* | ||
* @category Mugar | ||
* @package Mugar_CustomerIdentificationDocument | ||
* @license http://www.opensource.org/licenses/mit-license.html MIT License | ||
* @author Mugar (https://www.mugar.io/) | ||
* | ||
*/ | ||
|
||
namespace Mugar\CustomerIdentificationDocument\Block\Order\View; | ||
|
||
use Magento\Framework\View\Element\Template; | ||
use Magento\Framework\View\Element\Template\Context; | ||
use Magento\Framework\Registry; | ||
use Magento\Sales\Model\Order; | ||
use Mugar\CustomerIdentificationDocument\Api\Data\CidFieldsInterface; | ||
use Mugar\CustomerIdentificationDocument\Api\CidFieldsRepositoryInterface; | ||
|
||
class CidFields extends Template | ||
{ | ||
|
||
protected $coreRegistry = null; | ||
|
||
protected $cidFieldsRepository; | ||
|
||
public function __construct( | ||
Context $context, | ||
Registry $registry, | ||
CidFieldsRepositoryInterface $cidFieldsRepository, | ||
array $data = [] | ||
) { | ||
$this->coreRegistry = $registry; | ||
$this->cidFieldsRepository = $cidFieldsRepository; | ||
$this->_isScopePrivate = true; | ||
$this->_template = 'Mugar_CustomerIdentificationDocument::order/view/cid_fields.phtml'; | ||
parent::__construct($context, $data); | ||
} | ||
|
||
public function getOrder() : Order | ||
{ | ||
return $this->coreRegistry->registry('current_order'); | ||
} | ||
|
||
public function getCidFields(Order $order) | ||
{ | ||
return $this->cidFieldsRepository->getCidFields($order); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<?php | ||
|
||
namespace Mugar\CustomerIdentificationDocument\Model\Config\Source; | ||
|
||
use Magento\Framework\Data\OptionSourceInterface; | ||
|
||
class Types implements OptionSourceInterface | ||
{ | ||
/** | ||
* {@inheritdoc} | ||
* | ||
* @codeCoverageIgnore | ||
*/ | ||
public function toOptionArray() | ||
{ | ||
return [ | ||
['value' => 1, 'label' => __('DNI')], | ||
['value' => 2, 'label' => __('CI')], | ||
['value' => 3, 'label' => __('Passport')] | ||
]; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,8 @@ | ||
<?xml version="1.0"?> | ||
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> | ||
<body> | ||
<block class="Magento\Backend\Block\Template" name="order_cid_fields" template="Mugar_CustomerIdentificationDocument::order/view/cid_fields.phtml" /> | ||
<referenceContainer name="content"> | ||
<block class="Mugar\CustomerIdentificationDocument\Block\Adminhtml\Order\View\CidFields" name="order_cid_fields" template="Mugar_CustomerIdentificationDocument::order/view/cid_fields.phtml" /> | ||
</referenceContainer> | ||
</body> | ||
</page> | ||
</page> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.