-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathuc_csv.install
executable file
·124 lines (119 loc) · 3.35 KB
/
uc_csv.install
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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
<?php
/**
* @file
* This defines our schema for the module
*/
/**
* Implements hook_schema().
*/
function uc_csv_schema() {
$schema['uc_csv_reports'] = array(
'description' => 'A table of configured reports',
'fields' => array(
'rid' => array(
'description' => 'The export report key.',
'type' => 'serial',
'unsigned' => TRUE,
'not null' => TRUE,
),
'report_name' => array(
'description' => 'The name of the report',
'type' => 'varchar',
'length' => 64,
'not null' => TRUE,
),
'last_exported' => array(
'description' => 'The date of the last export',
'mysql_type' => 'datetime',
'type' => 'datetime',
),
'last_order_id' => array(
'description' => 'The last order id exported',
'type' => 'int',
'length' => 11,
'not null' => TRUE,
),
'shipping_address' => array(
'description' => 'Include shipping report in export.',
'type' => 'int',
'length' => 1,
'not null' => TRUE,
),
'billing_address' => array(
'description' => 'Include billing address in export',
'type' => 'int',
'length' => 1,
'not null' => TRUE,
),
'products' => array(
'description' => 'Include products in export',
'type' => 'int',
'length' => 1,
'not null' => TRUE,
),
'orderby' => array(
'description' => 'How the report is to be ordered',
'type' => 'varchar',
'length' => 32,
'not null' => TRUE,
),
'file_type' => array(
'description' => 'The type of file to be exported',
'type' => 'varchar',
'length' => 8,
'not null' => TRUE,
'default' => 'csv',
),
'statuses' => array(
'description' => 'The order statuses to be included in this report',
'type' => 'text',
'size' => 'medium',
'not null' => TRUE,
),
'track' => array(
'description' => 'Should this report track last exports. Boolean.',
'type' => 'int',
'length' => 1,
'not null' => TRUE,
),
'email_enable' => array(
'description' => 'Are we emailing this report when generated',
'type' => 'int',
'length' => 1,
'not null' => TRUE,
),
'email_address' => array(
'description' => 'Email address to send report to.',
'type' => 'varchar',
'length' => 255,
'not null' => TRUE,
),
),
'primary key' => array('rid'),
);
return $schema;
}
/**
* Implements hook_update_last_removed().
*/
function uc_csv_update_last_removed() {
return 7206;
}
/**
* Implements hook_update_N().
*/
function uc_csv_update_1000() {
$config = config('uc_csv.settings');
$config->set('uc_csv_enable_cron', update_variable_get('uc_csv_enable_cron', 'FALSE'));
$config->set('uc_csv_report_interval', update_variable_get('uc_csv_report_interval', '86400'));
$config->set('uc_csv_report_last_export', update_variable_get('uc_csv_report_last_export', ''));
update_variable_del('uc_csv_enable_cron');
update_variable_del('uc_csv_report_interval');
update_variable_del('uc_csv_report_last_export');
}
/**
* Implements hook_install().
*/
function uc_csv_install() {
// Dynamically generated variable data was detected.
}