Commit b2d21e52 authored by Stefan Busemann's avatar Stefan Busemann
Browse files

[TASK] import e-mail, first name, lastname

raises version to 1.1.0
related https://forge.typo3.org/issues/71190
parent 374cac61
...@@ -82,6 +82,13 @@ class Tx_T3oMembership_Domain_Model_Member extends Tx_Extbase_DomainObject_Abstr ...@@ -82,6 +82,13 @@ class Tx_T3oMembership_Domain_Model_Member extends Tx_Extbase_DomainObject_Abstr
*/ */
protected $email; protected $email;
/**
* firstname
*
* @var string
*/
protected $firstname;
/** /**
* url * url
* *
...@@ -89,6 +96,29 @@ class Tx_T3oMembership_Domain_Model_Member extends Tx_Extbase_DomainObject_Abstr ...@@ -89,6 +96,29 @@ class Tx_T3oMembership_Domain_Model_Member extends Tx_Extbase_DomainObject_Abstr
*/ */
protected $url; protected $url;
/**
* lastname
*
* @var string
*/
protected $lastname;
/**
* @return string
*/
public function getLastname()
{
return $this->lastname;
}
/**
* @param string $lastname
*/
public function setLastname($lastname)
{
$this->lastname = $lastname;
}
/** /**
* membership * membership
* *
...@@ -115,6 +145,22 @@ class Tx_T3oMembership_Domain_Model_Member extends Tx_Extbase_DomainObject_Abstr ...@@ -115,6 +145,22 @@ class Tx_T3oMembership_Domain_Model_Member extends Tx_Extbase_DomainObject_Abstr
$this->name = $name; $this->name = $name;
} }
/**
* @return string
*/
public function getFirstname()
{
return $this->firstname;
}
/**
* @param string $firstname
*/
public function setFirstname($firstname)
{
$this->firstname = $firstname;
}
/** /**
* Returns the externalId * Returns the externalId
* *
...@@ -286,4 +332,4 @@ class Tx_T3oMembership_Domain_Model_Member extends Tx_Extbase_DomainObject_Abstr ...@@ -286,4 +332,4 @@ class Tx_T3oMembership_Domain_Model_Member extends Tx_Extbase_DomainObject_Abstr
$this->membership = $membership; $this->membership = $membership;
} }
} }
\ No newline at end of file
...@@ -33,6 +33,8 @@ class Tx_T3oMembership_Task_ImportMembersTask extends tx_scheduler_Task { ...@@ -33,6 +33,8 @@ class Tx_T3oMembership_Task_ImportMembersTask extends tx_scheduler_Task {
* @return boolean * @return boolean
*/ */
public function execute() { public function execute() {
t3lib_div::devLog('[tx_scheduler_ImportMember]: execute', 't3o_membership', 0);
$membershipRecords = $this->getDatabaseConnection()->exec_SELECTgetRows( $membershipRecords = $this->getDatabaseConnection()->exec_SELECTgetRows(
'uid, name', 'uid, name',
'tx_t3omembership_domain_model_membership', 'tx_t3omembership_domain_model_membership',
...@@ -46,6 +48,7 @@ class Tx_T3oMembership_Task_ImportMembersTask extends tx_scheduler_Task { ...@@ -46,6 +48,7 @@ class Tx_T3oMembership_Task_ImportMembersTask extends tx_scheduler_Task {
// does the import file exist? // does the import file exist?
$importFile = t3lib_div::getFileAbsFileName($this->getImportFile()); $importFile = t3lib_div::getFileAbsFileName($this->getImportFile());
if (!file_exists($importFile)) { if (!file_exists($importFile)) {
t3lib_div::devLog('[tx_scheduler_ImportMember]: no importfile - given value: ' . $importFile, 't3o_membership', 0);
return FALSE; return FALSE;
} else { } else {
$this->getDatabaseConnection()->exec_TRUNCATEquery('tx_t3omembership_domain_model_member'); $this->getDatabaseConnection()->exec_TRUNCATEquery('tx_t3omembership_domain_model_member');
...@@ -65,7 +68,9 @@ class Tx_T3oMembership_Task_ImportMembersTask extends tx_scheduler_Task { ...@@ -65,7 +68,9 @@ class Tx_T3oMembership_Task_ImportMembersTask extends tx_scheduler_Task {
'crdate' => time(), 'crdate' => time(),
'tstamp' => time(), 'tstamp' => time(),
'email' => $fields[84], 'email' => $fields[84],
'url' => $fields[80] 'url' => $fields[80],
'firstname' => $fields[82],
'lastname' => $fields[83]
); );
$resource = $this->getDatabaseConnection()->exec_INSERTquery( $resource = $this->getDatabaseConnection()->exec_INSERTquery(
......
...@@ -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, 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, url, membership',
), ),
'types' => array( 'types' => array(
'1' => array('showitem' => 'sys_language_uid;;;;1-1-1, l10n_parent, l10n_diffsource, hidden;;1, name, 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, url, membership,--div--;LLL:EXT:cms/locallang_ttc.xml:tabs.access,starttime, endtime'),
), ),
'palettes' => array( 'palettes' => array(
'1' => array('showitem' => ''), '1' => array('showitem' => ''),
...@@ -176,6 +176,24 @@ $TCA['tx_t3omembership_domain_model_member'] = array( ...@@ -176,6 +176,24 @@ $TCA['tx_t3omembership_domain_model_member'] = array(
'eval' => 'trim' 'eval' => 'trim'
), ),
), ),
'firstname' => array(
'exclude' => 0,
'label' => 'LLL:EXT:t3o_membership/Resources/Private/Language/locallang_db.xml:tx_t3omembership_domain_model_member.firstname',
'config' => array(
'type' => 'input',
'size' => 30,
'eval' => 'trim'
),
),
'lastname' => array(
'exclude' => 0,
'label' => 'LLL:EXT:t3o_membership/Resources/Private/Language/locallang_db.xml:tx_t3omembership_domain_model_member.lastname',
'config' => array(
'type' => 'input',
'size' => 30,
'eval' => 'trim'
),
),
'membership' => array( 'membership' => array(
'exclude' => 0, 'exclude' => 0,
'label' => 'LLL:EXT:t3o_membership/Resources/Private/Language/locallang_db.xml:tx_t3omembership_domain_model_member.membership', 'label' => 'LLL:EXT:t3o_membership/Resources/Private/Language/locallang_db.xml:tx_t3omembership_domain_model_member.membership',
...@@ -187,4 +205,4 @@ $TCA['tx_t3omembership_domain_model_member'] = array( ...@@ -187,4 +205,4 @@ $TCA['tx_t3omembership_domain_model_member'] = array(
), ),
), ),
), ),
); );
\ No newline at end of file
...@@ -17,6 +17,8 @@ ...@@ -17,6 +17,8 @@
<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.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.lastname">Lastname</label>
<label index="tx_t3omembership_domain_model_member.membership">Membership</label> <label index="tx_t3omembership_domain_model_member.membership">Membership</label>
<label index="tx_t3omembership_domain_model_membership">Membership</label> <label index="tx_t3omembership_domain_model_membership">Membership</label>
...@@ -27,4 +29,4 @@ ...@@ -27,4 +29,4 @@
<label index="tx_t3omembership_task_importmemberstask.description">Import members from CSV file</label> <label index="tx_t3omembership_task_importmemberstask.description">Import members from CSV file</label>
</languageKey> </languageKey>
</data> </data>
</T3locallang> </T3locallang>
\ No newline at end of file
...@@ -20,14 +20,14 @@ $EM_CONF[$_EXTKEY] = array( ...@@ -20,14 +20,14 @@ $EM_CONF[$_EXTKEY] = array(
'shy' => '', 'shy' => '',
'priority' => '', 'priority' => '',
'module' => '', 'module' => '',
'state' => 'beta', 'state' => 'stable',
'internal' => '', 'internal' => '',
'uploadfolder' => '1', 'uploadfolder' => '1',
'createDirs' => '', 'createDirs' => '',
'modify_tables' => '', 'modify_tables' => '',
'clearCacheOnLoad' => 0, 'clearCacheOnLoad' => 0,
'lockType' => '', 'lockType' => '',
'version' => '1.1.0-dev', 'version' => '1.1.0',
'constraints' => array( 'constraints' => array(
'depends' => array( 'depends' => array(
), ),
......
...@@ -15,6 +15,8 @@ CREATE TABLE tx_t3omembership_domain_model_member ( ...@@ -15,6 +15,8 @@ CREATE TABLE tx_t3omembership_domain_model_member (
country varchar(255) DEFAULT '' NOT NULL, country varchar(255) DEFAULT '' NOT NULL,
email varchar(255) DEFAULT '' NOT NULL, email varchar(255) DEFAULT '' NOT NULL,
url varchar(255) DEFAULT '' NOT NULL, url varchar(255) DEFAULT '' NOT NULL,
firstname varchar(255) DEFAULT '' NOT NULL,
lastname varchar(255) DEFAULT '' NOT NULL,
membership int(11) unsigned DEFAULT '0', membership int(11) unsigned DEFAULT '0',
tstamp int(11) unsigned DEFAULT '0' NOT NULL, tstamp int(11) unsigned DEFAULT '0' NOT NULL,
...@@ -67,4 +69,4 @@ CREATE TABLE tx_t3omembership_domain_model_membership ( ...@@ -67,4 +69,4 @@ CREATE TABLE tx_t3omembership_domain_model_membership (
KEY language (l10n_parent,sys_language_uid) KEY language (l10n_parent,sys_language_uid)
); );
\ No newline at end of file
Supports Markdown
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