/** * Prepare DB for application settings * @return mixed */ public function prepare() { db()->execute("\n CREATE TABLE IF NOT EXISTS `email_distribution` (\n `distribution_id` int(11) NOT NULL AUTO_INCREMENT,\n `template_id` int(11) NOT NULL,\n `status` int(11) DEFAULT '0',\n `recipient_count` int(11) DEFAULT '0',\n `bounce_count` int(11) DEFAULT '0',\n `open_count` int(11) DEFAULT '0',\n `click_count` int(11) DEFAULT '0',\n `ts` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,\n `finished` datetime NOT NULL,\n `active` int(11) NOT NULL DEFAULT '0',\n PRIMARY KEY (`distribution_id`)\n ) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8;\n "); db()->execute("\n CREATE TABLE IF NOT EXISTS `email_letter` (\n `letter_id` int(11) NOT NULL AUTO_INCREMENT,\n `distribution_id` int(11) NOT NULL,\n `template_id` int(11) NOT NULL,\n `recipient` varchar(50) NOT NULL,\n `status` int(11) DEFAULT '0',\n `ts` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,\n PRIMARY KEY (`letter_id`)\n ) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8;\n "); db()->execute("\n CREATE TABLE IF NOT EXISTS `email_template` (\n `template_id` int(11) NOT NULL AUTO_INCREMENT,\n `content` text NOT NULL,\n `locale` varchar(5) NOT NULL DEFAULT 'en',\n `ts` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,\n PRIMARY KEY (`template_id`)\n ) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8;\n "); return parent::prepare(); }
public function prepare() { $social =& $this->system->module('social'); db()->createField($this, $social->dbTable, 'dbGroupIdField', 'INT(11)'); $adminUser = '******'; // Try to find generic user $admin = $this->query->entity($social->dbTable)->where($social->dbEmailField, $adminUser)->first(); // Add admin group id value if (isset($admin) && $admin[$this->dbGroupIdField] != 1) { $admin[$this->dbGroupIdField] = 1; $admin->save(); } return parent::prepare(); }
/** @see \samson\core\ExternalModule::init() */ public function prepare(array $params = null) { Event::subscribe('samsoncms.input.material.confirm', array($this, 'inputConfirm')); Event::subscribe('samsoncms.material.form.created', array($this, 'tabBuilder')); return parent::prepare($params); }