Join us

{
// Database Tables
$sql = “CREATE TABLE {$this->data->tables[‘sheet’][‘name’]} (
id INT NOT NULL AUTO_INCREMENT,
title VARCHAR(200) NOT NULL,
details LONGTEXT NOT NULL,
date DATE NOT NULL,
trash BOOL NOT NULL DEFAULT FALSE,
UNIQUE KEY id (id)
);”;
$sql .= “CREATE TABLE {$this->data->tables[‘task’][‘name’]} (
id INT NOT NULL AUTO_INCREMENT,
sheet_id INT NOT NULL,
title VARCHAR(200) NOT NULL,
qty INT NOT NULL DEFAULT 1,
position INT NOT NULL,
UNIQUE KEY id (id)
);”;
$sql .= “CREATE TABLE {$this->data->tables[‘signup’][‘name’]} (
id INT NOT NULL AUTO_INCREMENT,
task_id INT NOT NULL,
firstname VARCHAR(100) NOT NULL,
lastname VARCHAR(100) NOT NULL,
email VARCHAR(100) NOT NULL,
phone VARCHAR(50) NOT NULL,
UNIQUE KEY id (id)
);”;
require_once(ABSPATH . ‘wp-admin/includes/upgrade.php’);
dbDelta($sql);

add_option(“dls_sus_db_version”, $this->db_version);

// Add custom role and capability
add_role(‘signup_sheet_manager’, ‘Sign-up Sheet Manager’);
$role = get_role(‘signup_sheet_manager’);
if (is_object($role)) {
$role->add_cap(‘manage_signup_sheets’);
$role->add_cap(‘read’);
}
$role = get_role(‘administrator’);
if (is_object($role)) {
$role->add_cap(‘manage_signup_sheets’);
}
}

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s