-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.php
More file actions
executable file
·80 lines (72 loc) · 1.91 KB
/
setup.php
File metadata and controls
executable file
·80 lines (72 loc) · 1.91 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
<?php
$config = array();
$config['mod_name'] = 'Tickets';
$config['mod_version'] = '2.0';
$config['mod_directory'] = 'ticketsmith';
$config['mod_setup_class'] = 'CSetupTickets';
$config['mod_type'] = 'user';
$config['mod_ui_name'] = 'Tickets';
$config['mod_ui_icon'] = '';
$config['mod_description'] = 'A module for tracking tickets';
class CSetupTickets {
function install() {
$sql = " (
ticket int(10) unsigned DEFAULT '0' NOT NULL auto_increment,
author varchar(100) DEFAULT '' NOT NULL,
recipient varchar(100) DEFAULT '' NOT NULL,
subject varchar(100) DEFAULT '' NOT NULL,
attachment tinyint(1) unsigned DEFAULT '0' NOT NULL,
timestamp int(10) unsigned DEFAULT '0' NOT NULL,
type varchar(15) DEFAULT '' NOT NULL,
assignment int(10) unsigned DEFAULT '0' NOT NULL,
parent int(10) unsigned DEFAULT '0' NOT NULL,
activity int(10) unsigned DEFAULT '0' NOT NULL,
priority tinyint(1) unsigned DEFAULT '1' NOT NULL,
cc varchar(100) DEFAULT '' NOT NULL,
body text NOT NULL,
signature text,
PRIMARY KEY (ticket),
KEY parent (parent),
KEY type (type)
)";
$q = new DBQuery;
$q->createTable('tickets');
$q->createDefinition($sql);
$q->exec();
$q->clear();
return db_error();
}
function remove() {
$q = new DBQuery;
$q->dropTable('tickets');
$q->exec();
$q->clear();
return db_error();
}
function upgrade($old_version) {
$q = new DBQuery;
switch ($old_version) {
case '1.0.0':
$q->addTable('sysvals');
$q->addInsert('sysval_key_id', 1);
$q->addInsert('sysval_title', 'TicketsStatus');
$q->addInsert('sysval_value', 'Open|Open
Processing|Processing
Closed|Closed
Deleted|Deleted');
$q->exec();
$q->clear();
$q->addTable('sysvals');
$q->addInsert('sysval_key_id', 1);
$q->addInsert('sysval_title', 'TicketsPriority');
$q->addInsert('sysval_value', '0|Low
1|Normal
2|High
3|Highest
4|Showstopper');
$q->exec();
$q->clear();
}
return true;
}
}