-
Notifications
You must be signed in to change notification settings - Fork 4
/
wci-helper-functions.php
56 lines (50 loc) · 2.22 KB
/
wci-helper-functions.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
<?php
/*
+--------------------------------------------------------------------+
| CiviCRM Widget Creation Interface (WCI) Version 1.0 |
+--------------------------------------------------------------------+
| Copyright Zyxware Technologies (c) 2014 |
+--------------------------------------------------------------------+
| This file is a part of CiviCRM WCI. |
| |
| CiviCRM WCI is free software; you can copy, modify, and distribute |
| it under the terms of the GNU Affero General Public License |
| Version 3, 19 November 2007. |
| |
| CiviCRM WCI is distributed in the hope that it will be useful, |
| but WITHOUT ANY WARRANTY; without even the implied warranty of |
| MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
| See the GNU Affero General Public License for more details. |
| |
| You should have received a copy of the GNU Affero General Public |
| License along with this program; if not, contact Zyxware |
| Technologies at info[AT]zyxware[DOT]com. |
+--------------------------------------------------------------------+
*/
function getContributionPageOptions() {
$options = array(
0 => ts('- select -'),
);
$result = civicrm_api3('contribution_page', 'get', array(
'rowCount' => 0 // Fetch all contribution pages.
));
foreach ($result['values'] as $contribution_page) {
$options[$contribution_page['id']] = $contribution_page['title'];
}
return $options;
}
function getFinancialTypes() {
$query = "SELECT id, name FROM civicrm_financial_type";
$dao = CRM_Core_DAO::executeQuery($query);
$options = array(
0 => ts('- select -'),
);
while ($dao->fetch()) {
$options[$dao->id] = $dao->name;
}
return $options;
}
function getWciWidgetTemplatePath() {
$widget_tpl_path = __DIR__ . '/templates/CRM/Wci/Page';
return $widget_tpl_path;
}