Changeset 3950
- Timestamp:
- 05/01/07 09:51:38 (6 years ago)
- Files:
-
- modules/branches/2.3/cidlookup/install.php (modified) (1 diff)
- modules/branches/2.3/cidlookup/install.sql (modified) (1 diff)
- modules/branches/2.3/cidlookup/module.xml (modified) (2 diffs)
- modules/branches/2.3/cidlookup/uninstall.sql (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
modules/branches/2.3/cidlookup/install.php
r2128 r3950 2 2 3 3 global $db; 4 global $amp_conf; 4 5 6 $autoincrement = (($amp_conf["AMPDBENGINE"] == "sqlite") || ($amp_conf["AMPDBENGINE"] == "sqlite3")) ? "AUTOINCREMENT":"AUTO_INCREMENT"; 7 8 // create the tables 9 $sql = "CREATE TABLE IF NOT EXISTS cidlookup ( 10 cidlookup_id INTEGER NOT NULL PRIMARY KEY $autoincrement, 11 description varchar(50) NOT NULL, 12 sourcetype varchar(100) NOT NULL, 13 cache tinyint(1) NOT NULL default '0', 14 deptname varchar(30) default NULL, 15 http_host varchar(30) default NULL, 16 http_port varchar(30) default NULL, 17 http_username varchar(30) default NULL, 18 http_password varchar(30) default NULL, 19 http_path varchar(100) default NULL, 20 http_query varchar(100) default NULL, 21 mysql_host varchar(60) default NULL, 22 mysql_dbname varchar(60) default NULL, 23 mysql_query text, 24 mysql_username varchar(30) default NULL, 25 mysql_password varchar(30) default NULL 26 );"; 27 $check = $db->query($sql); 28 if (DB::IsError($check)) { 29 die( "Can not create `cidlookup` table: " . $check->getMessage() . "\n"); 30 } 31 32 33 $sql = "CREATE TABLE IF NOT EXISTS cidlookup_incoming ( 34 cidlookup_id INT NOT NULL, 35 extension VARCHAR(50), 36 cidnum VARCHAR(30), 37 channel VARCHAR(30) 38 );"; 39 $check = $db->query($sql); 40 if (DB::IsError($check)) { 41 die( "Can not create `cidlookup_incomming` table: " . $check->getMessage() . "\n"); 42 } 43 44 // first update 5 45 $sql = "SELECT cache FROM cidlookup"; 6 46 $check = $db->getRow($sql, DB_FETCHMODE_ASSOC); 7 if (DB::IsError($check)) {47 if (DB::IsError($check)) { 8 48 // add new field 9 $sql = "ALTER TABLE cidlookup ADD cache TINYINT( 1 )NOT NULL DEFAULT 0;";49 $sql = "ALTER TABLE cidlookup ADD cache INTEGER NOT NULL DEFAULT 0;"; 10 50 $result = $db->query($sql); 11 51 if(DB::IsError($result)) { 12 die($result->get DebugInfo());52 die($result->getMessage()); 13 53 } 14 54 } 15 55 56 // second update 57 $sql = "SELECT cidlookup from incoming;"; 58 $check = $db->query($sql); 59 if (DB::IsError($check)) { 60 $sql = "ALTER TABLE incoming ADD cidlookup INT(2);"; 61 $check = $db->query($sql); 62 if (DB::IsError($check)) { 63 die( "Can not alter `incoming` table: " . $check->getMessage() . "\n"); 64 } 65 } 66 67 68 ?> 69 modules/branches/2.3/cidlookup/install.sql
r2128 r3950 1 ALTER TABLE incoming ADD cidlookup INT(2); 2 3 CREATE TABLE IF NOT EXISTS cidlookup ( 4 cidlookup_id int(11) NOT NULL auto_increment, 5 description varchar(50) NOT NULL, 6 sourcetype varchar(100) NOT NULL, 7 cache tinyint(1) NOT NULL default '0', 8 deptname varchar(30) default NULL, 9 http_host varchar(30) default NULL, 10 http_port varchar(30) default NULL, 11 http_username varchar(30) default NULL, 12 http_password varchar(30) default NULL, 13 http_path varchar(100) default NULL, 14 http_query varchar(100) default NULL, 15 mysql_host varchar(60) default NULL, 16 mysql_dbname varchar(60) default NULL, 17 mysql_query text, 18 mysql_username varchar(30) default NULL, 19 mysql_password varchar(30) default NULL, 20 PRIMARY KEY (cidlookup_id) 21 ); 22 23 24 CREATE TABLE IF NOT EXISTS cidlookup_incoming ( 25 cidlookup_id INT NOT NULL, 26 extension VARCHAR(50), 27 cidnum VARCHAR(30), 28 channel VARCHAR(30) 29 ); 1 # empty file, see http://freepbx.org/trac/ticket/1277 modules/branches/2.3/cidlookup/module.xml
r3592 r3950 2 2 <rawname>cidlookup</rawname> 3 3 <name>Caller ID Lookup</name> 4 <version>1. 1.1</version>4 <version>1.2.0</version> 5 5 <description>Allows Caller ID Lookup of incoming calls against different sources (MySQL, HTTP, ENUM, Phonebook Module)</description> 6 6 <type>setup</type> … … 16 16 <info>http://freepbx.org/wiki/CallerIDLookup</info> 17 17 <changelog> 18 *1.2.0* Added SQLite3 support, fixes ticket:1796 (freePBX 2.3 only) 18 19 *1.1.1* Add he_IL translation 19 20 *1.1* First release for FreePBX 2.2 - Fixed compatibility issue with new UI modules/branches/2.3/cidlookup/uninstall.sql
r2128 r3950 1 DROP TABLE cidlookup;2 DROP TABLE cidlookup_incoming;1 DROP TABLE IF EXISTS cidlookup; 2 DROP TABLE IF EXISTS cidlookup_incoming; 3 3 4 4
