]> CyberLeo.Net >> Repos - Github/sugarcrm.git/blob - modules/Connectors/tpls/modify_properties.tpl
Release 6.4.0
[Github/sugarcrm.git] / modules / Connectors / tpls / modify_properties.tpl
1 {*
2 /*********************************************************************************
3  * SugarCRM Community Edition is a customer relationship management program developed by
4  * SugarCRM, Inc. Copyright (C) 2004-2011 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
39 <script type="text/javascript" src="{sugar_getjspath file='cache/include/javascript/sugar_grp_yui_widgets.js'}"></script>
40 <script type="text/javascript" src="{sugar_getjspath file='modules/Connectors/Connector.js'}"></script>
41 <link rel="stylesheet" type="text/css" href="{sugar_getjspath file='modules/Connectors/tpls/tabs.css'}"/>
42
43 {literal}
44
45 <script language="javascript">
46         var _tabView;
47         var _timer;
48         var _sourceArray = new Array();
49 var SourceTabs = {
50
51     init : function() {
52          _tabView = new YAHOO.widget.TabView();
53
54         {/literal}
55                  {counter assign=source_count start=0 print=0}
56                 {foreach name=connectors from=$SOURCES key=name item=source}
57                     {counter assign=source_count}
58                 {literal}
59                         tab = new YAHOO.widget.Tab({
60                                 label: '{/literal}{$source.name}{literal} ',
61                                 dataSrc: {/literal}'index.php?module=Connectors&action=SourceProperties&source_id={$source.id}&to_pdf=true'{literal},
62                                 cacheData: true,
63                                 {/literal}
64                                 {if $source_count == 1}
65                                 active: true
66                                 {else}
67                                 active: false
68                                 {/if}
69                                 {literal}
70                             });
71                             {/literal}
72                             _tabView.addTab(tab);                           
73                             tab.id = '{$source.id}';                
74                             //tab.addListener('beforeContentChange', SourceTabs.tabClicked);
75                             tab.addListener('click', SourceTabs.afterContentChange);
76                             _sourceArray[{$source_count}-1] = '{$source.id}';
77                {/foreach}
78                   {literal}
79                 _tabView.appendTo('container');
80     },
81
82     afterContentChange: function(info) { 
83
84                 if(typeof validate != 'undefined') {
85                    validate = new Array();
86                    validate["ModifyProperties"] = new Array();
87                 }    
88     
89         tab = _tabView.get('activeTab');
90         if(typeof tab.get('content') != 'undefined') {
91                 SUGAR.util.evalScript(tab.get('content'));  
92                 clearTimeout(_timer);
93         } else {
94             _timer = setTimeout(SourceTabs.afterContentChange, 1000);
95         }
96     },
97
98     fitContainer: function() {
99                 content_div = _tabView.getElementsByClassName('yui-content', 'div')[0];
100                 content_div.style.overflow='auto';
101                 content_div.style.height='405px';
102     }
103 }
104 YAHOO.util.Event.onDOMReady(SourceTabs.init);
105 </script>
106 {/literal}
107 <form name="ModifyProperties" method="POST">
108 <input type="hidden" name="modify" value="true">
109 <input type="hidden" name="module" value="Connectors">
110 <input type="hidden" name="action" value="SaveModifyProperties">
111 <input type="hidden" name="source_id" value="">
112 <input type="hidden" name="reset_to_default" value="">
113
114 {counter assign=source_count start=0 print=0}
115 {foreach name=connectors from=$SOURCES key=name item=source}
116 {counter assign=source_count}
117 <input type="hidden" name="source{$source_count}" value="{$source.id}">
118 {/foreach}
119
120 <table border="0" class="actionsContainer">
121 <tr><td>
122 <input id="connectors_top_save" title="{$APP.LBL_SAVE_BUTTON_LABEL}" accessKey="{$APP.LBL_SAVE_BUTTON_TITLE}" class="button" type="submit" value="{$APP.LBL_SAVE_BUTTON_LABEL}" onclick="return check_form('ModifyProperties') || confirm('{$mod.LBL_CONFIRM_CONTINUE_SAVE}');">
123 <input id="connectors_top_cancel" title="{$APP.LBL_CANCEL_BUTTON_LABEL}" accessKey="{$APP.LBL_CANCEL_BUTTON_KEY}" class="button" onclick="document.ModifyProperties.action.value='ConnectorSettings'; document.ModifyProperties.module.value='Connectors';" type="submit" value="{$APP.LBL_CANCEL_BUTTON_LABEL}">
124 </td></tr>
125 </table>
126
127
128 <table cellspacing="0" cellpadding="0" border="0" width="100%">
129 <tr><td class="tabDetailViewDF">
130 <div >
131 <div id="container" style="height: 465px">
132
133 </div>
134 </div>
135 </td></tr>
136 </table>
137 <table border="0" class="actionsContainer">
138 <tr><td>
139 <input id="connectors_bottom_save" title="{$APP.LBL_SAVE_BUTTON_LABEL}" accessKey="{$APP.LBL_SAVE_BUTTON_TITLE}" class="button" type="submit" name="button" value="{$APP.LBL_SAVE_BUTTON_LABEL}" onclick="return check_form('ModifyProperties') || confirm('{$mod.LBL_CONFIRM_CONTINUE_SAVE}');">
140 <input id="connectors_bottom_cancel" title="{$APP.LBL_CANCEL_BUTTON_LABEL}" accessKey="{$APP.LBL_CANCEL_BUTTON_KEY}" class="button" onclick="document.ModifyProperties.action.value='ConnectorSettings'; document.ModifyProperties.module.value='Connectors';" type="submit" name="button" value="{$APP.LBL_CANCEL_BUTTON_LABEL}">
141 </td></tr>
142 </table>
143 </form>
144
145 <script type="text/javascript">
146 {literal}
147 YAHOO.util.Event.onDOMReady(SourceTabs.fitContainer);
148 {/literal}
149
150 {foreach name=required_fields from=$REQUIRED_FIELDS key=id item=fields}
151         {foreach from=$fields key=field_key item=field_label}
152                 addToValidate("ModifyProperties", "{$id}_{$field_key}", "alpha", true, "{$field_label}");
153         {/foreach}
154 {/foreach}
155 </script>