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

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 <?php
namespace T3o\T3oDonation\Domain\Model; namespace T3o\T3oDonation\Domain\Model;
/** /**
* This file is part of the TYPO3 CMS project. * This file is part of the TYPO3 CMS project.
* *
* It is free software; you can redistribute it and/or modify it under * It is free software; you can redistribute it and/or modify it under
* the terms of the GNU General Public License, either version 2 * the terms of the GNU General Public License, either version 2
* of the License, or any later version. * of the License, or any later version.
* *
* For the full copyright and license information, please read the * For the full copyright and license information, please read the
* LICENSE.txt file that was distributed with this source code. * LICENSE.txt file that was distributed with this source code.
* *
* The TYPO3 project - inspiring people to share! * The TYPO3 project - inspiring people to share!
*/ */
/** /**
* Class \T3o\T3oDonation\Domain\Model\Donation * Class \T3o\T3oDonation\Domain\Model\Donation
...@@ -117,6 +118,11 @@ class Donation extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity ...@@ -117,6 +118,11 @@ class Donation extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity
*/ */
protected $date; protected $date;
/**
* @var \DateTime
*/
protected $crdate;
/** /**
* @return bool * @return bool
*/ */
...@@ -420,4 +426,13 @@ class Donation extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity ...@@ -420,4 +426,13 @@ class Donation extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity
{ {
return $this->date; return $this->date;
} }
/**
* @return \DateTime
*/
public function getCrdate()
{
return $this->date;
}
} }
...@@ -23,6 +23,7 @@ use TYPO3\CMS\Extbase\Persistence\QueryInterface; ...@@ -23,6 +23,7 @@ use TYPO3\CMS\Extbase\Persistence\QueryInterface;
class DonationRepository extends \TYPO3\CMS\Extbase\Persistence\Repository class DonationRepository extends \TYPO3\CMS\Extbase\Persistence\Repository
{ {
protected $defaultOrderings = array( protected $defaultOrderings = array(
'date' => QueryInterface::ORDER_DESCENDING 'crdate' => QueryInterface::ORDER_DESCENDING,
'date' => QueryInterface::ORDER_DESCENDING,
); );
} }
...@@ -212,6 +212,11 @@ return array( ...@@ -212,6 +212,11 @@ return array(
'eval' => 'datetime', 'eval' => 'datetime',
) )
), ),
'crdate' => [
'config' => [
'type' => 'passthrough',
],
],
), ),
'types' => array( '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') '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 { ...@@ -15,3 +15,11 @@ plugin.tx_t3odonation_form {
} }
plugin.tx_t3odonation_list < 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 @@ ...@@ -20,7 +20,16 @@
<tbody> <tbody>
<f:for each="{paginatedDonations}" as="donation"> <f:for each="{paginatedDonations}" as="donation">
<tr> <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> <td>
<f:format.currency currencySign="{donation.currency}" decimalSeparator="." <f:format.currency currencySign="{donation.currency}" decimalSeparator="."
thousandsSeparator="," prependCurrency="true">{donation.amount} thousandsSeparator="," prependCurrency="true">{donation.amount}
...@@ -34,4 +43,4 @@ ...@@ -34,4 +43,4 @@
</tbody> </tbody>
</table> </table>
</f:widget.paginate> </f:widget.paginate>
</f:section> </f:section>
\ 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