Changeset 4583
- Timestamp:
- 07/27/07 23:47:40 (1 year ago)
- Files:
-
- modules/branches/2.3/miscapps/functions.inc.php (modified) (1 diff)
- modules/branches/2.3/miscapps/module.xml (modified) (2 diffs)
- modules/branches/2.3/miscapps/uninstall.php (copied) (copied from modules/branches/2.3/miscapps/install.php) (1 diff)
- modules/branches/2.3/miscapps/uninstall.sql (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
modules/branches/2.3/miscapps/functions.inc.php
r4579 r4583 54 54 foreach (array_keys($results) as $idx) { 55 55 $fc = new featurecode('miscapps', 'miscapp_'.$results[$idx]['miscapps_id']); 56 $results[$idx]['ext'] = $fc->get Code();56 $results[$idx]['ext'] = $fc->getDefault(); 57 57 $results[$idx]['enabled'] = $fc->isEnabled(); 58 58 } modules/branches/2.3/miscapps/module.xml
r4581 r4583 2 2 <rawname>miscapps</rawname> 3 3 <name>Misc Applications</name> 4 <version>0.2.3 </version>4 <version>0.2.3.1</version> 5 5 <type>setup</type> 6 6 <category>Internal Options & Configuration</category> … … 12 12 </menuitems> 13 13 <changelog> 14 *0.2.3.1* added proper uninstall, removes any feature codes and then table 14 15 *0.2.3* #1902 miscapp always sets/pulls default code now regardless of custom override in featurecodes 15 16 *0.2.2* added SQLite3 support, fixes http://freepbx.org/trac/ticket/1775 modules/branches/2.3/miscapps/uninstall.php
r4245 r4583 4 4 global $amp_conf; 5 5 6 $autoincrement = (($amp_conf["AMPDBENGINE"] == "sqlite") || ($amp_conf["AMPDBENGINE"] == "sqlite3")) ? "AUTOINCREMENT":"AUTO_INCREMENT"; 7 $sql = "CREATE TABLE IF NOT EXISTS miscapps ( 8 miscapps_id INTEGER NOT NULL PRIMARY KEY $autoincrement, 9 ext VARCHAR( 50 ) , 10 description VARCHAR( 50 ) , 11 dest VARCHAR( 255 ) 12 )"; 13 14 $check = $db->query($sql); 15 if(DB::IsError($check)) { 16 die("Can not create miscdests table\n"); 17 } 18 $results = array(); 19 $sql = "SELECT miscapps_id, dest FROM miscapps"; 20 $results = $db->getAll($sql, DB_FETCHMODE_ASSOC); 21 if (!DB::IsError($results)) { // error - table must not be there 22 foreach ($results as $result) { 23 $old_dest = $result['dest']; 24 $miscapps_id = $result['miscapps_id']; 25 26 $new_dest = merge_ext_followme(trim($old_dest)); 27 if ($new_dest != $old_dest) { 28 $sql = "UPDATE miscapps SET dest = '$new_dest' WHERE miscapps_id = $miscapps_id AND dest = '$old_dest'"; 29 $results = $db->query($sql); 30 if(DB::IsError($results)) { 31 die($results->getMessage()); 32 } 33 } 34 } 6 $miscapps_arr = miscapps_list(); 7 foreach ($miscapps_arr as $item) { 8 echo "removing ".$item['description'].".."; 9 miscapps_delete($item['miscapps_id']); 10 echo "done<br>\n"; 35 11 } 36 12 13 echo "dropping table miscapps.."; 14 sql("DROP TABLE IF EXISTS `miscapps`"); 15 echo "done<br>\n"; 16 37 17 ?> modules/branches/2.3/miscapps/uninstall.sql
r4245 r4583 1 DROP TABLE IF EXISTS `miscapps`;
