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

[Feature] Add honorary members

The memberships can now get the option “no_filter” option. If this
option is enabled, the membershiptype is not visible as a filter. This
will be used for honorary members
parent 3c3f2b85
......@@ -43,6 +43,29 @@ class Tx_T3oMembership_Domain_Model_Membership extends Tx_Extbase_DomainObject_A
*/
protected $personalMembership;
/**
* noFilter
*
* @var bool
* @validate NotEmpty
*/
protected $noFilter;
/**
* @return boolean
*/
public function isNoFilter()
{
return $this->noFilter;
}
/**
* @param boolean $noFilter
*/
public function setNoFilter($noFilter)
{
$this->noFilter = $noFilter;
}
/**
* @return string
......
......@@ -86,6 +86,7 @@ class Tx_T3oMembership_Task_ImportMembersTask extends tx_scheduler_Task
$endTime = !empty($fields[17]) ? $endDate : 0;
$hidden = false;
if ($endTime > 0 && $endTime < time()) {
$hidden = true;
}
......@@ -176,6 +177,9 @@ class Tx_T3oMembership_Task_ImportMembersTask extends tx_scheduler_Task
$endDateTime = DateTime::createFromFormat('d.m.Y', $endDate);
$endDateTime->setTime(0, 0, 0);
# $endDateTime->add(new DateInterval('P1Y'));
return $endDateTime->getTimestamp();
}
......
......@@ -6,10 +6,10 @@ if (!defined('TYPO3_MODE')) {
$TCA['tx_t3omembership_domain_model_membership'] = array(
'ctrl' => $TCA['tx_t3omembership_domain_model_membership']['ctrl'],
'interface' => array(
'showRecordFieldList' => 'sys_language_uid, l10n_parent, l10n_diffsource, hidden, name, logo, personal_membership',
'showRecordFieldList' => 'sys_language_uid, l10n_parent, l10n_diffsource, hidden, name, logo, personal_membership, no_filter',
),
'types' => array(
'1' => array('showitem' => 'sys_language_uid;;;;1-1-1, l10n_parent, l10n_diffsource, hidden;;1, name, logo, personal_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, logo, personal_membership, no_filter, --div--;LLL:EXT:cms/locallang_ttc.xml:tabs.access,starttime, endtime'),
),
'palettes' => array(
'1' => array('showitem' => ''),
......@@ -113,5 +113,12 @@ $TCA['tx_t3omembership_domain_model_membership'] = array(
'type' => 'check',
),
),
'no_filter' => array(
'exclude' => 0,
'label' => 'LLL:EXT:t3o_membership/Resources/Private/Language/locallang_db.xml:tx_t3omembership_domain_model_membership.no_filter_option',
'config' => array(
'type' => 'check',
),
),
),
);
......@@ -27,6 +27,7 @@
<label index="tx_t3omembership_domain_model_membership.name">Name</label>
<label index="tx_t3omembership_domain_model_membership.logo">Logo</label>
<label index="tx_t3omembership_domain_model_membership.personal_membership">Personal membership (no company)</label>
<label index="tx_t3omembership_domain_model_membership.no_filter_option">Do not use this membership type as filter</label>
<label index="tx_t3omembership_task_importmemberstask.name">Import members from CSV file</label>
<label index="tx_t3omembership_task_importmemberstask.description">Import members from CSV file</label>
......
......@@ -5,25 +5,30 @@
<f:image src="typo3conf/ext/t3o_membership/Resources/Public/Icons/ShowAllMembers.png" alt="Show all memberships" />
</f:link.action>
</li>
<f:if condition="{filterTerm}">
<f:then>
<f:groupedFor each="{members}" as="membershipsOfMembers" groupBy="membership" groupKey="membership">
<li>
<f:link.action action="list" arguments="{filter: '{filterTerm}', membership: '{membership.uid}'}">
<f:image src="uploads/tx_t3omembership/{membership.logo}" alt="{membership.name}" />
</f:link.action>
</li>
<f:if condition="{membership.noFilter}=0">
<li>
<f:link.action action="list" arguments="{filter: '{filterTerm}', membership: '{membership.uid}'}">
<f:image src="uploads/tx_t3omembership/{membership.logo}" alt="{membership.name}" />
</f:link.action>
</li>
</f:if>
</f:groupedFor>
</f:then>
<f:else>
<f:for each="{memberships}" as="membership">
<li>
<f:link.action action="list" arguments="{membership: '{membership.uid}'}">
<f:image src="uploads/tx_t3omembership/{membership.logo}" alt="{membership.name}" />
</f:link.action>
</li>
<f:if condition="{membership.noFilter}!=1">
<li>
<f:link.action action="list" arguments="{membership: '{membership.uid}'}">
<f:image src="uploads/tx_t3omembership/{membership.logo}" alt="{membership.name}" />
</f:link.action>
</li>
</f:if>
</f:for>
</f:else>
</f:if>
</ul>
</div>
\ No newline at end of file
</div>
......@@ -52,6 +52,7 @@ CREATE TABLE tx_t3omembership_domain_model_membership (
name varchar(255) DEFAULT '' NOT NULL,
logo text NOT NULL,
personal_membership tinyint(4) DEFAULT '0' NOT NULL,
no_filter tinyint(4) DEFAULT '0' NOT NULL,
tstamp int(11) unsigned DEFAULT '0' NOT NULL,
crdate int(11) unsigned DEFAULT '0' 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