This project does not seem to handle request data directly as such no vulnerable execution paths were found.
include
, or for example
via PHP's auto-loading mechanism.
These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more
1 | <?php |
||
2 | if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point'); |
||
3 | |||
4 | /********************************************************************************* |
||
5 | * SugarCRM Community Edition is a customer relationship management program developed by |
||
6 | * SugarCRM, Inc. Copyright (C) 2004-2013 SugarCRM Inc. |
||
7 | |||
8 | * SuiteCRM is an extension to SugarCRM Community Edition developed by Salesagility Ltd. |
||
9 | * Copyright (C) 2011 - 2014 Salesagility Ltd. |
||
10 | * |
||
11 | * This program is free software; you can redistribute it and/or modify it under |
||
12 | * the terms of the GNU Affero General Public License version 3 as published by the |
||
13 | * Free Software Foundation with the addition of the following permission added |
||
14 | * to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK |
||
15 | * IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY |
||
16 | * OF NON INFRINGEMENT OF THIRD PARTY RIGHTS. |
||
17 | * |
||
18 | * This program is distributed in the hope that it will be useful, but WITHOUT |
||
19 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS |
||
20 | * FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more |
||
21 | * details. |
||
22 | * |
||
23 | * You should have received a copy of the GNU Affero General Public License along with |
||
24 | * this program; if not, see http://www.gnu.org/licenses or write to the Free |
||
25 | * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA |
||
26 | * 02110-1301 USA. |
||
27 | * |
||
28 | * You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road, |
||
29 | * SW2-130, Cupertino, CA 95014, USA. or at email address [email protected]. |
||
30 | * |
||
31 | * The interactive user interfaces in modified source and object code versions |
||
32 | * of this program must display Appropriate Legal Notices, as required under |
||
33 | * Section 5 of the GNU Affero General Public License version 3. |
||
34 | * |
||
35 | * In accordance with Section 7(b) of the GNU Affero General Public License version 3, |
||
36 | * these Appropriate Legal Notices must retain the display of the "Powered by |
||
37 | * SugarCRM" logo and "Supercharged by SuiteCRM" logo. If the display of the logos is not |
||
38 | * reasonably feasible for technical reasons, the Appropriate Legal Notices must |
||
39 | * display the words "Powered by SugarCRM" and "Supercharged by SuiteCRM". |
||
40 | ********************************************************************************/ |
||
41 | |||
42 | |||
43 | class DocumentsViewEdit extends ViewEdit |
||
44 | { |
||
45 | |||
46 | /** |
||
47 | * @see SugarView::ViewEdit() |
||
48 | */ |
||
49 | function __construct(){ |
||
50 | parent::__construct(); |
||
51 | $this->useForSubpanel = true; |
||
52 | } |
||
53 | |||
54 | /** |
||
55 | * @deprecated deprecated since version 7.6, PHP4 Style Constructors are deprecated and will be remove in 7.8, please update your code, use __construct instead |
||
56 | */ |
||
57 | function DocumentsViewEdit(){ |
||
58 | $deprecatedMessage = 'PHP4 Style Constructors are deprecated and will be remove in 7.8, please update your code'; |
||
59 | if(isset($GLOBALS['log'])) { |
||
60 | $GLOBALS['log']->deprecated($deprecatedMessage); |
||
61 | } |
||
62 | else { |
||
63 | trigger_error($deprecatedMessage, E_USER_DEPRECATED); |
||
64 | } |
||
65 | self::__construct(); |
||
66 | } |
||
67 | |||
68 | |||
69 | /** |
||
0 ignored issues
–
show
Coding Style
introduced
by
![]() |
|||
70 | * @see SugarView::display() |
||
71 | */ |
||
72 | public function display() |
||
73 | { |
||
74 | global $app_list_strings, $mod_strings; |
||
75 | |||
76 | $load_signed=false; |
||
77 | if ((isset($_REQUEST['load_signed_id']) && !empty($_REQUEST['load_signed_id']))) { |
||
78 | |||
79 | $load_signed=true; |
||
80 | if (isset($_REQUEST['record'])) { |
||
81 | $this->bean->related_doc_id=$_REQUEST['record']; |
||
82 | } |
||
83 | if (isset($_REQUEST['selected_revision_id'])) { |
||
84 | $this->bean->related_doc_rev_id=$_REQUEST['selected_revision_id']; |
||
85 | } |
||
86 | |||
87 | $this->bean->id=null; |
||
88 | $this->bean->document_name=null; |
||
89 | $this->bean->filename=null; |
||
90 | $this->bean->is_template=0; |
||
91 | } //if |
||
92 | |||
93 | if (!empty($this->bean->id) || |
||
94 | (empty($this->bean->id) && !empty($_REQUEST['record']) && !empty($_REQUEST['action']) && strtolower($_REQUEST['action'])=='quickedit') |
||
95 | ) { |
||
96 | $this->ss->assign("FILE_OR_HIDDEN", "hidden"); |
||
97 | if (!$this->ev->isDuplicate) { |
||
98 | $this->ss->assign("DISABLED", "disabled"); |
||
99 | } |
||
100 | } else { |
||
101 | $this->bean->revision = 1; |
||
102 | $this->ss->assign("FILE_OR_HIDDEN", "file"); |
||
103 | } |
||
104 | |||
105 | $popup_request_data = array( |
||
106 | 'call_back_function' => 'document_set_return', |
||
107 | 'form_name' => 'EditView', |
||
108 | 'field_to_name_array' => array( |
||
109 | 'id' => 'related_doc_id', |
||
110 | 'document_name' => 'related_document_name', |
||
111 | ), |
||
112 | ); |
||
113 | $json = getJSONobj(); |
||
114 | $this->ss->assign('encoded_document_popup_request_data', $json->encode($popup_request_data)); |
||
115 | |||
116 | |||
117 | //get related document name. |
||
118 | if (!empty($this->bean->related_doc_id)) { |
||
119 | $this->ss->assign("RELATED_DOCUMENT_NAME",Document::get_document_name($this->bean->related_doc_id)); |
||
120 | $this->ss->assign("RELATED_DOCUMENT_ID",$this->bean->related_doc_id); |
||
121 | if (!empty($this->bean->related_doc_rev_id)) { |
||
122 | $this->ss->assign("RELATED_DOCUMENT_REVISION_OPTIONS", get_select_options_with_id(DocumentRevision::get_document_revisions($this->bean->related_doc_id), $this->bean->related_doc_rev_id)); |
||
123 | } else { |
||
124 | $this->ss->assign("RELATED_DOCUMENT_REVISION_OPTIONS", get_select_options_with_id(DocumentRevision::get_document_revisions($this->bean->related_doc_id), '')); |
||
125 | } |
||
126 | } else { |
||
127 | $this->ss->assign("RELATED_DOCUMENT_REVISION_DISABLED", "disabled"); |
||
128 | } |
||
129 | |||
130 | |||
131 | //set parent information in the form. |
||
132 | if (isset($_REQUEST['parent_id'])) { |
||
133 | $this->ss->assign("PARENT_ID",$_REQUEST['parent_id']); |
||
134 | } //if |
||
135 | |||
136 | if (isset($_REQUEST['parent_name'])) { |
||
137 | $this->ss->assign("PARENT_NAME", $_REQUEST['parent_name']); |
||
138 | |||
139 | if (!empty($_REQUEST['parent_type'])) { |
||
140 | switch (strtolower($_REQUEST['parent_type'])) { |
||
141 | |||
142 | case "contracts" : |
||
0 ignored issues
–
show
There must be no space before the colon in a CASE statement
As per the PSR-2 coding standard, there must not be a space in front of the colon in case statements. switch ($selector) {
case "A": //right
doSomething();
break;
case "B" : //wrong
doSomethingElse();
break;
}
To learn more about the PSR-2 coding standard, please refer to the PHP-Fig. ![]() |
|||
143 | $this->ss->assign("LBL_PARENT_NAME",$mod_strings['LBL_CONTRACT_NAME']); |
||
144 | break; |
||
145 | |||
146 | //todo remove leads case. |
||
147 | case "leads" : |
||
0 ignored issues
–
show
There must be no space before the colon in a CASE statement
As per the PSR-2 coding standard, there must not be a space in front of the colon in case statements. switch ($selector) {
case "A": //right
doSomething();
break;
case "B" : //wrong
doSomethingElse();
break;
}
To learn more about the PSR-2 coding standard, please refer to the PHP-Fig. ![]() |
|||
148 | $this->ss->assign("LBL_PARENT_NAME",$mod_strings['LBL_CONTRACT_NAME']); |
||
149 | break; |
||
150 | } //switch |
||
151 | } //if |
||
152 | } //if |
||
153 | |||
154 | if (isset($_REQUEST['parent_type'])) { |
||
155 | $this->ss->assign("PARENT_TYPE",$_REQUEST['parent_type']); |
||
156 | } |
||
157 | |||
158 | if ($load_signed) { |
||
159 | $this->ss->assign("RELATED_DOCUMENT_REVISION_DISABLED", "disabled"); |
||
160 | $this->ss->assign("RELATED_DOCUMENT_BUTTON_AVAILABILITY", "hidden"); |
||
161 | $this->ss->assign("LOAD_SIGNED_ID",$_REQUEST['load_signed_id']); |
||
162 | } else { |
||
163 | $this->ss->assign("RELATED_DOCUMENT_BUTTON_AVAILABILITY", "button"); |
||
164 | } //if-else |
||
165 | |||
166 | parent::display(); |
||
167 | } |
||
168 | |||
169 | /** |
||
170 | * @see SugarView::_getModuleTitleParams() |
||
171 | */ |
||
172 | protected function _getModuleTitleParams($browserTitle = false) |
||
173 | { |
||
174 | $params = array(); |
||
175 | $params[] = $this->_getModuleTitleListParam($browserTitle); |
||
176 | if(!empty($this->bean->id)){ |
||
177 | $params[] = "<a href='index.php?module={$this->module}&action=DetailView&record={$this->bean->id}'>".$this->bean->document_name."</a>"; |
||
178 | $params[] = $GLOBALS['app_strings']['LBL_EDIT_BUTTON_LABEL']; |
||
179 | }else{ |
||
180 | $params[] = $GLOBALS['app_strings']['LBL_CREATE_BUTTON_LABEL']; |
||
181 | } |
||
182 | |||
183 | return $params; |
||
184 | } |
||
185 | |||
186 | } |
||
187 |