From 103af88abd049c4694e0fadc30712057060c3a40 Mon Sep 17 00:00:00 2001 From: Adam Varga Date: Wed, 6 Jul 2011 17:30:26 -0400 Subject: [PATCH 1/6] Removing backticks from table name variable in MY_Model.php because they break the dbprefix config setting, and automatically get added by CI elsewhere --- OpenVBX/libraries/MY_Model.php | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/OpenVBX/libraries/MY_Model.php b/OpenVBX/libraries/MY_Model.php index b0e5604c..16fd4a51 100644 --- a/OpenVBX/libraries/MY_Model.php +++ b/OpenVBX/libraries/MY_Model.php @@ -99,13 +99,13 @@ static function search($class, if(isset($search_options['id'])) { - $search_options["`{$table}`.id"] = $search_options['id']; + $search_options["{$table}.id"] = $search_options['id']; unset($search_options['id']); } /* Tenantize */ $ci = &get_instance(); - $search_options["`{$table}`.tenant_id"] = $ci->tenant->id; + $search_options["{$table}.tenant_id"] = $ci->tenant->id; foreach($search_options as $option => $value) { @@ -184,7 +184,7 @@ function set_fields($params) /* Tenantize */ if(!in_array('tenant_id', array_keys($params))) { - $ci->db->set("`{$this->table}`.tenant_id", $this->tenant_id); + $ci->db->set("{$this->table}.tenant_id", $this->tenant_id); } } @@ -202,7 +202,7 @@ function update($id, $params) } /* Tenantize */ - $ci->db->where("`{$this->table}`.tenant_id", $this->tenant_id); + $ci->db->where("{$this->table}.tenant_id", $this->tenant_id); $ci->db->update($this->table); } @@ -221,15 +221,15 @@ function insert($params) if(isset($this->unique) && !empty($this->unique)) { - $ci->db->from("`{$this->table}`"); + $ci->db->from("{$this->table}"); foreach($this->unique as $column) { - $ci->db->where("`{$this->table}`.`{$column}`", isset($this->values[$column])? $this->values[$column] : ''); + $ci->db->where("{$this->table}.`{$column}`", isset($this->values[$column])? $this->values[$column] : ''); } /* Tenantize */ - $ci->db->where("`{$this->table}`.tenant_id", $this->tenant_id); + $ci->db->where("{$this->table}.tenant_id", $this->tenant_id); if(($result = count($ci->db->get()->result())) > 0) { throw new MY_ModelDuplicateException("Duplicate entry exists - $result"); @@ -266,11 +266,11 @@ function delete() foreach($where as $key => $val) { $ci->db - ->where("`{$this->table}`.`{$key}`", $val); + ->where("{$this->table}.`{$key}`", $val); } /* Tenantize */ - $ci->db->where("`{$this->table}`.tenant_id", $this->tenant_id); + $ci->db->where("{$this->table}.tenant_id", $this->tenant_id); $ci->db->delete($this->table); return true; @@ -282,7 +282,7 @@ function delete() $ci = &get_instance(); $ci->db - ->where("`{$this->table}`.id", $this->id) + ->where("{$this->table}.id", $this->id) ->delete($this->table); } From 5a66689b1e264617829eda9dab5a277271a3cd99 Mon Sep 17 00:00:00 2001 From: Adam Varga Date: Tue, 12 Jul 2011 16:32:50 -0400 Subject: [PATCH 2/6] Outputting twiml messages to log as well as speaking it with tts --- OpenVBX/controllers/twiml.php | 1 + 1 file changed, 1 insertion(+) diff --git a/OpenVBX/controllers/twiml.php b/OpenVBX/controllers/twiml.php index 3d16dabe..f42381ba 100644 --- a/OpenVBX/controllers/twiml.php +++ b/OpenVBX/controllers/twiml.php @@ -237,6 +237,7 @@ private function applet($flow_id, $inst_id, $type = 'voice') } catch(Exception $ex) { + error_log($ex->getMessage()); $this->response->addSay('Error: ' + $ex->getMessage()); } From 6ce03cecca8846f3b4b861baf8f63e4e6a7fae69 Mon Sep 17 00:00:00 2001 From: Adam Varga Date: Mon, 18 Jul 2011 10:08:42 -0400 Subject: [PATCH 3/6] Fixing applet icon path --- OpenVBX/libraries/AppletUI.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/OpenVBX/libraries/AppletUI.php b/OpenVBX/libraries/AppletUI.php index 84238b24..23a7fdbd 100644 --- a/OpenVBX/libraries/AppletUI.php +++ b/OpenVBX/libraries/AppletUI.php @@ -114,7 +114,7 @@ public static function dropZone($name = 'dropZone', $label = 'Drop applet here') $plugin_name = $type_parts[0]; $applet_name = $type_parts[1]; - if(is_file('plugins/'.$plugin_name.'/applets'.$applet_name.'/icon.png')) { + if(is_file('plugins/'.$plugin_name.'/applets/'.$applet_name.'/icon.png')) { $icon_url = asset_url('plugins/' . $plugin_name . '/applets/' . $applet_name . '/icon.png'); } else { $icon_url = asset_url('assets/i/icon.png'); From ce494cdb24487c1df5ac1233e0f30e67aeb11cc7 Mon Sep 17 00:00:00 2001 From: Adam Varga Date: Tue, 2 Aug 2011 16:17:38 -0400 Subject: [PATCH 4/6] Fix upgrade script so they work when a dbprefix is set in the config file --- OpenVBX/config/database-sample.php | 1 + updates/47.sql | 4 ++-- updates/48.sql | 4 ++-- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/OpenVBX/config/database-sample.php b/OpenVBX/config/database-sample.php index 2b7c7dd5..cdcc8e90 100644 --- a/OpenVBX/config/database-sample.php +++ b/OpenVBX/config/database-sample.php @@ -46,6 +46,7 @@ $db["default"]["database"] = "OpenVBX"; $db["default"]["dbdriver"] = "mysql"; $db["default"]["dbprefix"] = ""; +$db["default"]["swap_pre"] = "{PRE}"; $db["default"]["pconnect"] = TRUE; $db["default"]["db_debug"] = TRUE; $db["default"]["cache_on"] = FALSE; diff --git a/updates/47.sql b/updates/47.sql index c0746078..7d72aca0 100644 --- a/updates/47.sql +++ b/updates/47.sql @@ -1,2 +1,2 @@ -UPDATE `settings` SET `value` = '0.91' WHERE `name` = 'version'; -UPDATE `settings` SET `value` = 47 WHERE `name` = 'schema-version'; +UPDATE `{PRE}settings` SET `value` = '0.91' WHERE `name` = 'version'; +UPDATE `{PRE}settings` SET `value` = 47 WHERE `name` = 'schema-version'; diff --git a/updates/48.sql b/updates/48.sql index 69a1ed38..2ecd9872 100644 --- a/updates/48.sql +++ b/updates/48.sql @@ -1,2 +1,2 @@ -UPDATE `settings` SET `value` = '0.92' WHERE `name` = 'version'; -UPDATE `settings` SET `value` = 48 WHERE `name` = 'schema-version'; +UPDATE `{PRE}settings` SET `value` = '0.92' WHERE `name` = 'version'; +UPDATE `{PRE}settings` SET `value` = 48 WHERE `name` = 'schema-version'; From e3c0753eb46ed46a27ad1f0345b69f1a8cde1c45 Mon Sep 17 00:00:00 2001 From: Adam Varga Date: Tue, 2 Aug 2011 17:03:44 -0400 Subject: [PATCH 5/6] Merging w/ upstream --- OpenVBX/controllers/twiml.php | 1 - 1 file changed, 1 deletion(-) diff --git a/OpenVBX/controllers/twiml.php b/OpenVBX/controllers/twiml.php index 8713740a..9e8a30db 100644 --- a/OpenVBX/controllers/twiml.php +++ b/OpenVBX/controllers/twiml.php @@ -238,7 +238,6 @@ private function applet($flow_id, $inst_id, $type = 'voice') } catch(Exception $ex) { - error_log($ex->getMessage()); $this->response->addSay('Error: ' + $ex->getMessage()); } From b7f7f24f74a74e8f35704bc4839e71b9fe8cd40e Mon Sep 17 00:00:00 2001 From: Adam Varga Date: Mon, 15 Aug 2011 13:46:22 -0400 Subject: [PATCH 6/6] Keeping update scripts compatible with prefixed database tables --- updates/51.sql | 4 ++-- updates/52.sql | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/updates/51.sql b/updates/51.sql index 011171d8..26c50bb4 100644 --- a/updates/51.sql +++ b/updates/51.sql @@ -1,2 +1,2 @@ -UPDATE `settings` SET `value` = '1.0.2' WHERE `name` = 'version'; -UPDATE `settings` SET `value` = 51 WHERE `name` = 'schema-version'; \ No newline at end of file +UPDATE `{PRE}settings` SET `value` = '1.0.2' WHERE `name` = 'version'; +UPDATE `{PRE}settings` SET `value` = 51 WHERE `name` = 'schema-version'; \ No newline at end of file diff --git a/updates/52.sql b/updates/52.sql index af4f06ca..35930849 100644 --- a/updates/52.sql +++ b/updates/52.sql @@ -1,2 +1,2 @@ -UPDATE `settings` SET `value` = '1.0.3' WHERE `name` = 'version'; -UPDATE `settings` SET `value` = 52 WHERE `name` = 'schema-version'; \ No newline at end of file +UPDATE `{PRE}settings` SET `value` = '1.0.3' WHERE `name` = 'version'; +UPDATE `{PRE}settings` SET `value` = 52 WHERE `name` = 'schema-version'; \ No newline at end of file