]> CyberLeo.Net >> Repos - Github/sugarcrm.git/blob - modules/Configurator/tpls/SugarpdfSettings.tpl
Release 6.4.0
[Github/sugarcrm.git] / modules / Configurator / tpls / SugarpdfSettings.tpl
1 {*
2 /*********************************************************************************
3  * SugarCRM Community Edition is a customer relationship management program developed by
4  * SugarCRM, Inc. Copyright (C) 2004-2011 SugarCRM Inc.
5  * 
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.
12  * 
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
16  * details.
17  * 
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
21  * 02110-1301 USA.
22  * 
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.
25  * 
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.
29  * 
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  ********************************************************************************/
36
37
38
39
40 *}
41
42 <script type='text/javascript' src="{sugar_getjspath file='include/javascript/overlibmws.js'}"></script>
43 <script type='text/javascript'>var fileFields = new Array();</script>
44 <BR>
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">
48     <tr>
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             &nbsp;<input title="{$MOD.LBL_RESTORE_BUTTON_LABEL}" class="button"  type="submit"  name="restore" value="  {$MOD.LBL_RESTORE_BUTTON_LABEL}  " >
52             &nbsp;<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}  " >
53         </td>
54     </tr>
55 </table>
56 <table width="100%" border="0" cellspacing="0" cellpadding="0">
57     <tr>
58     <td>
59
60     <table width="100%" border="0" cellspacing="0" cellpadding="0"  class="edit view" {if $pdf_enable_ezpdf=="0"}style="display:none"{/if}>
61         <tr>
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>
63         </tr>
64     </table>
65
66     <table width="100%" border="0" cellspacing="0" cellpadding="0" class="edit view" id="settingsForTCPDF">
67         <tr>
68             <th align="left" scope="row" colspan="4"><h4 >{$MOD.SUGARPDF_BASIC_SETTINGS}</h4></th>
69         </tr>
70         <tr>
71             <td scope="row">
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"}
76                         {counter}
77                         {include file="modules/Configurator/tpls/SugarpdfSettingsFields.tpl"}
78                     {/if}
79                 {/foreach}
80                 {if $count is odd}
81                         <td  ></td>
82                         <td  ></td>
83                     </tr>
84                 {/if}
85             </table>
86             </td>
87         </tr>
88     </table>
89
90
91     <table width="100%" border="0" cellspacing="0" cellpadding="0" class="edit view">
92         <tr>
93             <th align="left" scope="row" colspan="4"><h4 >{$MOD.SUGARPDF_LOGO_SETTINGS}</h4></th>
94         </tr>
95         <tr>
96             <td scope="row">
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"}
101                         {counter}
102                         {include file="modules/Configurator/tpls/SugarpdfSettingsFields.tpl"}
103                     {/if}
104                 {/foreach}
105                 {if $count is odd}
106                         <td  ></td>
107                         <td  ></td>
108                     </tr>
109                 {/if}
110             </table>
111             </td>
112         </tr>
113     </table>
114 <!--
115     <table width="100%" border="0" cellspacing="0" cellpadding="0" class="edit view">
116         <tr>
117             <th align="left" scope="row" colspan="4"><h4 >{$MOD.SUGARPDF_ADVANCED_SETTINGS}</h4></th>
118         </tr>
119         <tr>
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"}
125                         {counter}
126                         {include file="modules/Configurator/tpls/SugarpdfSettingsFields.tpl"}
127                     {/if}
128                 {/foreach}
129                 {if $count is odd}
130                         <td  ></td>
131                         <td  ></td>
132                     </tr>
133                 {/if}
134             </table>
135             </td>
136         </tr>
137     </table>
138 -->
139     </td>
140     </tr>
141 </table>
142
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 &nbsp;<input title="{$MOD.LBL_RESTORE_BUTTON_LABEL}" class="button"  type="submit"  name="restore" value="  {$MOD.LBL_RESTORE_BUTTON_LABEL}  " >
146 &nbsp;<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}  " />
147 </div>
148 {$JAVASCRIPT}
149 </form>
150 {literal}
151 <script type='text/javascript'>
152 function checkFileType(id, submit) {
153         if (submit == 0) {
154                 var fileName = document.getElementById(id).value;
155                 if ({/literal}{$GD_WARNING}{literal}==1 && (fileName.lastIndexOf(".png") != -1||
156                         fileName.lastIndexOf(".PNG") != -1)) {
157                         fileFields[id]=id;
158                         //alert({/literal}SUGAR.language.get('Configurator', 'PDF_GD_WARNING'{literal}));
159                 }
160         }
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}));
168                                 return false;
169                         }
170                 }
171         }
172         return true;
173  }
174  function verifyPercent(id){
175      var s = document.getElementById(id).value;
176      if(isInteger(s)){
177          if(inRange(s, 0, 100)){
178              return true;
179          }else{
180              document.getElementById(id).value = "";
181              return false;
182          }
183      }else{
184          document.getElementById(id).value = "";
185          return false;
186      }
187  }
188  function verifyNumber(id){
189      var s = document.getElementById(id).value;
190      if(isNumeric(s)){
191          return true;
192      }else{
193          document.getElementById(id).value = "";
194          return false;
195      }
196  }
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;
204              }
205          }
206      }else{
207          var chosen = "";
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;
211              }
212          }
213          if(chosen == "EZPDF"){
214              document.getElementById('settingsForTCPDF').style.display="none";
215              //document.getElementById('fontManager').style.display="none";
216          }
217      }
218  }
219  processPDFClass();
220 </script>
221 {/literal}