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

Contents of /contributions/modules/rsvp/rsvp_handler_field_rsvp_invite_total_invites.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 * Handler for total invites field.
6 */
7
8 class rsvp_handler_field_rsvp_invite_total_invites extends views_handler_field {
9
10 function query() {
11
12 $this->ensure_my_table();
13 $formula = 'COUNT(' . $this->table_alias . '.hash' . ')';
14 $this->query->add_field(NULL, $formula, $this->table_alias . '_total_invites');
15 $this->query->add_groupby('rsvp.nid');
16 }
17
18 function render($values) {
19
20 $item = !empty($values->{$this->table_alias . '_total_invites'}) ? $values->{$this->table_alias . '_total_invites'} : 0;
21 return $item;
22 }
23 }

  ViewVC Help
Powered by ViewVC 1.1.2