]> CyberLeo.Net >> Repos - Github/sugarcrm.git/blob - modules/ModuleBuilder/tpls/MBModule/field.tpl
Release 6.5.0
[Github/sugarcrm.git] / modules / ModuleBuilder / tpls / MBModule / field.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 <div id="overDiv" style="position:absolute; visibility:hidden; z-index:1000"></div>
39 {literal}
40 <script>
41 addForm('popup_form');
42 </script>
43 {/literal}
44
45 <form name='popup_form' id='popup_form_id' onsubmit='return false;'>
46 <input type='hidden' name='module' value='ModuleBuilder'>
47 <input type='hidden' name='action' value='{$action}'>
48 <input type='hidden' name='new_dropdown' value=''>
49 <input type='hidden' name='to_pdf' value='true'>
50 <input type='hidden' name='view_module' value='{$module->name}'>
51 {if isset($package->name)}
52     <input type='hidden' name='view_package' value='{$package->name}'>
53 {/if}
54 <input type='hidden' name='is_update' value='true'>
55         {if $hideLevel < 5}
56             &nbsp;
57             <input type='button' class='button' name='fsavebtn' value='{$mod_strings.LBL_BTN_SAVE}' 
58                         onclick='{literal}if(validate_type_selection() && check_form("popup_form")){ {/literal}{$preSave} {literal}ModuleBuilder.submitForm("popup_form_id"); }{/literal}'>
59             <input type='button' name='cancelbtn' value='{$mod_strings.LBL_BTN_CANCEL}' 
60                         onclick='ModuleBuilder.tabPanel.removeTab(ModuleBuilder.findTabById("east"));' class='button'>
61             {if !empty($vardef.name)}
62                 {if $hideLevel < 3}
63                 {literal}
64                     &nbsp;<input type='button' class='button' name='fdeletebtn' value='{/literal}{$mod_strings.LBL_BTN_DELETE}{literal}' onclick='if(confirm("{/literal}{$mod_strings.LBL_CONFIRM_FIELD_DELETE}{literal}")){document.popup_form.action.value="DeleteField";ModuleBuilder.submitForm("popup_form_id");}'>
65                 {/literal}
66                 {/if}
67                 {if !$no_duplicate}
68                 {literal}
69                 &nbsp;<input type='button' class='button' name='fclonebtn' value='{/literal}{$mod_strings.LBL_BTN_CLONE}{literal}' onclick='document.popup_form.action.value="CloneField";ModuleBuilder.submitForm("popup_form_id");'>
70                 {/literal}
71             {/if}
72             {/if}
73         
74         {else}
75             {literal}
76              <input type='button' class='button' name='lsavebtn' value='{/literal}{$mod_strings.LBL_BTN_SAVE}{literal}' onclick='if(check_form("popup_form")){this.form.action.value = "{/literal}{$action}{literal}";ModuleBuilder.submitForm("popup_form_id")};'>
77             {/literal}
78             {literal}
79                 &nbsp;<input type='button' class='button' name='fclonebtn' value='{/literal}{$mod_strings.LBL_BTN_CLONE}{literal}' onclick='document.popup_form.action.value="CloneField";ModuleBuilder.submitForm("popup_form_id");'>
80              {/literal}
81                  {literal}
82                 &nbsp;<input type='button' class='button' name='cancel' value='{/literal}{$mod_strings.LBL_BTN_CANCEL}{literal}' onclick='ModuleBuilder.tabPanel.get("activeTab").close()'>
83                 {/literal}
84                 
85 {/if}
86 <hr>
87
88 <table width="400px" >
89 <tr>
90     <td class="mbLBL" style="width:92px;">{sugar_translate module="DynamicFields" label="COLUMN_TITLE_DATA_TYPE"}:</td>
91     <td >{if empty($vardef.name) && $isClone == 0}
92                 {html_options name="type" id="type"  options=$field_types selected=$vardef.type onchange='ModuleBuilder.moduleLoadField("", this.options[this.selectedIndex].value);'}
93                 {sugar_help text=$mod_strings.LBL_POPHELP_FIELD_DATA_TYPE FIXX=250 FIXY=80}
94             {else}
95                 {$field_types[$vardef.type]}
96             {/if}
97             {if empty($field_types[$vardef.type]) && !empty($vardef.type)}({$vardef.type}){/if}
98             <input type='hidden' name='type' value={$vardef.type} />
99     </td>
100 </tr>
101 </table>
102 {$fieldLayout}
103 </form>
104
105 <script>
106 {literal}
107 function validate_type_selection(){
108     var typeSel = document.getElementById('type');
109     if(typeSel && typeSel.options){
110         if(typeSel.options[typeSel.selectedIndex].value == ''){
111             alert('{/literal}{sugar_translate module="DynamicFields" label="ERR_SELECT_FIELD_TYPE"}{literal}');
112             return false;
113         }
114     }
115     if (document.getElementById("customTypeValidate")){
116         return document.getElementById("customTypeValidate").onchange(); 
117     }
118     return true;
119 }
120 {/literal}
121 ModuleBuilder.helpSetup('fieldsEditor','{$help_group}');
122 </script>
123 {* <script>//Need this to work in FF4. Bug where last script isn't executed.</script> *}