Changeset 9552

Show
Ignore:
Timestamp:
04/27/10 14:20:56 (3 years ago)
Author:
mickecarlsson
Message:

Update the versionupgrade module so that it wont allow updating if cusomcontexts is installed. Added link to bounty page

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • modules/branches/2.7/versionupgrade/page.versionupgrade.php

    r9312 r9552  
    2626$core_xml = module_getinfo('core'); 
    2727$core_version = $core_xml['core']['version']; 
     28 
     29// Is customcontexts installed and active? 
     30if(function_exists('customcontexts_getmodulevalue')) { 
     31    // Get version of customcontexts 
     32    $customcontexts  = module_getinfo('customcontexts'); 
     33    $customcontexts_version = $customcontexts['customcontexts']['version']; 
     34  // If it is 0.3.5 then set variable so that we don't allow upgrade to 2.8 
     35  if (version_compare_freepbx('0.3.5', $customcontexts_version,"le")) { 
     36  $dont_upgrade_to_two_point_eight = TRUE; 
     37  }; 
     38    }; 
    2839 
    2940// These are from functions.inc.php, set all versions there 
     
    6879</table> 
    6980<?php 
    70 if (version_compare_freepbx($version, $versionupgrade_alpha_version,"lt")) { 
    71        echo sprintf(_("<h2 align='center' style='color:red'>WARNING - YOU WILL BE UPGRADED TO VERSION %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 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_upgrade_ver,$version,$versionupgrade_upgrade_ver,$versionupgrade_upgrade_ver); 
     81if ($dont_upgrade_to_two_point_eight) { 
     82    echo _("<h2 align='center' style='color:red'>WARNING - YOU HAVE THE CUSTOM CONTEXT MODULE INSTALLED</center></h2>"); 
     83    echo sprintf(_("This version (%s) of Custom Context module wont work with FreePBX version %s."), $customcontexts_version, $versionupgrade_upgrade_ver); 
     84    echo "<p>".sprintf(_("Because of this upgrading to FreePBX %s is not allowed"), $versionupgrade_upgrade_ver); 
     85    echo "<br />"._("You have only two options:<li>Uninstall or Disable Custom Context and loose all settings from this module<li>Skip this upgrade"); 
     86    echo "<p>".sprintf(_("However, there is work in progress of raising funds to update Custom Context to work with FreePBX %s."), $versionupgrade_upgrade_ver); 
     87    echo "<br />"._("If you like Custom Context please contribute to this by clicking ")."<a href = 'http://www.freepbx.org/bounties/custom-context'><blink><b>"._("here")."</b></blink></a>"; 
     88    } else if (version_compare_freepbx($version, $versionupgrade_alpha_version,"lt")) { 
     89          echo sprintf(_("<h2 align='center' style='color:red'>WARNING - YOU WILL BE UPGRADED TO VERSION %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 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_upgrade_ver,$version,$versionupgrade_upgrade_ver,$versionupgrade_upgrade_ver); 
    7290?> 
    7391