Changeset 1743

Show
Ignore:
Timestamp:
04/28/06 03:12:39 (7 years ago)
Author:
qldrob
Message:

#718 - 1st time run of IVR gives warnings - Check to make sure there are IVR's before trying to upgrade them. (Not worthy of a release)

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • modules/branches/2.1/ivr/functions.inc.php

    r1720 r1743  
    7676      } 
    7777   
    78       // Now process everything else 
    79       foreach (array_keys($ivr_newname) as $old) { 
    80         // Timeconditions 
    81         sql("UPDATE timeconditions set truegoto='".$ivr_newname[$arr[0]].",s,1' where truegoto='$old,s,1'"); 
    82         sql("UPDATE timeconditions set falsegoto='".$ivr_newname[$arr[0]].",s,1' where falsegoto='$old,s,1'"); 
    83         // Inbound Routes 
    84         sql("UPDATE incoming set destination='".$ivr_newname[$arr[0]].",s,1' where destination='$old,s,1'"); 
    85         // Ring Groups 
    86         sql("UPDATE ringgroups set postdest='".$ivr_newname[$arr[0]].",s,1' where postdest='$old,s,1'"); 
     78      // Now process everything else - if there's anything to process. 
     79      if (isset($ivr_newname) && is_array($ivr_newname)) { 
     80        foreach (array_keys($ivr_newname) as $old) { 
     81          // Timeconditions 
     82          sql("UPDATE timeconditions set truegoto='".$ivr_newname[$arr[0]].",s,1' where truegoto='$old,s,1'"); 
     83          sql("UPDATE timeconditions set falsegoto='".$ivr_newname[$arr[0]].",s,1' where falsegoto='$old,s,1'"); 
     84          // Inbound Routes 
     85          sql("UPDATE incoming set destination='".$ivr_newname[$arr[0]].",s,1' where destination='$old,s,1'"); 
     86          // Ring Groups 
     87          sql("UPDATE ringgroups set postdest='".$ivr_newname[$arr[0]].",s,1' where postdest='$old,s,1'"); 
     88        } 
    8789      } 
    8890    }