2 /*********************************************************************************
3 * SugarCRM 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='include/javascript/overlibmws.js'></script>
46 <form name="addFontView" enctype='multipart/form-data' method="POST" action="index.php?action=addFont&module=Configurator" onSubmit="return (check_form('addFontView'));">
47 <span class='error'>{$error}</span>
49 <table width="100%" cellpadding="0" cellspacing="0" border="0">
51 <td style="padding-bottom: 2px;">
52 <input title="{$MOD.LBL_ADD_FONT_BUTTON}" accessKey="{$APP.LBL_SAVE_BUTTON_KEY}" class="button" type="submit" name="save" value=" {$MOD.LBL_ADD_FONT_BUTTON} " >
53 <input title="{$MOD.LBL_CANCEL_BUTTON_TITLE}" onclick="document.location.href='index.php?module=Configurator&action=FontManager'" class="button" type="button" name="cancel" value=" {$APP.LBL_CANCEL_BUTTON_LABEL} " >
58 <table width="100%" border="0" cellspacing="0" cellpadding="0" class="edit view">
60 <td scope="row">{$MOD.LBL_PDF_METRIC_FILE}: <span class="required">*</span>{sugar_help text=$MOD.LBL_PDF_METRIC_FILE_INFO} </td>
62 <input type='file' size='30' name='pdf_metric_file' id='pdf_metric_file'>
68 <td scope="row">{$MOD.LBL_PDF_FONT_FILE}: <span class="required">*</span>{sugar_help text=$MOD.LBL_PDF_FONT_FILE_INFO} </td>
70 <input type='file' size='30' name='pdf_font_file' id='pdf_font_file'>
76 <td scope="row">{$MOD.LBL_FONT_LIST_EMBEDDED}: <span class="required">*</span>{sugar_help text=$MOD.LBL_FONT_LIST_EMBEDDED_INFO} </td>
78 <input type="hidden" name='pdf_embedded' value='false'>
79 <input type='checkbox' name='pdf_embedded' value='true' id='pdf_embedded' onchange="showCidInfo()" CHECKED>
84 <tr id="cidInfo" style="display:none">
85 <td scope="row">{$MOD.LBL_FONT_LIST_CIDINFO}: <span class="required">*</span>{sugar_help text=$MOD.LBL_FONT_LIST_CIDINFO_INFO} </td>
87 <textarea name='pdf_cidinfo' rows="4" cols="80" id="pdf_cidinfo"></textarea>
93 <td scope="row">{$MOD.LBL_PDF_ENCODING_TABLE}: <span class="required">*</span>{sugar_help text=$MOD.LBL_PDF_ENCODING_TABLE_INFO} </td>
95 {html_options name="pdf_encoding_table" options=$ENCODING_TABLE}
101 <td scope="row">{$MOD.LBL_PDF_PATCH}:{sugar_help text=$MOD.LBL_PDF_PATCH_INFO} </td>
103 <textarea size='60' name='pdf_patch' id='pdf_patch' rows="4" cols="80"></textarea>
105 <td scope="row"></td>
109 <td scope="row">{$MOD.LBL_FONT_LIST_STYLE}: <span class="required">*</span>{sugar_help text=$MOD.LBL_FONT_LIST_STYLE_INFO} </td>
111 {html_options name="pdf_style_list" options=$STYLE_LIST}
113 <td scope="row"></td>
118 <div style="padding-top: 2px;">
119 <input title="{$MOD.LBL_ADD_FONT_BUTTON}" accessKey="{$APP.LBL_SAVE_BUTTON_KEY}" class="button" type="submit" name="save" value=" {$MOD.LBL_ADD_FONT_BUTTON} " >
120 <input title="{$MOD.LBL_CANCEL_BUTTON_TITLE}" onclick="document.location.href='index.php?module=Configurator&action=FontManager'" class="button" type="button" name="cancel" value=" {$APP.LBL_CANCEL_BUTTON_LABEL} " />
124 <script type='text/javascript'>
125 function checkFileExtension(metric){
127 var element = document.getElementById("pdf_metric_file");
129 var element = document.getElementById("pdf_font_file");
131 if(element.value != ""){
133 var filename = element.value;
134 var dot = filename.lastIndexOf(".");
136 var extension = filename.substr(dot,filename.length);
138 if(extension==".ttf" || extension==".otf" || extension==".pfb") error=false;
140 if(extension==".afm" || extension==".ufm") error=false;
146 alert("{$MOD.JS_ALERT_PDF_WRONG_EXTENSION}");
151 function showCidInfo(){
152 if(document.getElementById("pdf_embedded").checked == false){
153 document.getElementById("cidInfo").style.display = "";
154 addToValidate('addFontView', 'pdf_cidinfo', 'varchar', 1,'{/literal}{$MOD.LBL_FONT_LIST_CIDINFO}{literal}' );
156 document.getElementById("cidInfo").style.display = "none";
157 removeFromValidate('addFontView', 'pdf_cidinfo');
160 document.getElementById('pdf_metric_file').onchange=function(){checkFileExtension(true);};
161 document.getElementById('pdf_font_file').onchange=function(){checkFileExtension(false);};
163 addToValidate('addFontView', 'pdf_metric_file', 'varchar', 1,'{$MOD.LBL_PDF_METRIC_FILE}' );
164 addToValidate('addFontView', 'pdf_font_file', 'varchar', 1,'{$MOD.LBL_PDF_FONT_FILE}' );