2 /*********************************************************************************
3 * SugarCRM Community Edition is a customer relationship management program developed by
4 * SugarCRM, Inc. Copyright (C) 2004-2013 SugarCRM Inc.
6 * This program is free software; you can redistribute it and/or modify it under
7 * the terms of the GNU Affero General Public License version 3 as published by the
8 * Free Software Foundation with the addition of the following permission added
9 * to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
10 * IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
11 * OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
13 * This program is distributed in the hope that it will be useful, but WITHOUT
14 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
15 * FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
18 * You should have received a copy of the GNU Affero General Public License along with
19 * this program; if not, see http://www.gnu.org/licenses or write to the Free
20 * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
23 * You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
24 * SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
26 * The interactive user interfaces in modified source and object code versions
27 * of this program must display Appropriate Legal Notices, as required under
28 * Section 5 of the GNU Affero General Public License version 3.
30 * In accordance with Section 7(b) of the GNU Affero General Public License version 3,
31 * these Appropriate Legal Notices must retain the display of the "Powered by
32 * SugarCRM" logo. If the display of the logo is not reasonably feasible for
33 * technical reasons, the Appropriate Legal Notices must display the words
34 * "Powered by SugarCRM".
35 ********************************************************************************/
42 <script type='text/javascript'>var fileFields = new Array();</script>
44 <form name="ConfigureSugarpdfSettings" enctype='multipart/form-data' method="POST" action="index.php?action=SugarpdfSettings&module=Configurator" onSubmit="if(checkFileType(null,1))return (check_form('ConfigureSugarpdfSettings'));else return false;">
45 <span class='error'>{$error}</span>
46 <table width="100%" cellpadding="0" cellspacing="0" border="0">
48 <td style="padding-bottom: 2px;">
49 <input title="{$APP.LBL_SAVE_BUTTON_TITLE}" accessKey="{$APP.LBL_SAVE_BUTTON_KEY}" class="button" type="submit" name="save" value=" {$APP.LBL_SAVE_BUTTON_LABEL} " >
50 <input title="{$MOD.LBL_RESTORE_BUTTON_LABEL}" class="button" type="submit" name="restore" value=" {$MOD.LBL_RESTORE_BUTTON_LABEL} " >
51 <input title="{$MOD.LBL_CANCEL_BUTTON_TITLE}" onclick="document.location.href='index.php?module=Administration&action=index'" class="button" type="button" name="cancel" value=" {$APP.LBL_CANCEL_BUTTON_LABEL} " >
55 <table width="100%" border="0" cellspacing="0" cellpadding="0">
59 <table width="100%" border="0" cellspacing="0" cellpadding="0" class="edit view" {if $pdf_enable_ezpdf=="0"}style="display:none"{/if}>
61 <td scope="row" style="text-align: center;">{html_radios name="sugarpdf_pdf_class" options=$pdf_class selected=$selected_pdf_class separator=' ' onchange='processPDFClass()'}</td>
65 <table width="100%" border="0" cellspacing="0" cellpadding="0" class="edit view" id="settingsForTCPDF">
67 <th align="left" scope="row" colspan="4"><h4 >{$MOD.SUGARPDF_BASIC_SETTINGS}</h4></th>
71 <table width="100%" border="0" cellspacing="0" cellpadding="0">
72 {counter start=0 assign='count'}
73 {foreach from=$SugarpdfSettings item=property key=name}
74 {if $property.class == "basic"}
76 {include file="modules/Configurator/tpls/SugarpdfSettingsFields.tpl"}
90 <table width="100%" border="0" cellspacing="0" cellpadding="0" class="edit view">
92 <th align="left" scope="row" colspan="4"><h4 >{$MOD.SUGARPDF_LOGO_SETTINGS}</h4></th>
96 <table width="100%" border="0" cellspacing="0" cellpadding="0">
97 {counter start=0 assign='count'}
98 {foreach from=$SugarpdfSettings item=property key=name}
99 {if $property.class == "logo"}
101 {include file="modules/Configurator/tpls/SugarpdfSettingsFields.tpl"}
114 <table width="100%" border="0" cellspacing="0" cellpadding="0" class="edit view">
116 <th align="left" scope="row" colspan="4"><h4 >{$MOD.SUGARPDF_ADVANCED_SETTINGS}</h4></th>
119 <td scope="row" scope="row">
120 <table width="100%" border="0" cellspacing="0" cellpadding="0">
121 {counter start=0 assign='count'}
122 {foreach from=$SugarpdfSettings item=property key=name}
123 {if $property.class == "advanced"}
125 {include file="modules/Configurator/tpls/SugarpdfSettingsFields.tpl"}
142 <div style="padding-top: 2px;">
143 <input title="{$APP.LBL_SAVE_BUTTON_TITLE}" class="button" type="submit" name="save" value=" {$APP.LBL_SAVE_BUTTON_LABEL} " />
144 <input title="{$MOD.LBL_RESTORE_BUTTON_LABEL}" class="button" type="submit" name="restore" value=" {$MOD.LBL_RESTORE_BUTTON_LABEL} " >
145 <input title="{$MOD.LBL_CANCEL_BUTTON_TITLE}" onclick="document.location.href='index.php?module=Administration&action=index'" class="button" type="button" name="cancel" value=" {$APP.LBL_CANCEL_BUTTON_LABEL} " />
150 <script type='text/javascript'>
151 function checkFileType(id, submit) {
153 var fileName = document.getElementById(id).value;
154 if ({/literal}{$GD_WARNING}{literal}==1 && (fileName.lastIndexOf(".png") != -1||
155 fileName.lastIndexOf(".PNG") != -1)) {
157 //alert({/literal}SUGAR.language.get('Configurator', 'PDF_GD_WARNING'{literal}));
160 else if (submit == 1) {
161 for (fileField in fileFields) {
162 var fileName = document.getElementById(fileField).value;
163 if ({/literal}{$GD_WARNING}{literal}==1 && (fileName.lastIndexOf(".png") != -1||
164 fileName.lastIndexOf(".PNG") != -1)) {
165 //add_error_style('ConfigureSugarpdfSettings', fileField, SUGAR.language.get('Configurator', 'PDF_GD_WARNING'));
166 alert({/literal}SUGAR.language.get('Configurator', 'PDF_GD_WARNING'{literal}));
173 function verifyPercent(id){
174 var s = document.getElementById(id).value;
176 if(inRange(s, 0, 100)){
179 document.getElementById(id).value = "";
183 document.getElementById(id).value = "";
187 function verifyNumber(id){
188 var s = document.getElementById(id).value;
192 document.getElementById(id).value = "";
196 function processPDFClass(){
197 document.getElementById('settingsForTCPDF').style.display="";
198 // document.getElementById('fontManager').style.display="";
199 if(!check_form('ConfigureSugarpdfSettings')){
200 for (var i = 0; i <document.ConfigureSugarpdfSettings.sugarpdf_pdf_class.length; i++) {
201 if(document.ConfigureSugarpdfSettings.sugarpdf_pdf_class[i].value == "TCPDF"){
202 document.ConfigureSugarpdfSettings.sugarpdf_pdf_class[i].checked=true;
207 for (var i = 0; i <document.ConfigureSugarpdfSettings.sugarpdf_pdf_class.length; i++) {
208 if (document.ConfigureSugarpdfSettings.sugarpdf_pdf_class[i].checked) {
209 chosen = document.ConfigureSugarpdfSettings.sugarpdf_pdf_class[i].value;
212 if(chosen == "EZPDF"){
213 document.getElementById('settingsForTCPDF').style.display="none";
214 //document.getElementById('fontManager').style.display="none";