Commit 629441d0 authored by Thomas Löffler's avatar Thomas Löffler

Merge branch '4-add-link-to-list-view' into 'master'

Resolve "Add link to list view"

Closes #4

See merge request t3o/t3o_donation!6
parents 001b5575 db770ac2
<?php
namespace T3o\T3oDonation\Domain\Model;
/**
* This file is part of the TYPO3 CMS project.
*
* It is free software; you can redistribute it and/or modify it under
* the terms of the GNU General Public License, either version 2
* of the License, or any later version.
*
* For the full copyright and license information, please read the
* LICENSE.txt file that was distributed with this source code.
*
* The TYPO3 project - inspiring people to share!
*/
/**
* This file is part of the TYPO3 CMS project.
*
* It is free software; you can redistribute it and/or modify it under
* the terms of the GNU General Public License, either version 2
* of the License, or any later version.
*
* For the full copyright and license information, please read the
* LICENSE.txt file that was distributed with this source code.
*
* The TYPO3 project - inspiring people to share!
*/
/**
* Class \T3o\T3oDonation\Domain\Model\Donation
......@@ -117,6 +118,11 @@ class Donation extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity
*/
protected $date;
/**
* @var \DateTime
*/
protected $crdate;
/**
* @return bool
*/
......@@ -420,4 +426,13 @@ class Donation extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity
{
return $this->date;
}
/**
* @return \DateTime
*/
public function getCrdate()
{
return $this->date;
}
}
......@@ -23,6 +23,7 @@ use TYPO3\CMS\Extbase\Persistence\QueryInterface;
class DonationRepository extends \TYPO3\CMS\Extbase\Persistence\Repository
{
protected $defaultOrderings = array(
'date' => QueryInterface::ORDER_DESCENDING
'crdate' => QueryInterface::ORDER_DESCENDING,
'date' => QueryInterface::ORDER_DESCENDING,
);
}
......@@ -212,6 +212,11 @@ return array(
'eval' => 'datetime',
)
),
'crdate' => [
'config' => [
'type' => 'passthrough',
],
],
),
'types' => array(
'0' => array('showitem' => 'hidden, name;;;;1-1-1, company, address, address_street, address_zip, address_city, address_state, address_country, address_country_code, url;;;;1-1-1, email, --div--;Donation, amount, fee, currency, paypal_transaction_id, date, --div--;Misc, comment, feuser, account')
......
......@@ -15,3 +15,11 @@ plugin.tx_t3odonation_form {
}
plugin.tx_t3odonation_list < plugin.tx_t3odonation_form
config.tx_extbase.persistence.classes {
Donation {
T3o\T3oDonation\Controller\Donation {
columns.crdate.mapOnProperty = crdate
}
}
}
......@@ -20,7 +20,16 @@
<tbody>
<f:for each="{paginatedDonations}" as="donation">
<tr>
<td>{donation.name}</td>
<td>
<f:if condition="{donation.url}">
<f:then>
<f:link.external uri="{donation.url}">{donation.name}</f:link.external>
</f:then>
<f:else>
{donation.name}
</f:else>
</f:if>
</td>
<td>
<f:format.currency currencySign="{donation.currency}" decimalSeparator="."
thousandsSeparator="," prependCurrency="true">{donation.amount}
......@@ -34,4 +43,4 @@
</tbody>
</table>
</f:widget.paginate>
</f:section>
\ No newline at end of file
</f:section>
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