summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authoremkael <emkael@tlen.pl>2016-05-06 12:42:41 +0200
committeremkael <emkael@tlen.pl>2016-05-06 12:42:41 +0200
commit29c9678df8a1a6285af3501b3c0b2ca2f57d358e (patch)
tree10dd7653c6a8895424de3f3aa5c02f4092deb050 /app
parentf73bc251c7e1362463d632c54f62ea4c48decab8 (diff)
* order parameter in event list
Diffstat (limited to 'app')
-rw-r--r--app/php/facades/EventFacade.php5
-rw-r--r--app/php/sqlmap/events.xml2
2 files changed, 4 insertions, 3 deletions
diff --git a/app/php/facades/EventFacade.php b/app/php/facades/EventFacade.php
index 909ca2a..a41b2f7 100644
--- a/app/php/facades/EventFacade.php
+++ b/app/php/facades/EventFacade.php
@@ -7,7 +7,7 @@ Prado::using('Application.user.DbUser');
class EventFacade extends Facade {
- public function getEventList($dateFrom=NULL, $dateTo=NULL, $calendars=NULL) {
+ public function getEventList($dateFrom=NULL, $dateTo=NULL, $calendars=NULL, $order='ASC') {
$calendarClause = '1=1';
if ($calendars) {
$calendarClause = sprintf(
@@ -28,7 +28,8 @@ class EventFacade extends Facade {
[
'date_from' => $dateFrom ?: '0000-00-00 00:00:00',
'date_to' => $dateTo ?: '9999-99-99',
- 'calendar_clause' => $calendarClause
+ 'calendar_clause' => $calendarClause,
+ 'order_clause' => $order
]
);
}
diff --git a/app/php/sqlmap/events.xml b/app/php/sqlmap/events.xml
index 5980b27..030a773 100644
--- a/app/php/sqlmap/events.xml
+++ b/app/php/sqlmap/events.xml
@@ -5,7 +5,7 @@
SELECT * FROM entries
WHERE end_date >= #date_from# AND begin_date <= #date_to#
AND $calendar_clause$
- ORDER BY begin_date ASC;
+ ORDER BY begin_date $order_clause$;
]]>
</select>
</sqlMapConfig>