public $from_name;
public $owner_id;
public $is_system;
+ public $active;
+ public $bcc_group;
+ public $test_class;
+
+
+
/* the code above is auto generated do not remove the tag below */
###END_AUTOCODE
* @param Object|Array $obj Object (or array) to send @see Pman_Core_Mailer
* + subject
* + rcpts || person << if person is set - then it goes to them...
+ * + rcpts_group (string) << name of group - normally to send admin emails.. (if set, then bcc_group is ignored.)
* + replace_links
* + template
* + mailer_opts
*
* @param bool $force - force re-creation of cached version of email.
*
- * @returns Pman_Core_Mailer
+ * @returns Pman_Core_Mailer||PEAR_Error
*/
function toMailer($obj,$force=false)
{
-
+ $p = new PEAR();
$contents = (array)$obj;
+
if(empty($this->id) && !empty($contents['template'])){
$this->get('name', $contents['template']);
}
if(empty($this->id)){
- $p = new PEAR();
+
return $p->raiseError("template [{$contents['template']}] has not been set");
}
+ // fill in BCC
+ if (!empty($this->bcc_group) && empty($contents['rcpts_group'])) {
+ $admin = DB_DAtaObject::Factory('groups')->lookupMembers($this->bcc_group,'email');
+ if (empty($admin)) {
+ return $p->raiseError("template [{$contents['template']}] - bcc group is empty");
+ }
+ $contents->bcc = $admin ;
+ }
+ if (!empty($contents['rcpts_group'])) {
+
+ $admin = DB_DAtaObject::Factory('groups')->lookupMembers($contents['rcpts_group'],'email');
+
+ if (empty($admin)) {
+ return $p->raiseError("Trying to send to {$contents['rcpts_group']} - group is empty");
+ }
+ $contents['rcpts'] = $admin;
+ }
+
+
+
if(empty($contents['subject'])){
$contents['subject'] = $this->subject;
}
}
+ // fixme - this is now in core/udatedatabase..
+
+ function initMail($mail_template_dir, $name, $master='')
+ {
+ $cm = DB_DataObject::factory('core_email');
+ if ($cm->get('name', $name)) {
+ return;
+ }
+
+// $basedir = $this->bootLoader->rootDir . $mail_template_dir;
+
+ $opts = array();
+
+ $opts['file'] = $mail_template_dir. $name .'.html';
+ if (!empty($master)) {
+ $opts['master'] = $mail_template_dir . $master .'.html';
+ }
+ print_r($opts);
+ require_once 'Pman/Core/Import/Core_email.php';
+ $x = new Pman_Core_Import_Core_email();
+ $x->get('', $opts);
+
+ }
+
+
}
}
} else {
- $person = 'Person';
+
+ $person = $au->tableName(); //'Person'; -- projects may not use person as the auth table...
$cfg = HTML_FlexyFramework::get()->Pman;
if (!empty($cfg['authTable'])) {
$person =$cfg['authTable'];
'm' => array(
'USD', 'HKD', 'GBP', 'CNY', 'SGD', 'JPY'
),
+ 'p' => '*',
'add_l'=> array(), // key -> value additional languages...
'add_c'=> array(), // additional countries...(eg. '-R' => 'Regional' )
'add_m'=> array(), // additional currencies...
+ 'add_p'=> array(), // additional currencies...
);
}
$ret[] = '**';
break;
+ case 'p':
+ require_once 'I18Nv2/PhonePrefix.php';
+ $c = new I18Nv2_PhonePrefix('en');
+ $ret = array_keys($c->codes);
+ if (!empty($cfg['add_p'])) {
+ $ret = array_merge($ret, array_keys($cfg['add_p']));
+ }
+ $ret[] = '**';
+ break;
}
{
$cfg = $this->cfg();
- //print_r($cfg);
if ($ltype === false) {
// trigger all builds.
//DB_DataObject::debugLevel(1);
$this->buildDB('c');
$this->buildDB('l');
$this->buildDB('m');
+ $this->buildDB('p', 'en');
return;
}
$complete = $x->fetchAll('lkey');
$list = $this->availableCodes($ltype);
- //echo '<PRE>'; print_r($list);
foreach($list as $lkey) {
// skip ones we know we have done...
require_once 'I18Nv2/Country.php';
require_once 'I18Nv2/Language.php';
require_once 'I18Nv2/Currency.php';
+ require_once 'I18Nv2/PhonePrefix.php';
$cache[$lang] = array(
'l' => new I18Nv2_Language($lang, 'UTF-8'),
'c' => new I18Nv2_Country($lang, 'UTF-8'),
- 'm' => new I18Nv2_Currency($lang, 'UTF-8')
+ 'm' => new I18Nv2_Currency($lang, 'UTF-8'),
+ 'p' => new I18Nv2_PhonePrefix($lang, 'UTF-8')
);
//echo '<PRE>';print_r(array($lang, $cache[$lang]['c']));
}
/// ctrl not used??
function onUpload($roo)
{
-// echo $_FILES['imageUpload']['type'];exit;
+ //print_r($_FILES); echo $_FILES['imageUpload']['type'];exit;
if (empty($_FILES['imageUpload']['tmp_name']) ||
empty($_FILES['imageUpload']['name']) ||
empty($_FILES['imageUpload']['type'])
--- // core comapy types - use core enums (Company Type)
-DROP TABLE core_company_type;
-
-
-CREATE TABLE core_event_audit (
- id int(11) NOT NULL AUTO_INCREMENT,
- PRIMARY KEY (id)
-);
-
-ALTER TABLE core_event_audit ADD COLUMN event_id int(11) NOT NULL DEFAULT 0;
-ALTER TABLE core_event_audit ADD COLUMN name varchar(128) NOT NULL DEFAULT '';
-ALTER TABLE core_event_audit ADD COLUMN old_audit_id int(11) NOT NULL DEFAULT 0;
-ALTER TABLE core_event_audit ADD COLUMN newvalue BLOB NOT NULL DEFAULT '';
-ALTER TABLE core_event_audit ADD INDEX lookup(event_id, name, old_audit_id);
-
--- BC name..
-RENAME TABLE Group_Members TO group_members;
-
-CREATE TABLE group_members (
- id int(11) NOT NULL AUTO_INCREMENT,
- PRIMARY KEY (id)
-);
-ALTER TABLE group_members ADD COLUMN group_id int(11) default NULL;
-ALTER TABLE group_members ADD COLUMN user_id int(11) NOT NULL default 0;
-
--- BC name..
-RENAME TABLE Group_Rights TO group_rights;
-
-
-CREATE TABLE group_rights (
- id int(11) NOT NULL AUTO_INCREMENT,
- PRIMARY KEY (id)
-);
-ALTER TABLE group_rights ADD COLUMN rightname varchar(64) NOT NULL DEFAULT '';
-ALTER TABLE group_rights ADD COLUMN group_id int(11) NOT NULL DEFAULT 0;
-ALTER TABLE group_rights ADD COLUMN accessmask varchar(10) NOT NULL DEFAULT '';
-
-#old mysql.
-ALTER TABLE group_rights CHANGE COLUMN AccessMask accessmask varchar(10) NOT NULL DEFAULT '';
-
-
-
-
-CREATE TABLE Groups (
- id int(11) NOT NULL auto_increment,
- PRIMARY KEY (id)
-);
-ALTER TABLE Groups ADD COLUMN name varchar(64) NOT NULL DEFAULT '';
-ALTER TABLE Groups ADD COLUMN type int(11) NOT NULL DEFAULT 0;
-ALTER TABLE Groups ADD COLUMN leader int(11) NOT NULL default 0;
-#old mysql..
-update Groups set type=0 where type is null;
+-- file is not really used any more..
-ALTER TABLE Groups CHANGE COLUMN type type int(11) NOT NULL default 0;
+-- // core comapy types - use core enums (Company Type)
+DROP TABLE core_company_type;
-
-
-
-CREATE TABLE Office (
- id int(11) NOT NULL auto_increment,
-
- PRIMARY KEY (id)
-);
-
-
-ALTER TABLE Office ADD COLUMN company_id int(11) NOT NULL default '0';
-ALTER TABLE Office ADD COLUMN name varchar(64) NOT NULL DEFAULT '';
-ALTER TABLE Office ADD COLUMN address text ;
-ALTER TABLE Office ADD COLUMN address2 TEXT;
-ALTER TABLE Office ADD COLUMN address3 TEXT;
-ALTER TABLE Office ADD COLUMN phone varchar(32) NOT NULL DEFAULT '';
-ALTER TABLE Office ADD COLUMN fax varchar(32) NOT NULL DEFAULT '';
-ALTER TABLE Office ADD COLUMN email varchar(128) NOT NULL DEFAULT '';
-ALTER TABLE Office ADD COLUMN role varchar(32) NOT NULL DEFAULT '';
-ALTER TABLE Office ADD COLUMN country VARCHAR(4) NULL;
-
-ALTER TABLE Office ADD COLUMN display_name VARCHAR(4) NULL;
-
-
-CREATE TABLE Projects (
- id int(11) NOT NULL auto_increment,
- PRIMARY KEY (id)
-
-) ;
-
-
-
-ALTER TABLE Projects ADD COLUMN name varchar(254) NOT NULL DEFAULT '';
-ALTER TABLE Projects ADD COLUMN remarks text ;
-ALTER TABLE Projects ADD COLUMN owner_id int(11) default NULL;
-ALTER TABLE Projects ADD COLUMN code varchar(32) NOT NULL DEFAULT '';
-ALTER TABLE Projects ADD COLUMN active int(11) default '1';
-ALTER TABLE Projects ADD COLUMN type varchar(1) NOT NULL default 'P';
-ALTER TABLE Projects ADD COLUMN client_id int(11) NOT NULL default '0';
-ALTER TABLE Projects ADD COLUMN team_id int(11) NOT NULL default '0';
-ALTER TABLE Projects ADD COLUMN file_location varchar(254) NOT NULL default '';
-ALTER TABLE Projects ADD COLUMN open_date date default NULL;
-ALTER TABLE Projects ADD COLUMN open_by int(11) NOT NULL default '0';
-ALTER TABLE Projects ADD COLUMN updated_dt DATETIME NOT NULL;
-
--- these should be removed, as they are code specific..
-ALTER TABLE Projects ADD COLUMN countries varchar(128) NOT NULL DEFAULT '';
-ALTER TABLE Projects ADD COLUMN languages varchar(128) NOT NULL DEFAULT '';
-ALTER TABLE Projects ADD COLUMN agency_id int(11) NOT NULL DEFAULT 0 ;
-
-ALTER TABLE Projects ADD INDEX plookup (code);
-
--- we duplicate office_id and company_id here...
--- not sure if we should keep doing that in the new design...
--- we should improve our links code to handle this..
-
-
-CREATE TABLE ProjectDirectory (
- id int(11) NOT NULL auto_increment,
- PRIMARY KEY (id)
-) ;
-
-ALTER TABLE ProjectDirectory ADD COLUMN project_id int(11) NOT NULL DEFAULT 0;
-ALTER TABLE ProjectDirectory ADD COLUMN person_id int(11) NOT NULL DEFAULT 0;
-ALTER TABLE ProjectDirectory ADD COLUMN ispm int(11) NOT NULL DEFAULT 0;
-ALTER TABLE ProjectDirectory ADD COLUMN role varchar(16) NOT NULL DEFAULT '';
-
-ALTER TABLE ProjectDirectory ADD INDEX plookup (project_id,person_id, ispm, role);
-
-
--// old core image type - merged into enum.
DROP TABLE core_image_type;
-CREATE TABLE i18n (
- id int(11) NOT NULL AUTO_INCREMENT,
- PRIMARY KEY (id)
-
-);
-
-ALTER TABLE i18n ADD COLUMN ltype varchar(1) NOT NULL DEFAULT '';
- ALTER TABLE i18n ADD COLUMN lkey varchar(8) NOT NULL DEFAULT '';
- ALTER TABLE i18n ADD COLUMN inlang varchar(8) NOT NULL DEFAULT '';
- ALTER TABLE i18n ADD COLUMN lval varchar(64) NOT NULL DEFAULT '';
-
-ALTER TABLE i18n ADD INDEX lookup (ltype, lkey, inlang);
-CREATE TABLE core_locking (
- id int(11) NOT NULL AUTO_INCREMENT,
- PRIMARY KEY (id)
-);
-ALTER TABLE core_locking ADD COLUMN on_table varchar(64) NOT NULL DEFAULT '';
-ALTER TABLE core_locking ADD COLUMN on_id int(11) NOT NULL DEFAULT 0;
-ALTER TABLE core_locking ADD COLUMN person_id int(11) NOT NULL DEFAULT 0;
-ALTER TABLE core_locking ADD COLUMN created datetime ;
-
-alter table core_locking ADD INDEX lookup(on_table, on_id, person_id, created);
--- oops... - wrong name of pid.
-alter table core_locking change column `int` id int(11) auto_increment not null;
-- ----------------------------
-CREATE TABLE translations (
- id int(11) NOT NULL AUTO_INCREMENT,
- PRIMARY KEY (id)
-);
-
-alter table translations ADD COLUMN module varchar(64) NOT NULL DEFAULT '';
-alter table translations ADD COLUMN tfile varchar(128) NOT NULL DEFAULT '';
-alter table translations ADD COLUMN tlang varchar(8) NOT NULL DEFAULT '';
-alter table translations ADD COLUMN tkey varchar(32) NOT NULL DEFAULT '';
-alter table translations ADD COLUMN tval longtext ;
-
-
-ALTER TABLE translations ADD INDEX qlookup (module, tfile, tlang, tkey);
-
-
-
-CREATE TABLE core_person_alias (
- id int(11) NOT NULL AUTO_INCREMENT,
-
- PRIMARY KEY (id)
-) ;
-ALTER TABLE core_person_alias ADD COLUMN person_id varchar(128) DEFAULT NULL;
-ALTER TABLE core_person_alias ADD COLUMN alias varchar(254) NOT NULL DEFAULT '';
-
-ALTER TABLE core_person_alias ADD INDEX alias (alias);
-
-
-
-CREATE TABLE core_notify_recur (
- id int(11) NOT NULL AUTO_INCREMENT,
-
- PRIMARY KEY (id)
-);
-
-
-ALTER TABLE core_notify_recur ADD COLUMN person_id int(11) NOT NULL;
-ALTER TABLE core_notify_recur ADD COLUMN dtstart datetime NOT NULL;
-ALTER TABLE core_notify_recur ADD COLUMN dtend datetime NOT NULL;
-ALTER TABLE core_notify_recur ADD COLUMN max_applied_dt datetime NOT NULL;
-ALTER TABLE core_notify_recur ADD COLUMN updated_dt datetime NOT NULL;
-ALTER TABLE core_notify_recur ADD COLUMN last_applied_dt datetime NOT NULL;
-ALTER TABLE core_notify_recur ADD COLUMN tz varchar(64) NOT NULL;
-
-ALTER TABLE core_notify_recur ADD COLUMN freq varchar(8) NOT NULL;
-ALTER TABLE core_notify_recur ADD COLUMN freq_day text NOT NULL;
-ALTER TABLE core_notify_recur ADD COLUMN freq_hour text NOT NULL;
-
-ALTER TABLE core_notify_recur ADD COLUMN onid int(11) NOT NULL default 0;
-ALTER TABLE core_notify_recur ADD COLUMN ontable varchar(128) NOT NULL default '';
-ALTER TABLE core_notify_recur ADD COLUMN last_event_id int(11) default 0;
-ALTER TABLE core_notify_recur ADD COLUMN method varchar(128) default '';
-
-ALTER TABLE core_notify_recur ADD COLUMN method_id int(11) default 0;
-
-ALTER TABLE core_notify_recur ADD INDEX lookup(person_id, dtstart, dtend, tz, max_applied_dt, updated_dt, last_applied_dt);
-
--- old design..
-ALTER TABLE core_notify_recur CHANGE COLUMN tz tz varchar(64) NOT NULL;
-
company_id = Companies:id
[core_email]
-owner_id = Person:id
\ No newline at end of file
+owner_id = Person:id
+bcc_group = Groups:id
}
}
- if (!file_exists($fn)) {
-
+ if (!file_exists($fn)) {
$this->validateSize();
}
return true;
}
- // DEFAULT allowed - override with Pman_Core_Images[sizes] => array();
+
+ $ff = HTML_FlexyFramework::get();
$sizes = array(
'100',
'200x0',
'200x200',
'400x0',
- '300x100', // logo on login.
+ '300x100',
'500'
);
- // this should be configurable...
- $ff = HTML_FlexyFramework::get();
-
-
$cfg = isset($ff->Pman_Images) ? $ff->Pman_Images :
(isset($ff->Pman_Core_Images) ? $ff->Pman_Core_Images : array());
-
-
if (!empty($cfg['sizes'])) {
$sizes = array_merge($sizes , $cfg['sizes']);
}
+ $project = $ff->project;
+
+ require_once $ff->project . '.php';
+
+ $project = new $ff->project();
+
+ if(isset($project::$Pman_Core_Images_Size)){
+ $sizes = $project::$Pman_Core_Images_Size;
+ }
if (!in_array($this->size, $sizes)) {
- print_r($sizes);
die("invalid scale - ".$this->size);
}
}
unlink($output);
}
- //var_dump($output);
+
if (!file_exists(dirname($output))) {
mkdir(dirname($output), 0755, true);
}
"name" : "Pman.Dialog.Image",
"parent" : "",
"title" : "",
- "path" : "/home/edward/gitlive/Pman.Core/Pman.Dialog.Image.bjs",
+ "path" : "/home/alan/gitlive/Pman.Core/Pman.Dialog.Image.bjs",
"permname" : "",
"modOrder" : "001",
"strings" : {
});
ret = ret.sort(function(a,b) {
- if (a[0] == '**') return 1; // other always at end..
- if (b[0] == '**') return -1; // other always at end..
+ if (a[0] == '**') { return 1; } // other always at end..
+ if (b[0] == '**') { return -1; } // other always at end..
return a[1] > b[1] ? 1 : -1;
});
params : {
msg : msg,
url : url,
+ source_url : window.location.toString(),
line : line,
col : col,
stack : '' + stack // array???
* request, a url encoded string or a function to call to get either.
* @cfg {Function} success called with ( JSON decoded data of the data.. )
* @cfg {Function} success called with ( JSON decoded data of the data.. )
+* @cfg {Boolean} showFailureDialog (true|false) default true
*/
Pman.Request = function(config){
Roo.extend(Pman.Request, Roo.data.Connection, {
// private
+ showFailureDialog : true,
+
processResponse : function(response) {
// convert the Roo Connection response into JSON data.
if (this.mask && this.maskEl) {
Roo.get(this.maskEl).unmask(true);
}
+ if(!this.showFailureDialog){
+ return;
+ }
if (res !== true) {
var decode = this.processResponse(response);
Roo.log(decode);
+
if (Roo.MessageBox.isVisible()) {
alert(decode && decode.errorMsg ? decode.errorMsg : "Error Sending data - return true from failure to remove message");
return;
- }
+ }
+
Roo.MessageBox.alert("Error", decode && decode.errorMsg ? decode.errorMsg : "Error Sending data");
+
}
}
});
\ No newline at end of file
}
var $opts = false;
+ var $disabled = array();
var $cli = false;
{
PEAR::setErrorHandling(PEAR_ERROR_CALLBACK, array($this, 'onPearError'));
+ $ff = HTML_FlexyFramework::get();
+
+ $this->disabled = explode(',', $ff->disable);
//$this->fixSequencesPgsql();exit;
$this->opts = $opts;
$this->checkOpts($opts);
-
-
if (empty($opts['data-only'])) {
$this->importSQL();
}
$this->runUpdateModulesData();
- if (!empty($opts['add-company'])) {
+ if (!empty($opts['add-company']) && !in_array('Core', $this->disabled)) {
// make sure we have a good cache...?
DB_DataObject::factory('companies')->initCompanies($this, $opts);
foreach($ar as $m) {
- echo "Importing SQL from module $m\n";
+
+ if(in_array($m, $this->disabled)){
+ echo "module $m is disabled \n";
+ continue;
+ }
+
+ echo "Importing SQL from module $m\n";
if (!empty($this->opts['only-module-sql']) && $m != $this->opts['only-module-sql']) {
continue;
}
$this->{$dirmethod}($dburl, $fd);
+
// new -- sql directory..
// new style will not support migrate ... they have to go into mysql-migrate.... directories..
// new style will not support pg.sql etc.. naming - that's what the direcotries are for..
function runUpdateModulesData()
{
-
-
HTML_FlexyFramework::get()->generateDataobjectsCache(true);
- echo "Running jsonImportFromArray\n";
- Pman_Core_UpdateDatabase::jsonImportFromArray($this->opts);
+ if(!in_array('Core', $this->disabled)){
+ echo "Running jsonImportFromArray\n";
+ Pman_Core_UpdateDatabase::jsonImportFromArray($this->opts);
+
+
+ echo "Running updateData on modules\n";
+ // runs core...
+ echo "Core\n";
+ $this->updateData();
+ }
- echo "Running updateData on modules\n";
- // runs core...
- echo "Core\n";
- $this->updateData();
$modules = array_reverse($this->modulesList());
// move 'project' one to the end...
foreach ($modules as $module){
+ if(in_array($module, $this->disabled)){
+ continue;
+ }
$file = $this->rootDir. "/Pman/$module/UpdateDatabase.php";
if($module == 'Core' || !file_exists($file)){
continue;
}
+
+ function initEmails($templateDir, $emails)
+ {
+
+ $pg = HTML_FlexyFramework::get()->page;
+ foreach($emails as $name=>$data) {
+ $cm = DB_DataObject::factory('core_email');
+ $update = $cm->get('name', $name);
+ $old = clone($cm);
+
+ if (empty($cm->bcc_group)) {
+ if (empty($data['bcc_group'])) {
+ $this->jerr("missing bcc_group for template $name");
+ }
+ $g = DB_DataObject::Factory('Groups')->lookup('name',$data['bcc_group']);
+
+ if (!$g) {
+ $this->jerr("bcc_group {$data['bcc_group']} does not exist when importing template $name");
+ }
+ if (!$g->members('email')) {
+ $this->jerr("bcc_group {$data['bcc_group']} does not have any members");
+ }
+
+
+ $cm->bcc_group = $g->id;
+ }
+ if (empty($cm->test_class)) {
+ if (empty($data['test_class'])) {
+ $this->jerr("missing test_class for template $name");
+ }
+ $cm->test_class = $data['test_class'];
+ }
+ require_once $cm->test_class . '.php';
+
+ $clsname = str_replace('/','_', $cm->test_class);
+ try {
+ $method = new ReflectionMethod($clsname , 'test_'. $name) ;
+ $got_it = $method->isStatic();
+ } catch(Exception $e) {
+ $got_it = false;
+
+ }
+ if (!$got_it) {
+ $this->jerr("template {$name} does not have a test method {$clsname}::test_{$name}");
+ }
+ if ($update) {
+ $cm->update($old);
+ echo "email: {$name} - checked\n";
+ continue; /// we do not import the body content of templates that exist...
+ } else {
+ $cm->insert();
+ }
+
+
+ // $basedir = $this->bootLoader->rootDir . $mail_template_dir;
+
+ $opts = array(
+ 'update' => 1,
+ 'file' => $templateDir. $name .'.html'
+ );
+
+ if (!empty($data['master'])) {
+ $opts['master'] = $templateDir . $master .'.html';
+ }
+ require_once 'Pman/Core/Import/Core_email.php';
+ $x = new Pman_Core_Import_Core_email();
+ $x->get('', $opts);
+
+ echo "email: {$name} - CREATED\n";
+ }
+ }
+
+
function updateData()
{
// fill i18n data..
--- /dev/null
+
+CREATE TABLE Groups (
+ id int(11) NOT NULL auto_increment,
+ PRIMARY KEY (id)
+);
+
+ALTER TABLE Groups ADD COLUMN name varchar(64) NOT NULL DEFAULT '';
+ALTER TABLE Groups ADD COLUMN type int(11) NOT NULL DEFAULT 0;
+ALTER TABLE Groups ADD COLUMN leader int(11) NOT NULL default 0;
+#old mysql..
+update Groups set type=0 where type is null;
+
+ALTER TABLE Groups CHANGE COLUMN type type int(11) NOT NULL default 0;
+
+
+
-CREATE TABLE `i18n` (
- `id` int(11) NOT NULL AUTO_INCREMENT,
- `ltype` varchar(1) NOT NULL DEFAULT '',
- `lkey` varchar(8) NOT NULL DEFAULT '',
- `inlang` varchar(8) NOT NULL DEFAULT '',
- `lval` varchar(64) NOT NULL DEFAULT '',
- `is_active` int(1) NOT NULL DEFAULT '1',
- PRIMARY KEY (`id`),
- KEY `lookup` (`ltype`,`lkey`,`inlang`)
-) ENGINE=InnoDB;
+CREATE TABLE i18n (
+ id int(11) NOT NULL AUTO_INCREMENT,
+ PRIMARY KEY (id)
+
+) ENGINE=InnoDB;
+ALTER TABLE i18n ADD COLUMN ltype varchar(1) NOT NULL DEFAULT '';
+ALTER TABLE i18n ADD COLUMN lkey varchar(8) NOT NULL DEFAULT '';
+ALTER TABLE i18n ADD COLUMN inlang varchar(8) NOT NULL DEFAULT '';
+ALTER TABLE i18n ADD COLUMN lval varchar(64) NOT NULL DEFAULT '';
ALTER TABLE i18n ADD COLUMN is_active int(1) NOT NULL DEFAULT 1;
-
\ No newline at end of file
+
+ALTER TABLE i18n ADD INDEX lookup (ltype, lkey, inlang);
--- /dev/null
+
+CREATE TABLE Office (
+ id int(11) NOT NULL auto_increment,
+
+ PRIMARY KEY (id)
+);
+
+
+ALTER TABLE Office ADD COLUMN company_id int(11) NOT NULL default '0';
+ALTER TABLE Office ADD COLUMN name varchar(64) NOT NULL DEFAULT '';
+ALTER TABLE Office ADD COLUMN address text ;
+ALTER TABLE Office ADD COLUMN address2 TEXT;
+ALTER TABLE Office ADD COLUMN address3 TEXT;
+ALTER TABLE Office ADD COLUMN phone varchar(32) NOT NULL DEFAULT '';
+ALTER TABLE Office ADD COLUMN fax varchar(32) NOT NULL DEFAULT '';
+ALTER TABLE Office ADD COLUMN email varchar(128) NOT NULL DEFAULT '';
+ALTER TABLE Office ADD COLUMN role varchar(32) NOT NULL DEFAULT '';
+ALTER TABLE Office ADD COLUMN country VARCHAR(4) NULL;
+
+ALTER TABLE Office ADD COLUMN display_name VARCHAR(4) NULL;
+
--- /dev/null
+
+CREATE TABLE Projects (
+ id int(11) NOT NULL auto_increment,
+ PRIMARY KEY (id)
+
+) ;
+
+
+
+ALTER TABLE Projects ADD COLUMN name varchar(254) NOT NULL DEFAULT '';
+ALTER TABLE Projects ADD COLUMN remarks text ;
+ALTER TABLE Projects ADD COLUMN owner_id int(11) default NULL;
+ALTER TABLE Projects ADD COLUMN code varchar(32) NOT NULL DEFAULT '';
+ALTER TABLE Projects ADD COLUMN active int(11) default '1';
+ALTER TABLE Projects ADD COLUMN type varchar(1) NOT NULL default 'P';
+ALTER TABLE Projects ADD COLUMN client_id int(11) NOT NULL default '0';
+ALTER TABLE Projects ADD COLUMN team_id int(11) NOT NULL default '0';
+ALTER TABLE Projects ADD COLUMN file_location varchar(254) NOT NULL default '';
+ALTER TABLE Projects ADD COLUMN open_date date default NULL;
+ALTER TABLE Projects ADD COLUMN open_by int(11) NOT NULL default '0';
+ALTER TABLE Projects ADD COLUMN updated_dt DATETIME NOT NULL;
+
+-- these should be removed, as they are code specific..
+ALTER TABLE Projects ADD COLUMN countries varchar(128) NOT NULL DEFAULT '';
+ALTER TABLE Projects ADD COLUMN languages varchar(128) NOT NULL DEFAULT '';
+ALTER TABLE Projects ADD COLUMN agency_id int(11) NOT NULL DEFAULT 0 ;
+
+ALTER TABLE Projects ADD INDEX plookup (code);
+
\ No newline at end of file
CREATE TABLE core_email (
id INT(11) NOT NULL AUTO_INCREMENT ,
- subject TEXT NULL ,
- bodytext TEXT NULL ,
- plaintext TEXT NULL ,
+ subject TEXT ,
+ bodytext TEXT ,
+ plaintext TEXT ,
name VARCHAR(255) NOT NULL DEFAULT '',
updated_dt DATETIME NOT NULL ,
from_email VARCHAR(254) NULL DEFAULT '',
PRIMARY KEY (id)
);
+ALTER TABLE core_email ADD COLUMN active INT(2) default 1;
-call mysql_change_engine('core_email');
+-- need to store BCC data here.
+ALTER TABLE core_email ADD COLUMN bcc_group INT(11) default 0;
+-- each email template should have a test class with a static method ::test_{name}
+ALTER TABLE core_email ADD COLUMN test_class VARCHAR(254) default 0;
+
+
+
+
+
+UPDATE core_email SET updated_dt = NOW() where updated_dt IS NULL;
-UPDATE core_email SET updated_dt = NOW();
\ No newline at end of file
--- /dev/null
+
+CREATE TABLE core_event_audit (
+ id int(11) NOT NULL AUTO_INCREMENT,
+ PRIMARY KEY (id)
+);
+
+ALTER TABLE core_event_audit ADD COLUMN event_id int(11) NOT NULL DEFAULT 0;
+ALTER TABLE core_event_audit ADD COLUMN name varchar(128) NOT NULL DEFAULT '';
+ALTER TABLE core_event_audit ADD COLUMN old_audit_id int(11) NOT NULL DEFAULT 0;
+ALTER TABLE core_event_audit ADD COLUMN newvalue BLOB NOT NULL DEFAULT '';
+ALTER TABLE core_event_audit ADD INDEX lookup(event_id, name, old_audit_id);
+
+
+
+
+
--- /dev/null
+
+CREATE TABLE core_locking (
+ id int(11) NOT NULL AUTO_INCREMENT,
+ PRIMARY KEY (id)
+);
+ALTER TABLE core_locking ADD COLUMN on_table varchar(64) NOT NULL DEFAULT '';
+ALTER TABLE core_locking ADD COLUMN on_id int(11) NOT NULL DEFAULT 0;
+ALTER TABLE core_locking ADD COLUMN person_id int(11) NOT NULL DEFAULT 0;
+ALTER TABLE core_locking ADD COLUMN created datetime ;
+
+alter table core_locking ADD INDEX lookup(on_table, on_id, person_id, created);
+-- oops... - wrong name of pid.
+alter table core_locking change column `int` id int(11) auto_increment not null;
\ No newline at end of file
--- /dev/null
+
+CREATE TABLE core_notify_recur (
+ id int(11) NOT NULL AUTO_INCREMENT,
+
+ PRIMARY KEY (id)
+);
+
+
+ALTER TABLE core_notify_recur ADD COLUMN person_id int(11) NOT NULL;
+ALTER TABLE core_notify_recur ADD COLUMN dtstart datetime NOT NULL;
+ALTER TABLE core_notify_recur ADD COLUMN dtend datetime NOT NULL;
+ALTER TABLE core_notify_recur ADD COLUMN max_applied_dt datetime NOT NULL;
+ALTER TABLE core_notify_recur ADD COLUMN updated_dt datetime NOT NULL;
+ALTER TABLE core_notify_recur ADD COLUMN last_applied_dt datetime NOT NULL;
+ALTER TABLE core_notify_recur ADD COLUMN tz varchar(64) NOT NULL;
+
+ALTER TABLE core_notify_recur ADD COLUMN freq varchar(8) NOT NULL;
+ALTER TABLE core_notify_recur ADD COLUMN freq_day text NOT NULL;
+ALTER TABLE core_notify_recur ADD COLUMN freq_hour text NOT NULL;
+
+ALTER TABLE core_notify_recur ADD COLUMN onid int(11) NOT NULL default 0;
+ALTER TABLE core_notify_recur ADD COLUMN ontable varchar(128) NOT NULL default '';
+ALTER TABLE core_notify_recur ADD COLUMN last_event_id int(11) default 0;
+ALTER TABLE core_notify_recur ADD COLUMN method varchar(128) default '';
+
+ALTER TABLE core_notify_recur ADD COLUMN method_id int(11) default 0;
+
+ALTER TABLE core_notify_recur ADD INDEX lookup(person_id, dtstart, dtend, tz, max_applied_dt, updated_dt, last_applied_dt);
+
+-- old design..
+ALTER TABLE core_notify_recur CHANGE COLUMN tz tz varchar(64) NOT NULL;
+
--- /dev/null
+
+CREATE TABLE core_person_alias (
+ id int(11) NOT NULL AUTO_INCREMENT,
+
+ PRIMARY KEY (id)
+) ;
+ALTER TABLE core_person_alias ADD COLUMN person_id varchar(128) DEFAULT NULL;
+ALTER TABLE core_person_alias ADD COLUMN alias varchar(254) NOT NULL DEFAULT '';
+
+ALTER TABLE core_person_alias ADD INDEX alias (alias);
--- /dev/null
+-- BC name..
+RENAME TABLE Group_Members TO group_members;
+
+CREATE TABLE group_members (
+ id int(11) NOT NULL AUTO_INCREMENT,
+ PRIMARY KEY (id)
+);
+ALTER TABLE group_members ADD COLUMN group_id int(11) default NULL;
+ALTER TABLE group_members ADD COLUMN user_id int(11) NOT NULL default 0;
+
+
\ No newline at end of file
--- /dev/null
+RENAME TABLE Group_Rights TO group_rights;
+
+
+CREATE TABLE group_rights (
+ id int(11) NOT NULL AUTO_INCREMENT,
+ PRIMARY KEY (id)
+);
+ALTER TABLE group_rights ADD COLUMN rightname varchar(64) NOT NULL DEFAULT '';
+ALTER TABLE group_rights ADD COLUMN group_id int(11) NOT NULL DEFAULT 0;
+ALTER TABLE group_rights ADD COLUMN accessmask varchar(10) NOT NULL DEFAULT '';
+
+-- old mysql.
+ALTER TABLE group_rights CHANGE COLUMN AccessMask accessmask varchar(10) NOT NULL DEFAULT '';
+
ALTER TABLE ProjectDirectory ADD INDEX plookup (project_id,person_id, ispm, role);
-
\ No newline at end of file
+
+
+
\ No newline at end of file
--- /dev/null
+
+CREATE TABLE translations (
+ id int(11) NOT NULL AUTO_INCREMENT,
+ PRIMARY KEY (id)
+);
+
+alter table translations ADD COLUMN module varchar(64) NOT NULL DEFAULT '';
+alter table translations ADD COLUMN tfile varchar(128) NOT NULL DEFAULT '';
+alter table translations ADD COLUMN tlang varchar(8) NOT NULL DEFAULT '';
+alter table translations ADD COLUMN tkey varchar(32) NOT NULL DEFAULT '';
+alter table translations ADD COLUMN tval longtext ;
+
+
+ALTER TABLE translations ADD INDEX qlookup (module, tfile, tlang, tkey);
+
+
+
function(prop){
// ie!!!.
var el = this.dom, v, cs;
- if(el == document) return null;
+ if(el == document) { return null; }
prop = chkCache(prop);
return (v = el.style[prop]) ? v :
} :
function(prop){
var el = this.dom, m, cs;
- if(el == document) return null;
+ if(el == document) { return null; }
if (prop == 'opacity') {
if (el.style.filter.match) {
if(m = el.style.filter.match(opacityRe)){