]> CyberLeo.Net >> Repos - Github/sugarcrm.git/blob - modules/Configurator/metadata/SugarpdfSettingsdefs.php
Release 6.5.0
[Github/sugarcrm.git] / modules / Configurator / metadata / SugarpdfSettingsdefs.php
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-2012 SugarCRM Inc.
6  * 
7  * This program is free software; you can redistribute it and/or modify it under
8  * the terms of the GNU Affero General Public License version 3 as published by the
9  * Free Software Foundation with the addition of the following permission added
10  * to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
11  * IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
12  * OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
13  * 
14  * This program is distributed in the hope that it will be useful, but WITHOUT
15  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
16  * FOR A PARTICULAR PURPOSE.  See the GNU Affero General Public License for more
17  * details.
18  * 
19  * You should have received a copy of the GNU Affero General Public License along with
20  * this program; if not, see http://www.gnu.org/licenses or write to the Free
21  * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
22  * 02110-1301 USA.
23  * 
24  * You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
25  * SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
26  * 
27  * The interactive user interfaces in modified source and object code versions
28  * of this program must display Appropriate Legal Notices, as required under
29  * Section 5 of the GNU Affero General Public License version 3.
30  * 
31  * In accordance with Section 7(b) of the GNU Affero General Public License version 3,
32  * these Appropriate Legal Notices must retain the display of the "Powered by
33  * SugarCRM" logo. If the display of the logo is not reasonably feasible for
34  * technical reasons, the Appropriate Legal Notices must display the words
35  * "Powered by SugarCRM".
36  ********************************************************************************/
37
38
39 require_once('include/Sugarpdf/sugarpdf_config.php');
40
41 $SugarpdfSettings = array(
42     "sugarpdf_pdf_title"=>array(
43         "label"=>$mod_strings["PDF_TITLE"],
44         "info_label"=>$mod_strings["PDF_TITLE_INFO"],
45         "value"=>PDF_TITLE,
46         "class"=>"basic",
47         "type"=>"text",
48     ),
49     "sugarpdf_pdf_subject"=>array(
50         "label"=>$mod_strings["PDF_SUBJECT"],
51         "info_label"=>$mod_strings["PDF_SUBJECT_INFO"],
52         "value"=>PDF_SUBJECT,
53         "class"=>"basic",
54         "type"=>"text",
55     ),
56 /*    "sugarpdf_pdf_creator"=>array(
57         "label"=>$mod_strings["PDF_CREATOR"],
58         "info_label"=>$mod_strings["PDF_CREATOR_INFO"],
59         "value"=>PDF_CREATOR,
60         "class"=>"basic",
61         "type"=>"text",
62         "required"=>"true"
63     ),*/
64     "sugarpdf_pdf_author"=>array(
65         "label"=>$mod_strings["PDF_AUTHOR"],
66         "info_label"=>$mod_strings["PDF_AUTHOR_INFO"],
67         "value"=>PDF_AUTHOR,
68         "class"=>"basic",
69         "type"=>"text",
70         "required"=>"true"
71     ),
72     "sugarpdf_pdf_keywords"=>array(
73         "label"=>$mod_strings["PDF_KEYWORDS"],
74         "info_label"=>$mod_strings["PDF_KEYWORDS_INFO"],
75         "value"=>PDF_KEYWORDS,
76         "class"=>"basic",
77         "type"=>"text"
78     ),
79     /*
80     "sugarpdf_pdf_header_title"=>array(
81         "label"=>$mod_strings["PDF_HEADER_TITLE"],
82         "info_label"=>$mod_strings["PDF_HEADER_TITLE_INFO"],
83         "value"=>PDF_HEADER_TITLE,
84         "class"=>"basic",
85         "type"=>"text",
86     ),
87     "sugarpdf_pdf_header_string"=>array(
88         "label"=>$mod_strings["PDF_HEADER_STRING"],
89         "info_label"=>$mod_strings["PDF_HEADER_STRING_INFO"],
90         "value"=>PDF_HEADER_STRING,
91         "class"=>"basic",
92         "type"=>"text",
93     ),
94     */
95     "sugarpdf_pdf_header_logo"=>array(
96         "label"=>$mod_strings["PDF_HEADER_LOGO"],
97         "info_label"=>$mod_strings["PDF_HEADER_LOGO_INFO"],
98         "value"=>PDF_HEADER_LOGO,
99         "path"=>K_PATH_CUSTOM_IMAGES.PDF_HEADER_LOGO,
100         "class"=>"logo",
101         "type"=>"image",
102     ),
103     "new_header_logo"=>array(
104         "label"=>$mod_strings["PDF_NEW_HEADER_LOGO"],
105         "info_label"=>$mod_strings["PDF_NEW_HEADER_LOGO_INFO"],
106         "value"=>"",
107         "class"=>"logo",
108         "type"=>"file",
109     ),
110     /*
111     "sugarpdf_pdf_header_logo_width"=>array(
112         "label"=>$mod_strings["PDF_HEADER_LOGO_WIDTH"],
113         "info_label"=>$mod_strings["PDF_HEADER_LOGO_WIDTH_INFO"],
114         "value"=>PDF_HEADER_LOGO_WIDTH,
115         "class"=>"logo",
116         "type"=>"number",
117         "required"=>"true",
118         "unit"=>PDF_UNIT
119     ),
120     */
121     "sugarpdf_pdf_small_header_logo"=>array(
122         "label"=>$mod_strings["PDF_SMALL_HEADER_LOGO"],
123         "info_label"=>$mod_strings["PDF_SMALL_HEADER_LOGO_INFO"],
124         "value"=>PDF_SMALL_HEADER_LOGO,
125         "path"=>K_PATH_CUSTOM_IMAGES.PDF_SMALL_HEADER_LOGO,
126         "class"=>"logo",
127         "type"=>"image",
128     ),
129     "new_small_header_logo"=>array(
130         "label"=>$mod_strings["PDF_NEW_SMALL_HEADER_LOGO"],
131         "info_label"=>$mod_strings["PDF_NEW_SMALL_HEADER_LOGO_INFO"],
132         "value"=>"",
133         "class"=>"logo",
134         "type"=>"file",
135     ),
136     /*
137     "sugarpdf_pdf_small_header_logo_width"=>array(
138         "label"=>$mod_strings["PDF_SMALL_HEADER_LOGO_WIDTH"],
139         "info_label"=>$mod_strings["PDF_SMALL_HEADER_LOGO_WIDTH_INFO"],
140         "value"=>PDF_SMALL_HEADER_LOGO_WIDTH,
141         "class"=>"logo",
142         "type"=>"number",
143         "required"=>"true",
144         "unit"=>PDF_UNIT
145     ),
146 */
147     
148
149     "sugarpdf_pdf_filename"=>array(
150         "label"=>$mod_strings["PDF_FILENAME"],
151         "info_label"=>$mod_strings["PDF_FILENAME_INFO"],
152         "value"=>PDF_FILENAME,
153         "class"=>"advanced",
154         "type"=>"text",
155         "required"=>"true"
156     ),
157     "sugarpdf_pdf_compression"=>array(
158         "label"=>$mod_strings["PDF_COMPRESSION"],
159         "info_label"=>$mod_strings["PDF_COMPRESSION_INFO"],
160         "value"=>PDF_COMPRESSION,
161         "class"=>"advanced",
162         "type"=>"bool",
163     ),
164     "sugarpdf_pdf_jpeg_quality"=>array(
165         "label"=>$mod_strings["PDF_JPEG_QUALITY"],
166         "info_label"=>$mod_strings["PDF_JPEG_QUALITY_INFO"],
167         "value"=>PDF_JPEG_QUALITY,
168         "class"=>"advanced",
169         "type"=>"percent",
170         "required"=>"true"
171     ),
172     "sugarpdf_pdf_pdf_version"=>array(
173         "label"=>$mod_strings["PDF_PDF_VERSION"],
174         "info_label"=>$mod_strings["PDF_PDF_VERSION_INFO"],
175         "value"=>PDF_PDF_VERSION,
176         "class"=>"advanced",
177         "type"=>"number",
178         "required"=>"true"
179     ),
180     
181     
182     "sugarpdf_pdf_protection"=>array(
183         "label"=>$mod_strings["PDF_PROTECTION"],
184         "info_label"=>$mod_strings["PDF_PROTECTION_INFO"],
185         "value"=>explode(",",PDF_PROTECTION),
186         "class"=>"advanced",
187         "type"=>"multiselect",
188         "selectList"=>array("print"=>"Print", "modify"=>"Modify", "copy"=>"Copy", "annot-forms"=>"Annotations and forms"),
189     ),
190     
191     "sugarpdf_pdf_user_password"=>array(
192         "label"=>$mod_strings["PDF_USER_PASSWORD"],
193         "info_label"=>$mod_strings["PDF_USER_PASSWORD_INFO"],
194         "value"=>blowfishDecode(blowfishGetKey('sugarpdf_pdf_user_password'), PDF_USER_PASSWORD),
195         "class"=>"advanced",
196         "type"=>"password"
197     ),
198     "sugarpdf_pdf_owner_password"=>array(
199         "label"=>$mod_strings["PDF_OWNER_PASSWORD"],
200         "info_label"=>$mod_strings["PDF_OWNER_PASSWORD_INFO"],
201         "value"=>blowfishDecode(blowfishGetKey('sugarpdf_pdf_owner_password'), PDF_OWNER_PASSWORD),
202         "class"=>"advanced",
203         "type"=>"password"
204     ),
205
206     "sugarpdf_pdf_acl_access"=>array(
207         "label"=>$mod_strings["PDF_ACL_ACCESS"],
208         "info_label"=>$mod_strings["PDF_ACL_ACCESS_INFO"],
209         "value"=>PDF_ACL_ACCESS,
210         "class"=>"advanced",
211         "type"=>"select",
212         "selectList"=>array("edit"=>"Edition","list"=>"List","detail"=>"Detail", "export"=>"Export"),
213         "required"=>"true"
214     ),
215     
216 /*    "sugarpdf_head_magnification"=>array(
217         "label"=>$mod_strings["HEAD_MAGNIFICATION"],
218         "info_label"=>$mod_strings["HEAD_MAGNIFICATION_INFO"],
219         "value"=>HEAD_MAGNIFICATION,
220         "class"=>"advanced",
221         "type"=>"number",
222         "required"=>"true"
223     ),*/
224 /*    "sugarpdf_k_title_magnification"=>array(
225         "label"=>$mod_strings["K_TITLE_MAGNIFICATION"],
226         "info_label"=>$mod_strings["K_TITLE_MAGNIFICATION_INFO"],
227         "value"=>K_TITLE_MAGNIFICATION,
228         "class"=>"advanced",
229         "type"=>"number",
230         "required"=>"true"
231     ),*/
232     
233     "sugarpdf_k_small_ratio"=>array(
234         "label"=>$mod_strings["K_SMALL_RATIO"],
235         "info_label"=>$mod_strings["K_SMALL_RATIO_INFO"],
236         "value"=>K_SMALL_RATIO,
237         "class"=>"advanced",
238         "type"=>"number",
239         "required"=>"true"
240     ),
241     "sugarpdf_k_cell_height_ratio"=>array(
242         "label"=>$mod_strings["K_CELL_HEIGHT_RATIO"],
243         "info_label"=>$mod_strings["K_CELL_HEIGHT_RATIO_INFO"],
244         "value"=>K_CELL_HEIGHT_RATIO,
245         "class"=>"advanced",
246         "type"=>"number",
247         "required"=>"true"
248     ),
249     "sugarpdf_pdf_image_scale_ratio"=>array(
250         "label"=>$mod_strings["PDF_IMAGE_SCALE_RATIO"],
251         "info_label"=>$mod_strings["PDF_IMAGE_SCALE_RATIO_INFO"],
252         "value"=>PDF_IMAGE_SCALE_RATIO,
253         "class"=>"advanced",
254         "type"=>"number",
255         "required"=>"true"
256     ),
257     "sugarpdf_pdf_unit"=>array(
258         "label"=>$mod_strings["PDF_UNIT"],
259         "info_label"=>$mod_strings["PDF_UNIT_INFO"],
260         "value"=>PDF_UNIT,
261         "class"=>"advanced",
262         "type"=>"select",
263     //TODO translate
264         "selectList"=>array("mm"=>"Millimeter", "pt"=>"Point", "cm"=>"Centimeter", "in"=>"Inch"),
265         "required"=>"true"
266     ),
267 );
268
269 // Use the OOB directory for images if there is no image in the custom directory
270 $small_logo = $SugarpdfSettings['sugarpdf_pdf_small_header_logo']['path'];
271 $logo = $SugarpdfSettings['sugarpdf_pdf_header_logo']['path'];
272 if (@getimagesize($logo) === FALSE) {
273     $SugarpdfSettings['sugarpdf_pdf_header_logo']['path'] = K_PATH_IMAGES.$SugarpdfSettings['sugarpdf_pdf_header_logo']['value'];
274 }
275 if (@getimagesize($small_logo) === FALSE) {
276     $SugarpdfSettings['sugarpdf_pdf_small_header_logo']['path'] = K_PATH_IMAGES.$SugarpdfSettings['sugarpdf_pdf_small_header_logo']['value'];
277 }
278
279 ?>