3 +--------------------------------------------------------------------+
4 | CiviCRM version 4.6 |
5 +--------------------------------------------------------------------+
6 | Copyright CiviCRM LLC (c) 2004-2015 |
7 +--------------------------------------------------------------------+
8 | This file is a part of CiviCRM. |
10 | CiviCRM is free software; you can copy, modify, and distribute it |
11 | under the terms of the GNU Affero General Public License |
12 | Version 3, 19 November 2007. |
14 | CiviCRM is distributed in the hope that it will be useful, but |
15 | WITHOUT ANY WARRANTY; without even the implied warranty of |
16 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
17 | See the GNU Affero General Public License for more details. |
19 | You should have received a copy of the GNU Affero General Public |
20 | License and the CiviCRM Licensing Exception along |
21 | with this program; if not, contact CiviCRM LLC |
22 | at info[AT]civicrm[DOT]org. If you have questions about the |
23 | GNU Affero General Public License or the licensing of CiviCRM, |
24 | see the CiviCRM license FAQ at http://civicrm.org/licensing |
25 +--------------------------------------------------------------------+
31 * @copyright CiviCRM LLC (c) 2004-2015
35 function civicrm_rules_get_condition() {
37 'civicrm_rules_condition_mailing_approved' =>
39 'label' => t('Approval Status: Approved'),
41 'approvalstatus' => array(
43 'label' => t('Approved'),
46 'base' => 'civicrm_rules_condition_mailing_approved',
47 'group' => 'CiviCRM Mailing',
49 'civicrm_rules_condition_mailing_rejected' =>
51 'label' => t('Approval Status: Rejected'),
53 'approvalstatus' => array(
55 'label' => t('Rejected'),
58 'base' => 'civicrm_rules_condition_mailing_rejected',
59 'group' => 'CiviCRM Mailing',
61 'civicrm_rules_condition_participant_role' =>
63 'label' => t('Participant Role'),
64 'base' => 'civicrm_rules_condition_participant_role',
65 'parameter' => civicrm_rules_condition_parameter(t('Participant Role'), 'participant'),
66 'group' => 'CiviCRM participant',
68 'civicrm_rules_condition_event_type' =>
70 'label' => t('Event Type'),
71 'base' => 'civicrm_rules_condition_event_type',
72 'parameter' => civicrm_rules_condition_parameter(t('Created Event'), 'event'),
73 'group' => 'CiviCRM event',
78 function civicrm_rules_condition_parameter($label, $type = 'contact') {
80 $default = array($type => array('type' => $type, 'label' => $label));
82 if ($type == 'participant') {
83 return $default + array(
84 'civicrm_participant_role' => array('type' => 'list<integer>',
85 'label' => t('Participant role'),
86 'options list' => 'civicrm_rules_get_participant_role_options',
90 if ($type == 'event') {
91 return $default + array(
92 'civicrm_event_type' => array('type' => 'list<integer>',
93 'label' => t('CiviCRM event type'),
94 'options list' => 'civicrm_rules_get_event_type_options',