]> CyberLeo.Net >> Repos - Github/sugarcrm.git/blob - modules/MergeRecords/Step3.html
Release 6.5.0
[Github/sugarcrm.git] / modules / MergeRecords / Step3.html
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 <!-- BEGIN: main -->
39 <p>
40 <form name="EditView" id="EditView" method="POST" action="index.php">
41         <input type="hidden" name="module" value="MergeRecords">
42         <input type="hidden" name="record" value="{ID}">
43         <input type="hidden" name="merge_module" value="{MERGE_MODULE}">
44         <input type="hidden" name="action">
45         <input type="hidden" name="return_module" value="{RETURN_MODULE}">
46         <input type="hidden" name="return_id" value="{RETURN_ID}">
47         <input type="hidden" name="return_action" value="{RETURN_ACTION}">
48         <input type="hidden" name="change_parent" value="0">
49         <input type="hidden" name="change_parent_id" value="">
50         <input type="hidden" name="remove" value="0">
51         <input type="hidden" name="remove_id" value="">
52         <input type="hidden" name="merged_links" value="{MERGED_LINKS}">
53         {MERGED_IDS}
54         
55         <table width="100%" cellpadding="0" cellspacing="0" border="0">
56         <tr>
57                 <td align="left" style="padding-bottom: 2px;"><input title="{MOD.LBL_SAVE_MERGED_RECORD_BUTTON_TITLE}" class="button" onclick="return merge_verify();" type="submit" name="button" value="  {MOD.LBL_SAVE_MERGED_RECORD_BUTTON_LABEL}  " >&nbsp;
58                 <input title="{APP.LBL_CANCEL_BUTTON_TITLE}" accessKey="{APP.LBL_CANCEL_BUTTON_KEY}" class="button" onclick="this.form.action.value='{RETURN_ACTION}'; this.form.module.value='{RETURN_MODULE}'; this.form.record.value='{RETURN_ID}'" type="submit" name="button" value="  {APP.LBL_CANCEL_BUTTON_LABEL}  "></td>
59                 <td align="right" nowrap><span class="required">{APP.LBL_REQUIRED_SYMBOL}</span> {APP.NTC_REQUIRED}</td>
60         </tr>
61         </table>
62 <table width="100%" border="0" cellspacing="0" cellpadding="0" >
63 <tr height="20">
64 <td>
65 <table width="100%" border="0" cellspacing="0" cellpadding="0" class="tabform">
66         {DIFF_HEADER}
67 <!-- BEGIN: merge_row_diff -->
68         <tr height="20">{FILE "modules/MergeRecords/MergeField.html"}</tr>
69 <!-- END: merge_row_diff -->
70         {GROUP_PARTITION}
71         {SIMILAR_HEADER}
72 <!-- BEGIN: merge_row_similar -->
73         <tr height="20">{FILE "modules/MergeRecords/MergeField.html"}</tr>
74 <!-- END: merge_row_similar -->
75 </table>
76 </td>
77 </tr>
78 </table>
79 <br/>
80         <table width="100%" cellpadding="0" cellspacing="0" border="0">
81         <tr>
82                 <td align="left" style="padding-bottom: 2px;"><input title="{MOD.LBL_SAVE_MERGED_RECORD_BUTTON_TITLE}" class="button" onclick="return merge_verify();" type="submit" name="button" value="  {MOD.LBL_SAVE_MERGED_RECORD_BUTTON_LABEL}  " >&nbsp;
83                 <input title="{APP.LBL_CANCEL_BUTTON_TITLE}" accessKey="{APP.LBL_CANCEL_BUTTON_KEY}" class="button" onclick="this.form.action.value='{RETURN_ACTION}'; this.form.module.value='{RETURN_MODULE}'; this.form.record.value='{RETURN_ID}'" type="submit" name="button" value="  {APP.LBL_CANCEL_BUTTON_LABEL}  "></td>
84         </tr>
85         </table>
86 </form>
87 <p>
88
89 <script type="text/javascript">
90 function merge_verify() {
91         if (!check_form('EditView')) {
92                 return false;
93         }
94
95         var message="{MERGE_VERIFY}";
96         if (confirm(message)) {
97                 document.EditView.action.value='SaveMerge';
98                 return true;
99         } else {
100                 return false;
101         }
102 }
103 function copy_value(json_array)
104 {
105         var target_element = document.getElementById(json_array['field_name']);
106         if(json_array['field_type'] == 'enum')
107         {
108                 for(i=0; i < target_element.options.length; i++)
109                 {
110                         if(target_element.options[i].value == json_array['field_value'])
111                         {
112                                 target_element.options[i].selected=true;
113                                 i=target_element.options.length+1;
114                         }
115                 }
116         }
117         else if(json_array['field_type'] == 'bool')
118         {
119                 if(json_array['field_value'] == '1' || json_array['field_value'] == 'on')
120                         target_element.checked=true;
121                 else
122                         target_element.checked=false;
123         }
124         else if(json_array['field_type'] == 'relate' || json_array['field_type'] == 'link')
125         {
126                 for(popup_field in json_array['popup_fields'])
127                 {
128                         var target_element = document.getElementById(popup_field);
129                         target_element.value = json_array['popup_fields'][popup_field];
130                         //alert("Field:"+popup_field+"\nValue:"+json_array['popup_fields'][popup_field]);
131                 }
132         }
133         else if(json_array['field_type'] == 'teamset')
134         {
135                 var teams = json_array['field_value2'];
136                 var isFirstFieldEmpty = collection['EditView_team_name'].clean_up();
137                 var index = 0;
138                 
139                 //expand the list
140                 collection['EditView_team_name'].js_more();
141             collection['EditView_team_name'].show_arrow_label(true);
142
143                 for(team_id in teams) {
144                          if(teams[team_id]['id']) {
145                                  var temp_array = []; 
146                                  temp_array['name'] = teams[team_id]['display_name'];
147                          temp_array['id'] = teams[team_id]['id'];
148                          if(isFirstFieldEmpty && index == 0){
149                                 collection['EditView_team_name'].replace_first(temp_array);
150                          }else{
151                                 collection['EditView_team_name'].add(temp_array);
152                          }
153                          index++;
154                          }
155                 }
156         }
157         else if(json_array['field_type'] == 'datetimecombo'){
158                 dt = json_array['field_value'];
159                 date = dt.substr(0,10);
160                  //Get hours and minutes and adjust as necessary
161             var hrs = parseInt(dt.substring(11,13), 10);
162             var mins = parseInt(dt.substring(14,16), 10);
163         
164             //A safety scan to make sure hrs and minutes are formatted correctly
165                 if (mins > 0 && mins < 15) {
166                         mins = 15;
167                 } else if (mins > 15 && mins < 30) {
168                         mins = 30;
169                 } else if (mins > 30 && mins < 45) {
170                         mins = 45;
171                 } else if (mins > 45) {
172                         hrs += 1;
173                         mins = 0;
174                 } //if-else
175                 
176             document.getElementById(json_array['field_name']+'_date').value=date;
177             var hourObj = document.getElementById(json_array['field_name']+'_hours');
178             for(var i=0; i< hourObj.length; i++){
179                 if(hourObj.options[i].value == hrs){
180                         hourObj.options[i].selected='checked';
181                 }
182             }
183
184             
185             var minuteObj = document.getElementById(json_array['field_name']+'_minutes');
186             for(var i=0; i< minuteObj.length; i++){
187                 if(minuteObj.options[i].value == mins){
188                         minuteObj.options[i].selected='checked';
189                 }
190             }
191             
192                 var hasMeridiem = /am|pm/i.test("{USER_DATEFORMAT}");           
193             if(hasMeridiem){
194                 meridiem = trim(dt.substring(16));
195                     var meridiemObj = document.getElementById(json_array['field_name'] + "_meridiem");
196                     for(var i=0; i< meridiemObj.length; i++){
197                         if(meridiemObj.options[i].value == meridiem){
198                                 meridiemObj.options[i].selected='checked';
199                         }
200                     }
201             }
202             target_element.value = json_array['field_value'];
203         }
204         else if(json_array['field_type'] == 'multienum'){
205             var multienumObj = document.getElementById(json_array['field_name']);
206             for(var i=0; i< multienumObj.length; i++){
207                 
208             if ( json_array['field_value'].indexOf(multienumObj.options[i].value) != -1 ) {
209                 multienumObj.options[i].selected='checked';
210             }
211             else {
212                 multienumObj.options[i].selected = '';
213             }
214         }
215         }
216         else
217         {
218                 target_element.value = json_array['field_value'];
219         } 
220         return true;
221 }
222
223 function change_primary(button, new_id) {
224         document.EditView.change_parent.value='1';
225         document.EditView.change_parent_id.value=new_id;
226         document.EditView.action.value='Step3';
227         
228         document.EditView.submit();
229 }
230 function remove_me(button, new_id) {
231         document.EditView.remove.value='1';
232         document.EditView.remove_id.value=new_id;
233         document.EditView.action.value='Step3';
234         
235         document.EditView.submit();
236 }
237 </script>
238 {VALIDATION_JS}
239 <!-- END: main -->