PageRenderTime 45ms CodeModel.GetById 18ms RepoModel.GetById 0ms app.codeStats 0ms

/modules/Configurator/tpls/SugarpdfSettings.tpl

https://github.com/jacknicole/sugarcrm_dev
Smarty Template | 221 lines | 175 code | 6 blank | 40 comment | 28 complexity | d283c244e66075367faef6cbc01f3459 MD5 | raw file
  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. <script type='text/javascript' src='include/javascript/overlibmws.js'></script>
  38. <script type='text/javascript'>var fileFields = new Array();</script>
  39. <BR>
  40. <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;">
  41. <span class='error'>{$error}</span>
  42. <table width="100%" cellpadding="0" cellspacing="0" border="0">
  43. <tr>
  44. <td style="padding-bottom: 2px;">
  45. <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} " >
  46. &nbsp;<input title="{$MOD.LBL_RESTORE_BUTTON_LABEL}" class="button" type="submit" name="restore" value=" {$MOD.LBL_RESTORE_BUTTON_LABEL} " >
  47. &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} " >
  48. </td>
  49. </tr>
  50. </table>
  51. <table width="100%" border="0" cellspacing="0" cellpadding="0">
  52. <tr>
  53. <td>
  54. <table width="100%" border="0" cellspacing="0" cellpadding="0" class="edit view" {if $pdf_enable_ezpdf=="0"}style="display:none"{/if}>
  55. <tr>
  56. <td scope="row" style="text-align: center;">{html_radios name="sugarpdf_pdf_class" options=$pdf_class selected=$selected_pdf_class separator=' ' onchange='processPDFClass()'}</td>
  57. </tr>
  58. </table>
  59. <table width="100%" border="0" cellspacing="0" cellpadding="0" class="edit view" id="settingsForTCPDF">
  60. <tr>
  61. <th align="left" scope="row" colspan="4"><h4 >{$MOD.SUGARPDF_BASIC_SETTINGS}</h4></th>
  62. </tr>
  63. <tr>
  64. <td scope="row">
  65. <table width="100%" border="0" cellspacing="0" cellpadding="0">
  66. {counter start=0 assign='count'}
  67. {foreach from=$SugarpdfSettings item=property key=name}
  68. {if $property.class == "basic"}
  69. {counter}
  70. {include file="modules/Configurator/tpls/SugarpdfSettingsFields.tpl"}
  71. {/if}
  72. {/foreach}
  73. {if $count is odd}
  74. <td ></td>
  75. <td ></td>
  76. </tr>
  77. {/if}
  78. </table>
  79. </td>
  80. </tr>
  81. </table>
  82. <table width="100%" border="0" cellspacing="0" cellpadding="0" class="edit view">
  83. <tr>
  84. <th align="left" scope="row" colspan="4"><h4 >{$MOD.SUGARPDF_LOGO_SETTINGS}</h4></th>
  85. </tr>
  86. <tr>
  87. <td scope="row">
  88. <table width="100%" border="0" cellspacing="0" cellpadding="0">
  89. {counter start=0 assign='count'}
  90. {foreach from=$SugarpdfSettings item=property key=name}
  91. {if $property.class == "logo"}
  92. {counter}
  93. {include file="modules/Configurator/tpls/SugarpdfSettingsFields.tpl"}
  94. {/if}
  95. {/foreach}
  96. {if $count is odd}
  97. <td ></td>
  98. <td ></td>
  99. </tr>
  100. {/if}
  101. </table>
  102. </td>
  103. </tr>
  104. </table>
  105. <!--
  106. <table width="100%" border="0" cellspacing="0" cellpadding="0" class="edit view">
  107. <tr>
  108. <th align="left" scope="row" colspan="4"><h4 >{$MOD.SUGARPDF_ADVANCED_SETTINGS}</h4></th>
  109. </tr>
  110. <tr>
  111. <td scope="row" scope="row">
  112. <table width="100%" border="0" cellspacing="0" cellpadding="0">
  113. {counter start=0 assign='count'}
  114. {foreach from=$SugarpdfSettings item=property key=name}
  115. {if $property.class == "advanced"}
  116. {counter}
  117. {include file="modules/Configurator/tpls/SugarpdfSettingsFields.tpl"}
  118. {/if}
  119. {/foreach}
  120. {if $count is odd}
  121. <td ></td>
  122. <td ></td>
  123. </tr>
  124. {/if}
  125. </table>
  126. </td>
  127. </tr>
  128. </table>
  129. -->
  130. </td>
  131. </tr>
  132. </table>
  133. <div style="padding-top: 2px;">
  134. <input title="{$APP.LBL_SAVE_BUTTON_TITLE}" class="button" type="submit" name="save" value=" {$APP.LBL_SAVE_BUTTON_LABEL} " />
  135. &nbsp;<input title="{$MOD.LBL_RESTORE_BUTTON_LABEL}" class="button" type="submit" name="restore" value=" {$MOD.LBL_RESTORE_BUTTON_LABEL} " >
  136. &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} " />
  137. </div>
  138. {$JAVASCRIPT}
  139. </form>
  140. {literal}
  141. <script type='text/javascript'>
  142. function checkFileType(id, submit) {
  143. if (submit == 0) {
  144. var fileName = document.getElementById(id).value;
  145. if ({/literal}{$GD_WARNING}{literal}==1 && (fileName.lastIndexOf(".png") != -1||
  146. fileName.lastIndexOf(".PNG") != -1)) {
  147. fileFields[id]=id;
  148. //alert({/literal}SUGAR.language.get('Configurator', 'PDF_GD_WARNING'{literal}));
  149. }
  150. }
  151. else if (submit == 1) {
  152. for (fileField in fileFields) {
  153. var fileName = document.getElementById(fileField).value;
  154. if ({/literal}{$GD_WARNING}{literal}==1 && (fileName.lastIndexOf(".png") != -1||
  155. fileName.lastIndexOf(".PNG") != -1)) {
  156. //add_error_style('ConfigureSugarpdfSettings', fileField, SUGAR.language.get('Configurator', 'PDF_GD_WARNING'));
  157. alert({/literal}SUGAR.language.get('Configurator', 'PDF_GD_WARNING'{literal}));
  158. return false;
  159. }
  160. }
  161. }
  162. return true;
  163. }
  164. function verifyPercent(id){
  165. var s = document.getElementById(id).value;
  166. if(isInteger(s)){
  167. if(inRange(s, 0, 100)){
  168. return true;
  169. }else{
  170. document.getElementById(id).value = "";
  171. return false;
  172. }
  173. }else{
  174. document.getElementById(id).value = "";
  175. return false;
  176. }
  177. }
  178. function verifyNumber(id){
  179. var s = document.getElementById(id).value;
  180. if(isNumeric(s)){
  181. return true;
  182. }else{
  183. document.getElementById(id).value = "";
  184. return false;
  185. }
  186. }
  187. function processPDFClass(){
  188. document.getElementById('settingsForTCPDF').style.display="";
  189. // document.getElementById('fontManager').style.display="";
  190. if(!check_form('ConfigureSugarpdfSettings')){
  191. for (var i = 0; i <document.ConfigureSugarpdfSettings.sugarpdf_pdf_class.length; i++) {
  192. if(document.ConfigureSugarpdfSettings.sugarpdf_pdf_class[i].value == "TCPDF"){
  193. document.ConfigureSugarpdfSettings.sugarpdf_pdf_class[i].checked=true;
  194. }
  195. }
  196. }else{
  197. var chosen = "";
  198. for (var i = 0; i <document.ConfigureSugarpdfSettings.sugarpdf_pdf_class.length; i++) {
  199. if (document.ConfigureSugarpdfSettings.sugarpdf_pdf_class[i].checked) {
  200. chosen = document.ConfigureSugarpdfSettings.sugarpdf_pdf_class[i].value;
  201. }
  202. }
  203. if(chosen == "EZPDF"){
  204. document.getElementById('settingsForTCPDF').style.display="none";
  205. //document.getElementById('fontManager').style.display="none";
  206. }
  207. }
  208. }
  209. processPDFClass();
  210. </script>
  211. {/literal}