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