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 ********************************************************************************/
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=''>
49 <input type='hidden' name='refreshTree' value='1'>
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()'>
67 <span class='mbLBLL'>{$MOD.LBL_DROPDOWN_TITLE_NAME}: </span>
69 <input type='hidden' id='dropdown_name' name='dropdown_name' value='{$dropdown_name}'>{$dropdown_name}
71 <input type='text' id='dropdown_name' name='dropdown_name' value={$prepopulated_name}>
77 {$MOD.LBL_DROPDOWN_LANGUAGE}:
78 {html_options name='dropdown_lang' options=$available_languages selected=$selected_lang onchange='this.form.action.value="dropdown";ModuleBuilder.handleSave("dropdown_form")'}
82 <td style='padding-top:10px;' class='mbLBLL'>{$MOD.LBL_DROPDOWN_ITEMS}:</td>
85 <td><b>{$MOD.LBL_DROPDOWN_ITEM_NAME}</b><span class='fieldValue'>[{$MOD.LBL_DROPDOWN_ITEM_LABEL}]<span></td>
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}" >
97 <input id='value_{$name}' value='{$name}' type = 'hidden'>
98 <span class='fieldValue' id='span_{$name}'>
99 {if (!isset($val) || $val =='')}[{$MOD.LBL_BLANK}]{else}[{$val}]{/if}
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)' >
106 <a href='javascript:void(0)' onclick='SimpleList.editDropDownValue("{$name}", true)'>
109 <a href='javascript:void(0)' onclick='SimpleList.deleteDropDownValue("{$name}", true)'>
123 <td class='mbLBLL'>{$MOD.LBL_DROPDOWN_ITEM_NAME}:</td><td class='mbLBLL'>{$MOD.LBL_DROPDOWN_ITEM_LABEL}:</td>
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>
129 <tr><td><input type='button' id='dropdownaddbtn' value='{$APP.LBL_ADD_BUTTON}' class='button'></td></tr>
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()'>
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');
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);
159 <script>// Bug in FF4 where it doesn't run the last script. Remove when the bug is fixed.</script>