// Clean copy_from_front data
This commit is contained in:
1 parent
f15c62740e
commit
6d4bf3b9aa
3 files changed
+52
-52
No files matched your search
+22
-22
@@ -109,28 +109,28 @@ class AddressCore extends ObjectModel
|
|||||||
'table' => 'address',
|
'table' => 'address',
|
||||||
'primary' => 'id_address',
|
'primary' => 'id_address',
|
||||||
'fields' => array(
|
'fields' => array(
|
||||||
'id_customer' => array('type' => self::TYPE_INT, 'validate' => 'isNullOrUnsignedId', 'copy_from_front' => false),
|
'id_customer' => array('type' => self::TYPE_INT, 'validate' => 'isNullOrUnsignedId', 'copy_post' => false),
|
||||||
'id_manufacturer' => array('type' => self::TYPE_INT, 'validate' => 'isNullOrUnsignedId', 'copy_from_front' => false),
|
'id_manufacturer' => array('type' => self::TYPE_INT, 'validate' => 'isNullOrUnsignedId', 'copy_post' => false),
|
||||||
'id_supplier' => array('type' => self::TYPE_INT, 'validate' => 'isNullOrUnsignedId', 'copy_from_front' => false),
|
'id_supplier' => array('type' => self::TYPE_INT, 'validate' => 'isNullOrUnsignedId', 'copy_post' => false),
|
||||||
'id_warehouse' => array('type' => self::TYPE_INT, 'validate' => 'isNullOrUnsignedId', 'copy_from_front' => false),
|
'id_warehouse' => array('type' => self::TYPE_INT, 'validate' => 'isNullOrUnsignedId', 'copy_post' => false),
|
||||||
'id_country' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedId', 'required' => true, 'copy_from_front' => true),
|
'id_country' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedId', 'required' => true),
|
||||||
'id_state' => array('type' => self::TYPE_INT, 'validate' => 'isNullOrUnsignedId', 'copy_from_front' => true),
|
'id_state' => array('type' => self::TYPE_INT, 'validate' => 'isNullOrUnsignedId'),
|
||||||
'alias' => array('type' => self::TYPE_STRING, 'validate' => 'isGenericName', 'required' => true, 'size' => 32, 'copy_from_front' => true),
|
'alias' => array('type' => self::TYPE_STRING, 'validate' => 'isGenericName', 'required' => true, 'size' => 32),
|
||||||
'company' => array('type' => self::TYPE_STRING, 'validate' => 'isGenericName', 'size' => 32, 'copy_from_front' => true),
|
'company' => array('type' => self::TYPE_STRING, 'validate' => 'isGenericName', 'size' => 32),
|
||||||
'lastname' => array('type' => self::TYPE_STRING, 'validate' => 'isName', 'required' => true, 'size' => 32, 'copy_from_front' => true),
|
'lastname' => array('type' => self::TYPE_STRING, 'validate' => 'isName', 'required' => true, 'size' => 32),
|
||||||
'firstname' => array('type' => self::TYPE_STRING, 'validate' => 'isName', 'required' => true, 'size' => 32, 'copy_from_front' => true),
|
'firstname' => array('type' => self::TYPE_STRING, 'validate' => 'isName', 'required' => true, 'size' => 32),
|
||||||
'vat_number' => array('type' => self::TYPE_STRING, 'validate' => 'isGenericName', 'copy_from_front' => true),
|
'vat_number' => array('type' => self::TYPE_STRING, 'validate' => 'isGenericName'),
|
||||||
'address1' => array('type' => self::TYPE_STRING, 'validate' => 'isAddress', 'required' => true, 'size' => 128, 'copy_from_front' => true),
|
'address1' => array('type' => self::TYPE_STRING, 'validate' => 'isAddress', 'required' => true, 'size' => 128),
|
||||||
'address2' => array('type' => self::TYPE_STRING, 'validate' => 'isAddress', 'size' => 128, 'copy_from_front' => true),
|
'address2' => array('type' => self::TYPE_STRING, 'validate' => 'isAddress', 'size' => 128),
|
||||||
'postcode' => array('type' => self::TYPE_STRING, 'validate' => 'isPostCode', 'size' => 12, 'copy_from_front' => true),
|
'postcode' => array('type' => self::TYPE_STRING, 'validate' => 'isPostCode', 'size' => 12),
|
||||||
'city' => array('type' => self::TYPE_STRING, 'validate' => 'isCityName', 'required' => true, 'size' => 64, 'copy_from_front' => true),
|
'city' => array('type' => self::TYPE_STRING, 'validate' => 'isCityName', 'required' => true, 'size' => 64),
|
||||||
'other' => array('type' => self::TYPE_STRING, 'validate' => 'isMessage', 'size' => 300, 'copy_from_front' => true),
|
'other' => array('type' => self::TYPE_STRING, 'validate' => 'isMessage', 'size' => 300),
|
||||||
'phone' => array('type' => self::TYPE_STRING, 'validate' => 'isPhoneNumber', 'size' => 16, 'copy_from_front' => true),
|
'phone' => array('type' => self::TYPE_STRING, 'validate' => 'isPhoneNumber', 'size' => 16),
|
||||||
'phone_mobile' => array('type' => self::TYPE_STRING, 'validate' => 'isPhoneNumber', 'size' => 16, 'copy_from_front' => true),
|
'phone_mobile' => array('type' => self::TYPE_STRING, 'validate' => 'isPhoneNumber', 'size' => 16),
|
||||||
'dni' => array('type' => self::TYPE_STRING, 'validate' => 'isDniLite', 'size' => 16, 'copy_from_front' => true),
|
'dni' => array('type' => self::TYPE_STRING, 'validate' => 'isDniLite', 'size' => 16),
|
||||||
'deleted' => array('type' => self::TYPE_BOOL, 'validate' => 'isBool', 'copy_from_front' => false),
|
'deleted' => array('type' => self::TYPE_BOOL, 'validate' => 'isBool', 'copy_post' => false),
|
||||||
'date_add' => array('type' => self::TYPE_DATE, 'validate' => 'isDateFormat', 'copy_from_front' => false),
|
'date_add' => array('type' => self::TYPE_DATE, 'validate' => 'isDateFormat', 'copy_post' => false),
|
||||||
'date_upd' => array('type' => self::TYPE_DATE, 'validate' => 'isDateFormat', 'copy_from_front' => false),
|
'date_upd' => array('type' => self::TYPE_DATE, 'validate' => 'isDateFormat', 'copy_post' => false),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
+29
-29
@@ -155,35 +155,35 @@ class CustomerCore extends ObjectModel
|
|||||||
'table' => 'customer',
|
'table' => 'customer',
|
||||||
'primary' => 'id_customer',
|
'primary' => 'id_customer',
|
||||||
'fields' => array(
|
'fields' => array(
|
||||||
'secure_key' => array('type' => self::TYPE_STRING, 'validate' => 'isMd5', 'copy_from_front' => false),
|
'secure_key' => array('type' => self::TYPE_STRING, 'validate' => 'isMd5', 'copy_post' => false),
|
||||||
'lastname' => array('type' => self::TYPE_STRING, 'validate' => 'isName', 'required' => true, 'size' => 32, 'copy_from_front' => true),
|
'lastname' => array('type' => self::TYPE_STRING, 'validate' => 'isName', 'required' => true, 'size' => 32),
|
||||||
'firstname' => array('type' => self::TYPE_STRING, 'validate' => 'isName', 'required' => true, 'size' => 32, 'copy_from_front' => true),
|
'firstname' => array('type' => self::TYPE_STRING, 'validate' => 'isName', 'required' => true, 'size' => 32),
|
||||||
'email' => array('type' => self::TYPE_STRING, 'validate' => 'isEmail', 'required' => true, 'size' => 128, 'copy_from_front' => true),
|
'email' => array('type' => self::TYPE_STRING, 'validate' => 'isEmail', 'required' => true, 'size' => 128),
|
||||||
'passwd' => array('type' => self::TYPE_STRING, 'validate' => 'isPasswd', 'required' => true, 'size' => 32, 'copy_from_front' => true),
|
'passwd' => array('type' => self::TYPE_STRING, 'validate' => 'isPasswd', 'required' => true, 'size' => 32),
|
||||||
'last_passwd_gen' => array('type' => self::TYPE_STRING, 'copy_from_front' => false),
|
'last_passwd_gen' => array('type' => self::TYPE_STRING, 'copy_post' => false),
|
||||||
'id_gender' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedId', 'copy_from_front' => true),
|
'id_gender' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedId'),
|
||||||
'birthday' => array('type' => self::TYPE_DATE, 'validate' => 'isBirthDate', 'copy_from_front' => true),
|
'birthday' => array('type' => self::TYPE_DATE, 'validate' => 'isBirthDate'),
|
||||||
'newsletter' => array('type' => self::TYPE_BOOL, 'validate' => 'isBool', 'copy_from_front' => true),
|
'newsletter' => array('type' => self::TYPE_BOOL, 'validate' => 'isBool'),
|
||||||
'newsletter_date_add' => array('type' => self::TYPE_DATE,'copy_from_front' => false),
|
'newsletter_date_add' => array('type' => self::TYPE_DATE,'copy_post' => false),
|
||||||
'ip_registration_newsletter' => array('type' => self::TYPE_STRING, 'copy_from_front' => false),
|
'ip_registration_newsletter' => array('type' => self::TYPE_STRING, 'copy_post' => false),
|
||||||
'optin' => array('type' => self::TYPE_BOOL, 'validate' => 'isBool', 'copy_from_front' => true),
|
'optin' => array('type' => self::TYPE_BOOL, 'validate' => 'isBool'),
|
||||||
'website' => array('type' => self::TYPE_STRING, 'validate' => 'isUrl', 'copy_from_front' => true),
|
'website' => array('type' => self::TYPE_STRING, 'validate' => 'isUrl'),
|
||||||
'company' => array('type' => self::TYPE_STRING, 'validate' => 'isName', 'copy_from_front' => true),
|
'company' => array('type' => self::TYPE_STRING, 'validate' => 'isName'),
|
||||||
'siret' => array('type' => self::TYPE_STRING, 'validate' => 'isSiret', 'copy_from_front' => true),
|
'siret' => array('type' => self::TYPE_STRING, 'validate' => 'isSiret'),
|
||||||
'ape' => array('type' => self::TYPE_STRING, 'validate' => 'isApe', 'copy_from_front' => true),
|
'ape' => array('type' => self::TYPE_STRING, 'validate' => 'isApe'),
|
||||||
'outstanding_allow_amount' => array('type' => self::TYPE_INT, 'validate' => 'isFloat', 'copy_from_front' => false),
|
'outstanding_allow_amount' => array('type' => self::TYPE_INT, 'validate' => 'isFloat', 'copy_post' => false),
|
||||||
'show_public_prices' => array('type' => self::TYPE_BOOL, 'validate' => 'isBool', 'copy_from_front' => false),
|
'show_public_prices' => array('type' => self::TYPE_BOOL, 'validate' => 'isBool', 'copy_post' => false),
|
||||||
'id_risk' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedInt', 'copy_from_front' => false),
|
'id_risk' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedInt', 'copy_post' => false),
|
||||||
'max_payment_days' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedInt', 'copy_from_front' => false),
|
'max_payment_days' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedInt', 'copy_post' => false),
|
||||||
'active' => array('type' => self::TYPE_BOOL, 'validate' => 'isBool', 'copy_from_front' => false),
|
'active' => array('type' => self::TYPE_BOOL, 'validate' => 'isBool', 'copy_post' => false),
|
||||||
'deleted' => array('type' => self::TYPE_BOOL, 'validate' => 'isBool', 'copy_from_front' => false),
|
'deleted' => array('type' => self::TYPE_BOOL, 'validate' => 'isBool', 'copy_post' => false),
|
||||||
'note' => array('type' => self::TYPE_STRING, 'validate' => 'isCleanHtml', 'size' => 65000, 'copy_from_front' => false),
|
'note' => array('type' => self::TYPE_STRING, 'validate' => 'isCleanHtml', 'size' => 65000, 'copy_post' => false),
|
||||||
'is_guest' => array('type' => self::TYPE_BOOL, 'validate' => 'isBool', 'copy_from_front' => false),
|
'is_guest' => array('type' => self::TYPE_BOOL, 'validate' => 'isBool', 'copy_post' => false),
|
||||||
'id_shop' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedId', 'copy_from_front' => false),
|
'id_shop' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedId', 'copy_post' => false),
|
||||||
'id_group_shop' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedId', 'copy_from_front' => false),
|
'id_group_shop' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedId', 'copy_post' => false),
|
||||||
'id_default_group' => array('type' => self::TYPE_INT, 'copy_from_front' => false),
|
'id_default_group' => array('type' => self::TYPE_INT, 'copy_post' => false),
|
||||||
'date_add' => array('type' => self::TYPE_DATE, 'validate' => 'isDate', 'copy_from_front' => false),
|
'date_add' => array('type' => self::TYPE_DATE, 'validate' => 'isDate', 'copy_post' => false),
|
||||||
'date_upd' => array('type' => self::TYPE_DATE, 'validate' => 'isDate', 'copy_from_front' => false),
|
'date_upd' => array('type' => self::TYPE_DATE, 'validate' => 'isDate', 'copy_post' => false),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
@@ -798,7 +798,7 @@ abstract class ObjectModelCore
|
|||||||
$errors[] = '<b>'.self::displayFieldName($field, get_class($this), $htmlentities).'</b> '.Tools::displayError('is invalid.');
|
$errors[] = '<b>'.self::displayFieldName($field, get_class($this), $htmlentities).'</b> '.Tools::displayError('is invalid.');
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (!isset($data['copy_from_front']) || !$data['copy_from_front'])
|
if (isset($data['copy_post']) && !$data['copy_post'])
|
||||||
continue;
|
continue;
|
||||||
if ($field == 'passwd')
|
if ($field == 'passwd')
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in new issue
Block a user