1
|
|
|
<?php |
2
|
|
|
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point'); |
3
|
|
|
/********************************************************************************* |
4
|
|
|
* SugarCRM Community Edition is a customer relationship management program developed by |
5
|
|
|
* SugarCRM, Inc. Copyright (C) 2004-2013 SugarCRM Inc. |
6
|
|
|
|
7
|
|
|
* SuiteCRM is an extension to SugarCRM Community Edition developed by Salesagility Ltd. |
8
|
|
|
* Copyright (C) 2011 - 2014 Salesagility Ltd. |
9
|
|
|
* |
10
|
|
|
* This program is free software; you can redistribute it and/or modify it under |
11
|
|
|
* the terms of the GNU Affero General Public License version 3 as published by the |
12
|
|
|
* Free Software Foundation with the addition of the following permission added |
13
|
|
|
* to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK |
14
|
|
|
* IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY |
15
|
|
|
* OF NON INFRINGEMENT OF THIRD PARTY RIGHTS. |
16
|
|
|
* |
17
|
|
|
* This program is distributed in the hope that it will be useful, but WITHOUT |
18
|
|
|
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS |
19
|
|
|
* FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more |
20
|
|
|
* details. |
21
|
|
|
* |
22
|
|
|
* You should have received a copy of the GNU Affero General Public License along with |
23
|
|
|
* this program; if not, see http://www.gnu.org/licenses or write to the Free |
24
|
|
|
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA |
25
|
|
|
* 02110-1301 USA. |
26
|
|
|
* |
27
|
|
|
* You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road, |
28
|
|
|
* SW2-130, Cupertino, CA 95014, USA. or at email address [email protected]. |
29
|
|
|
* |
30
|
|
|
* The interactive user interfaces in modified source and object code versions |
31
|
|
|
* of this program must display Appropriate Legal Notices, as required under |
32
|
|
|
* Section 5 of the GNU Affero General Public License version 3. |
33
|
|
|
* |
34
|
|
|
* In accordance with Section 7(b) of the GNU Affero General Public License version 3, |
35
|
|
|
* these Appropriate Legal Notices must retain the display of the "Powered by |
36
|
|
|
* SugarCRM" logo and "Supercharged by SuiteCRM" logo. If the display of the logos is not |
37
|
|
|
* reasonably feasible for technical reasons, the Appropriate Legal Notices must |
38
|
|
|
* display the words "Powered by SugarCRM" and "Supercharged by SuiteCRM". |
39
|
|
|
********************************************************************************/ |
40
|
|
|
|
41
|
|
|
|
42
|
|
|
|
43
|
|
|
|
44
|
|
|
global $theme; |
45
|
|
|
|
46
|
|
|
|
47
|
|
|
|
48
|
|
|
|
49
|
|
|
|
50
|
|
|
|
51
|
|
|
|
52
|
|
|
|
53
|
|
|
|
54
|
|
|
class Popup_Picker |
|
|
|
|
55
|
|
|
{ |
56
|
|
|
|
57
|
|
|
|
58
|
|
|
|
59
|
|
|
/* |
60
|
|
|
* |
61
|
|
|
*/ |
62
|
|
|
function _get_where_clause() |
63
|
|
|
{ |
64
|
|
|
$where = ''; |
65
|
|
|
if(isset($_REQUEST['query'])) |
66
|
|
|
{ |
67
|
|
|
$where_clauses = array(); |
68
|
|
|
append_where_clause($where_clauses, "name", "releases.name"); |
69
|
|
|
|
70
|
|
|
$where = generate_where_statement($where_clauses); |
71
|
|
|
} |
72
|
|
|
|
73
|
|
|
return $where; |
74
|
|
|
} |
75
|
|
|
|
76
|
|
|
/** |
77
|
|
|
* |
78
|
|
|
*/ |
79
|
|
|
function process_page() |
80
|
|
|
{ |
81
|
|
|
global $theme; |
82
|
|
|
global $mod_strings; |
83
|
|
|
global $app_strings; |
84
|
|
|
global $currentModule; |
85
|
|
|
global $sugar_version, $sugar_config; |
86
|
|
|
|
87
|
|
|
$output_html = ''; |
88
|
|
|
$where = ''; |
89
|
|
|
|
90
|
|
|
$where = $this->_get_where_clause(); |
91
|
|
|
|
92
|
|
|
|
93
|
|
|
|
94
|
|
|
$name = empty($_REQUEST['name']) ? '' : $_REQUEST['name']; |
95
|
|
|
$request_data = empty($_REQUEST['request_data']) ? '' : $_REQUEST['request_data']; |
96
|
|
|
$hide_clear_button = empty($_REQUEST['hide_clear_button']) ? false : true; |
97
|
|
|
|
98
|
|
|
$button = "<form action='index.php' method='post' name='form' id='form'>\n"; |
99
|
|
|
if(!$hide_clear_button) |
100
|
|
|
{ |
101
|
|
|
$button .= "<input type='button' name='button' class='button' onclick=\"send_back('','');\" title='" |
102
|
|
|
.$app_strings['LBL_CLEAR_BUTTON_TITLE']."' value=' " |
103
|
|
|
.$app_strings['LBL_CLEAR_BUTTON_LABEL']." ' />\n"; |
104
|
|
|
} |
105
|
|
|
$button .= "<input type='submit' name='button' class='button' onclick=\"window.close();\" title='" |
106
|
|
|
.$app_strings['LBL_CANCEL_BUTTON_TITLE']."' accesskey='" |
107
|
|
|
.$app_strings['LBL_CANCEL_BUTTON_KEY']."' value=' " |
108
|
|
|
.$app_strings['LBL_CANCEL_BUTTON_LABEL']." ' />\n"; |
109
|
|
|
$button .= "</form>\n"; |
110
|
|
|
|
111
|
|
|
$form = new XTemplate('modules/Releases/Popup_picker.html'); |
112
|
|
|
$form->assign('MOD', $mod_strings); |
113
|
|
|
$form->assign('APP', $app_strings); |
114
|
|
|
$form->assign('THEME', $theme); |
115
|
|
|
$form->assign('MODULE_NAME', $currentModule); |
116
|
|
|
$form->assign('NAME', $name); |
117
|
|
|
$form->assign('request_data', $request_data); |
118
|
|
|
|
119
|
|
|
ob_start(); |
120
|
|
|
insert_popup_header($theme); |
121
|
|
|
$output_html .= ob_get_contents(); |
122
|
|
|
ob_end_clean(); |
123
|
|
|
|
124
|
|
|
$output_html .= get_form_header($mod_strings['LBL_SEARCH_FORM_TITLE'], '', false); |
125
|
|
|
|
126
|
|
|
$form->parse('main.SearchHeader'); |
127
|
|
|
$output_html .= $form->text('main.SearchHeader'); |
128
|
|
|
|
129
|
|
|
// Reset the sections that are already in the page so that they do not print again later. |
130
|
|
|
$form->reset('main.SearchHeader'); |
131
|
|
|
|
132
|
|
|
// create the listview |
133
|
|
|
$seed_bean = new Release(); |
134
|
|
|
$ListView = new ListView(); |
135
|
|
|
$ListView->show_export_button = false; |
136
|
|
|
$ListView->process_for_popups = true; |
137
|
|
|
$ListView->setXTemplate($form); |
138
|
|
|
$ListView->setHeaderTitle($mod_strings['LBL_LIST_FORM_TITLE']); |
139
|
|
|
$ListView->setHeaderText($button); |
140
|
|
|
$ListView->setQuery($where, '', 'name', 'RELEASE'); |
141
|
|
|
$ListView->setModStrings($mod_strings); |
142
|
|
|
|
143
|
|
|
ob_start(); |
144
|
|
|
$ListView->processListView($seed_bean, 'main', 'RELEASE'); |
145
|
|
|
$output_html .= ob_get_contents(); |
146
|
|
|
ob_end_clean(); |
147
|
|
|
|
148
|
|
|
$output_html .= insert_popup_footer(); |
149
|
|
|
return $output_html; |
150
|
|
|
} |
151
|
|
|
} // end of class Popup_Picker |
152
|
|
|
?> |
This check looks for classes that have been defined more than once.
If you can, we would recommend to use standard object-oriented programming techniques. For example, to avoid multiple types, it might make sense to create a common interface, and then multiple, different implementations for that interface.
This also has the side-effect of providing you with better IDE auto-completion, static analysis and also better OPCode caching from PHP.