]> CyberLeo.Net >> Repos - Github/sugarcrm.git/blob - modules/ModuleBuilder/tpls/MBModule/dropdown.tpl
Release 6.5.0
[Github/sugarcrm.git] / modules / ModuleBuilder / tpls / MBModule / dropdown.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>&nbsp;
39 <link rel="stylesheet" type="text/css" href="modules/ModuleBuilder/tpls/ListEditor.css"></link>
40 <link rel="stylesheet" type="text/css" href="modules/ModuleBuilder/tpls/MBModule/dropdown.css"></link> 
41 <form name='dropdown_form' onsubmit = "return false">
42 <input type='hidden' name='module' value='ModuleBuilder'>
43 <input type='hidden' name='action' value='{$action}'>
44 <input type='hidden' name='to_pdf' value='true'>
45 <input type='hidden' name='view_module' value='{$module_name}'>
46 <input type='hidden' name='view_package' value='{$package_name}'>
47 <input type='hidden' id='list_value' name='list_value' value=''>
48 {if ($refreshTree)}
49 <input type='hidden' name='refreshTree' value='1'>
50 {/if}
51 <table>
52         <tr>
53                 <td colspan='3'>
54                         <input id = "saveBtn" type='button' class='button' onclick='SimpleList.handleSave()' value='{$APP.LBL_SAVE_BUTTON_LABEL}'>
55                         <input type='button' class='button' onclick='SimpleList.undo()' value='{$MOD.LBL_BTN_UNDO}'>
56                         <input type='button' class='button' onclick='SimpleList.redo()' value='{$MOD.LBL_BTN_REDO}'>
57                         <input type='button' class='button' name='cancel' value='{$MOD.LBL_BTN_CANCEL}' onclick='ModuleBuilder.tabPanel.get("activeTab").close()'>
58                 </td>
59         </tr>
60         <tr>
61                 <td colspan='2'>
62                         <hr/>
63                 </td>
64         </tr>
65         <tr>
66                 <td>
67                         <span class='mbLBLL'>{$MOD.LBL_DROPDOWN_TITLE_NAME}:&nbsp;</span>
68                         {if $name }
69                         <input type='hidden' id='dropdown_name' name='dropdown_name' value='{$dropdown_name}'>{$dropdown_name}
70                         {else}
71                         <input type='text' id='dropdown_name' name='dropdown_name' value={$prepopulated_name}>
72                         {/if}
73                 </td>
74         </tr>
75         <tr>
76                 <td class='mbLBLL'>
77                         {$MOD.LBL_DROPDOWN_LANGUAGE}:&nbsp;
78                         {html_options name='dropdown_lang' options=$available_languages selected=$selected_lang onchange='this.form.action.value="dropdown";ModuleBuilder.handleSave("dropdown_form")'}
79                 </td>
80         </tr>
81         <tr>
82                 <td style='padding-top:10px;' class='mbLBLL'>{$MOD.LBL_DROPDOWN_ITEMS}:</td>
83         </tr>
84         <tr>
85                 <td><b>{$MOD.LBL_DROPDOWN_ITEM_NAME}</b><span class='fieldValue'>[{$MOD.LBL_DROPDOWN_ITEM_LABEL}]<span></td>
86         </tr>
87         <tr>
88                 <td colspan='3'>
89                     <ul id="ul1" class="listContainer">
90                     {foreach from=$options key='name' item='val'}
91                 {if (!isset($val) || $val =='')}{assign var='name' value=$MOD.LBL_BLANK}{/if}
92                         <li class="draggable" id="{$name}" >
93                               <table width='100%'>
94                                 <tr>
95                                    <td>
96                                        <b>{$name}</b>
97                                        <input id='value_{$name}' value='{$val}' type = 'hidden'>
98                                        <span class='fieldValue' id='span_{$name}'>
99                                            {if (!isset($val) || $val =='')}[{$MOD.LBL_BLANK}]{else}[{$val}]{/if}
100                                        </span>
101                                        <span class='fieldValue' id='span_edit_{$name}' style='display:none'>
102                                            <input type='text' id='input_{$name}' value="{$val}" onBlur='SimpleList.setDropDownValue("{$name}", this.value, true)' >
103                                        </span>
104                                    </td>
105                                    <td align='right'>
106                                        <a href='javascript:void(0)' onclick='SimpleList.editDropDownValue("{$name}", true)'>
107                                        {$editImage}</a>
108                                        &nbsp;
109                                        <a href='javascript:void(0)' onclick='SimpleList.deleteDropDownValue("{$name}", true)'>
110                                        {$deleteImage}</a>
111                                    </td>
112                                 </tr>
113                               </table>
114                             </li>
115                         {/foreach}
116                    </ul>
117                 </td>
118         </tr>
119         <tr>
120                 <td colspan='3'>
121                    <table width='100%'>
122                         <tr>
123                                 <td class='mbLBLL'>{$MOD.LBL_DROPDOWN_ITEM_NAME}:</td><td class='mbLBLL'>{$MOD.LBL_DROPDOWN_ITEM_LABEL}:</td>
124                         </tr>
125                         <tr>
126                                 <td><input type='text' id='drop_name' name='drop_name' maxlength='100'></td>
127                                 <td><input type='text' id='drop_value' name='drop_value'></td>
128                         </tr>
129                         <tr><td><input type='button' id='dropdownaddbtn' value='{$APP.LBL_ADD_BUTTON}' class='button'></td></tr>
130                     </table>
131                 </td>
132         </tr>
133         <tr>
134                 <td colspan='3'>
135                         <input type='button' class='button' value='{$MOD.LBL_BTN_SORT_ASCENDING}' onclick='SimpleList.sortAscending()'>
136                         <input type='button' class='button' value='{$MOD.LBL_BTN_SORT_DESCENDING}' onclick='SimpleList.sortDescending()'>
137                 </td>
138         </tr>
139   </table>
140   </form>
141   {literal}
142 <script>
143 addForm('dropdown_form');
144 addToValidate('dropdown_form', 'dropdown_name', 'DBName', false, SUGAR.language.get("ModuleBuilder", "LBL_JS_VALIDATE_NAME"));
145 addToValidate('dropdown_form', 'drop_value', 'varchar', false, SUGAR.language.get("ModuleBuilder", "LBL_JS_VALIDATE_LABEL"));
146 eval({/literal}{$ul_list}{literal});
147 SimpleList.ul_list = list;
148 SimpleList.init({/literal}'{$editImage}'{literal}, {/literal}'{$deleteImage}'{literal});
149 ModuleBuilder.helpSetup('dropdowns','editdropdown');
150
151 var addListenerFields = ['drop_name','drop_value' ]
152 YAHOO.util.Event.addListener(addListenerFields,"keydown", function(e){
153         if (e.keyCode == 13) {
154                 YAHOO.util.Event.stopEvent(e);
155         }
156 });
157
158 </script>
159 <script>// Bug in FF4 where it doesn't run the last script. Remove when the bug is fixed.</script>
160 {/literal}
161 </div>
162