/[drupal]/contributions/modules/rsvp/rsvp_handler_field_rsvp_total_rsvps.inc
ViewVC logotype

Contents of /contributions/modules/rsvp/rsvp_handler_field_rsvp_total_rsvps.inc

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.1 - (show annotations) (download) (as text)
Sun Nov 30 21:12:07 2008 UTC (11 months, 3 weeks ago) by owahab
Branch: MAIN
CVS Tags: DRUPAL-6--1-0-RC1, DRUPAL-6--1-0-RC2, DRUPAL-6--1-0-RC3, DRUPAL-6--1-0-RC4, DRUPAL-6--1-0, DRUPAL-6--1-1, HEAD
Branch point for: DRUPAL-6--1, DRUPAL-6--2
File MIME type: text/x-php
#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