Author: pmacadden
Date: 2010-05-08 04:14:27 +0200 (Sat, 08 May 2010)
New Revision: 29399
Modified:
plugins/pmPropelEventCalendarPlugin/trunk/README
plugins/pmPropelEventCalendarPlugin/trunk/modules/pm_propel_event_calendar/actions/actions.class.php
Log:
bugfixes and some improvements
Modified: plugins/pmPropelEventCalendarPlugin/trunk/README
===================================================================
--- plugins/pmPropelEventCalendarPlugin/trunk/README 2010-05-07 18:54:56 UTC
(rev 29398)
+++ plugins/pmPropelEventCalendarPlugin/trunk/README 2010-05-08 02:14:27 UTC
(rev 29399)
@@ -40,6 +40,7 @@
peer_method: doSelect # default
title: Event calendar # default
order: desc # default, could be 'asc'
+ order_by_column: DATE # default
module: event # propel admin module, used to present
the results (not required)
* Clear your cache
Modified:
plugins/pmPropelEventCalendarPlugin/trunk/modules/pm_propel_event_calendar/actions/actions.class.php
===================================================================
---
plugins/pmPropelEventCalendarPlugin/trunk/modules/pm_propel_event_calendar/actions/actions.class.php
2010-05-07 18:54:56 UTC (rev 29398)
+++
plugins/pmPropelEventCalendarPlugin/trunk/modules/pm_propel_event_calendar/actions/actions.class.php
2010-05-08 02:14:27 UTC (rev 29399)
@@ -26,32 +26,33 @@
*/
public function executeSearch(sfWebRequest $request)
{
- $selected_date = $request->getParameter('date');
+ $this->selected_date = $request->getParameter('date');
$this->class = sfConfig::get('app_pm_propel_event_calendar_class',
'Event');
- $peer_class = $this->class.'Peer';
- $column = sfConfig::get('app_pm_propel_event_calendar_column', 'DATE');
- $peer_method = sfConfig::get('app_pm_propel_event_calendar_peer_method',
'doSelect');
- $order = sfConfig::get('app_pm_propel_event_calendar_order', 'desc');
- $module = sfConfig::get('app_pm_propel_event_calendar_module');
+ $this->peer_class = $this->class.'Peer';
+ $this->column = sfConfig::get('app_pm_propel_event_calendar_column',
'DATE');
+ $this->peer_method =
sfConfig::get('app_pm_propel_event_calendar_peer_method', 'doSelect');
+ $this->order_by_column =
sfConfig::get('app_pm_propel_event_calendar_order_by_column', 'DATE');
+ $this->order = sfConfig::get('app_pm_propel_event_calendar_order', 'desc');
+ $this->module = sfConfig::get('app_pm_propel_event_calendar_module');
$c = new Criteria();
- $c->add(constant("$peer_class::$column"), $selected_date);
+ $c->add(constant($this->peer_class."::".$this->column),
$this->selected_date);
- if ($order == 'desc')
+ if ($this->order == 'desc')
{
- $c->addDescendingOrderByColumn(constant("$peer_class::$column"));
+
$c->addDescendingOrderByColumn(constant($this->peer_class."::".$this->order_by_column));
}
else
{
- $c->addAscendingOrderByColumn(constant("$peer_class::$column"));
+
$c->addAscendingOrderByColumn(constant($this->peer_class."::".$this->order_by_column));
}
- if (!is_null($module))
+ if (!is_null($this->module))
{
$filters = array(
- sfInflector::underscore($column) => array(
- "from" => $selected_date,
- "to" => $selected_date
+ sfInflector::underscore($this->column) => array(
+ "from" => $this->selected_date,
+ "to" => $this->selected_date
)
);
@@ -60,7 +61,7 @@
}
else
{
- $this->results = call_user_func(array($peer_class, $peer_method), $c);
+ $this->results = call_user_func(array($this->peer_class,
$this->peer_method), $c);
}
}
}
--
You received this message because you are subscribed to the Google Groups
"symfony SVN" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/symfony-svn?hl=en.