2 /*********************************************************************************
3 * SugarCRM Community Edition is a customer relationship management program developed by
4 * SugarCRM, Inc. Copyright (C) 2004-2012 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 <form name='CreatePackage' id='CreatePackage'>
39 <input type='hidden' name='module' value='ModuleBuilder'>
40 <input type='hidden' name='action' value='SavePackage'>
41 <input type='hidden' name='duplicate' value='0'>
42 <input type='hidden' name='to_pdf' value='1'>
43 <input type='hidden' name='original_name' value='{$package->name}'>
45 <h2>{$package->title}</h2>
46 <table class='mbTable' >
47 <tr><td></td><td><input style="padding-bottom:0px;" type='button' name='savebtn' value='{$mod_strings.LBL_BTN_SAVE}' class='button' onclick="document.CreatePackage.action.value='SavePackage';ModuleBuilder.handleSave('CreatePackage');">
48 {if !empty($package->name)}
49 <input style="padding-bottom:0px;" type='button' name='duplicatebtn' value='{$mod_strings.LBL_BTN_DUPLICATE}' class='button' onclick="document.CreatePackage.action.value='SavePackage';document.CreatePackage.duplicate.value=1;ModuleBuilder.handleSave('CreatePackage');">
50 <input style="padding-bottom:0px;" type='button' name='deploybtn' value='{$mod_strings.LBL_BTN_DEPLOY}' class='button' onclick="ModuleBuilder.packageDeploy('CreatePackage', {$package_already_deployed});">
51 <input style="padding-bottom:0px;" type='button' name='publishbtn' value='{$mod_strings.LBL_BTN_PUBLISH}' class='button' onclick="ModuleBuilder.packagePublish('CreatePackage');">
52 <input style="padding-bottom:0px;" type='button' name='exportbtn' value='{$mod_strings.LBL_BTN_EXP}' class='button' onclick="ModuleBuilder.packageExport('CreatePackage');">
53 <input style="padding-bottom:0px;" type='button' name='deletebtn' value='{$mod_strings.LBL_BTN_DELETE}' class='button' onclick="ModuleBuilder.packageDelete('{$package->name}');">{/if}</td></tr>
55 <td height='100%'> </td><td> </td>
57 {if !empty($package->name)}
58 <tr><td class='mbLBL' ><b>{$mod_strings.LBL_LAST_MODIFIED}</b></td><td>{$package->date_modified}</td></tr>
61 <td class='mbLBL' ><font color="#ff0000"> * </font><b>{$mod_strings.LBL_PACKAGE_NAME}</b></td><td>
62 <input type='text' name='name' size='36' maxlength='36' value='{$package->name}'>
66 <td class='mbLBL' ><b>{$mod_strings.LBL_AUTHOR}</b></td><td><input type='text' name='author' size='36' maxlength='36' value='{$package->author}'></td>
71 <td class='mbLBL' ><font color="#ff0000"> * </font><b>{$mod_strings.LBL_KEY}</b></td>
73 {if empty($package->key)}
74 <input type='text' name='key' size='5' maxlength='5' value='{$package->key}'>
76 {$package->key}<input type='hidden' name='key' size='5' maxlength='5' value='{$package->key}'>
82 <td class='mbLBL' ><b>{$mod_strings.LBL_DESCRIPTION}</b></td><td><textarea name='description' cols='60' rows='5'>{$package->description}</textarea></td>
86 <td></td><td id='readme'>{sugar_getimage name="advanced_search" ext=".gif" alt=$mod_strings.LBL_HIDEOPTIONS other_attributes='border="0" id="options" '}<a style="text-decoration:none" href="javascript: void(0)" onclick ="toggleEl('readmefield');"><b>{$mod_strings.LBL_ADD_README}</b></a></td>
89 <td height='100%'> </td><td> </td>
91 <tr id='readmefield' style="display:none;">
93 <td ><textarea name='readme' cols='60' rows='10'>{$package->readme}</textarea></td>
96 {if !empty($package->name)}
99 <td class='mbLBL'><b>{$mod_strings.LBL_MODULES}</b></td>
102 <tr id="package_modules">
103 {counter name='items' assign='items' start=1}
105 <table id="new_module" onclick="ModuleBuilder.addModule('{$package->name}')" class='wizardButton' onmousedown="ModuleBuilder.buttonDown(this);return false;" onmouseout="ModuleBuilder.buttonOut(this);">
107 <td align='center'>{sugar_image name="NewModule" width=48 height=48}</td>
110 <a class='studiolink' href="javascript:void(0)" onclick="ModuleBuilder.addModule('{$package->name}')">
111 {$mod_strings.LBL_NEW_MODULE}</a>
117 {foreach from=$package->moduleTypes key='name' item='type'}
118 {assign var='imgurl' value=$type|cat:'_32'}
119 {if $items % 4 == 0 && $items != 0}
123 <table id= "existing_module" onclick="ModuleBuilder.viewModule('{$package->name}', '{$name}')" class='wizardButton' onmousedown="ModuleBuilder.buttonDown(this);return false;" onmouseout="ModuleBuilder.buttonOut(this);">
125 <td align='center'>{sugar_image name=$type width=48 height=48}</td>
126 </tr><tr><td align='center'>
127 <a class='studiolink' href="javascript:void(0)" onclick="ModuleBuilder.viewModule('{$package->name}', '{$name}')">
131 {counter name='items'}
142 <td height='100%'> </td><td> </td>
148 addForm('CreatePackage');
149 addToValidate('CreatePackage', 'name', 'DBName', true, '{/literal}{$mod_strings.LBL_JS_VALIDATE_NAME}{literal}');
150 addToValidateIsInArray('CreatePackage', 'name', 'in_array', false, '{/literal}{$mod_strings.LBL_JS_VALIDATE_PACKAGE_NAME}','{$package_labels}'{literal}, 'u==');
151 addToValidate('CreatePackage', 'key', 'DBNameRaw', true, '{/literal}{$mod_strings.LBL_JS_VALIDATE_KEY}{literal}');
153 ModuleBuilder.helpRegister('CreatePackage');
154 ModuleBuilder.helpRegisterByID('CreatePackage','td');
155 if(document.getElementById('package_modules'))
156 ModuleBuilder.helpRegisterByID('package_modules', 'table');
157 ModuleBuilder.helpSetup({/literal}'{$package->help.group}','{$package->help.default}'{literal});
159 var display = document.getElementById('readmefield').style.display;
160 if(display=='table-row' || display=='inline-block'){
161 document.getElementById('options').src = "{/literal}{sugar_getimagepath file='advanced_search.gif'}{literal}";
162 document.getElementById('readmefield').style.display ='none';
163 }else if (display=='none'){
164 document.getElementById('options').src = "{/literal}{sugar_getimagepath file='basic_search.gif'}{literal}";
165 document.getElementById('readmefield').style.display = (navigator.appName=="Microsoft Internet Explorer")? 'inline-block' : 'table-row';
170 {include file='modules/ModuleBuilder/tpls/assistantJavascript.tpl'}