Produced by Araxis Merge on 2023-07-12 04:42:38 +0000. See www.araxis.com for information about Merge. This report uses XHTML and CSS2, and is best viewed with a modern standards-compliant browser. For optimum results when printing this report, use landscape orientation and enable printing of background images and colours in your browser.
| # | Location | File | Last Modified |
|---|---|---|---|
| 1 | Porto v4.0.5/Theme Files/Porto Theme/app/code/Smartwave/Dailydeals/Block/Adminhtml/Dailydeal/Edit/Tab | Dailydeal.php | 2018-03-14 03:40:54 +0000 |
| 2 | Porto v4.0.6/Theme Files/Porto Theme/app/code/Smartwave/Dailydeals/Block/Adminhtml/Dailydeal/Edit/Tab | Dailydeal.php | 2023-06-14 04:28:05 +0000 |
| Description | Between Files 1 and 2 | |
|---|---|---|
| Text Blocks | Lines | |
| Unchanged | 4 | 372 |
| Changed | 3 | 13 |
| Inserted | 0 | 0 |
| Removed | 0 | 0 |
| Whitespace | Consecutive whitespace is treated as a single space |
|---|---|
| Character case | Differences in character case are significant |
| Line endings | Differences in line endings (CR and LF characters) are ignored |
| CR/LF characters | Not shown in the comparison detail |
| Active line-pairing rules |
No regular expressions were active.
| 1 | <?php | 1 | <?php | |||
| 2 | namespace Smartwave\Dailydeals\Block\Adminhtml\Dailydeal\Edit\Tab; | 2 | namespace Smartwave\Dailydeals\Block\Adminhtml\Dailydeal\Edit\Tab; | |||
| 3 | 3 | |||||
| 4 | class Dailydeal extends \Magento\Backend\Block\Widget\Form\Generic implements \Magento\Backend\Block\Widget\Tab\TabInterface | 4 | class Dailydeal extends \Magento\Backend\Block\Widget\Form\Generic implements \Magento\Backend\Block\Widget\Tab\TabInterface | |||
| 5 | { | 5 | { | |||
| 6 | /** | 6 | /** | |||
| 7 | * Country options | 7 | * Country options | |||
| 8 | * | 8 | * | |||
| 9 | * @var \Magento\Config\Model\Config\Source\Yesno | 9 | * @var \Magento\Config\Model\Config\Source\Yesno | |||
| 10 | */ | 10 | */ | |||
| 11 | protected $booleanOptions; | 11 | protected $booleanOptions; | |||
| 12 | 12 | |||||
| 13 | /** | 13 | /** | |||
| 14 | * Discount Type options | 14 | * Discount Type options | |||
| 15 | * | 15 | * | |||
| 16 | * @var \Smartwave\Dailydeals\Model\Dailydeal\Source\SwDiscountType | 16 | * @var \Smartwave\Dailydeals\Model\Dailydeal\Source\SwDiscountType | |||
| 17 | */ | 17 | */ | |||
| 18 | protected $swDiscountTypeOptions; | 18 | protected $swDiscountTypeOptions; | |||
| 19 | 19 | |||||
| 20 | protected $swDealProductOptions; | 20 | protected $swDealProductOptions; | |||
| 21 | /** | 21 | /** | |||
| 22 | * constructor | 22 | * constructor | |||
| 23 | * | 23 | * | |||
| 24 | * @param \Magento\Config\Model\Config\Source\Yesno $booleanOptions | 24 | * @param \Magento\Config\Model\Config\Source\Yesno $booleanOptions | |||
| 25 | * @param \Smartwave\Dailydeals\Model\Dailydeal\Source\SwDiscountType $swDiscountTypeOptions | 25 | * @param \Smartwave\Dailydeals\Model\Dailydeal\Source\SwDiscountType $swDiscountTypeOptions | |||
| 26 | * @param \Magento\Backend\Block\Template\Context $context | 26 | * @param \Magento\Backend\Block\Template\Context $context | |||
| 27 | * @param \Magento\Framework\Registry $registry | 27 | * @param \Magento\Framework\Registry $registry | |||
| 28 | * @param \Magento\Framework\Data\FormFactory $formFactory | 28 | * @param \Magento\Framework\Data\FormFactory $formFactory | |||
| 29 | * @param array $data | 29 | * @param array $data | |||
| 30 | */ | 30 | */ | |||
| 31 | public function __construct( | 31 | public function __construct( | |||
| 32 | \Magento\Config\Model\Config\Source\Yesno $booleanOptions, | 32 | \Magento\Config\Model\Config\Source\Yesno $booleanOptions, | |||
| 33 | \Smartwave\Dailydeals\Model\Dailydeal\Source\SwDiscountType $swDiscountTypeOptions, | 33 | \Smartwave\Dailydeals\Model\Dailydeal\Source\SwDiscountType $swDiscountTypeOptions, | |||
| 34 | \Smartwave\Dailydeals\Model\Dailydeal\Source\SwDealProduct $swDealProductOptions, | 34 | \Smartwave\Dailydeals\Model\Dailydeal\Source\SwDealProduct $swDealProductOptions, | |||
| 35 | \Magento\Backend\Block\Template\Context $context, | 35 | \Magento\Backend\Block\Template\Context $context, | |||
| 36 | \Magento\Framework\Registry $registry, | 36 | \Magento\Framework\Registry $registry, | |||
| 37 | \Magento\Framework\Data\FormFactory $formFactory, | 37 | \Magento\Framework\Data\FormFactory $formFactory, | |||
| 38 | array $data = [] | 38 | array $data = [] | |||
| 39 | ) { | 39 | ) { | |||
| 40 | 40 | |||||
| 41 | $this->booleanOptions = $booleanOptions; | 41 | $this->booleanOptions = $booleanOptions; | |||
| 42 | $this->swDiscountTypeOptions = $swDiscountTypeOptions; | 42 | $this->swDiscountTypeOptions = $swDiscountTypeOptions; | |||
| 43 | $this->swDealProductOptions = $swDealProductOptions; | 43 | $this->swDealProductOptions = $swDealProductOptions; | |||
| 44 | parent::__construct($context, $registry, $formFactory, $data); | 44 | parent::__construct($context, $registry, $formFactory, $data); | |||
| 45 | } | 45 | } | |||
| 46 | 46 | |||||
| 47 | /** | 47 | /** | |||
| 48 | * Prepare form | 48 | * Prepare form | |||
| 49 | * | 49 | * | |||
| 50 | * @return $this | 50 | * @return $this | |||
| 51 | */ | 51 | */ | |||
| 52 | protected function _prepareForm() | 52 | protected function _prepareForm() | |||
| 53 | { | 53 | { | |||
| 54 | /** @var \Smartwave\Dailydeals\Model\Dailydeal $dailydeal */ | 54 | /** @var \Smartwave\Dailydeals\Model\Dailydeal $dailydeal */ | |||
| 55 | $dailydeal = $this->_coreRegistry->registry('sw_dailydeals_dailydeal'); | 55 | $dailydeal = $this->_coreRegistry->registry('sw_dailydeals_dailydeal'); | |||
| 56 | $form = $this->_formFactory->create(); | 56 | $form = $this->_formFactory->create(); | |||
| 57 | $form->setHtmlIdPrefix('dailydeal_'); | 57 | $form->setHtmlIdPrefix('dailydeal_'); | |||
| 58 | $form->setFieldNameSuffix('dailydeal'); | 58 | $form->setFieldNameSuffix('dailydeal'); | |||
| 59 | $fieldset = $form->addFieldset( | 59 | $fieldset = $form->addFieldset( | |||
| 60 | 'base_fieldset', | 60 | 'base_fieldset', | |||
| 61 | [ | 61 | [ | |||
| 62 | 'legend' => __('Dailydeal Information'), | 62 | 'legend' => __('Dailydeal Information'), | |||
| 63 | 'class' => 'fieldset-wide' | 63 | 'class' => 'fieldset-wide' | |||
| 64 | ] | 64 | ] | |||
| 65 | ); | 65 | ); | |||
| 66 | if ($dailydeal->getId()) { | 66 | if ($dailydeal->getId()) { | |||
| 67 | $fieldset->addField( | 67 | $fieldset->addField( | |||
| 68 | 'dailydeal_id', | 68 | 'dailydeal_id', | |||
| 69 | 'hidden', | 69 | 'hidden', | |||
| 70 | ['name' => 'dailydeal_id'] | 70 | ['name' => 'dailydeal_id'] | |||
| 71 | ); | 71 | ); | |||
| 72 | } | 72 | } | |||
| 73 | $fieldset->addField( | 73 | $fieldset->addField( | |||
| 74 | 'sw_product_sku', | 74 | 'sw_product_sku', | |||
| 75 | 'select', | 75 | 'select', | |||
| 76 | [ | 76 | [ | |||
| 77 | 'name' => 'sw_product_sku', | 77 | 'name' => 'sw_product_sku', | |||
| 78 | 'label' => __('Product Sku'), | 78 | 'label' => __('Product Sku'), | |||
| 79 | 'title' => __('Product Sku'), | 79 | 'title' => __('Product Sku'), | |||
| 80 | 'onchange' => 'checkSelectedItem(this.value)', | 80 | 'onchange' => 'checkSelectedItem(this.value)', | |||
| 81 | 'values' => array_merge(['' => ''], $this->swDealProductOptions->toOptionArray()), | 81 | 'values' => array_merge(['' => ''], $this->swDealProductOptions->toOptionArray()), | |||
| 82 | ] | 82 | ] | |||
| 83 | ); | 83 | ); | |||
| 84 | 84 | |||||
| 85 | $fieldset->addField( | 85 | $fieldset->addField( | |||
| 86 | 'sw_deal_enable', | 86 | 'sw_deal_enable', | |||
| 87 | 'select', | 87 | 'select', | |||
| 88 | [ | 88 | [ | |||
| 89 | 'name' => 'sw_deal_enable', | 89 | 'name' => 'sw_deal_enable', | |||
| 90 | 'label' => __('Enable Deal'), | 90 | 'label' => __('Enable Deal'), | |||
| 91 | 'title' => __('Enable Deal'), | 91 | 'title' => __('Enable Deal'), | |||
| 92 | 'values' => $this->booleanOptions->toOptionArray(), | 92 | 'values' => $this->booleanOptions->toOptionArray(), | |||
| 93 | ] | 93 | ] | |||
| 94 | ); | 94 | ); | |||
| 95 | $fieldset->addField( | 95 | $fieldset->addField( | |||
| 96 | 'sw_discount_type', | 96 | 'sw_discount_type', | |||
| 97 | 'select', | 97 | 'select', | |||
| 98 | [ | 98 | [ | |||
| 99 | 'name' => 'sw_discount_type', | 99 | 'name' => 'sw_discount_type', | |||
| 100 | 'label' => __('Discount Type'), | 100 | 'label' => __('Discount Type'), | |||
| 101 | 'title' => __('Discount Type'), | 101 | 'title' => __('Discount Type'), | |||
| 102 | 'values' => array_merge(['' => ''], $this->swDiscountTypeOptions->toOptionArray()), | 102 | 'values' => array_merge(['' => ''], $this->swDiscountTypeOptions->toOptionArray()), | |||
| 103 | ] | 103 | ] | |||
| 104 | ); | 104 | ); | |||
| 105 | $fieldset->addField( | 105 | $fieldset->addField( | |||
| 106 | 'sw_discount_amount', | 106 | 'sw_discount_amount', | |||
| 107 | 'text', | 107 | 'text', | |||
| 108 | [ | 108 | [ | |||
| 109 | 'name' => 'sw_discount_amount', | 109 | 'name' => 'sw_discount_amount', | |||
| 110 | 'label' => __('Discount Value'), | 110 | 'label' => __('Discount Value'), | |||
| 111 | 'title' => __('Discount Value'), | 111 | 'title' => __('Discount Value'), | |||
| 112 | ] | 112 | ] | |||
| 113 | ); | 113 | ); | |||
| 114 | $fieldset->addField( | 114 | $fieldset->addField( | |||
| 115 | 'sw_date_from', | 115 | 'sw_date_from', | |||
| 116 | 'date', | 116 | 'date', | |||
| 117 | [ | 117 | [ | |||
| 118 | 'name' => 'sw_date_from', | 118 | 'name' => 'sw_date_from', | |||
| 119 | 'label' => __('Date From'), | 119 | 'label' => __('Date From'), | |||
| 120 | 'title' => __('Date From'), | 120 | 'title' => __('Date From'), | |||
| 121 | 'date_format' => $this->_localeDate->getDateFormat(\IntlDateFormatter::SHORT), | 121 | 'date_format' => 'MM/d/Y', | |||
| 122 | 'time_format' => $this->_localeDate->getTimeFormat(\IntlDateFormatter::SHORT), | 122 | 'time_format' => 'HH:mm', | |||
| 123 | 123 | |||||
| 124 | 'class' => 'validate-date', | 124 | 'class' => 'validate-date', | |||
| 125 | ] | 125 | ] | |||
| 126 | ); | 126 | ); | |||
| 127 | $fieldset->addField( | 127 | $fieldset->addField( | |||
| 128 | 'sw_date_to', | 128 | 'sw_date_to', | |||
| 129 | 'date', | 129 | 'date', | |||
| 130 | [ | 130 | [ | |||
| 131 | 'name' => 'sw_date_to', | 131 | 'name' => 'sw_date_to', | |||
| 132 | 'label' => __('Date To'), | 132 | 'label' => __('Date To'), | |||
| 133 | 'title' => __('Date To'), | 133 | 'title' => __('Date To'), | |||
| 134 | 'date_format' => $this->_localeDate->getDateFormat(\IntlDateFormatter::SHORT), | 134 | 'date_format' => 'MM/d/Y', | |||
| 135 | 'time_format' => $this->_localeDate->getTimeFormat(\IntlDateFormatter::SHORT), | 135 | | |||
| 136 | // 'time_format' => 'hh:mm:ss a', | |||||
| 137 | 'class' => 'validate-date', | 136 | 'class' => 'validate-date', | |||
| 138 | ] | 137 | ] | |||
| 139 | ); | 138 | ); | |||
| 140 | 139 | |||||
| 141 | $dailydealData = $this->_session->getData('sw_dailydeals_dailydeal_data', true); | 140 | $dailydealData = $this->_session->getData('sw_dailydeals_dailydeal_data', true); | |||
| 142 | if ($dailydealData) { | 141 | if ($dailydealData) { | |||
| 143 | $dailydeal->addData($dailydealData); | 142 | $dailydeal->addData($dailydealData); | |||
| 144 | } else { | 143 | } else { | |||
| 145 | if (!$dailydeal->getId()) { | 144 | if (!$dailydeal->getId()) { | |||
| 146 | $dailydeal->addData($dailydeal->getDefaultValues()); | 145 | $dailydeal->addData($dailydeal->getDefaultValues()); | |||
| 147 | } | 146 | } | |||
| 148 | } | 147 | } | |||
| 149 | $form->addValues($dailydeal->getData()); | 148 | $form->addValues($dailydeal->getData()); | |||
| 150 | $this->setForm($form); | 149 | $this->setForm($form); | |||
| 151 | return parent::_prepareForm(); | 150 | return parent::_prepareForm(); | |||
| 152 | } | 151 | } | |||
| 153 | 152 | |||||
| 154 | /** | 153 | /** | |||
| 155 | * Prepare label for tab | 154 | * Prepare label for tab | |||
| 156 | * | 155 | * | |||
| 157 | * @return string | 156 | * @return string | |||
| 158 | */ | 157 | */ | |||
| 159 | public function getTabLabel() | 158 | public function getTabLabel() | |||
| 160 | { | 159 | { | |||
| 161 | return __('Dailydeal'); | 160 | return __('Dailydeal'); | |||
| 162 | } | 161 | } | |||
| 163 | 162 | |||||
| 164 | /** | 163 | /** | |||
| 165 | * Prepare title for tab | 164 | * Prepare title for tab | |||
| 166 | * | 165 | * | |||
| 167 | * @return string | 166 | * @return string | |||
| 168 | */ | 167 | */ | |||
| 169 | public function getTabTitle() | 168 | public function getTabTitle() | |||
| 170 | { | 169 | { | |||
| 171 | return $this->getTabLabel(); | 170 | return $this->getTabLabel(); | |||
| 172 | } | 171 | } | |||
| 173 | 172 | |||||
| 174 | /** | 173 | /** | |||
| 175 | * Can show tab in tabs | 174 | * Can show tab in tabs | |||
| 176 | * | 175 | * | |||
| 177 | * @return boolean | 176 | * @return boolean | |||
| 178 | */ | 177 | */ | |||
| 179 | public function canShowTab() | 178 | public function canShowTab() | |||
| 180 | { | 179 | { | |||
| 181 | return true; | 180 | return true; | |||
| 182 | } | 181 | } | |||
| 183 | 182 | |||||
| 184 | /** | 183 | /** | |||
| 185 | * Tab is hidden | 184 | * Tab is hidden | |||
| 186 | * | 185 | * | |||
| 187 | * @return boolean | 186 | * @return boolean | |||
| 188 | */ | 187 | */ | |||
| 189 | public function isHidden() | 188 | public function isHidden() | |||
| 190 | { | 189 | { | |||
| 191 | return false; | 190 | return false; | |||
| 192 | } | 191 | } | |||
| 193 | } | 192 | } |
Araxis Merge (but not the data content of this report) is Copyright © 1993–2019 Araxis Ltd (www.araxis.com). All rights reserved.