/[drupal]/contributions/modules/casetracker_work/casetracker_work.install
ViewVC logotype

Contents of /contributions/modules/casetracker_work/casetracker_work.install

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.2 - (show annotations) (download) (as text)
Mon Mar 31 09:58:36 2008 UTC (19 months, 4 weeks ago) by sime
Branch: MAIN
CVS Tags: HEAD
Branch point for: DRUPAL-5
Changes since 1.1: +28 -15 lines
File MIME type: text/x-php
* Gone through and revitalized code.
* added views support, more could be done.
1 <?php
2 /* $Id$ */
3
4 function casetracker_work_install() {
5 switch ($GLOBALS['db_type']) {
6 case 'mysql':
7 case 'mysqli':
8 db_query("CREATE TABLE casetracker_work (
9 ctwid int(10) unsigned NOT NULL auto_increment,
10 nid int(10) unsigned NOT NULL default '0',
11 uid int(10) unsigned NOT NULL default '0',
12 tid int(10) unsigned NOT NULL default '0',
13 start int(12) unsigned default '0',
14 finish int(12) unsigned default '0',
15 duration int(12) unsigned default NULL,
16 rate varchar(15) NOT NULL default '',
17 locked int(2) unsigned default '0',
18 activity text,
19 PRIMARY KEY (ctwid)
20 ) /*!40100 DEFAULT CHARACTER SET UTF8 */ ");
21 break;
22 }
23 $ret = array();
24 $ret = db_query("ALTER TABLE {users} ADD casetracker_rate varchar(15) NOT NULL default ''");
25 return $ret;
26 }
27
28 /**
29 * Implementation of hook_uninstall().
30 */
31 function casetracker_work_uninstall() {
32
33 $ret = array();
34 $ret[] = db_query('DROP TABLE {casetracker_work}');
35 $ret[] = db_query('ALTER TABLE {users} DROP casetracker_rate');
36
37 $variables = array(
38 );
39 foreach ($variables as $variable) {
40 variable_del($variable);
41 }
42 return $ret;
43 }

  ViewVC Help
Powered by ViewVC 1.1.2