2 /*********************************************************************************
3 * SugarCRM Community Edition is a customer relationship management program developed by
4 * SugarCRM, Inc. Copyright (C) 2004-2011 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' src="{sugar_getjspath file='include/javascript/overlibmws.js'}"></script>
43 <script type='text/javascript'>var fileFields = new Array();</script>
45 <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;">
46 <span class='error'>{$error}</span>
47 <table width="100%" cellpadding="0" cellspacing="0" border="0">
49 <td style="padding-bottom: 2px;">
50 <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} " >
51 <input title="{$MOD.LBL_RESTORE_BUTTON_LABEL}" class="button" type="submit" name="restore" value=" {$MOD.LBL_RESTORE_BUTTON_LABEL} " >
52 <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} " >
56 <table width="100%" border="0" cellspacing="0" cellpadding="0">
60 <table width="100%" border="0" cellspacing="0" cellpadding="0" class="edit view" {if $pdf_enable_ezpdf=="0"}style="display:none"{/if}>
62 <td scope="row" style="text-align: center;">{html_radios name="sugarpdf_pdf_class" options=$pdf_class selected=$selected_pdf_class separator=' ' onchange='processPDFClass()'}</td>
66 <table width="100%" border="0" cellspacing="0" cellpadding="0" class="edit view" id="settingsForTCPDF">
68 <th align="left" scope="row" colspan="4"><h4 >{$MOD.SUGARPDF_BASIC_SETTINGS}</h4></th>
72 <table width="100%" border="0" cellspacing="0" cellpadding="0">
73 {counter start=0 assign='count'}
74 {foreach from=$SugarpdfSettings item=property key=name}
75 {if $property.class == "basic"}
77 {include file="modules/Configurator/tpls/SugarpdfSettingsFields.tpl"}
91 <table width="100%" border="0" cellspacing="0" cellpadding="0" class="edit view">
93 <th align="left" scope="row" colspan="4"><h4 >{$MOD.SUGARPDF_LOGO_SETTINGS}</h4></th>
97 <table width="100%" border="0" cellspacing="0" cellpadding="0">
98 {counter start=0 assign='count'}
99 {foreach from=$SugarpdfSettings item=property key=name}
100 {if $property.class == "logo"}
102 {include file="modules/Configurator/tpls/SugarpdfSettingsFields.tpl"}
115 <table width="100%" border="0" cellspacing="0" cellpadding="0" class="edit view">
117 <th align="left" scope="row" colspan="4"><h4 >{$MOD.SUGARPDF_ADVANCED_SETTINGS}</h4></th>
120 <td scope="row" scope="row">
121 <table width="100%" border="0" cellspacing="0" cellpadding="0">
122 {counter start=0 assign='count'}
123 {foreach from=$SugarpdfSettings item=property key=name}
124 {if $property.class == "advanced"}
126 {include file="modules/Configurator/tpls/SugarpdfSettingsFields.tpl"}
143 <div style="padding-top: 2px;">
144 <input title="{$APP.LBL_SAVE_BUTTON_TITLE}" class="button" type="submit" name="save" value=" {$APP.LBL_SAVE_BUTTON_LABEL} " />
145 <input title="{$MOD.LBL_RESTORE_BUTTON_LABEL}" class="button" type="submit" name="restore" value=" {$MOD.LBL_RESTORE_BUTTON_LABEL} " >
146 <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} " />
151 <script type='text/javascript'>
152 function checkFileType(id, submit) {
154 var fileName = document.getElementById(id).value;
155 if ({/literal}{$GD_WARNING}{literal}==1 && (fileName.lastIndexOf(".png") != -1||
156 fileName.lastIndexOf(".PNG") != -1)) {
158 //alert({/literal}SUGAR.language.get('Configurator', 'PDF_GD_WARNING'{literal}));
161 else if (submit == 1) {
162 for (fileField in fileFields) {
163 var fileName = document.getElementById(fileField).value;
164 if ({/literal}{$GD_WARNING}{literal}==1 && (fileName.lastIndexOf(".png") != -1||
165 fileName.lastIndexOf(".PNG") != -1)) {
166 //add_error_style('ConfigureSugarpdfSettings', fileField, SUGAR.language.get('Configurator', 'PDF_GD_WARNING'));
167 alert({/literal}SUGAR.language.get('Configurator', 'PDF_GD_WARNING'{literal}));
174 function verifyPercent(id){
175 var s = document.getElementById(id).value;
177 if(inRange(s, 0, 100)){
180 document.getElementById(id).value = "";
184 document.getElementById(id).value = "";
188 function verifyNumber(id){
189 var s = document.getElementById(id).value;
193 document.getElementById(id).value = "";
197 function processPDFClass(){
198 document.getElementById('settingsForTCPDF').style.display="";
199 // document.getElementById('fontManager').style.display="";
200 if(!check_form('ConfigureSugarpdfSettings')){
201 for (var i = 0; i <document.ConfigureSugarpdfSettings.sugarpdf_pdf_class.length; i++) {
202 if(document.ConfigureSugarpdfSettings.sugarpdf_pdf_class[i].value == "TCPDF"){
203 document.ConfigureSugarpdfSettings.sugarpdf_pdf_class[i].checked=true;
208 for (var i = 0; i <document.ConfigureSugarpdfSettings.sugarpdf_pdf_class.length; i++) {
209 if (document.ConfigureSugarpdfSettings.sugarpdf_pdf_class[i].checked) {
210 chosen = document.ConfigureSugarpdfSettings.sugarpdf_pdf_class[i].value;
213 if(chosen == "EZPDF"){
214 document.getElementById('settingsForTCPDF').style.display="none";
215 //document.getElementById('fontManager').style.display="none";