Skip to content

Commit db6be22

Browse files
author
shreesh arora
committed
added auto_generated column in address table
1 parent 6b7ef21 commit db6be22

File tree

3 files changed

+6
-0
lines changed

3 files changed

+6
-0
lines changed

Diff for: classes/Address.php

+4
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,9 @@ class AddressCore extends ObjectModel
9898
/** @var bool True if address has been deleted (staying in database as deleted) */
9999
public $deleted = 0;
100100

101+
/** @var bool True if address has been created automatically (by system) */
102+
public $auto_generated;
103+
101104
protected static $_idZones = array();
102105
protected static $_idCountries = array();
103106

@@ -128,6 +131,7 @@ class AddressCore extends ObjectModel
128131
'phone_mobile' => array('type' => self::TYPE_STRING, 'validate' => 'isPhoneNumber', 'size' => 32),
129132
'dni' => array('type' => self::TYPE_STRING, 'validate' => 'isDniLite', 'size' => 16),
130133
'deleted' => array('type' => self::TYPE_BOOL, 'validate' => 'isBool', 'copy_post' => false),
134+
'auto_generated' => array('type' => self::TYPE_BOOL, 'validate' => 'isBool'),
131135
'date_add' => array('type' => self::TYPE_DATE, 'validate' => 'isDate', 'copy_post' => false),
132136
'date_upd' => array('type' => self::TYPE_DATE, 'validate' => 'isDate', 'copy_post' => false),
133137
),

Diff for: controllers/front/AuthController.php

+1
Original file line numberDiff line numberDiff line change
@@ -460,6 +460,7 @@ protected function processSubmitAccount()
460460
$_POST['alias'] = 'My address';
461461
$_POST['id_country'] = $objHotel->country_id;
462462
$_POST['id_state'] = $objHotel->state_id;
463+
$_POST['auto_generated'] = true;
463464
// if form is shorter then address name will be customer name
464465
$lastnameAddress = $_POST['lastname'];
465466
$firstnameAddress = $_POST['firstname'];

Diff for: install/data/db_structure.sql

+1
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ CREATE TABLE `PREFIX_address` (
4242
`date_upd` datetime NOT NULL,
4343
`active` tinyint(1) unsigned NOT NULL DEFAULT '1',
4444
`deleted` tinyint(1) unsigned NOT NULL DEFAULT '0',
45+
`auto_generated` tinyint(1) unsigned NOT NULL DEFAULT '0',
4546
PRIMARY KEY (`id_address`),
4647
KEY `address_customer` (`id_customer`),
4748
KEY `id_country` (`id_country`),

0 commit comments

Comments
 (0)