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
}
if ($this->request->hasArgument('membership') && $this->request->getArgument('membership')) {
$filterMembership = (int)$this->request->getArgument('membership');
$this->view->assign('membership', $filterMembership);
$this->view->assign('selectedMembership', $filterMembership);
}
if ($filterString || $filterMembership) {
......
......@@ -23,11 +23,6 @@ use Typo3Agencies\Domain\Model\Agency;
*/
class Member extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity
{
/**
* @var Agency
*/
protected $agency;
/**
* Member name
*
......@@ -47,7 +42,7 @@ class Member extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity
/**
* endDate
*
* @var DateTime
* @var \DateTime
* @validate NotEmpty
*/
protected $endDate;
......@@ -125,14 +120,6 @@ class Member extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity
*/
protected $membership;
/**
* @return Agency
*/
public function getAgency()
{
return $this->agency;
}
/**
* Returns the name
*
......@@ -211,7 +198,7 @@ class Member extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity
/**
* Returns the endDate
*
* @return DateTime $endDate
* @return \DateTime $endDate
*/
public function getEndDate()
{
......@@ -221,7 +208,7 @@ class Member extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity
/**
* Sets the endDate
*
* @param DateTime $endDate
* @param \DateTime $endDate
* @return void
*/
public function setEndDate($endDate)
......
......@@ -42,8 +42,7 @@ class MemberRepository extends \TYPO3\CMS\Extbase\Persistence\Repository
$query = $this->createQuery();
$constraints = array();
if ($filterString) {
$filterString = $this->getDatabaseConnection()->escapeStrForLike($filterString,
'tx_t3omembership_domain_model_member');
$filterString = $this->getDatabaseConnection()->escapeStrForLike($filterString, 'tx_t3omembership_domain_model_member');
$constraints[] = $query->like('name', '%' . $filterString . '%');
}
if ($filterMembership) {
......@@ -54,7 +53,7 @@ class MemberRepository extends \TYPO3\CMS\Extbase\Persistence\Repository
}
/**
* @return t3lib_DB
* @return \TYPO3\CMS\Core\Database\DatabaseConnection
*/
protected function getDatabaseConnection()
{
......
......@@ -43,7 +43,7 @@ class ImportMembersTask extends \TYPO3\CMS\Extbase\Scheduler\Task
public function execute()
{
/** @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');
$membershipRecords = $this->getDatabaseConnection()->exec_SELECTgetRows(
......@@ -168,7 +168,7 @@ class ImportMembersTask extends \TYPO3\CMS\Extbase\Scheduler\Task
* Parses the value of the "Beginn" column to a UNIX timestamp.
*
* @param string $endDate
* @return array
* @return int
*/
protected function getMemberEndDate($endDate)
{
......@@ -176,12 +176,9 @@ class ImportMembersTask extends \TYPO3\CMS\Extbase\Scheduler\Task
return 0;
}
$endDateTime = DateTime::createFromFormat('d.m.Y', $endDate);
$endDateTime = \DateTime::createFromFormat('d.m.Y', $endDate);
$endDateTime->setTime(0, 0, 0);
# $endDateTime->add(new DateInterval('P1Y'));
return $endDateTime->getTimestamp();
}
......@@ -239,7 +236,7 @@ class ImportMembersTask extends \TYPO3\CMS\Extbase\Scheduler\Task
foreach ($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['t3omembership']['importMemberTaksHooks'] as $classData) {
$hookObject = GeneralUtility::getUserObj($classData);
if (!is_object($hookObject)) {
throw new UnexpectedValueException( // @TODO Namespace?
throw new \UnexpectedValueException( // @TODO Namespace?
'The hook object class ' . $classData . ' could not be instantiated.'
);
}
......@@ -258,7 +255,7 @@ class ImportMembersTask extends \TYPO3\CMS\Extbase\Scheduler\Task
}
/**
* @return t3lib_DB
* @return \TYPO3\CMS\Core\Database\DatabaseConnection
*/
protected function getDatabaseConnection()
{
......
<div class="tx-t3o-membership">
<div class="container">
<f:render section="main" />
</div>
<f:form action="list" method="POST">
<f:form.textfield id="t3o_membership_filter" name="filter" value="{filterTerm}" />
<f:form.submit value="{f:translate(key:'filter')}" class="bu" />
<f:form action="list" class="mb-3">
<div class="input-group input-group-lg">
<f:form.textfield class="form-control" id="t3o_membership_filter" name="filter" value="{filterTerm}" />
<span class="input-group-btn"><button class="btn btn-primary"><f:translate key="filter" /></button></span>
</div>
</f:form>
<div class="b-members-filter">
<ul>
<li class="membershiptype-reset act empty-option">
<f:link.action action="list" arguments="{filter: '{filterTerm}'}">
<f:image src="typo3conf/ext/t3o_membership/Resources/Public/Icons/ShowAllMembers.png" alt="Show all memberships" />
<div class="mb-3">
<ul class="nav nav-pills nav-fill">
<li class="nav-item">
<f:link.action class="nav-link{f:if(condition:'{selectedMembership} == 0',then:' active')}" action="list" arguments="{filter: '{filterTerm}'}">
Show all members
</f:link.action>
</li>
<f:if condition="{filterTerm}">
<f:then>
<f:groupedFor each="{members}" as="membershipsOfMembers" groupBy="membership" groupKey="membership">
<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}" />
<li class="nav-item">
<f:link.action class="nav-link{f:if(condition:'{selectedMembership} == {membership.uid}',then:' active')}" action="list" arguments="{filter: '{filterTerm}', membership: '{membership.uid}'}">
{membership.name}
</f:link.action>
</li>
</f:if>
......@@ -21,9 +20,9 @@
<f:else>
<f:for each="{memberships}" as="membership">
<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}" />
<li class="nav-item">
<f:link.action class="nav-link{f:if(condition:'{selectedMembership} == {membership.uid}',then:' active')}" action="list" arguments="{membership: '{membership.uid}'}">
{membership.name}
</f:link.action>
</li>
</f:if>
......
......@@ -3,22 +3,22 @@
<f:flashMessages/>
<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">
<thead>
<tr>
<th>
<f:translate key="tx_t3omembership_domain_model_member.name"/>
<f:translate key="tx_t3omembership_domain_model_member.name" />
</th>
<th>Professional support</th>
<th>
<f:translate key="tx_t3omembership_domain_model_member.membership"/>
<f:translate key="tx_t3omembership_domain_model_member.membership" />
</th>
</tr>
</thead>
<tbody>
<f:for each="{members}" as="member">
<f:cycle values="{0: 'tr-even', 1: 'tr-odd'}" as="cycle">
<tr class="{cycle}">
<tr>
<f:if condition="{member.membership.personalMembership}">
<f:then>
<f:if condition="{member.lastname}">
......@@ -33,21 +33,9 @@
</f:then>
<f:else>
<td>
<f:if condition="{member.agency}">
<f:then>
<f:link.action action="show" controller="Agency" pluginName="Pi1"
extensionName="Typo3Agencies" arguments="{agency: member.agency}"
pageUid="{settings.agenciesPid}"
title="Professional services of TYPO3 {member.membership} member {member.name}">
{member.name}
</f:link.action>
</f:then>
<f:else>
<f:if condition="{member.url}">
<f:then>
<f:link.external uri="{member.url}"
title="Website of TYPO3 {member.membership} member {member.name}"
target="_blank">
<f:link.external uri="{member.url}" title="Website of TYPO3 {member.membership} member {member.name}" target="_blank">
{member.name}
</f:link.external>
</f:then>
......@@ -55,30 +43,13 @@
{member.name}
</f:else>
</f:if>
</f:else>
</f:if>
</td>
</f:else>
</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>
</tr>
</f:cycle>
</f:for>
</tbody>
</table>
</f:section>
......@@ -18,7 +18,7 @@ if (!defined('TYPO3_MODE')) {
);
// 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,
'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',
......
......@@ -3,7 +3,7 @@ if (!defined('TYPO3_MODE')) {
die ('Access denied.');
}
\TYPO3\CMS\Extbase\Utility\ExtensionUtility::registerPlugin(
$_EXTKEY,
'T3o.' . $_EXTKEY,
'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