forked from gs-connectors/tmgmt_globalsight
-
Notifications
You must be signed in to change notification settings - Fork 0
/
tmgmt_globalsight.install
69 lines (61 loc) · 1.89 KB
/
tmgmt_globalsight.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
<?php
/**
* Implements hook_requirements().
*/
function tmgmt_globalsight_requirements($phase) {
$requirements = array();
// Ensure translations don't break during installation.
$t = get_t();
// Report Drupal version
if ($phase == 'runtime') {
if (!file_exists(drupal_get_path('module', 'tmgmt_globalsight') . '/lib/nusoap/lib/nusoap.php')) {
$requirements['nusoap'] = array(
'title' => $t('Nusoap library'),
'description' => $t('Nusoap library was not installed. Please download it from !url. For more information, please refer to README.txt.', array('!url' => l('Sourceforge', 'http://sourceforge.net/projects/nusoap/'))),
'value' => $t('Not found!'),
'severity' => REQUIREMENT_ERROR,
);
}
}
return $requirements;
}
/**
* Implements hook_schema().
*/
function tmgmt_globalsight_schema() {
$schema['tmgmt_globalsight'] = array(
'description' => 'A translation job represents a translation order that can be assigned to a translator.',
'fields' => array(
'tjid' => array(
'description' => 'The identifier of the translation job.',
'type' => 'int',
'not null' => TRUE,
),
'job_name' => array(
'description' => 'GlobalSight Job Name.',
'type' => 'varchar',
'length' => 255,
'not null' => TRUE,
),
'status' => array(
'description' => 'The state of the translation job.',
'type' => 'int',
'not null' => TRUE,
'size' => 'tiny',
'unsigned' => TRUE,
),
),
'primary key' => array('tjid'),
'indexes' => array(
'status' => array('status'),
),
);
return $schema;
}
/**
* Removes job_id status and profile ID fields from {tmgmt_globalsight} table.
*/
function tmgmt_globalsight_update_7100() {
db_drop_field('tmgmt_globalsight', 'job_id');
db_drop_field('tmgmt_globalsight', 'profile_id');
}