]> CyberLeo.Net >> Repos - Github/sugarcrm.git/blob - modules/UpgradeWizard/uw_main.tpl
Release 6.4.0
[Github/sugarcrm.git] / modules / UpgradeWizard / uw_main.tpl
1 {if false}
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 {/if}
40
41 <script type="text/javascript" language="Javascript" src="{sugar_getjspath file='modules/UpgradeWizard/upgradeWizard.js'}"></script>
42
43 {$UW_JS}
44
45 <div id="title">
46 {$UW_TITLE}
47 </div>
48
49 <div id="progress" style="display:none;">
50 {$UW_PROGRESS}
51 </div>
52
53 <div id="message" style="display:none;">
54 {$UW_MESSAGE}
55 </div>
56
57 <div id="nav">
58 <table width="100%" cellpadding="0" cellspacing="0" border="0">
59         <tr>
60                 <td>
61 <form action="index.php" method="post" name="UpgradeWizardForm" id="form">
62         <input type="hidden" name="module" value="UpgradeWizard">
63         <input type="hidden" name="action" value="index">
64         <input type="hidden" name="step" id="step" value="{$UW_STEP}">
65         <input type="hidden" name="overwrite_files" id="over">
66         <input type="hidden" name="schema_change" id="schema">
67         <input type="hidden" name="schema_drop"   id="schema_drop">
68         <input type="hidden" name="overwrite_files_serial" id="overwrite_files_serial">
69         <input type="hidden" name="addTaskReminder" id="addTaskReminder">
70         <input type="hidden" name="addEmailReminder" id="addEmailReminder">
71     {if !isset($includeContainerCSS) || $includeContainerCSS}
72     <link rel='stylesheet' type='text/css' href="{sugar_getjspath file='include/javascript/yui/assets/container.css'}" />
73         {if $step == 'commit'}
74     <link rel='stylesheet' type='text/css' href="{sugar_getjspath file='include/javascript/yui/build/container/assets/container.css'}"/>
75     <link rel='stylesheet' type='text/css' href="{sugar_getjspath file='themes/default/css/yui.css'}"/>
76        {/if}
77     {/if}
78                 {if $showBack}
79                         <input  title           = "{$MOD.LBL_BUTTON_BACK}"
80                                         class           = "button"
81                                         onclick         = "document.getElementById('form').step.value='{$STEP_BACK}';"
82                                         type            = "submit"
83                                         value           = "  {$MOD.LBL_BUTTON_BACK}  ">
84                 {/if}
85                 {if $showNext}
86                         <input  title           = "{$MOD.LBL_BUTTON_NEXT}"
87                                         class           = "button"
88                                         {$disableNextForLicense}
89                                         onclick = " handleUploadCheck('{$step}', {$u_allow}); if(!{$u_allow}) return; upgradeP('{$step}', false);document.getElementById('form').step.value='{$STEP_NEXT}'; handlePreflight('{$step}'); document.getElementById('form').submit();"
90                                         type            = "button"
91                                         value           = "  {$MOD.LBL_BUTTON_NEXT}  "
92                                         id                      = "next_button" >
93                 {/if}
94                 {if $showCancel}
95                         <input  title           = "{$MOD.LBL_BUTTON_CANCEL}"
96                                         class           = "button"
97                                 {if $step == 'start'}
98                                         {**** if this is the first step, cancel should take you to administration screen ****}
99                                         onclick         = "document.location.href='index.php?module=Administration&action=index';"
100                                         type            = "button"
101                                 {else}
102                                         onclick         = "cancelUpgrade();document.getElementById('form').step.value='{$STEP_CANCEL}';"
103                                         type            = "submit"
104                                 {/if}
105                                         value           = "  {$MOD.LBL_BUTTON_CANCEL}  ">
106                 {/if}
107                 {if $showRecheck}
108                         <input  title           = "{$MOD.LBL_BUTTON_RECHECK}"
109                                         class           = "button"
110                                         onclick         = "upgradeP('{$step}', true);document.getElementById('form').step.value='{$STEP_RECHECK}';"
111                                         type            = "submit"
112                                         value           = "  {$MOD.LBL_BUTTON_RECHECK}  ">
113                 {/if}
114                 {if $showDone}
115                         <input  title           = "{$MOD.LBL_BUTTON_DONE}"
116                                         class           = "button"
117                                         onclick         = "deleteCacheAjax();window.location.href='index.php?module=Home&action=About';"
118                                         type            = "button"
119                                         value           = "  {$MOD.LBL_BUTTON_DONE}  ">
120                 {/if}
121                 {if $showExit}
122                         <input  title           = "{$MOD.LBL_BUTTON_EXIT}"
123                                         class           = "button"
124                                         onclick         = "window.location.href='index.php?module=Administration&action=index';"
125                                         type            = "button"
126                                         value           = "  {$MOD.LBL_BUTTON_EXIT}  ">
127                 {/if}
128
129 </form>
130                 </td>
131         </tr>
132 </table>
133 </div>
134
135 <div id="main">
136 <table width="100%" border="0" cellpadding="0" cellpadding="0"
137     class="{if !isset($includeContainerCSS) || $includeContainerCSS}tabDetailView{else}detail view small{/if}">
138 {if $step != "start" && $step != "cancel" && $step != "end"}
139         <tr>
140                 <td id=error_messages colspan="2">
141                         <div id="top_message">{$top_message}</div>
142                 </td>
143         </tr>
144 {/if}
145         <tr>
146                 <td width="25%" rowspan="2" {if !isset($includeContainerCSS) || $includeContainerCSS}class="tabDetailViewDL"{else}scope="row"{/if}><slot>
147                         {$CHECKLIST}
148                 </slot></td>
149                 <td width="75%" {if !isset($includeContainerCSS) || $includeContainerCSS}class="tabDetailViewDF"{/if}><slot>
150                         {$UW_MAIN}&nbsp;
151                 </slot></td>
152         </tr>
153 {if $step == "upload"}
154         <tr>
155                 <td valign="top" {if !isset($includeContainerCSS) || $includeContainerCSS}class="tabDetailViewDF"{/if}>
156                         &nbsp;<br />
157                         {$UW_HISTORY}
158                 </td>
159         </tr>
160 {/if}
161 </table>
162 </div>
163
164 <table width="100%" cellpadding="0" cellspacing="0" border="0">
165         <tr>
166                 <td>
167 <form action="index.php" method="post" name="UpgradeWizardForm" id="form">
168         <input type="hidden" name="module" value="UpgradeWizard">
169         <input type="hidden" name="action" value="index">
170         <input type="hidden" name="step" value="{$UW_STEP}">
171         <input type="hidden" name="overwrite_files" id="over">
172         <input type="hidden" name="schema_change" id="schema">
173         <input type="hidden" name="schema_drop"   id="schema_drop">
174         <input type="hidden" name="overwrite_files_serial" id="overwrite_files_serial">
175         <input type="hidden" name="addTaskReminder" id="addTaskReminder">
176         <input type="hidden" name="addEmailReminder" id="addEmailReminder">
177     {if !isset($includeContainerCSS) || $includeContainerCSS}
178     <link rel='stylesheet' type='text/css' href='include/javascript/yui/assets/container.css' />
179         {if $step == 'commit'}
180     <link rel='stylesheet' type='text/css' href='include/javascript/yui/build/container/assets/container.css'/>
181     <link rel='stylesheet' type='text/css' href='themes/default/css/yui.css'/>
182        {/if}
183     {/if}
184                 {if $showBack}
185                         <input  title           = "{$MOD.LBL_BUTTON_BACK}"
186                                         class           = "button"
187                                         onclick         = "document.getElementById('form').step.value='{$STEP_BACK}';"
188                                         type            = "submit"
189                                         value           = "  {$MOD.LBL_BUTTON_BACK}  ">
190                 {/if}
191                 {if $showNext}
192                         <input  title           = "{$MOD.LBL_BUTTON_NEXT}"
193                                         class           = "button"
194                                         {$disableNextForLicense}
195                                         onclick = " handleUploadCheck('{$step}', {$u_allow}); if(!{$u_allow}) return; upgradeP('{$step}', false);document.getElementById('form').step.value='{$STEP_NEXT}'; handlePreflight('{$step}'); document.getElementById('form').submit();"
196                                         type            = "button"
197                                         value           = "  {$MOD.LBL_BUTTON_NEXT}  "
198                                         id                      = "next_button" >
199                 {/if}
200                 {if $showCancel}
201                         <input  title           = "{$MOD.LBL_BUTTON_CANCEL}"
202                                         class           = "button"
203                                 {if $step == 'start'}
204                                         {**** if this is the first step, cancel should take you to administration screen ****}
205                                         onclick         = "document.location.href='index.php?module=Administration&action=index';"
206                                         type            = "button"
207                                 {else}
208                                         onclick         = "cancelUpgrade();document.getElementById('form').step.value='{$STEP_CANCEL}';"
209                                         type            = "submit"
210                                 {/if}
211                                         value           = "  {$MOD.LBL_BUTTON_CANCEL}  ">
212                 {/if}
213                 {if $showRecheck}
214                         <input  title           = "{$MOD.LBL_BUTTON_RECHECK}"
215                                         class           = "button"
216                                         onclick         = "upgradeP('{$step}', true);document.getElementById('form').step.value='{$STEP_RECHECK}';"
217                                         type            = "submit"
218                                         value           = "  {$MOD.LBL_BUTTON_RECHECK}  ">
219                 {/if}
220                 {if $showDone}
221                         <input  title           = "{$MOD.LBL_BUTTON_DONE}"
222                                         class           = "button"
223                                         onclick         = "deleteCacheAjax();window.location.href='index.php?module=Home&action=About';"
224                                         type            = "button"
225                                         value           = "  {$MOD.LBL_BUTTON_DONE}  ">
226                 {/if}
227                 {if $showExit}
228                         <input  title           = "{$MOD.LBL_BUTTON_EXIT}"
229                                         class           = "button"
230                                         onclick         = "window.location.href='index.php?module=Administration&action=index';"
231                                         type            = "button"
232                                         value           = "  {$MOD.LBL_BUTTON_EXIT}  ">
233                 {/if}
234
235 </form>
236                 </td>
237         </tr>
238 </table>
239
240
241 <script>
242
243 UPGRADE_PROGRESS = '{$MOD.LBL_UPGRADE_IN_PROGRESS}';
244 TIME_ELAPSED = "{$MOD.LBL_UPGRADE_TIME_ELAPSED}";
245 START_IN_PROGRESS = "{$MOD.LBL_START_UPGRADE_IN_PROGRESS}";
246 SYSTEM_CHECK_IN_PROGRESS = "{$MOD.LBL_SYSTEM_CHECKS_IN_PROGRESS}";
247 LICENSE_CHECK_IN_PROGRESS = "{$MOD.LBL_LICENSE_CHECK_IN_PROGRESS}";
248 PREFLIGHT_CHECK_IN_PROGRESS ="{$MOD.LBL_PREFLIGHT_CHECK_IN_PROGRESS}";
249 COMMIT_UPGRADE_IN_PROGRESS ="{$MOD.LBL_COMMIT_UPGRADE_IN_PROGRESS}";
250 UPGRADE_SUMMARY_IN_PROGRESS ="{$MOD.LBL_UPGRADE_SUMMARY_IN_PROGRESS}";
251 UPGRADE_SCRIPTS_IN_PROGRESS ="{$MOD.LBL_UPGRADE_SCRIPTS_IN_PROGRESS}";
252 SET_STEP_TO_COMPLETE = "{$MOD.LBL_UW_COMPLETE}";
253 UPLOADE_UPGRADE_IN_PROGRESS= "{$MOD.LBL_UPLOADE_UPGRADE_IN_PROGRESS}";
254 UPLOADING_UPGRADE_PACKAGE = "{$MOD.LBL_UPLOADING_UPGRADE_PACKAGE}";
255 UPGRADE_CANCEL_IN_PROGRESS ="{$MOD.LBL_UPGRADE_CANCEL_IN_PROGRESS}";
256 PREFLIGHT_FILE_COPYING_PROGRESS = "{$MOD.LBL_PREFLIGHT_FILE_COPYING_PROGRESS}";
257 {literal}
258 var msgPanel;
259 var c=0
260 var s=0
261 var t
262 var currStage
263 var timeOutWindowMultiplier = 1
264 var timeOutWindow = 60
265 function upgradeP(step, recheck){
266 //if(step == 'systemCheck'){
267 //      return;
268 //}
269
270 if(document.getElementById("upgradeDiv") != null){
271             var args = {    width:"300px",
272                             modal:true,
273                             //xy:[400,300],
274                             fixedcenter: true,
275                             constraintoviewport: false,
276                             underlay:"shadow",
277                             close:false,
278                             draggable:true,
279                             effect:{effect:YAHOO.widget.ContainerEffect.FADE, duration:.5}
280                            } ;
281                     msg_panel = new YAHOO.widget.Panel('p_msg', args);
282                     //If we haven't built our panel using existing markup,
283                     //we can set its content via script:
284
285                                 if(step == 'start' || step == 'systemCheck'){
286                         //currStage = START_IN_PROGRESS;
287                         currStage = SYSTEM_CHECK_IN_PROGRESS;
288                 }
289                 /* removed window from system check. if you need to add back, remove check at the top
290                  * of this function as well
291                 if(step == 'systemCheck'){
292                         currStage = UPLOADE_UPGRADE_IN_PROGRESS;
293                         //document.getElementById(step).innerHTML='<i>'+SET_STEP_TO_COMPLETE+'</i>'
294                 }
295                 */
296                 if(step == 'uploadingUpgradePackage'){
297                         currStage = UPLOADING_UPGRADE_PACKAGE;
298                 }
299                 if(step == 'license_fiveO'){
300                         //currStage = LICENSE_CHECK_IN_PROGRESS;
301                         currStage = PREFLIGHT_CHECK_IN_PROGRESS;
302                         //document.getElementById(step).innerHTML='<i>'+SET_STEP_TO_COMPLETE+'</i>'
303                 }
304                 if(step == 'upload'){
305                         //currStage = LICENSE_CHECK_IN_PROGRESS;
306                         currStage = PREFLIGHT_CHECK_IN_PROGRESS;
307                         //document.getElementById(step).innerHTML='<i>'+SET_STEP_TO_COMPLETE+'</i>'
308                 }
309                 if(step == 'preflight'){
310                         if(recheck){
311                         currStage = PREFLIGHT_CHECK_IN_PROGRESS;
312                         }
313                         else{
314                                 currStage = PREFLIGHT_FILE_COPYING_PROGRESS;
315                         }
316                         //document.getElementById(step).innerHTML='<i>'+SET_STEP_TO_COMPLETE+'</i>'
317                 }
318                 if(step == 'commit'){
319                         currStage = UPGRADE_SCRIPTS_IN_PROGRESS;
320                         //document.getElementById(step).innerHTML='<i>'+SET_STEP_TO_COMPLETE+'</i>'
321                 }
322                 if(step == 'layouts'){
323                         currStage = UPGRADE_SUMMARY_IN_PROGRESS;
324                         //document.getElementById(step).innerHTML='<i>'+SET_STEP_TO_COMPLETE+'</i>'
325                 }
326                     msg_panel.setHeader(currStage);
327                     msg_panel.setBody(document.getElementById("upgradeDiv").innerHTML);
328                     //timedCount(currStage);
329                     //msg_panel.setFooter('Time Elapsed '+s);
330                     msg_panel.render(document.body);
331                     msgPanel = msg_panel;
332                         msgPanel.show;
333     }
334     return;
335 }
336
337 function cancelUpgrade(){
338 if(document.getElementById("upgradeDiv") != null){
339             var args = {    width:"300px",
340                             modal:true,
341                             //xy:[400,300],
342                             fixedcenter: true,
343                             constraintoviewport: false,
344                             underlay:"shadow",
345                             close:false,
346                             draggable:true,
347                             effect:{effect:YAHOO.widget.ContainerEffect.FADE, duration:.5}
348                            } ;
349                     msg_panel = new YAHOO.widget.Panel('p_msg', args);
350                     //If we haven't built our panel using existing markup,
351                     //we can set its content via script:
352
353                 currStage = UPGRADE_CANCEL_IN_PROGRESS;
354                 //document.getElementById(step).innerHTML='<i>'+SET_STEP_TO_COMPLETE+'</i>'
355                     msg_panel.setHeader(currStage);
356                     msg_panel.setBody(document.getElementById("upgradeDiv").innerHTML);
357                     //timedCount(currStage);
358                     //msg_panel.setFooter('Time Elapsed '+s);
359                     msg_panel.render(document.body);
360                     msgPanel = msg_panel;
361                         msgPanel.show;
362     }
363     return;
364 }
365
366 function timedCount(currStage)
367 {
368       msg_panel.setFooter(TIME_ELAPSED+'   '+s);
369       currStage = currStage+'   '+s;
370       msg_panel.setHeader(currStage);
371         c=c+1
372                 s=c
373
374                 timeOutWindowMultiples = timeOutWindowMultiplier*timeOutWindow
375                 if(c == timeOutWindowMultiples){
376                   updateUpgradeStepTime(timeOutWindow)
377                   timeOutWindowMultiplier = timeOutWindowMultiplier+1
378                 }
379
380                 if(c<10){
381                         s='0'+c
382                 }
383
384           if(c>=60 && c<3600){
385                          m=1
386                          while(c>=((m+1)*60)){
387                             m=m+1
388                           }
389                          secs= (c-(m*60))
390                          if(m < 10){
391                              m = '0'+m
392                           }
393                           if(secs < 10){
394                              secs = '0'+secs
395                           }
396                           s=m+':'+ secs
397                  }
398                  if(c>=3600){
399                           h=1;
400                           while(c>=((h+1)*3600)){
401                             h=h+1;
402                            }
403                           r= c-(h*3600)
404                           m = 0
405                           secs = 0
406                           if(r>=60){
407                                  m=1;
408                                   while(r>=((m+1)*60)){
409                                      m=m+1;
410                                   }
411                                   secs =  (r-(m*60))
412                             }
413                             if(h < 10){
414                                h = '0'+h
415                              }
416                              if(m < 10){
417                                m = '0'+m
418                              }
419                              if(secs <10){
420                                      secs = '0'+ secs
421                                   }
422                           s=h+':'+m+':'+ secs
423                    }
424                 t=setTimeout("timedCount(currStage)",1000)
425 }
426 function updateUpgradeStepTime(ts){
427   success = function(r) {
428         //making ajax call every three minutes to make sure the browser
429         //remains active
430     }
431    postData = 'upgradeStepTime=' + ts + '&module=UpgradeWizard&action=upgradeTimeCounter&to_pdf=1&sugar_body_only=1';
432    var ajxProgress = YAHOO.util.Connect.asyncRequest('POST','index.php', {success: success, failure: success}, postData);
433 }
434 </script>
435 {/literal}
436
437