Commit de3441f8 authored by Thomas Löffler's avatar Thomas Löffler

Changes to run in bootstrap on typo3.org

* Changes namespaces
* Bootstraps templates
* Use navigation instead of images
* Removes occurences of typo3_agencies extension
parent f99de3e5
...@@ -77,7 +77,7 @@ class MemberController extends \TYPO3\CMS\Extbase\Mvc\Controller\ActionControlle ...@@ -77,7 +77,7 @@ class MemberController extends \TYPO3\CMS\Extbase\Mvc\Controller\ActionControlle
} }
if ($this->request->hasArgument('membership') && $this->request->getArgument('membership')) { if ($this->request->hasArgument('membership') && $this->request->getArgument('membership')) {
$filterMembership = (int)$this->request->getArgument('membership'); $filterMembership = (int)$this->request->getArgument('membership');
$this->view->assign('membership', $filterMembership); $this->view->assign('selectedMembership', $filterMembership);
} }
if ($filterString || $filterMembership) { if ($filterString || $filterMembership) {
......
...@@ -23,11 +23,6 @@ use Typo3Agencies\Domain\Model\Agency; ...@@ -23,11 +23,6 @@ use Typo3Agencies\Domain\Model\Agency;
*/ */
class Member extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity class Member extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity
{ {
/**
* @var Agency
*/
protected $agency;
/** /**
* Member name * Member name
* *
...@@ -47,7 +42,7 @@ class Member extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity ...@@ -47,7 +42,7 @@ class Member extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity
/** /**
* endDate * endDate
* *
* @var DateTime * @var \DateTime
* @validate NotEmpty * @validate NotEmpty
*/ */
protected $endDate; protected $endDate;
...@@ -125,14 +120,6 @@ class Member extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity ...@@ -125,14 +120,6 @@ class Member extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity
*/ */
protected $membership; protected $membership;
/**
* @return Agency
*/
public function getAgency()
{
return $this->agency;
}
/** /**
* Returns the name * Returns the name
* *
...@@ -211,7 +198,7 @@ class Member extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity ...@@ -211,7 +198,7 @@ class Member extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity
/** /**
* Returns the endDate * Returns the endDate
* *
* @return DateTime $endDate * @return \DateTime $endDate
*/ */
public function getEndDate() public function getEndDate()
{ {
...@@ -221,7 +208,7 @@ class Member extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity ...@@ -221,7 +208,7 @@ class Member extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity
/** /**
* Sets the endDate * Sets the endDate
* *
* @param DateTime $endDate * @param \DateTime $endDate
* @return void * @return void
*/ */
public function setEndDate($endDate) public function setEndDate($endDate)
......
...@@ -42,8 +42,7 @@ class MemberRepository extends \TYPO3\CMS\Extbase\Persistence\Repository ...@@ -42,8 +42,7 @@ class MemberRepository extends \TYPO3\CMS\Extbase\Persistence\Repository
$query = $this->createQuery(); $query = $this->createQuery();
$constraints = array(); $constraints = array();
if ($filterString) { if ($filterString) {
$filterString = $this->getDatabaseConnection()->escapeStrForLike($filterString, $filterString = $this->getDatabaseConnection()->escapeStrForLike($filterString, 'tx_t3omembership_domain_model_member');
'tx_t3omembership_domain_model_member');
$constraints[] = $query->like('name', '%' . $filterString . '%'); $constraints[] = $query->like('name', '%' . $filterString . '%');
} }
if ($filterMembership) { if ($filterMembership) {
...@@ -54,7 +53,7 @@ class MemberRepository extends \TYPO3\CMS\Extbase\Persistence\Repository ...@@ -54,7 +53,7 @@ class MemberRepository extends \TYPO3\CMS\Extbase\Persistence\Repository
} }
/** /**
* @return t3lib_DB * @return \TYPO3\CMS\Core\Database\DatabaseConnection
*/ */
protected function getDatabaseConnection() protected function getDatabaseConnection()
{ {
......
...@@ -43,7 +43,7 @@ class ImportMembersTask extends \TYPO3\CMS\Extbase\Scheduler\Task ...@@ -43,7 +43,7 @@ class ImportMembersTask extends \TYPO3\CMS\Extbase\Scheduler\Task
public function execute() public function execute()
{ {
/** @var $logger \TYPO3\CMS\Core\Log\Logger */ /** @var $logger \TYPO3\CMS\Core\Log\Logger */
$logger = GeneralUtility::makeInstance('TYPO3\CMS\Core\Log\LogManager')->getLogger(__CLASS__); $logger = GeneralUtility::makeInstance(\TYPO3\CMS\Core\Log\LogManager::class)->getLogger(__CLASS__);
$logger->debug('Execute'); $logger->debug('Execute');
$membershipRecords = $this->getDatabaseConnection()->exec_SELECTgetRows( $membershipRecords = $this->getDatabaseConnection()->exec_SELECTgetRows(
...@@ -168,7 +168,7 @@ class ImportMembersTask extends \TYPO3\CMS\Extbase\Scheduler\Task ...@@ -168,7 +168,7 @@ class ImportMembersTask extends \TYPO3\CMS\Extbase\Scheduler\Task
* Parses the value of the "Beginn" column to a UNIX timestamp. * Parses the value of the "Beginn" column to a UNIX timestamp.
* *
* @param string $endDate * @param string $endDate
* @return array * @return int
*/ */
protected function getMemberEndDate($endDate) protected function getMemberEndDate($endDate)
{ {
...@@ -176,12 +176,9 @@ class ImportMembersTask extends \TYPO3\CMS\Extbase\Scheduler\Task ...@@ -176,12 +176,9 @@ class ImportMembersTask extends \TYPO3\CMS\Extbase\Scheduler\Task
return 0; return 0;
} }
$endDateTime = DateTime::createFromFormat('d.m.Y', $endDate); $endDateTime = \DateTime::createFromFormat('d.m.Y', $endDate);
$endDateTime->setTime(0, 0, 0); $endDateTime->setTime(0, 0, 0);
# $endDateTime->add(new DateInterval('P1Y'));
return $endDateTime->getTimestamp(); return $endDateTime->getTimestamp();
} }
...@@ -239,7 +236,7 @@ class ImportMembersTask extends \TYPO3\CMS\Extbase\Scheduler\Task ...@@ -239,7 +236,7 @@ class ImportMembersTask extends \TYPO3\CMS\Extbase\Scheduler\Task
foreach ($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['t3omembership']['importMemberTaksHooks'] as $classData) { foreach ($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['t3omembership']['importMemberTaksHooks'] as $classData) {
$hookObject = GeneralUtility::getUserObj($classData); $hookObject = GeneralUtility::getUserObj($classData);
if (!is_object($hookObject)) { if (!is_object($hookObject)) {
throw new UnexpectedValueException( // @TODO Namespace? throw new \UnexpectedValueException( // @TODO Namespace?
'The hook object class ' . $classData . ' could not be instantiated.' 'The hook object class ' . $classData . ' could not be instantiated.'
); );
} }
...@@ -258,7 +255,7 @@ class ImportMembersTask extends \TYPO3\CMS\Extbase\Scheduler\Task ...@@ -258,7 +255,7 @@ class ImportMembersTask extends \TYPO3\CMS\Extbase\Scheduler\Task
} }
/** /**
* @return t3lib_DB * @return \TYPO3\CMS\Core\Database\DatabaseConnection
*/ */
protected function getDatabaseConnection() protected function getDatabaseConnection()
{ {
......
<div class="tx-t3o-membership"> <div class="container">
<f:render section="main" /> <f:render section="main" />
</div> </div>
\ No newline at end of file
<f:form action="list" method="POST"> <f:form action="list" class="mb-3">
<f:form.textfield id="t3o_membership_filter" name="filter" value="{filterTerm}" /> <div class="input-group input-group-lg">
<f:form.submit value="{f:translate(key:'filter')}" class="bu" /> <f:form.textfield class="form-control" id="t3o_membership_filter" name="filter" value="{filterTerm}" />
</f:form> <span class="input-group-btn"><button class="btn btn-primary"><f:translate key="filter" /></button></span>
\ No newline at end of file </div>
</f:form>
<div class="b-members-filter"> <div class="mb-3">
<ul> <ul class="nav nav-pills nav-fill">
<li class="membershiptype-reset act empty-option"> <li class="nav-item">
<f:link.action action="list" arguments="{filter: '{filterTerm}'}"> <f:link.action class="nav-link{f:if(condition:'{selectedMembership} == 0',then:' active')}" action="list" arguments="{filter: '{filterTerm}'}">
<f:image src="typo3conf/ext/t3o_membership/Resources/Public/Icons/ShowAllMembers.png" alt="Show all memberships" /> Show all members
</f:link.action> </f:link.action>
</li> </li>
<f:if condition="{filterTerm}"> <f:if condition="{filterTerm}">
<f:then> <f:then>
<f:groupedFor each="{members}" as="membershipsOfMembers" groupBy="membership" groupKey="membership"> <f:groupedFor each="{members}" as="membershipsOfMembers" groupBy="membership" groupKey="membership">
<f:if condition="{membership.noFilter}=0"> <f:if condition="{membership.noFilter}=0">
<li> <li class="nav-item">
<f:link.action action="list" arguments="{filter: '{filterTerm}', membership: '{membership.uid}'}"> <f:link.action class="nav-link{f:if(condition:'{selectedMembership} == {membership.uid}',then:' active')}" action="list" arguments="{filter: '{filterTerm}', membership: '{membership.uid}'}">
<f:image src="uploads/tx_t3omembership/{membership.logo}" alt="{membership.name}" /> {membership.name}
</f:link.action> </f:link.action>
</li> </li>
</f:if> </f:if>
...@@ -21,9 +20,9 @@ ...@@ -21,9 +20,9 @@
<f:else> <f:else>
<f:for each="{memberships}" as="membership"> <f:for each="{memberships}" as="membership">
<f:if condition="{membership.noFilter}!=1"> <f:if condition="{membership.noFilter}!=1">
<li> <li class="nav-item">
<f:link.action action="list" arguments="{membership: '{membership.uid}'}"> <f:link.action class="nav-link{f:if(condition:'{selectedMembership} == {membership.uid}',then:' active')}" action="list" arguments="{membership: '{membership.uid}'}">
<f:image src="uploads/tx_t3omembership/{membership.logo}" alt="{membership.name}" /> {membership.name}
</f:link.action> </f:link.action>
</li> </li>
</f:if> </f:if>
......
...@@ -3,22 +3,22 @@ ...@@ -3,22 +3,22 @@
<f:flashMessages/> <f:flashMessages/>
<f:render partial="Member/Filter" arguments="{filterTerm: filter}"/> <f:render partial="Member/Filter" arguments="{filterTerm: filter}"/>
<f:render partial="Member/Membership" arguments="{members: members, memberships: memberships, filterTerm: filter}"/> <f:render partial="Member/Membership" arguments="{_all}"/>
<table class="tx_t3omembership featured"> <table class="table table-striped">
<tr> <thead>
<th> <tr>
<f:translate key="tx_t3omembership_domain_model_member.name"/> <th>
</th> <f:translate key="tx_t3omembership_domain_model_member.name" />
<th>Professional support</th> </th>
<th> <th>
<f:translate key="tx_t3omembership_domain_model_member.membership"/> <f:translate key="tx_t3omembership_domain_model_member.membership" />
</th> </th>
</tr> </tr>
</thead>
<f:for each="{members}" as="member"> <tbody>
<f:cycle values="{0: 'tr-even', 1: 'tr-odd'}" as="cycle"> <f:for each="{members}" as="member">
<tr class="{cycle}"> <tr>
<f:if condition="{member.membership.personalMembership}"> <f:if condition="{member.membership.personalMembership}">
<f:then> <f:then>
<f:if condition="{member.lastname}"> <f:if condition="{member.lastname}">
...@@ -33,52 +33,23 @@ ...@@ -33,52 +33,23 @@
</f:then> </f:then>
<f:else> <f:else>
<td> <td>
<f:if condition="{member.agency}"> <f:if condition="{member.url}">
<f:then> <f:then>
<f:link.action action="show" controller="Agency" pluginName="Pi1" <f:link.external uri="{member.url}" title="Website of TYPO3 {member.membership} member {member.name}" target="_blank">
extensionName="Typo3Agencies" arguments="{agency: member.agency}"
pageUid="{settings.agenciesPid}"
title="Professional services of TYPO3 {member.membership} member {member.name}">
{member.name} {member.name}
</f:link.action> </f:link.external>
</f:then> </f:then>
<f:else> <f:else>
<f:if condition="{member.url}"> {member.name}
<f:then>
<f:link.external uri="{member.url}"
title="Website of TYPO3 {member.membership} member {member.name}"
target="_blank">
{member.name}
</f:link.external>
</f:then>
<f:else>
{member.name}
</f:else>
</f:if>
</f:else> </f:else>
</f:if> </f:if>
</td> </td>
</f:else> </f:else>
</f:if> </f:if>
<td>
<f:if condition="{member.membership.personalMembership}">
<f:else>
<f:if condition="{member.agency}">
<f:link.action action="show" controller="Agency" pluginName="Pi1"
extensionName="Typo3Agencies" arguments="{agency: member.agency}"
pageUid="{settings.agenciesPid}" class="supporttypes"
title="Professional services of TYPO3 {member.membership} member {member.name}">
<f:if condition="{member.agency.trainingService}"><span class="ico i-training"></span></f:if>
<f:if condition="{member.agency.hostingService}"><span class="ico i-hosting"></span></f:if>
<f:if condition="{member.agency.developmentService}"><span class="ico i-development"></span></f:if>
</f:link.action>
</f:if>
</f:else>
</f:if>
</td>
<td>{member.membership}</td> <td>{member.membership}</td>
</tr> </tr>
</f:cycle> </f:for>
</f:for>
</tbody>
</table> </table>
</f:section> </f:section>
...@@ -18,7 +18,7 @@ if (!defined('TYPO3_MODE')) { ...@@ -18,7 +18,7 @@ if (!defined('TYPO3_MODE')) {
); );
// Import members // Import members
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['scheduler']['tasks']['Tx_T3oMembership_Task_ImportMembersTask'] = array( $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['scheduler']['tasks'][\T3o\T3oMembership\Task\ImportMembersTask::class] = array(
'extension' => $_EXTKEY, 'extension' => $_EXTKEY,
'title' => 'LLL:EXT:' . $_EXTKEY . '/Resources/Private/Language/locallang_db.xlf:tx_t3omembership_task_importmemberstask.name', 'title' => 'LLL:EXT:' . $_EXTKEY . '/Resources/Private/Language/locallang_db.xlf:tx_t3omembership_task_importmemberstask.name',
'description' => 'LLL:EXT:' . $_EXTKEY . '/Resources/Private/Language/locallang_db.xlf:tx_t3omembership_task_importmemberstask.description', 'description' => 'LLL:EXT:' . $_EXTKEY . '/Resources/Private/Language/locallang_db.xlf:tx_t3omembership_task_importmemberstask.description',
......
...@@ -3,7 +3,7 @@ if (!defined('TYPO3_MODE')) { ...@@ -3,7 +3,7 @@ if (!defined('TYPO3_MODE')) {
die ('Access denied.'); die ('Access denied.');
} }
\TYPO3\CMS\Extbase\Utility\ExtensionUtility::registerPlugin( \TYPO3\CMS\Extbase\Utility\ExtensionUtility::registerPlugin(
$_EXTKEY, 'T3o.' . $_EXTKEY,
'List', 'List',
'Association member list' 'Association member list'
); );
......
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