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.
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.
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
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
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.
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.
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 ********************************************************************************/
39 require_once('include/Sugarpdf/sugarpdf_config.php');
41 $SugarpdfSettings = array(
42 "sugarpdf_pdf_title"=>array(
43 "label"=>$mod_strings["PDF_TITLE"],
44 "info_label"=>$mod_strings["PDF_TITLE_INFO"],
49 "sugarpdf_pdf_subject"=>array(
50 "label"=>$mod_strings["PDF_SUBJECT"],
51 "info_label"=>$mod_strings["PDF_SUBJECT_INFO"],
56 /* "sugarpdf_pdf_creator"=>array(
57 "label"=>$mod_strings["PDF_CREATOR"],
58 "info_label"=>$mod_strings["PDF_CREATOR_INFO"],
64 "sugarpdf_pdf_author"=>array(
65 "label"=>$mod_strings["PDF_AUTHOR"],
66 "info_label"=>$mod_strings["PDF_AUTHOR_INFO"],
72 "sugarpdf_pdf_keywords"=>array(
73 "label"=>$mod_strings["PDF_KEYWORDS"],
74 "info_label"=>$mod_strings["PDF_KEYWORDS_INFO"],
75 "value"=>PDF_KEYWORDS,
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,
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,
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,
103 "new_header_logo"=>array(
104 "label"=>$mod_strings["PDF_NEW_HEADER_LOGO"],
105 "info_label"=>$mod_strings["PDF_NEW_HEADER_LOGO_INFO"],
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,
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,
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"],
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,
149 "sugarpdf_pdf_filename"=>array(
150 "label"=>$mod_strings["PDF_FILENAME"],
151 "info_label"=>$mod_strings["PDF_FILENAME_INFO"],
152 "value"=>PDF_FILENAME,
157 "sugarpdf_pdf_compression"=>array(
158 "label"=>$mod_strings["PDF_COMPRESSION"],
159 "info_label"=>$mod_strings["PDF_COMPRESSION_INFO"],
160 "value"=>PDF_COMPRESSION,
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,
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,
182 "sugarpdf_pdf_protection"=>array(
183 "label"=>$mod_strings["PDF_PROTECTION"],
184 "info_label"=>$mod_strings["PDF_PROTECTION_INFO"],
185 "value"=>explode(",",PDF_PROTECTION),
187 "type"=>"multiselect",
188 "selectList"=>array("print"=>"Print", "modify"=>"Modify", "copy"=>"Copy", "annot-forms"=>"Annotations and forms"),
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),
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),
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,
212 "selectList"=>array("edit"=>"Edition","list"=>"List","detail"=>"Detail", "export"=>"Export"),
216 /* "sugarpdf_head_magnification"=>array(
217 "label"=>$mod_strings["HEAD_MAGNIFICATION"],
218 "info_label"=>$mod_strings["HEAD_MAGNIFICATION_INFO"],
219 "value"=>HEAD_MAGNIFICATION,
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,
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,
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,
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,
257 "sugarpdf_pdf_unit"=>array(
258 "label"=>$mod_strings["PDF_UNIT"],
259 "info_label"=>$mod_strings["PDF_UNIT_INFO"],
264 "selectList"=>array("mm"=>"Millimeter", "pt"=>"Point", "cm"=>"Centimeter", "in"=>"Inch"),
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'];
275 if (@getimagesize($small_logo) === FALSE) {
276 $SugarpdfSettings['sugarpdf_pdf_small_header_logo']['path'] = K_PATH_IMAGES.$SugarpdfSettings['sugarpdf_pdf_small_header_logo']['value'];