Show
Ignore:
Timestamp:
01/05/11 09:47:29 (2 years ago)
Author:
mbrevda
Message:

re #4723

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • modules/branches/bootstrap-2.9/directory/install.php

    r10795 r10796  
    11<?php 
    2 global $db; 
    3 global $amp_conf; 
     2global $db, $amp_conf; 
    43 
    54if (! function_exists("out")) { 
     
    191190 
    192191 
    193   //check to see if were using the directory in ivr's 
    194   $count = $db->getOne('SELECT count(*) FROM ivr WHERE displayname != "__install_done"'); 
    195   if(DB::IsError($count)) {  
    196     die_freepbx(_('Error migrating to new directory! ERROR: Could not get count of Ivr\'s using the legacy Directory ' . $q->getDebugInfo())); 
     192  //check to see if were using the directory in ivr's, ensureing that we have ivr's 
     193  $ivr_stat = $db->getOne('SELECT count(*) FROM modules WHERE modulename = "ivr" AND enabled = 1'); 
     194  if(DB::IsError($q)) {  
     195    die_freepbx(_('Error migrating to new directory! ERROR: Could not get Ivr status ' . $q->getDebugInfo())); 
     196  } 
     197  if ($ivr_stat == 1) { 
     198    $count = $db->getOne('SELECT count(*) FROM ivr WHERE displayname != "__install_done"'); 
     199    if(DB::IsError($count)) {  
     200      die_freepbx(_('Error migrating to new directory! ERROR: Could not get count of Ivr\'s using the legacy Directory ' . $q->getDebugInfo())); 
     201    } 
     202  } else { 
     203    $count = 0; 
    197204  } 
    198205