Changeset 10770
- Timestamp:
- 12/29/10 22:50:01 (2 years ago)
- Files:
-
- freepbx/branches/2.8 (modified) (1 prop)
- freepbx/branches/2.8/upgrades/2.8.0/custom-context.php (modified) (2 diffs)
- freepbx/branches/2.8/upgrades/2.8.0alpha1/tables.php (modified) (3 diffs)
- freepbx/branches/2.8/upgrades/2.8.0alpha2/tables.php (modified) (2 diffs)
- freepbx/branches/2.8/upgrades/2.8.0rc1/custom-context.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
freepbx/branches/2.8
- Property svnmerge-integrated changed from /freepbx/branches/2.7:1-10414 /freepbx/trunk:1-9714,9744,9768,10150-10151,10215 to /freepbx/branches/2.7:1-10414 /freepbx/trunk:1-9714,9744,9768,10150-10151,10215,10739
freepbx/branches/2.8/upgrades/2.8.0/custom-context.php
r9922 r10770 25 25 echo $text; 26 26 } 27 }28 29 if (!function_exists('sql')) {30 function sql($sql,$type="query",$fetchmode=null) {31 global $db;32 $results = $db->$type($sql,$fetchmode);33 if(DB::IsError($results)) {34 die($results->getDebugInfo() . "SQL - <br /> $sql" );35 }36 return $results;37 }38 27 } 39 28 … … 66 55 */ 67 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`"; 68 $routes = sql($sql,"getAll",DB_FETCHMODE_ASSOC); 57 $routes = $db->getAll($sql,DB_FETCHMODE_ASSOC); 58 if(DB::IsError($routes)) { 59 die($routes->getDebugInfo() . "SQL - <br /> $sql" ); 60 } 69 61 $newincludes = array(); 70 62 foreach ($includes as $inc => $myinclude) { freepbx/branches/2.8/upgrades/2.8.0alpha1/tables.php
r9784 r10770 2 2 global $amp_conf; 3 3 global $db; 4 5 if (!function_exists('sql')) {6 function sql($sql,$type="query",$fetchmode=null) {7 global $db;8 $results = $db->$type($sql,$fetchmode);9 if(DB::IsError($results)) {10 die($results->getDebugInfo() . "SQL - <br /> $sql" );11 }12 return $results;13 }14 }15 4 16 5 /* fix manager.conf settings for older manager.conf files being upgraded as new permissions are needed for later releases of Asterisk … … 209 198 { 210 199 global $amp_conf; 200 global $db; 211 201 212 202 if ($amp_conf["AMPDBENGINE"] == "sqlite3") 213 203 { 214 $results = sql("SELECT DISTINCT context FROM extensions WHERE context LIKE 'outrt-%' ORDER BY context ","getAll"); 204 $sql = "SELECT DISTINCT context FROM extensions WHERE context LIKE 'outrt-%' ORDER BY context "; 205 $results = $db->getAll($sql); 206 if(DB::IsError($results)) { 207 die($results->getDebugInfo() . "SQL - <br /> $sql" ); 208 } 209 215 210 foreach( array_keys($results) as $idx ) 216 211 { … … 220 215 else 221 216 { 222 $results = sql("SELECT DISTINCT SUBSTRING(context,7) FROM extensions WHERE context LIKE 'outrt-%' ORDER BY context ","getAll"); 217 $sql = "SELECT DISTINCT SUBSTRING(context,7) FROM extensions WHERE context LIKE 'outrt-%' ORDER BY context "; 218 $results = $db->getAll($sql); 219 if(DB::IsError($results)) { 220 die($results->getDebugInfo() . "SQL - <br /> $sql" ); 221 } 223 222 } 224 223 return $results; freepbx/branches/2.8/upgrades/2.8.0alpha2/tables.php
r10389 r10770 2 2 global $amp_conf; 3 3 global $db; 4 5 if (!function_exists('sql')) {6 function sql($sql,$type="query",$fetchmode=null) {7 global $db;8 $results = $db->$type($sql,$fetchmode);9 if(DB::IsError($results)) {10 die($results->getDebugInfo() . "SQL - <br /> $sql" );11 }12 return $results;13 }14 }15 4 16 5 /* fix manager.conf settings for older manager.conf files being upgraded as new permissions are needed for later releases of Asterisk … … 69 58 out(_("created")); 70 59 outn(_("migrating rules..")); 71 $patterns = sql('SELECT * FROM trunks_dialpatterns','getAll',DB_FETCHMODE_ASSOC); 60 $sql = 'SELECT * FROM trunks_dialpatterns'; 61 $patterns = $db->getAll($sql,DB_FETCHMODE_ASSOC); 62 if(DB::IsError($patterns)) { 63 die($patterns->getDebugInfo() . "SQL - <br /> $sql" ); 64 } 72 65 $patterns_insert = array(); 73 66 foreach ($patterns as $key => $pattern_rec) { freepbx/branches/2.8/upgrades/2.8.0rc1/custom-context.php
r9922 r10770 25 25 echo $text; 26 26 } 27 }28 29 if (!function_exists('sql')) {30 function sql($sql,$type="query",$fetchmode=null) {31 global $db;32 $results = $db->$type($sql,$fetchmode);33 if(DB::IsError($results)) {34 die($results->getDebugInfo() . "SQL - <br /> $sql" );35 }36 return $results;37 }38 27 } 39 28 … … 66 55 */ 67 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`"; 68 $routes = sql($sql,"getAll",DB_FETCHMODE_ASSOC); 57 $routes = $db->getAll($sql,DB_FETCHMODE_ASSOC); 58 if(DB::IsError($routes)) { 59 die($routes->getDebugInfo() . "SQL - <br /> $sql" ); 60 } 61 69 62 $newincludes = array(); 70 63 foreach ($includes as $inc => $myinclude) {
