root/modules/branches/2.7/versionupgrade/page.versionupgrade.php

Revision 9867, 6.2 kB (checked in by p_lindheimer, 3 years ago)

remove Custom Context restriction, fix but in variable name, add info about status (BETA, RC, etc.)

Line 
1 <?php
2 /* $Id: page.versionupgrade.php 3790 2007-02-16 18:52:53Z p_lindheimer $ */
3 //Copyright (C) 2008 Astrogen LLC
4 //
5 //This program is free software; you can redistribute it and/or
6 //modify it under the terms of the GNU General Public License
7 //as published by the Free Software Foundation; either version 2
8 //of the License, or (at your option) any later version.
9 //
10 //This program is distributed in the hope that it will be useful,
11 //but WITHOUT ANY WARRANTY; without even the implied warranty of
12 //MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13 //GNU General Public License for more details.
14
15 $dispnum = 'versionupgrade'; //used for switch on config.php
16 $type = isset($_REQUEST['type'])?$_REQUEST['type']:'tool';
17 $upgraderequest = isset($_REQUEST['upgraderequest'])?$_REQUEST['upgraderequest']:'';
18
19 ?>
20 </div>
21 <div class="content">
22
23 <?php
24 $version = getversion();
25 $framework_version = get_framework_version();
26 $core_xml = module_getinfo('core');
27 $core_version = $core_xml['core']['version'];
28
29 // These are from functions.inc.php, set all versions there
30 global $versionupgrade_status;
31 global $versionupgrade_alpha_version;
32 global $versionupgrade_upgrade_ver;
33 global $versionupgrade_upgrade_final;
34 global $versionupgrade_beta1_version;
35
36 if (version_compare_freepbx($version, $versionupgrade_alpha_version,"lt") && $upgraderequest == "UPGRADE") {
37         versionupgrade_setversion($versionupgrade_alpha_version);
38     $version = getversion();
39 }
40
41 echo "<h2>".sprintf(_("%s Upgrade Module"),$versionupgrade_upgrade_ver)."</h2>";
42 echo "<p><b>"._("Current Version Info (Updated each stage of upgrade process):")."</b></p>";
43 ?>
44 <table>
45 <tr>
46     <td><b>
47         <?php echo _("FreePBX Base Version:") ?>
48     </td></b>
49     <td><b>
50         <?php echo $version ?>
51     </td></b>
52 </tr>
53 <tr>
54     <td><b>
55         <?php echo _("FreePBX Framework Version:") ?>
56     </td></b>
57     <td><b>
58         <?php echo $framework_version ?>
59     </td></b>
60 </tr>
61 <tr>
62     <td><b>
63         <?php echo _("FreePBX Core Version:") ?>
64     </td></b>
65     <td><b>
66         <?php echo $core_version ?>
67     </td></b>
68 </tr>
69 </table>
70 <?php
71 if (version_compare_freepbx($version, $versionupgrade_alpha_version,"lt")) {
72           echo sprintf(_("<h2 align='center' style='color:red'>WARNING - YOU WILL BE UPGRADED TO VERSION %s %s</h2><p>This module will allow you to upgrade to FreePBX version %s from the current version, %s, that you are running.</p><p>The upgrade process is a simple but multi-step process that you should complete all at one time. As always when upgrading a system, it is advisable that you complete this process when the system is not actively being used.</p>The steps you will take are:<ol><li>Press the upgrade button below.</li><li>Go to Module Admin, check for online updates, and upgrade the <b>FreePBX Framework</b> module ONLY from the online repository which will now be connected to version %s.</li><li>Now, Check for online updates again and upgrade all other modules that have upgrades available. If you get dependency warnings, just repeat the process until all your modules have been upgraded.</li><li>Now press the Apply Configuration bar.</li></ol><p>   Once you have completed
73           these step you will be upgraded to the new %s version and you may disable or remove this module if it does not do so automatically.</p>"),$versionupgrade_upgrade_final,$versionupgrade_status,$versionupgrade_upgrade_ver,$version,$versionupgrade_upgrade_ver,$versionupgrade_upgrade_ver);
74 ?>
75
76 <br />
77 <form name="upgrade" action="<?php  $_SERVER['PHP_SELF'] ?>" method="post" onsubmit="return upgrade_onsubmit();">
78     <input type="hidden" name="display" value="<?php echo $dispnum?>">
79     <input type="hidden" name="type" value="<?php echo $type?>">
80     <input type="hidden" name="upgraderequest" value="UPGRADE">
81     <table>
82         <tr>
83             <td valign="top" class="label">
84                 <input type="submit" class="button" value="<?php echo _("UPGRADE NOW")?>">
85             </td>
86         </tr>
87        
88         <tr>
89             <td height="8"></td>
90             <td></td>
91         </tr>
92     </table>
93
94     <script language="javascript">
95     <!--
96     var theForm = document.upgrade;
97     function upgrade_onsubmit() {
98         var msgConfirmUpgrade = "<?php echo sprintf(_("You are about to upgrade your system to FreePBX %s %s. You can not reverse this process. Do you want to continue?"),$versionupgrade_upgrade_final, $versionupgrade_status); ?>";
99    
100         if (!confirm(msgConfirmUpgrade)) {
101                 return false;
102         }
103     }
104     //-->
105     </script>
106 </form>
107
108 <?php
109 } else if (version_compare_freepbx($version, $versionupgrade_beta1_version,"lt")) {
110
111     echo "<br />".sprintf(_("<p>You appear to have partially upgraded to version %s, your current version number is %s. The remaining steps you should take are:</p><ol><li>Go to Module Admin, press check for online updates, and upgrade the <b>FreePBX Framework</b> module from the online repository. Do not upgrade other modules.</li><li>Check for online updates again and upgrade all other modules that have upgrades available. If you get dependency warnings, simply repeat the process until all modules are upgraded.</li><li>Press the Apply Configuration Changes bar.</li></ol><p>Once you have completed these steps you will be upgraded to the new %s version and you may disable or remove this module if it it does not do so automatically.</p>"),$versionupgrade_upgrade_ver,$version,$versionupgrade_upgrade_ver);
112
113 }    else if (version_compare_freepbx($core_version, $versionupgrade_alpha_version, "lt")) {
114
115     echo "<br />".sprintf(_("<p>You appear to have upgraded Framework to version %s, your current version number is %s. You still need to upgrade the Core Module and any other modules that show upgrades available. The remaining steps you should take are:</p><ol><li>Check for online updates again and upgrade all other modules that have upgrades available including Core. If you get dependency warnings simply repeat the process until all modules are upgraded.</li><li>Press the Apply Configuration Changes bar.</li></ol><p>Once you have completed these steps you will be upgraded to the new %s version and you may disable or remove this module if it it does not do so automatically.</p>"),$versionupgrade_upgrade_ver,$version,$versionupgrade_upgrade_ver);
116
117 } else {
118
119     $results = module_delete($dispnum);
120     redirect("config.php");
121
122     echo sprintf(_("You have successfully upgraded to FreePBX version %s. If this module has not been automatically disabled you should go to Module Admin and disabled or uninstall this module at this time"),$version);
123 }
124
125 ?>
126
Note: See TracBrowser for help on using the browser.