commiting uncommited changes on live site
[weblabels.fsf.org.git] / crm.fsf.org / 20131203 / files / sites / all / modules-old / civicrm / drupal / modules / views / civicrm / civicrm_handler_filter_group_status.inc
1 <?php
2 /*
3 +--------------------------------------------------------------------+
4 | CiviCRM version 4.6 |
5 +--------------------------------------------------------------------+
6 | This file is a part of CiviCRM. |
7 | |
8 | CiviCRM is free software; you can copy, modify, and distribute it |
9 | under the terms of the GNU Affero General Public License |
10 | Version 3, 19 November 2007 and the CiviCRM Licensing Exception. |
11 | |
12 | CiviCRM is distributed in the hope that it will be useful, but |
13 | WITHOUT ANY WARRANTY; without even the implied warranty of |
14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
15 | See the GNU Affero General Public License for more details. |
16 | |
17 | You should have received a copy of the GNU Affero General Public |
18 | License and the CiviCRM Licensing Exception along |
19 | with this program; if not, contact CiviCRM LLC |
20 | at info[AT]civicrm[DOT]org. If you have questions about the |
21 | GNU Affero General Public License or the licensing of CiviCRM, |
22 | see the CiviCRM license FAQ at http://civicrm.org/licensing |
23 +--------------------------------------------------------------------+
24 */
25
26
27 /*
28 * Heavily based on anonymous code contribution. No claim.
29 * CiviCRM Views Integration
30 */
31 class civicrm_handler_filter_group_status extends views_handler_filter_in_operator {
32
33 static $groupContactStatus = NULL;
34 function construct() {
35 parent::construct();
36
37 if (!self::$groupContactStatus) {
38 if (!civicrm_initialize()) {
39 return;
40 }
41 self::$groupContactStatus = array(
42 0 => 'Added',
43 1 => 'Removed',
44 2 => 'Pending',
45 );
46 }
47 }
48
49 function get_value_options() {
50 if (!isset($this->value_options)) {
51 $this->value_title = t('Contact Group Status');
52 $options = array();
53 foreach (self::$groupContactStatus as $id => $name) {
54 $options[$name] = $name;
55 }
56 $this->value_options = $options;
57 }
58 }
59 }
60
61
62