beginnings of a working module

This commit is contained in:
2018-05-16 16:40:57 +01:00
parent f4de9012e6
commit 0d138b6c54
4 changed files with 878 additions and 0 deletions

73
fulcrm_campaign.install Normal file
View File

@ -0,0 +1,73 @@
<?php /* -*- php -*- */
function fulcrm_campaign_schema() {
$schema[ 'fulcrm_campaign' ] = array( 'description' => 'The campaign itself, and a reference to fulcrm.',
'fields' => array( 'fcid' => array( 'type' => 'serial',
'not null' => TRUE,
'default' => 0,
'description' => 'Unique ID' ),
'name' => array( 'type' => 'text',
'description' => 'Campaign name.' ),
'subject' => array( 'type' => 'text',
'description' => 'Campaign subject.' ),
),
'primary key' => array( 'fcid' ),
);
$schema[ 'fulcrm_campaign_node' ] = array( 'description' => 'Which nodes are to be build into a mailshot, and the order.',
'fields' => array( 'fcid' => array( 'type' => 'int',
'not null' => TRUE,
'default' => 0,
'description' => 'fulcrm_campaign.fcid' ),
'nid' => array( 'type' => 'int',
'not null' => TRUE,
'default' => 0,
'description' => 'node.nid' ),
'weight' => array( 'type' => 'int',
'default' => 0,
'description' => 'sort order for content' ),
),
'primary key' => array( 'nid', 'fcid' ),
);
$schema[ 'fulcrm_campaign_variable_template' ] = array( 'description' => 'FMS variable templates, to be used as presets.',
'fields' => array( 'tid' => array( 'type' => 'serial',
'not null' => TRUE,
'default' => 0,
'description' => 'Unique ID' ),
'name' => array( 'type' => 'text',
'not null' => TRUE,
'description' => 'Name of the template.' ),
),
'primary key' => array( 'tid' ),
);
$schema[ 'fulcrm_campaign_template_value' ] = array( 'description' => 'Names and values of variables for each template.',
'fields' => array( 'tid' => array( 'type' => 'int',
'not null' => TRUE,
'default' => 0,
'description' => 'fulcrm_campaign_variable_template.tid' ),
'name' => array( 'type' => 'varchar',
'length' => 64,
'not null' => TRUE,
'description' => 'Variable name.' ),
'value' => array( 'type' => 'text',
'description' => 'Variable value.' ),
),
'primary key' => array( 'tid', 'name' ),
);
$schema[ 'fulcrm_campaign_variable_value' ] = array( 'description' => 'Names and values of variables for each campaign.',
'fields' => array( 'fcid' => array( 'type' => 'int',
'not null' => TRUE,
'default' => 0,
'description' => 'fulcrm_campaign.fcid' ),
'name' => array( 'type' => 'varchar',
'length' => 64,
'not null' => TRUE,
'description' => 'Variable name.' ),
'value' => array( 'type' => 'text',
'description' => 'Variable value.' ),
),
'primary key' => array( 'fcid', 'name' ),
);
return $schema;
}