-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.php
More file actions
86 lines (76 loc) · 1.99 KB
/
setup.php
File metadata and controls
86 lines (76 loc) · 1.99 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
81
82
83
84
85
86
<?php /* $Id: setup.php,v 1.1.1.1 2003/12/04 17:53:45 iexposure Exp $ */
/*
dotProject Module
Name: Timesheet
Directory: timesheet
Version: 0.1
Class: user
UI Name: Timesheet
UI Icon:
This file does no action in itself.
If it is accessed directory it will give a summary of the module parameters.
*/
// MODULE CONFIGURATION DEFINITION
$config = array();
$config['mod_name'] = 'Timesheet';
$config['mod_version'] = '0.1';
$config['mod_directory'] = 'timesheet';
$config['mod_setup_class'] = 'CSetupTimesheet';
$config['mod_type'] = 'user';
$config['mod_ui_name'] = 'Timesheet';
$config['mod_ui_icon'] = '';
$config['mod_description'] = 'This is a Timesheet module';
if (@$a == 'setup') {
echo dPshowModuleConfig( $config );
}
require_once dPgetConfig( 'root_dir' ).'/modules/system/syskeys/syskeys.class.php';
/*
// MODULE SETUP CLASS
This class must contain the following methods:
install - creates the required db tables
remove - drop the appropriate db tables
upgrade - upgrades tables from previous versions
*/
class CSetupTimesheet {
/*
Install routine
*/
function install() {
$sql = "
CREATE TABLE timesheet (
timesheet_id int(11) not NULL auto_increment,
user_id int(11) not NULL,
timesheet_date date not NULL,
timesheet_time_in time not NULL,
timesheet_time_out time not NULL,
timesheet_time_break time not NULL,
timesheet_time_break_start time not NULL,
timesheet_note varchar(255),
PRIMARY KEY (timesheet_id)
) TYPE=MyISAM
";
db_exec( $sql );
$sv = new CSysVal( 1, 'BillingCategory', "0|Billable\n1|Unbillable" );
$sv->store();
$sv = new CSysVal( 1, 'WorkCategory', "0|Programming\n1|Design" );
$sv->store();
return true;
}
/*
Removal routine
*/
function remove() {
$sql = "DROP TABLE timesheet";
db_exec( $sql );
//$sql = "DELETE FROM sysvals WHERE sysval_title = 'BillingCategory' or sysval_title = 'WorkCategory'";
//db_exec( $sql );
return true;
}
/*
Upgrade routine
*/
function upgrade() {
return true;
}
}
?>