Storm, the main SuiteDesk module

This commit is contained in:
Manuel Cillero 2017-07-26 15:05:40 +02:00
parent 82d3282b44
commit bcf9ace539
422 changed files with 62462 additions and 0 deletions

View file

@ -0,0 +1,78 @@
<?php
/**
* @file
*/
function stormevent_install() {
drupal_install_schema('stormevent');
variable_set('node_options_stormevent', array('status'));
$attributes = array();
$attributes['Event type'] = array(
'event' => 'event',
'diary' => 'diary',
'plan' => 'plan',
'meeting' => 'meeting',
'call' => 'call',
'email' => 'email',
);
$attributes['Event type search'] = array(
'-' => 'all',
'event' => 'event',
'diary' => 'diary',
'plan' => 'plan',
'meeting' => 'meeting',
'call' => 'call',
'email' => 'email',
);
$s = "INSERT INTO {stormattribute} (domain, akey, avalue, weight) VALUES ('%s', '%s', '%s', %d)";
$prevdomain = '';
$weight = 0;
foreach ($attributes as $domain => $attribute) {
if ($domain != $prevdomain) $weight=0;
foreach ($attribute as $key => $value) {
db_query($s, $domain, $key, $value, $weight);
$weight++;
}
$prevdomain = $domain;
}
}
function stormevent_disable() {
drupal_set_message(t('Nodes of type "event" have not been deleted on disabling SuiteDesk event. Please note that they will now have reduced functionality, and will not be protected by SuiteDesk event access controls.'), 'warning');
}
function stormevent_uninstall() {
drupal_uninstall_schema('stormevent');
}
function stormevent_schema() {
$schema['stormevent'] = array(
'fields' => array(
'vid' => array('type' => 'int', 'not null' => TRUE, 'default' => 0),
'nid' => array('type' => 'int', 'not null' => TRUE, 'default' => 0),
'organization_nid' => array('type' => 'int'),
'organization_title' => array('type' => 'varchar', 'length' => 128),
'project_nid' => array('type' => 'int'),
'project_title' => array('type' => 'varchar', 'length' => 128),
'task_nid' => array('type' => 'int'),
'task_title' => array('type' => 'varchar', 'length' => 128),
'eventtype' => array('type' => 'varchar', 'length' => 100),
'version' => array('type' => 'varchar', 'length' => 12),
'event_access' => array('type' => 'int', 'default' => 0),
),
'primary key' => array('vid'),
'indexes' => array(
'nid' => array('nid'),
'organization_nid' => array('organization_nid'),
'project_nid' => array('project_nid'),
'task_nid' => array('task_nid'),
),
);
return $schema;
}