Parent Directory
|
Revision Log
|
Revision Graph
#330247 by ulf1, adding new files
| 1 | <?php |
| 2 | // $Id$ |
| 3 | |
| 4 | |
| 5 | |
| 6 | |
| 7 | /** |
| 8 | * Handler for total RSVPs field. |
| 9 | */ |
| 10 | |
| 11 | class rsvp_handler_field_rsvp_total_rsvps extends views_handler_field { |
| 12 | |
| 13 | function query() { |
| 14 | |
| 15 | $this->ensure_my_table(); |
| 16 | $formula = 'COUNT(DISTINCT ' . $this->table_alias . '.rid)'; |
| 17 | $this->query->add_field(NULL, $formula, $this->table_alias . '_total_rsvps'); |
| 18 | $this->query->add_groupby('nid'); |
| 19 | } |
| 20 | |
| 21 | function render($values) { |
| 22 | |
| 23 | $item = !empty($values->{$this->table_alias . '_total_rsvps'}) ? $values->{$this->table_alias . '_total_rsvps'} : 0; |
| 24 | return $item; |
| 25 | } |
| 26 | } |
| 27 |
| ViewVC Help | |
| Powered by ViewVC 1.1.2 |