| 1 |
<?php |
|---|
| 2 |
|
|---|
| 3 |
|
|---|
| 4 |
|
|---|
| 5 |
|
|---|
| 6 |
|
|---|
| 7 |
|
|---|
| 8 |
|
|---|
| 9 |
|
|---|
| 10 |
|
|---|
| 11 |
|
|---|
| 12 |
|
|---|
| 13 |
|
|---|
| 14 |
|
|---|
| 15 |
$dispnum = 'versionupgrade'; |
|---|
| 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 |
|
|---|
| 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 |
|
|---|