| 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 | | |
|---|
| 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 | | } |
|---|