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 ********************************************************************************/
38 <link rel="stylesheet" type="text/css" href="modules/ModuleBuilder/tpls/MB.css" />
39 <form name='CreateModule'>
40 <input type='hidden' name='module' value='ModuleBuilder'>
41 <input type='hidden' name='action' value='SaveModule'>
42 <input type='hidden' name='package' value='{$package->name}'>
43 <input type='hidden' name='original_name' value='{$module->name}'>
44 <input type='hidden' name='duplicate' value='0'>
45 <input type='hidden' name='to_pdf' value='1'>
46 <table class='mbTable' >
47 <tr><td></td><td colspan=4><input type='button' name='savebtn' value='{$mod_strings.LBL_BTN_SAVE}' class='button' onclick="ModuleBuilder.handleSave('CreateModule');">
48 {if !empty($module->name)}
49 <input type='button' name='duplicatebtn' value='{$mod_strings.LBL_BTN_DUPLICATE}' class='button' onclick="document.CreateModule.duplicate.value=1;ModuleBuilder.handleSave('CreateModule');">
50 <input type='button' name='viewfieldsbtn' value='{$mod_strings.LBL_BTN_VIEW_FIELDS}' class='button' onclick="ModuleBuilder.handleSave('CreateModule', ModuleBuilder.moduleViewFields);">
51 <input type='button' name='viewrelsbtn' value='{$mod_strings.LBL_BTN_VIEW_RELATIONSHIPS}' class='button' onclick="ModuleBuilder.handleSave('CreateModule', ModuleBuilder.moduleViewRelationships);">
52 <input type='button' name='viewlayoutsbtn' value='{$mod_strings.LBL_BTN_VIEW_LAYOUTS}' class='button' onclick="ModuleBuilder.handleSave('CreateModule', ModuleBuilder.moduleViewLayouts);">
53 <input type='button' name='deletebtn' value='{$mod_strings.LBL_BTN_DELETE}' class='button' onclick="ModuleBuilder.moduleDelete('{$package->name}', '{$module->name}');">{/if}</td></tr>
55 <td height='100%'> </td><td> </td>
58 <tr><td class='mbLBL'><b>{$mod_strings.LBL_PACKAGE}</b></td><td colspan='5'>{$package->name}</td></tr>
59 <tr><td class='mbLBL'><font color="#ff0000"> * </font><b>{$mod_strings.LBL_MODULE_NAME}</b></td><td colspan='5'><input type='text' name='name' value='{$module->name}' size='36' maxlength='36'></td></tr>
60 <tr><td class='mbLBL'><font color="#ff0000"> * </font><b>{$mod_strings.LBL_LABEL}</b></td><td colspan='5'><input type='text' name='label' value='{$module->config.label}' size='36' maxlength='36'></td></tr>
63 <td class='mbLBL' width='5%' nowrap>{sugar_translate label='LBL_MB_IMPORTABLE' module='ModuleBuilder'}:</td>
64 <td> <input type='checkbox' name='importable' value=1 {if !empty($module->config.importable)}checked{/if}></td>
66 {counter name='items' assign='items' start=0}
67 {foreach from=$module->implementable key='name' item='label'}
69 <td class='mbLBL' width='5%' nowrap>{$label}:</td>
70 <td > <input type='checkbox' name='{$name}' value=1 {if !empty($module->config[$name])}checked{/if}></td>
71 {counter name='items'}
75 <td class='mbLBL'><font color="#ff0000"> * </font><b>{$mod_strings.LBL_TYPE}</b></td>
76 {counter name='items' assign='items' start=0}
79 <tr{if empty($module->name)} id="factory_modules"{/if}>
80 {if empty($module->name)}<input type='hidden' name='type'>{/if}
81 {foreach from=$types key='type' item='name'}
82 {assign var='imgurl' value=$type|cat:'_32'}
83 {if empty($module->name) || $type != 'basic' || count($module->mbvardefs->templates) == 1}
84 {if $items % 6 == 0 && $items != 0}
89 {if empty($module->name)}
91 <table id='type_{$type}' onclick='ModuleBuilder.buttonDown(this,"{$type}", "type"); ModuleBuilder.buttonToForm("CreateModule", "type", "type");' class='wizardButton' onmousedown='return false;' onmouseout='ModuleBuilder.buttonOut(this,"{$type}", "type");'>
93 <td align='center'>{sugar_image name=$type width=48 height=48}</td>
96 <a class='studiolink' href="javascript:void(0)" onclick='ModuleBuilder.buttonDown(this,"{$type}", "type"); ModuleBuilder.buttonToForm("CreateModule", "type", "type");'>{$name}</a>
97 <script>ModuleBuilder.buttonAdd('type_{$type}', '{$type}', 'type');</script>
100 <td align='center'>{sugar_image name=$type width=48 height=48}<br>
105 {counter name='items'}
112 <td height='100%'> </td><td> </td>
117 addForm('CreateModule');
118 addToValidate('CreateModule', 'name', 'DBName', true, '{/literal}{$mod_strings.LBL_JS_VALIDATE_NAME}{literal}');
119 addToValidate('CreateModule', 'label', 'varchar', true, '{/literal}{$mod_strings.LBL_JS_VALIDATE_LABEL}{literal}');
120 addToValidate('CreateModule', 'type', 'varchar', true, '{/literal}{$mod_strings.LBL_JS_VALIDATE_TYPE}{literal}');
121 ModuleBuilder.helpRegister('CreateModule');
122 if(document.getElementById('factory_modules'))
123 ModuleBuilder.helpRegisterByID('factory_modules', 'table');
124 ModuleBuilder.helpSetup({/literal}'{$module->help.group}','{$module->help.default}'{literal});
125 ModuleBuilder.MBpackage = '{/literal}{$module->package}{literal}';
126 ModuleBuilder.module = '{/literal}{$module->name}{literal}';
129 {include file='modules/ModuleBuilder/tpls/assistantJavascript.tpl'}