Commit 22e5a715 authored by Stefan Busemann's avatar Stefan Busemann
Browse files

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

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