Commit 3ee40b8c authored by Thomas Löffler's avatar Thomas Löffler
Browse files

[TASK] Extend import for invoice_email, country, start and end date

parent b68aec59
...@@ -104,20 +104,9 @@ class Tx_T3oMembership_Domain_Model_Member extends Tx_Extbase_DomainObject_Abstr ...@@ -104,20 +104,9 @@ class Tx_T3oMembership_Domain_Model_Member extends Tx_Extbase_DomainObject_Abstr
protected $lastname; protected $lastname;
/** /**
* @return string * @var string
*/ */
public function getLastname() protected $invoiceEmail;
{
return $this->lastname;
}
/**
* @param string $lastname
*/
public function setLastname($lastname)
{
$this->lastname = $lastname;
}
/** /**
* membership * membership
...@@ -161,6 +150,21 @@ class Tx_T3oMembership_Domain_Model_Member extends Tx_Extbase_DomainObject_Abstr ...@@ -161,6 +150,21 @@ class Tx_T3oMembership_Domain_Model_Member extends Tx_Extbase_DomainObject_Abstr
{ {
$this->firstname = $firstname; $this->firstname = $firstname;
} }
/**
* @return string
*/
public function getLastname() {
return $this->lastname;
}
/**
* @param string $lastname
*/
public function setLastname($lastname) {
$this->lastname = $lastname;
}
/** /**
* Returns the externalId * Returns the externalId
* *
...@@ -313,6 +317,20 @@ class Tx_T3oMembership_Domain_Model_Member extends Tx_Extbase_DomainObject_Abstr ...@@ -313,6 +317,20 @@ class Tx_T3oMembership_Domain_Model_Member extends Tx_Extbase_DomainObject_Abstr
$this->url = $url; $this->url = $url;
} }
/**
* @return string
*/
public function getInvoiceEmail() {
return $this->invoiceEmail;
}
/**
* @param string $invoiceEmail
*/
public function setInvoiceEmail($invoiceEmail) {
$this->invoiceEmail = $invoiceEmail;
}
/** /**
* Returns the membership * Returns the membership
* *
......
...@@ -56,18 +56,23 @@ class Tx_T3oMembership_Task_ImportMembersTask extends tx_scheduler_Task { ...@@ -56,18 +56,23 @@ class Tx_T3oMembership_Task_ImportMembersTask extends tx_scheduler_Task {
array_shift($fileData); array_shift($fileData);
foreach ($fileData as $key => $line) { foreach ($fileData as $key => $line) {
$fields = t3lib_div::trimExplode("\t", $line); $fields = t3lib_div::trimExplode("\t", $line);
$endTime = strtotime($fields[15]);
$member = array( $member = array(
'name' => $fields[6], 'name' => $fields[6],
'external_id' => (int) $fields[0], 'external_id' => (int)$fields[0],
'address' => $fields[7] !== '' ? $fields[7] : $fields[8], 'address' => $fields[7] !== '' ? $fields[7] : $fields[8],
'zip' => $fields[10], 'zip' => $fields[10],
'city' => $fields[11], 'city' => $fields[11],
'end_date' => strtotime($fields[16]), 'country' => $fields[13],
'end_date' => $endTime,
'endtime' => $endTime,
'starttime' => strtotime(date('d.m.Y', $endTime) . ' -1 year'),
'membership' => $this->getMembershipUid($fields[12]), 'membership' => $this->getMembershipUid($fields[12]),
'pid' => $this->getMembershipStoragePid(), 'pid' => $this->getMembershipStoragePid(),
'crdate' => time(), 'crdate' => time(),
'tstamp' => time(), 'tstamp' => time(),
'email' => $fields[84], 'invoice_email' => $fields[84],
'email' => $fields[79],
'url' => $fields[80], 'url' => $fields[80],
'firstname' => $fields[82], 'firstname' => $fields[82],
'lastname' => $fields[83] 'lastname' => $fields[83]
......
...@@ -6,10 +6,10 @@ if (!defined ('TYPO3_MODE')) { ...@@ -6,10 +6,10 @@ if (!defined ('TYPO3_MODE')) {
$TCA['tx_t3omembership_domain_model_member'] = array( $TCA['tx_t3omembership_domain_model_member'] = array(
'ctrl' => $TCA['tx_t3omembership_domain_model_member']['ctrl'], 'ctrl' => $TCA['tx_t3omembership_domain_model_member']['ctrl'],
'interface' => array( 'interface' => array(
'showRecordFieldList' => 'sys_language_uid, l10n_parent, l10n_diffsource, hidden, name, firstname, lastname, external_id, end_date, address, zip, city, country, email, url, membership', 'showRecordFieldList' => 'sys_language_uid, l10n_parent, l10n_diffsource, hidden, name, firstname, lastname, external_id, end_date, address, zip, city, country, email, invoice_email, url, membership',
), ),
'types' => array( 'types' => array(
'1' => array('showitem' => 'sys_language_uid;;;;1-1-1, l10n_parent, l10n_diffsource, hidden;;1, name, firstname, lastname, external_id, end_date, address, zip, city, country, email, url, membership,--div--;LLL:EXT:cms/locallang_ttc.xml:tabs.access,starttime, endtime'), '1' => array('showitem' => 'sys_language_uid;;;;1-1-1, l10n_parent, l10n_diffsource, hidden;;1, name, firstname, lastname, external_id, end_date, address, zip, city, country, email, invoice_email, url, membership,--div--;LLL:EXT:cms/locallang_ttc.xml:tabs.access,starttime, endtime'),
), ),
'palettes' => array( 'palettes' => array(
'1' => array('showitem' => ''), '1' => array('showitem' => ''),
...@@ -167,6 +167,15 @@ $TCA['tx_t3omembership_domain_model_member'] = array( ...@@ -167,6 +167,15 @@ $TCA['tx_t3omembership_domain_model_member'] = array(
'eval' => 'trim,required' 'eval' => 'trim,required'
), ),
), ),
'invoice_email' => array(
'exclude' => 0,
'label' => 'LLL:EXT:t3o_membership/Resources/Private/Language/locallang_db.xml:tx_t3omembership_domain_model_member.invoice_email',
'config' => array(
'type' => 'input',
'size' => 30,
'eval' => 'trim,required'
),
),
'url' => array( 'url' => array(
'exclude' => 0, 'exclude' => 0,
'label' => 'LLL:EXT:t3o_membership/Resources/Private/Language/locallang_db.xml:tx_t3omembership_domain_model_member.url', 'label' => 'LLL:EXT:t3o_membership/Resources/Private/Language/locallang_db.xml:tx_t3omembership_domain_model_member.url',
......
...@@ -16,6 +16,7 @@ ...@@ -16,6 +16,7 @@
<label index="tx_t3omembership_domain_model_member.city">City</label> <label index="tx_t3omembership_domain_model_member.city">City</label>
<label index="tx_t3omembership_domain_model_member.country">Country</label> <label index="tx_t3omembership_domain_model_member.country">Country</label>
<label index="tx_t3omembership_domain_model_member.email">Email</label> <label index="tx_t3omembership_domain_model_member.email">Email</label>
<label index="tx_t3omembership_domain_model_member.invoice_email">Invoice Email</label>
<label index="tx_t3omembership_domain_model_member.url">Url</label> <label index="tx_t3omembership_domain_model_member.url">Url</label>
<label index="tx_t3omembership_domain_model_member.firstname">Firstname</label> <label index="tx_t3omembership_domain_model_member.firstname">Firstname</label>
<label index="tx_t3omembership_domain_model_member.lastname">Lastname</label> <label index="tx_t3omembership_domain_model_member.lastname">Lastname</label>
......
...@@ -27,7 +27,7 @@ $EM_CONF[$_EXTKEY] = array( ...@@ -27,7 +27,7 @@ $EM_CONF[$_EXTKEY] = array(
'modify_tables' => '', 'modify_tables' => '',
'clearCacheOnLoad' => 0, 'clearCacheOnLoad' => 0,
'lockType' => '', 'lockType' => '',
'version' => '1.1.0', 'version' => '1.1.1',
'constraints' => array( 'constraints' => array(
'depends' => array( 'depends' => array(
), ),
......
...@@ -14,6 +14,7 @@ CREATE TABLE tx_t3omembership_domain_model_member ( ...@@ -14,6 +14,7 @@ CREATE TABLE tx_t3omembership_domain_model_member (
city varchar(255) DEFAULT '' NOT NULL, city varchar(255) DEFAULT '' NOT NULL,
country varchar(255) DEFAULT '' NOT NULL, country varchar(255) DEFAULT '' NOT NULL,
email varchar(255) DEFAULT '' NOT NULL, email varchar(255) DEFAULT '' NOT NULL,
invoice_email varchar(255) DEFAULT '' NOT NULL,
url varchar(255) DEFAULT '' NOT NULL, url varchar(255) DEFAULT '' NOT NULL,
firstname varchar(255) DEFAULT '' NOT NULL, firstname varchar(255) DEFAULT '' NOT NULL,
lastname varchar(255) DEFAULT '' NOT NULL, lastname varchar(255) DEFAULT '' NOT NULL,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment