Added website field to client CSV import

This commit is contained in:
Hillel Coren 2016-07-04 21:33:50 +03:00
parent d051ae70ef
commit aba50f66dc
2 changed files with 7 additions and 0 deletions

View File

@ -85,6 +85,10 @@ class Client extends EntityModel
* @var string * @var string
*/ */
public static $fieldCountry = 'country'; public static $fieldCountry = 'country';
/**
* @var string
*/
public static $fieldWebsite = 'website';
/** /**
* @return array * @return array
@ -101,6 +105,7 @@ class Client extends EntityModel
Client::$fieldPostalCode, Client::$fieldPostalCode,
Client::$fieldCountry, Client::$fieldCountry,
Client::$fieldNotes, Client::$fieldNotes,
Client::$fieldWebsite,
Contact::$fieldFirstName, Contact::$fieldFirstName,
Contact::$fieldLastName, Contact::$fieldLastName,
Contact::$fieldPhone, Contact::$fieldPhone,
@ -126,6 +131,7 @@ class Client extends EntityModel
'zip|postal|code' => 'postal_code', 'zip|postal|code' => 'postal_code',
'country' => 'country', 'country' => 'country',
'note' => 'notes', 'note' => 'notes',
'site|website' => 'website',
]; ];
} }

View File

@ -27,6 +27,7 @@ class ClientTransformer extends BaseTransformer
'state' => $this->getString($data, 'state'), 'state' => $this->getString($data, 'state'),
'postal_code' => $this->getString($data, 'postal_code'), 'postal_code' => $this->getString($data, 'postal_code'),
'private_notes' => $this->getString($data, 'notes'), 'private_notes' => $this->getString($data, 'notes'),
'website' => $this->getString($data, 'website'),
'contacts' => [ 'contacts' => [
[ [
'first_name' => $this->getString($data, 'first_name'), 'first_name' => $this->getString($data, 'first_name'),