Changeset 9919

Show
Ignore:
Timestamp:
06/25/10 10:02:08 (2 years ago)
Author:
mbrevda
Message:

re #4369, remove time condition migration, that should be done from thre CC module; also remove core_get_routes function to avoid any conflicts with the same function name further down the line

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • freepbx/branches/2.8/upgrades/2.8.0rc1/custom-context.php

    r9917 r9919  
    2727} 
    2828 
    29 if (!function_exists('core_routing_list')) { 
    30   function core_routing_list() { 
    31     $sql = "SELECT a.*, b.seq FROM `outbound_routes` a JOIN `outbound_route_sequence` b ON a.route_id = b.route_id ORDER BY `seq`"; 
    32     $routes = sql($sql,"getAll",DB_FETCHMODE_ASSOC); 
    33     return $routes; 
    34   } 
    35 } 
    36 // TODO: returning false will fail the install with #4345 checked in 
    37 // 
    38 if (!function_exists('timeconditions_timegroups_add_group_timestrings')) { 
    39   out(_('Time Conditions Module required and not present .. aborting install')); 
    40   return false; 
    41 } 
    42  
    4329//check if we have custom context installed, and migrate them if we do 
    4430$sql = 'DESCRIBE customcontexts_includes_list'; 
    4531$test = $db->getAll($sql); 
    4632if(!DB::IsError($test)) {  
    47 $ver = modules_getversion('customcontexts'); 
     33 $ver = modules_getversion('customcontexts'); 
    4834  outn(_("checking if Custom Context migration is required...")); 
    4935  if ($ver !== null && version_compare($ver, "2.8.0beta1.0", "<")) { 
     
    6854         * oh well... 
    6955         */ 
    70         $routes = core_routing_list(); 
     56        $sql = "SELECT a.*, b.seq FROM `outbound_routes` a JOIN `outbound_route_sequence` b ON a.route_id = b.route_id ORDER BY `seq`"; 
     57        $routes = sql($sql,"getAll",DB_FETCHMODE_ASSOC); 
    7158        $newincludes = array(); 
    7259        foreach ($includes as $inc => $myinclude) { 
     
    113100    out(_("not needed")); 
    114101  } 
    115   $tgs = $db->getAll('SELECT * FROM customcontexts_timegroups',DB_FETCHMODE_ASSOC); 
    116   if(!DB::IsError($tgs)) { 
    117     outn(_("migrating customcontexts_timegroups if needed.."));          
    118     foreach ($tgs as $tg) { 
    119       $tg_strings = sql('SELECT time FROM customcontexts_timegroups_detail WHERE timegroupid = '.$tg['id'].' ORDER BY id','getCol','time'); 
    120       $tg_id = timeconditions_timegroups_add_group_timestrings($tg['description'],$tg_strings); 
    121       sql("UPDATE customcontexts_includes set timegroupid = $tg_id WHERE timegroupid = {$tg['id']}"); 
    122     } 
    123     out(_("done"));          
    124     outn(_("removing customcontexts_timegroups and customcontexts_tiemgroups_detail tables.."));           
    125     unset($sql); 
    126     $sql[] = "DROP TABLE IF EXISTS `customcontexts_timegroups`"; 
    127     $sql[] = "DROP TABLE IF EXISTS `customcontexts_timegroups_detail`"; 
    128     foreach ($sql as $q){ 
    129       $db->query($q); 
    130     } 
    131     out(_("done"));          
    132   } 
    133102} 
    134103?>