Skip to content

Commit

Permalink
Fix later conflict
Browse files Browse the repository at this point in the history
  • Loading branch information
justinbeaty committed Dec 9, 2024
1 parent 6f929f7 commit 6c095c6
Show file tree
Hide file tree
Showing 2 changed files with 278 additions and 38 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
* @package Mage_Customer
* @copyright Copyright (c) 2006-2020 Magento, Inc. (https://magento.com)
* @copyright Copyright (c) 2020-2024 The OpenMage Contributors (https://openmage.org)
* @copyright Copyright (c) 2024 Maho (https://mahocommerce.com)
* @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
*/

Expand Down Expand Up @@ -258,6 +257,41 @@

$setup = $installer->getConnection();

$select = $setup->select()
->from($installer->getTable('core/config_data'), 'COUNT(*)')
->where('path=?', 'customer/address/prefix_show')
->where('value!=?', '0');
$showPrefix = (bool)Mage::helper('customer/address')->getConfig('prefix_show')
|| $setup->fetchOne($select) > 0;

$select = $setup->select()
->from($installer->getTable('core/config_data'), 'COUNT(*)')
->where('path=?', 'customer/address/middlename_show')
->where('value!=?', '0');
$showMiddlename = (bool)Mage::helper('customer/address')->getConfig('middlename_show')
|| $setup->fetchOne($select) > 0;

$select = $setup->select()
->from($installer->getTable('core/config_data'), 'COUNT(*)')
->where('path=?', 'customer/address/suffix_show')
->where('value!=?', '0');
$showSuffix = (bool)Mage::helper('customer/address')->getConfig('suffix_show')
|| $setup->fetchOne($select) > 0;

$select = $setup->select()
->from($installer->getTable('core/config_data'), 'COUNT(*)')
->where('path=?', 'customer/address/dob_show')
->where('value!=?', '0');
$showDob = (bool)Mage::helper('customer/address')->getConfig('dob_show')
|| $setup->fetchOne($select) > 0;

$select = $setup->select()
->from($installer->getTable('core/config_data'), 'COUNT(*)')
->where('path=?', 'customer/address/taxvat_show')
->where('value!=?', '0');
$showTaxVat = (bool)Mage::helper('customer/address')->getConfig('taxvat_show')
|| $setup->fetchOne($select) > 0;

/**
*****************************************************************************
* customer/account/create/
Expand Down Expand Up @@ -293,30 +327,64 @@
]);

$elementSort = 0;
if ($showPrefix) {
$setup->insert($installer->getTable('eav/form_element'), [
'type_id' => $formTypeId,
'fieldset_id' => $fieldsetId,
'attribute_id' => $installer->getAttributeId($entityTypeId, 'prefix'),
'sort_order' => $elementSort++
]);
}
$setup->insert($installer->getTable('eav/form_element'), [
'type_id' => $formTypeId,
'fieldset_id' => $fieldsetId,
'attribute_id' => $installer->getAttributeId($entityTypeId, 'firstname'),
'sort_order' => $elementSort++
]);
$setup->insert($installer->getTable('eav/form_element'), [
'type_id' => $formTypeId,
'fieldset_id' => $fieldsetId,
'attribute_id' => $installer->getAttributeId($entityTypeId, 'middlename'),
'sort_order' => $elementSort++
]);
if ($showMiddlename) {
$setup->insert($installer->getTable('eav/form_element'), [
'type_id' => $formTypeId,
'fieldset_id' => $fieldsetId,
'attribute_id' => $installer->getAttributeId($entityTypeId, 'middlename'),
'sort_order' => $elementSort++
]);
}
$setup->insert($installer->getTable('eav/form_element'), [
'type_id' => $formTypeId,
'fieldset_id' => $fieldsetId,
'attribute_id' => $installer->getAttributeId($entityTypeId, 'lastname'),
'sort_order' => $elementSort++
]);
if ($showSuffix) {
$setup->insert($installer->getTable('eav/form_element'), [
'type_id' => $formTypeId,
'fieldset_id' => $fieldsetId,
'attribute_id' => $installer->getAttributeId($entityTypeId, 'suffix'),
'sort_order' => $elementSort++
]);
}
$setup->insert($installer->getTable('eav/form_element'), [
'type_id' => $formTypeId,
'fieldset_id' => $fieldsetId,
'attribute_id' => $installer->getAttributeId($entityTypeId, 'email'),
'sort_order' => $elementSort++
]);
if ($showDob) {
$setup->insert($installer->getTable('eav/form_element'), [
'type_id' => $formTypeId,
'fieldset_id' => $fieldsetId,
'attribute_id' => $installer->getAttributeId($entityTypeId, 'dob'),
'sort_order' => $elementSort++
]);
}
if ($showTaxVat) {
$setup->insert($installer->getTable('eav/form_element'), [
'type_id' => $formTypeId,
'fieldset_id' => $fieldsetId,
'attribute_id' => $installer->getAttributeId($entityTypeId, 'taxvat'),
'sort_order' => $elementSort++
]);
}

/**
*****************************************************************************
Expand Down Expand Up @@ -353,30 +421,64 @@
]);

$elementSort = 0;
if ($showPrefix) {
$setup->insert($installer->getTable('eav/form_element'), [
'type_id' => $formTypeId,
'fieldset_id' => $fieldsetId,
'attribute_id' => $installer->getAttributeId($entityTypeId, 'prefix'),
'sort_order' => $elementSort++
]);
}
$setup->insert($installer->getTable('eav/form_element'), [
'type_id' => $formTypeId,
'fieldset_id' => $fieldsetId,
'attribute_id' => $installer->getAttributeId($entityTypeId, 'firstname'),
'sort_order' => $elementSort++
]);
$setup->insert($installer->getTable('eav/form_element'), [
'type_id' => $formTypeId,
'fieldset_id' => $fieldsetId,
'attribute_id' => $installer->getAttributeId($entityTypeId, 'middlename'),
'sort_order' => $elementSort++
]);
if ($showMiddlename) {
$setup->insert($installer->getTable('eav/form_element'), [
'type_id' => $formTypeId,
'fieldset_id' => $fieldsetId,
'attribute_id' => $installer->getAttributeId($entityTypeId, 'middlename'),
'sort_order' => $elementSort++
]);
}
$setup->insert($installer->getTable('eav/form_element'), [
'type_id' => $formTypeId,
'fieldset_id' => $fieldsetId,
'attribute_id' => $installer->getAttributeId($entityTypeId, 'lastname'),
'sort_order' => $elementSort++
]);
if ($showSuffix) {
$setup->insert($installer->getTable('eav/form_element'), [
'type_id' => $formTypeId,
'fieldset_id' => $fieldsetId,
'attribute_id' => $installer->getAttributeId($entityTypeId, 'suffix'),
'sort_order' => $elementSort++
]);
}
$setup->insert($installer->getTable('eav/form_element'), [
'type_id' => $formTypeId,
'fieldset_id' => $fieldsetId,
'attribute_id' => $installer->getAttributeId($entityTypeId, 'email'),
'sort_order' => $elementSort++
]);
if ($showDob) {
$setup->insert($installer->getTable('eav/form_element'), [
'type_id' => $formTypeId,
'fieldset_id' => $fieldsetId,
'attribute_id' => $installer->getAttributeId($entityTypeId, 'dob'),
'sort_order' => $elementSort++
]);
}
if ($showTaxVat) {
$setup->insert($installer->getTable('eav/form_element'), [
'type_id' => $formTypeId,
'fieldset_id' => $fieldsetId,
'attribute_id' => $installer->getAttributeId($entityTypeId, 'taxvat'),
'sort_order' => $elementSort++
]);
}

/**
*****************************************************************************
Expand Down Expand Up @@ -413,24 +515,42 @@
]);

$elementSort = 0;
if ($showPrefix) {
$setup->insert($installer->getTable('eav/form_element'), [
'type_id' => $formTypeId,
'fieldset_id' => $fieldsetId,
'attribute_id' => $installer->getAttributeId($entityTypeId, 'prefix'),
'sort_order' => $elementSort++
]);
}
$setup->insert($installer->getTable('eav/form_element'), [
'type_id' => $formTypeId,
'fieldset_id' => $fieldsetId,
'attribute_id' => $installer->getAttributeId($entityTypeId, 'firstname'),
'sort_order' => $elementSort++
]);
$setup->insert($installer->getTable('eav/form_element'), [
'type_id' => $formTypeId,
'fieldset_id' => $fieldsetId,
'attribute_id' => $installer->getAttributeId($entityTypeId, 'middlename'),
'sort_order' => $elementSort++
]);
if ($showMiddlename) {
$setup->insert($installer->getTable('eav/form_element'), [
'type_id' => $formTypeId,
'fieldset_id' => $fieldsetId,
'attribute_id' => $installer->getAttributeId($entityTypeId, 'middlename'),
'sort_order' => $elementSort++
]);
}
$setup->insert($installer->getTable('eav/form_element'), [
'type_id' => $formTypeId,
'fieldset_id' => $fieldsetId,
'attribute_id' => $installer->getAttributeId($entityTypeId, 'lastname'),
'sort_order' => $elementSort++
]);
if ($showSuffix) {
$setup->insert($installer->getTable('eav/form_element'), [
'type_id' => $formTypeId,
'fieldset_id' => $fieldsetId,
'attribute_id' => $installer->getAttributeId($entityTypeId, 'suffix'),
'sort_order' => $elementSort++
]);
}
$setup->insert($installer->getTable('eav/form_element'), [
'type_id' => $formTypeId,
'fieldset_id' => $fieldsetId,
Expand Down
Loading

0 comments on commit 6c095c6

Please sign in to comment.