diff --git a/codepot/etc/codepot.mysql b/codepot/etc/codepot.mysql index befeda3e..d74846a0 100644 --- a/codepot/etc/codepot.mysql +++ b/codepot/etc/codepot.mysql @@ -187,6 +187,11 @@ CREATE TABLE file_list ( md5sum CHAR(32) NOT NULL, description VARCHAR(255) NOT NULL, + createdon DATETIME NOT NULL, + updatedon DATETIME NOT NULL, + createdby VARCHAR(32) NOT NULL, + updatedby VARCHAR(32) NOT NULL, + INDEX file_list_id (projectid, name), UNIQUE KEY file_list_fileid (projectid, filename), UNIQUE KEY (encname), diff --git a/codepot/etc/codepot.oracle b/codepot/etc/codepot.oracle index 9b4a5c12..37c083d8 100644 --- a/codepot/etc/codepot.oracle +++ b/codepot/etc/codepot.oracle @@ -170,6 +170,10 @@ CREATE TABLE "cpot_file_list" ( "encname" VARCHAR(255) NOT NULL, "md5sum" CHAR(32) NOT NULL, "description" CLOB NOT NULL, + "createdon" TIMESTAMP NOT NULL, + "updatedon" TIMESTAMP NOT NULL, + "createdby" VARCHAR(32) NOT NULL, + "updatedby" VARCHAR(32) NOT NULL, UNIQUE ("projectid", "filename"), UNIQUE ("encname"), CONSTRAINT file_list_projectid FOREIGN KEY ("projectid","name") REFERENCES "cpot_file"("projectid","name") diff --git a/codepot/etc/codepot.pgsql b/codepot/etc/codepot.pgsql index 4a629774..866ba030 100644 --- a/codepot/etc/codepot.pgsql +++ b/codepot/etc/codepot.pgsql @@ -225,6 +225,11 @@ CREATE TABLE file_list ( md5sum CHAR(32) NOT NULL, description VARCHAR(255) NOT NULL, + createdon TIMESTAMP NOT NULL, + updatedon TIMESTAMP NOT NULL, + createdby VARCHAR(32) NOT NULL, + updatedby VARCHAR(32) NOT NULL, + UNIQUE (projectid, filename), UNIQUE (encname), diff --git a/codepot/src/codepot/helpers/codepot_helper.php b/codepot/src/codepot/helpers/codepot_helper.php index c05a0d86..7165593e 100644 --- a/codepot/src/codepot/helpers/codepot_helper.php +++ b/codepot/src/codepot/helpers/codepot_helper.php @@ -28,6 +28,50 @@ if ( ! function_exists('codepot_merge_path')) } } +if ( ! function_exists('codepot_nowtodbdate')) +{ + function codepot_nowtodbdate() + { + if (CODEPOT_DATABASE_STORE_GMT) + { + return gmstrftime('%Y-%m-%d %H:%M:%S'); + } + else + { + return gmstrftime('%Y-%m-%d %H:%M:%S'); + } + } +} + +if ( ! function_exists('codepot_unixtimetodbdate')) +{ + function codepot_unixtimetodbdate($unixtime) + { + if (CODEPOT_DATABASE_STORE_GMT) + { + return gmstrftime('%Y-%m-%d %H:%M:%S', $unixtime); + } + else + { + return gmstrftime('%Y-%m-%d %H:%M:%S', $unixtime); + } + } +} + +if ( ! function_exists('codepot_dbdatetodispdate')) +{ + function codepot_dbdatetodispdate($dbdate) + { + if (CODEPOT_DATABASE_STORE_GMT) + { + return strftime('%Y-%m-%d %H:%M:%S %z', strtotime($dbdate . ' +0000')); + } + else + { + return strftime('%Y-%m-%d %H:%M:%S %z', strtotime($dbdate)); + } + } +} if ( !function_exists ('codepot_json_encode')) { diff --git a/codepot/src/codepot/language/english/common_lang.php b/codepot/src/codepot/language/english/common_lang.php index 99b5efe0..1cc34f50 100644 --- a/codepot/src/codepot/language/english/common_lang.php +++ b/codepot/src/codepot/language/english/common_lang.php @@ -98,6 +98,7 @@ $lang['Site'] = 'Site'; $lang['Sites'] = 'Sites'; $lang['Size'] = 'Size'; $lang['Source'] = 'Source'; +$lang['State'] = 'State'; $lang['Status'] = 'Status'; $lang['Summary'] = 'Summary'; $lang['Success'] = 'Success'; diff --git a/codepot/src/codepot/language/indonesian/common_lang.php b/codepot/src/codepot/language/indonesian/common_lang.php index 6e586b10..e8f4fb7e 100644 --- a/codepot/src/codepot/language/indonesian/common_lang.php +++ b/codepot/src/codepot/language/indonesian/common_lang.php @@ -97,6 +97,7 @@ $lang['Site'] = 'Site'; $lang['Sites'] = 'Sites'; $lang['Size'] = 'Ukuran'; $lang['Source'] = 'Sumber'; +$lang['State'] = 'State'; $lang['Status'] = 'Status'; $lang['Success'] = 'Success'; $lang['Summary'] = 'Rangkuman'; diff --git a/codepot/src/codepot/language/korean/common_lang.php b/codepot/src/codepot/language/korean/common_lang.php index c33d886c..660324a0 100644 --- a/codepot/src/codepot/language/korean/common_lang.php +++ b/codepot/src/codepot/language/korean/common_lang.php @@ -97,6 +97,7 @@ $lang['Sign out'] = '로그아웃'; $lang['Site'] = '사이트'; $lang['Sites'] = '사이트'; $lang['Size'] = '크기'; +$lang['State'] = '현황'; $lang['Status'] = '상태'; $lang['Source'] = '소스'; $lang['Success'] = '성공'; diff --git a/codepot/src/codepot/models/codereviewmodel.php b/codepot/src/codepot/models/codereviewmodel.php index 66e6527e..929f4a65 100644 --- a/codepot/src/codepot/models/codereviewmodel.php +++ b/codepot/src/codepot/models/codereviewmodel.php @@ -59,8 +59,8 @@ class CodeReviewModel extends Model $this->db->set ('rev', $revision); $this->db->set ('sno', $newsno); $this->db->set ('comment', $comment); - $this->db->set ('createdon', date('Y-m-d H:i:s')); - $this->db->set ('updatedon', date('Y-m-d H:i:s')); + $this->db->set ('createdon', codepot_nowtodbdate()); + $this->db->set ('updatedon', codepot_nowtodbdate()); $this->db->set ('createdby', $userid); $this->db->set ('updatedby', $userid); $this->db->insert ('code_review'); @@ -70,7 +70,7 @@ class CodeReviewModel extends Model $this->db->trans_rollback (); return FALSE; } - /*$this->db->set ('createdon', date('Y-m-d H:i:s')); + /*$this->db->set ('createdon', codepot_nowtodbdate()); $this->db->set ('type', 'code_review'); $this->db->set ('action', 'insert'); $this->db->set ('projectid', $projectid); @@ -98,7 +98,7 @@ class CodeReviewModel extends Model $this->db->where ('sno', $sno); if ($strict) $this->db->where ('updatedby', $userid); $this->db->set ('comment', $comment); - $this->db->set ('updatedon', date('Y-m-d H:i:s')); + $this->db->set ('updatedon', codepot_nowtodbdate()); $this->db->set ('updatedby', $userid); $this->db->update ('code_review'); if ($this->db->trans_status() === FALSE) @@ -108,7 +108,7 @@ class CodeReviewModel extends Model return FALSE; } - /*$this->db->set ('createdon', date('Y-m-d H:i:s')); + /*$this->db->set ('createdon', codepot_nowtodbdate()); $this->db->set ('type', 'code_review'); $this->db->set ('action', 'insert'); $this->db->set ('projectid', $projectid); @@ -142,7 +142,7 @@ class CodeReviewModel extends Model return FALSE; } - /*$this->db->set ('createdon', date('Y-m-d H:i:s')); + /*$this->db->set ('createdon', codepot_nowtodbdate()); $this->db->set ('type', 'issue'); $this->db->set ('action', 'delete'); $this->db->set ('projectid', $projectid); diff --git a/codepot/src/codepot/models/filemodel.php b/codepot/src/codepot/models/filemodel.php index b27e2811..0bb6253a 100644 --- a/codepot/src/codepot/models/filemodel.php +++ b/codepot/src/codepot/models/filemodel.php @@ -41,7 +41,7 @@ class FileModel extends Model $this->db->where ('projectid', $project->id); $this->db->where ('name', $file->name); - $this->db->select ('filename,encname,md5sum,description'); + $this->db->select ('filename,encname,md5sum,description,createdon,createdby'); $query = $this->db->get('file_list'); if ($this->db->trans_status() === FALSE) { @@ -90,7 +90,7 @@ class FileModel extends Model { $this->db->where ('projectid', $project->id); $this->db->where ('name', $f->name); - $this->db->select ('filename,encname,md5sum,description'); + $this->db->select ('filename,encname,md5sum,description,createdon,createdby'); $query = $this->db->get('file_list'); if ($this->db->trans_status() === FALSE) { @@ -116,13 +116,13 @@ class FileModel extends Model $this->db->set ('tag', $file->tag); $this->db->set ('md5sum', $file->md5sum); $this->db->set ('description', $file->description); - $this->db->set ('createdon', date('Y-m-d H:i:s')); + $this->db->set ('createdon', codepot_nowtodbdate()); $this->db->set ('createdby', $userid); - $this->db->set ('updatedon', date('Y-m-d H:i:s')); + $this->db->set ('updatedon', codepot_nowtodbdate()); $this->db->set ('updatedby', $userid); $this->db->insert ('file'); - $this->db->set ('createdon', date('Y-m-d H:i:s')); + $this->db->set ('createdon', codepot_nowtodbdate()); $this->db->set ('type', 'file'); $this->db->set ('action', 'create'); $this->db->set ('projectid', $file->projectid); @@ -144,7 +144,7 @@ class FileModel extends Model $this->db->set ('name', $file->name); $this->db->set ('tag', $file->tag); $this->db->set ('description', $file->description); - $this->db->set ('updatedon', date('Y-m-d H:i:s')); + $this->db->set ('updatedon', codepot_nowtodbdate()); $this->db->set ('updatedby', $userid); $this->db->update ('file'); // file_list gets updated for the schema itself (reference/trigger) @@ -158,13 +158,13 @@ class FileModel extends Model $this->db->set ('f.name', $file->name); $this->db->set ('f.tag', $file->tag); $this->db->set ('f.description', $file->description); - $this->db->set ('f.updatedon', date('Y-m-d H:i:s')); + $this->db->set ('f.updatedon', codepot_nowtodbdate()); $this->db->set ('f.updatedby', $userid); $this->db->set ('fl.name', $file->name); $this->db->update ('file as f, file_list as fl'); */ - $this->db->set ('createdon', date('Y-m-d H:i:s')); + $this->db->set ('createdon', codepot_nowtodbdate()); $this->db->set ('type', 'file'); $this->db->set ('action', 'update'); $this->db->set ('projectid', $projectid); @@ -226,7 +226,7 @@ class FileModel extends Model return FALSE; } - $this->db->set ('createdon', date('Y-m-d H:i:s')); + $this->db->set ('createdon', codepot_nowtodbdate()); $this->db->set ('type', 'file'); $this->db->set ('action', 'delete'); $this->db->set ('projectid', $projectid); @@ -287,9 +287,9 @@ class FileModel extends Model $this->db->set ('name', $name); $this->db->set ('tag', $tag); $this->db->set ('description', $description); - $this->db->set ('createdon', date('Y-m-d H:i:s')); + $this->db->set ('createdon', codepot_nowtodbdate()); $this->db->set ('createdby', $userid); - $this->db->set ('updatedon', date('Y-m-d H:i:s')); + $this->db->set ('updatedon', codepot_nowtodbdate()); $this->db->set ('updatedby', $userid); $this->db->insert ('file'); if ($this->db->trans_status() === FALSE) @@ -335,9 +335,10 @@ class FileModel extends Model $this->db->set ('name', $name); $this->db->set ('filename', $f['name']); $this->db->set ('encname', $ud['file_name']); - $this->db->set ('md5sum', $md5sum); $this->db->set ('description', $f['desc']); + $this->db->set ('createdby', $userid); + $this->db->set ('createdon', codepot_nowtodbdate()); $this->db->insert ('file_list'); if ($this->db->trans_status() === FALSE) { @@ -348,7 +349,7 @@ class FileModel extends Model } } - $this->db->set ('createdon', date('Y-m-d H:i:s')); + $this->db->set ('createdon', codepot_nowtodbdate()); $this->db->set ('type', 'file'); $this->db->set ('action', 'create'); $this->db->set ('projectid', $projectid); @@ -417,9 +418,10 @@ class FileModel extends Model $this->db->set ('name', $name); $this->db->set ('filename', $f['name']); $this->db->set ('encname', $ud['file_name']); - $this->db->set ('md5sum', $md5sum); $this->db->set ('description', $f['desc']); + $this->db->set ('createdby', $userid); + $this->db->set ('createdon', codepot_nowtodbdate()); $this->db->insert ('file_list'); if ($this->db->trans_status() === FALSE) { @@ -430,7 +432,7 @@ class FileModel extends Model } } - $this->db->set ('createdon', date('Y-m-d H:i:s')); + $this->db->set ('createdon', codepot_nowtodbdate()); $this->db->set ('type', 'file'); $this->db->set ('action', 'update'); $this->db->set ('projectid', $projectid); @@ -510,6 +512,8 @@ class FileModel extends Model $this->db->where ('name', $name); $this->db->where ('filename', $f['name']); $this->db->set ('description', $f['desc']); + $this->db->set ('updatedby', $userid); + $this->db->set ('updatedon', codepot_nowtodbdate()); $this->db->update ('file_list'); if ($this->db->trans_status() === FALSE) { @@ -520,7 +524,7 @@ class FileModel extends Model } } - $this->db->set ('createdon', date('Y-m-d H:i:s')); + $this->db->set ('createdon', codepot_nowtodbdate()); $this->db->set ('type', 'file'); $this->db->set ('action', 'update'); $this->db->set ('projectid', $projectid); diff --git a/codepot/src/codepot/models/issuemodel.php b/codepot/src/codepot/models/issuemodel.php index cc157838..e3c5ab1c 100644 --- a/codepot/src/codepot/models/issuemodel.php +++ b/codepot/src/codepot/models/issuemodel.php @@ -206,8 +206,8 @@ class IssueModel extends Model $this->db->set ('status', $issue->status); $this->db->set ('owner', $issue->owner); $this->db->set ('priority', $issue->priority); - $this->db->set ('createdon', date('Y-m-d H:i:s')); - $this->db->set ('updatedon', date('Y-m-d H:i:s')); + $this->db->set ('createdon', codepot_nowtodbdate()); + $this->db->set ('updatedon', codepot_nowtodbdate()); $this->db->set ('createdby', $userid); $this->db->set ('updatedby', $userid); $this->db->insert ('issue'); @@ -220,11 +220,11 @@ class IssueModel extends Model $this->db->set ('owner', $issue->owner); $this->db->set ('comment', ''); $this->db->set ('priority', $issue->priority); - $this->db->set ('updatedon', date('Y-m-d H:i:s')); + $this->db->set ('updatedon', codepot_nowtodbdate()); $this->db->set ('updatedby', $userid); $this->db->insert ('issue_change'); - $this->db->set ('createdon', date('Y-m-d H:i:s')); + $this->db->set ('createdon', codepot_nowtodbdate()); $this->db->set ('type', 'issue'); $this->db->set ('action', 'create'); $this->db->set ('projectid', $issue->projectid); @@ -245,11 +245,11 @@ class IssueModel extends Model $this->db->where ('id', $issue->id); $this->db->set ('summary', $issue->summary); $this->db->set ('description', $issue->description); - $this->db->set ('updatedon', date('Y-m-d H:i:s')); + $this->db->set ('updatedon', codepot_nowtodbdate()); $this->db->set ('updatedby', $userid); $this->db->update ('issue'); - $this->db->set ('createdon', date('Y-m-d H:i:s')); + $this->db->set ('createdon', codepot_nowtodbdate()); $this->db->set ('type', 'issue'); $this->db->set ('action', 'update'); $this->db->set ('projectid', $issue->projectid); @@ -275,7 +275,7 @@ class IssueModel extends Model $this->db->set ('status', $issue->status); $this->db->set ('owner', $issue->owner); $this->db->set ('priority', $issue->priority); - $this->db->set ('updatedon', date('Y-m-d H:i:s')); + $this->db->set ('updatedon', codepot_nowtodbdate()); $this->db->set ('updatedby', $userid); $this->db->update ('issue'); @@ -287,11 +287,11 @@ class IssueModel extends Model $this->db->set ('owner', $issue->owner); $this->db->set ('priority', $issue->priority); $this->db->set ('comment', ''); - $this->db->set ('updatedon', date('Y-m-d H:i:s')); + $this->db->set ('updatedon', codepot_nowtodbdate()); $this->db->set ('updatedby', $userid); $this->db->update ('issue_change'); - $this->db->set ('createdon', date('Y-m-d H:i:s')); + $this->db->set ('createdon', codepot_nowtodbdate()); $this->db->set ('type', 'issue'); $this->db->set ('action', 'update'); $this->db->set ('projectid', $issue->projectid); @@ -330,7 +330,7 @@ class IssueModel extends Model $this->db->set ('owner', $change->owner); $this->db->set ('priority', $change->priority); $this->db->set ('comment', $change->comment); - $this->db->set ('updatedon', date('Y-m-d H:i:s')); + $this->db->set ('updatedon', codepot_nowtodbdate()); $this->db->set ('updatedby', $userid); $this->db->insert ('issue_change'); @@ -340,11 +340,11 @@ class IssueModel extends Model $this->db->set ('status', $change->status); $this->db->set ('owner', $change->owner); $this->db->set ('priority', $change->priority); - $this->db->set ('updatedon', date('Y-m-d H:i:s')); + $this->db->set ('updatedon', codepot_nowtodbdate()); $this->db->set ('updatedby', $userid); $this->db->update ('issue'); - $this->db->set ('createdon', date('Y-m-d H:i:s')); + $this->db->set ('createdon', codepot_nowtodbdate()); $this->db->set ('type', 'issue'); $this->db->set ('action', 'change'); $this->db->set ('projectid', $project->id); @@ -439,7 +439,7 @@ class IssueModel extends Model $this->db->where ('id', $issue->id); $this->db->delete ('issue'); - $this->db->set ('createdon', date('Y-m-d H:i:s')); + $this->db->set ('createdon', codepot_nowtodbdate()); $this->db->set ('type', 'issue'); $this->db->set ('action', 'delete'); $this->db->set ('projectid', $issue->projectid); @@ -484,8 +484,8 @@ class IssueModel extends Model $this->db->set ('status', $issue->status); $this->db->set ('owner', $issue->owner); $this->db->set ('priority', $issue->priority); - $this->db->set ('createdon', date('Y-m-d H:i:s')); - $this->db->set ('updatedon', date('Y-m-d H:i:s')); + $this->db->set ('createdon', codepot_nowtodbdate()); + $this->db->set ('updatedon', codepot_nowtodbdate()); $this->db->set ('createdby', $userid); $this->db->set ('updatedby', $userid); $this->db->insert ('issue'); @@ -504,7 +504,7 @@ class IssueModel extends Model $this->db->set ('owner', $issue->owner); $this->db->set ('comment', ''); $this->db->set ('priority', $issue->priority); - $this->db->set ('updatedon', date('Y-m-d H:i:s')); + $this->db->set ('updatedon', codepot_nowtodbdate()); $this->db->set ('updatedby', $userid); $this->db->insert ('issue_change'); if ($this->db->trans_status() === FALSE) @@ -562,7 +562,7 @@ class IssueModel extends Model } } - $this->db->set ('createdon', date('Y-m-d H:i:s')); + $this->db->set ('createdon', codepot_nowtodbdate()); $this->db->set ('type', 'issue'); $this->db->set ('action', 'create'); $this->db->set ('projectid', $issue->projectid); @@ -600,7 +600,7 @@ class IssueModel extends Model $this->db->where ('id', $issue->id); $this->db->set ('summary', $issue->summary); $this->db->set ('description', $issue->description); - $this->db->set ('updatedon', date('Y-m-d H:i:s')); + $this->db->set ('updatedon', codepot_nowtodbdate()); $this->db->set ('updatedby', $userid); $this->db->update ('issue'); if ($this->db->trans_status() === FALSE) @@ -610,7 +610,7 @@ class IssueModel extends Model return FALSE; } - $this->db->set ('createdon', date('Y-m-d H:i:s')); + $this->db->set ('createdon', codepot_nowtodbdate()); $this->db->set ('type', 'issue'); $this->db->set ('action', 'update'); $this->db->set ('projectid', $issue->projectid); @@ -679,7 +679,7 @@ class IssueModel extends Model return FALSE; } - $this->db->set ('createdon', date('Y-m-d H:i:s')); + $this->db->set ('createdon', codepot_nowtodbdate()); $this->db->set ('type', 'issue'); $this->db->set ('action', 'delete'); $this->db->set ('projectid', $projectid); @@ -781,7 +781,7 @@ class IssueModel extends Model } } - $this->db->set ('createdon', date('Y-m-d H:i:s')); + $this->db->set ('createdon', codepot_nowtodbdate()); $this->db->set ('type', 'issue'); $this->db->set ('action', 'update'); $this->db->set ('projectid', $projectid); @@ -871,7 +871,7 @@ class IssueModel extends Model } } - $this->db->set ('createdon', date('Y-m-d H:i:s')); + $this->db->set ('createdon', codepot_nowtodbdate()); $this->db->set ('type', 'issue'); $this->db->set ('action', 'update'); $this->db->set ('projectid', $projectid); diff --git a/codepot/src/codepot/models/logmodel.php b/codepot/src/codepot/models/logmodel.php index 524fcec3..5a89e522 100644 --- a/codepot/src/codepot/models/logmodel.php +++ b/codepot/src/codepot/models/logmodel.php @@ -159,7 +159,7 @@ class LogModel extends Model $this->db->set ('action', $log->action); $this->db->set ('projectid', $log->projectid); $this->db->set ('message', $log->message); - $this->db->set ('createdon', date('Y-m-d H:i:s')); + $this->db->set ('createdon', codepot_nowtodbdate()); $this->db->set ('userid', $log->userid); $this->db->insert ('log'); @@ -200,8 +200,7 @@ class LogModel extends Model $now = time(); $one_month_ago = $now - (24 * 60 * 60 * 30); - $this->db->where ('createdon <=', - date ("Y-m-d H:i:s", $one_month_ago)); + $this->db->where ('createdon <=', codepot_unixtimetodate($one_month_ago)); $this->db->delete ('log'); if ($this->db->trans_status() === FALSE) diff --git a/codepot/src/codepot/models/projectmodel.php b/codepot/src/codepot/models/projectmodel.php index b2cc69ee..1fe296c4 100644 --- a/codepot/src/codepot/models/projectmodel.php +++ b/codepot/src/codepot/models/projectmodel.php @@ -146,9 +146,9 @@ class ProjectModel extends Model $this->db->set ('description', $project->description); $this->db->set ('commitable', $project->commitable); $this->db->set ('public', $project->public); - $this->db->set ('createdon', date('Y-m-d H:i:s')); + $this->db->set ('createdon', codepot_nowtodbdate()); $this->db->set ('createdby', $userid); - $this->db->set ('updatedon', date('Y-m-d H:i:s')); + $this->db->set ('updatedon', codepot_nowtodbdate()); $this->db->set ('updatedby', $userid); $this->db->insert ('project'); @@ -173,7 +173,7 @@ class ProjectModel extends Model $this->db->insert ('project_membership'); } - $this->db->set ('createdon', date('Y-m-d H:i:s')); + $this->db->set ('createdon', codepot_nowtodbdate()); $this->db->set ('type', 'project'); $this->db->set ('action', 'create'); $this->db->set ('projectid', $project->id); @@ -262,7 +262,7 @@ class ProjectModel extends Model $this->db->set ('description', $project->description); $this->db->set ('commitable', $project->commitable); $this->db->set ('public', $project->public); - $this->db->set ('updatedon', date('Y-m-d H:i:s')); + $this->db->set ('updatedon', codepot_nowtodbdate()); $this->db->set ('updatedby', $userid); $this->db->update ('project'); @@ -288,7 +288,7 @@ class ProjectModel extends Model $this->db->insert ('project_membership'); } - $this->db->set ('createdon', date('Y-m-d H:i:s')); + $this->db->set ('createdon', codepot_nowtodbdate()); $this->db->set ('type', 'project'); $this->db->set ('action', 'update'); $this->db->set ('projectid', $project->id); @@ -356,7 +356,7 @@ class ProjectModel extends Model $this->db->where ('id', $project->id); $this->db->delete ('project'); - $this->db->set ('createdon', date('Y-m-d H:i:s')); + $this->db->set ('createdon', codepot_nowtodbdate()); $this->db->set ('type', 'project'); $this->db->set ('action', 'delete'); $this->db->set ('projectid', $project->id); diff --git a/codepot/src/codepot/models/sitemodel.php b/codepot/src/codepot/models/sitemodel.php index 967a7a17..e8ac88d8 100644 --- a/codepot/src/codepot/models/sitemodel.php +++ b/codepot/src/codepot/models/sitemodel.php @@ -67,9 +67,9 @@ class SiteModel extends Model $this->db->set ('name', $site->name); $this->db->set ('summary', $site->summary); $this->db->set ('text', $site->text); - $this->db->set ('createdon', date('Y-m-d H:i:s')); + $this->db->set ('createdon', codepot_nowtodbdate()); $this->db->set ('createdby', $userid); - $this->db->set ('updatedon', date('Y-m-d H:i:s')); + $this->db->set ('updatedon', codepot_nowtodbdate()); $this->db->set ('updatedby', $userid); $this->db->insert ('site'); @@ -93,7 +93,7 @@ class SiteModel extends Model $this->db->set ('name', $site->name); $this->db->set ('summary', $site->summary); $this->db->set ('text', $site->text); - $this->db->set ('updatedon', date('Y-m-d H:i:s')); + $this->db->set ('updatedon', codepot_nowtodbdate()); $this->db->set ('updatedby', $userid); $this->db->update ('site'); diff --git a/codepot/src/codepot/models/wikimodel.php b/codepot/src/codepot/models/wikimodel.php index 847e5e4d..ba367764 100644 --- a/codepot/src/codepot/models/wikimodel.php +++ b/codepot/src/codepot/models/wikimodel.php @@ -100,7 +100,7 @@ class WikiModel extends Model // TODO: check if userid can do this.. $this->db->trans_begin (); // manual transaction. not using trans_start(). - $now = date('Y-m-d H:i:s'); + $now = codepot_nowtodbdate(); $this->db->set ('projectid', $wiki->projectid); $this->db->set ('name', $wiki->name); @@ -167,7 +167,7 @@ class WikiModel extends Model // TODO: check if userid can do this.. $this->db->trans_begin (); // manual transaction. not using trans_start(). - $now = date('Y-m-d H:i:s'); + $now = codepot_nowtodbdate(); if (!is_null($new_wiki_name) && $wiki->name != $new_wiki_name) { @@ -293,7 +293,7 @@ class WikiModel extends Model $this->db->where ('name', $wiki->name); $this->db->delete ('wiki'); - $this->db->set ('createdon', date('Y-m-d H:i:s')); + $this->db->set ('createdon', codepot_nowtodbdate()); $this->db->set ('type', 'wiki'); $this->db->set ('action', 'delete'); $this->db->set ('projectid', $wiki->projectid); diff --git a/codepot/src/codepot/views/code_folder.php b/codepot/src/codepot/views/code_folder.php index c27f0577..941f6c2b 100644 --- a/codepot/src/codepot/views/code_folder.php +++ b/codepot/src/codepot/views/code_folder.php @@ -987,7 +987,7 @@ $this->load->view ( print htmlspecialchars($f['last_author']); print ''; print ''; - print date('Y-m-d', $f['time_t']); + print strftime('%Y-%m-%d', $f['time_t']); print ''; print ''; print ''; @@ -1023,8 +1023,7 @@ $this->load->view ( print htmlspecialchars($f['last_author']); print ''; print ''; - //print date('r', $f['time_t']); - print date('Y-m-d', $f['time_t']); + print strftime('%Y-%m-%d', $f['time_t']); print ''; print ''; diff --git a/codepot/src/codepot/views/code_history.php b/codepot/src/codepot/views/code_history.php index 8d163e9b..0265ecbf 100644 --- a/codepot/src/codepot/views/code_history.php +++ b/codepot/src/codepot/views/code_history.php @@ -143,8 +143,7 @@ $this->load->view ( print ''; print ''; - //print date('r', strtotime($h['date'])); - print date('Y-m-d', strtotime($h['date'])); + print strftime('%Y-%m-%d', strtotime($h['date'])); print ''; print ''; diff --git a/codepot/src/codepot/views/code_revision.php b/codepot/src/codepot/views/code_revision.php index 76b2a036..fb638094 100644 --- a/codepot/src/codepot/views/code_revision.php +++ b/codepot/src/codepot/views/code_revision.php @@ -799,7 +799,7 @@ $history = $file['history']; print "
\n"; printf (" %d", $rc->sno); printf (" %s", $rc->updatedby); - printf (" %s", $rc->updatedon); + printf (" %s", codepot_dbdatetodispdate($rc->updatedon)); if ($login['id'] == $rc->updatedby) { diff --git a/codepot/src/codepot/views/file_home.php b/codepot/src/codepot/views/file_home.php index 751fa1a5..507ff262 100644 --- a/codepot/src/codepot/views/file_home.php +++ b/codepot/src/codepot/views/file_home.php @@ -258,9 +258,11 @@ $this->load->view (
-
lang->line('Files')?>
-
+
+
lang->line('Files')?>
+ +
file_list); @@ -271,7 +273,9 @@ $this->load->view ( | lang->line('New')?> +
+
diff --git a/codepot/src/codepot/views/file_show.php b/codepot/src/codepot/views/file_show.php index 8b180caf..2dcfbdfd 100644 --- a/codepot/src/codepot/views/file_show.php +++ b/codepot/src/codepot/views/file_show.php @@ -166,26 +166,8 @@ var original_file_desc = [ ]; $(function () { - if ($("#file_show_mainarea_result_info").is(":visible")) - btn_label = "lang->line('Hide metadata')?>"; - else - btn_label = "lang->line('Show metadata')?>"; - - - btn = $('#file_show_mainarea_metadata_button').button({'label': btn_label}).click (function () { - - if ($('#file_show_mainarea_result_info').is(':visible')) - { - $('#file_show_mainarea_result_info').hide('blind',{},200); - $('#file_show_mainarea_metadata_button').button( - 'option', 'label', "lang->line('Show metadata')?>"); - } - else - { - $('#file_show_mainarea_result_info').show('blind',{},200); - $('#file_show_mainarea_metadata_button').button( - 'option', 'label', 'lang->line('Hide metadata')?>'); - } + $('#file_show_mainarea_metadata').accordion({ + collapsible: true }); $('#file_show_mainarea_files').accordion({ @@ -611,17 +593,34 @@ $this->load->view (
-
name)?>
-
+ -
+ +
+ +
+
lang->line('Metadata')?>
+
+
    +
  • lang->line('Created on')?> createdon); ?>
  • +
  • lang->line('Created by')?> createdby); ?>
  • +
  • lang->line('Last updated on')?> updatedon); ?>
  • +
  • lang->line('Last updated by')?> updatedby); ?>
  • +
+
+
lang->line('Files')?>
@@ -634,19 +633,22 @@ $this->load->view (
- +
file_list[$i]; - $xname = $this->converter->AsciiToHex($f->filename); print ''; } ?> @@ -660,15 +662,6 @@ $this->load->view ( -
-
    -
  • lang->line('Created on')?> createdon ?>
  • -
  • lang->line('Created by')?> createdby ?>
  • -
  • lang->line('Last updated on')?> updatedon ?>
  • -
  • lang->line('Last updated by')?> updatedby ?>
  • -
-
- diff --git a/codepot/src/codepot/views/graph_main.php b/codepot/src/codepot/views/graph_main.php index 646a3da1..8eed88b5 100644 --- a/codepot/src/codepot/views/graph_main.php +++ b/codepot/src/codepot/views/graph_main.php @@ -466,10 +466,10 @@ $this->load->view (
    -
  • lang->line('Created on')?> createdon?>
  • -
  • lang->line('Created by')?> createdby?>
  • -
  • lang->line('Last updated on')?> updatedon?>
  • -
  • lang->line('Last updated by')?> updatedby?>
  • +
  • lang->line('Created on')?> createdon);?>
  • +
  • lang->line('Created by')?> createdby);?>
  • +
  • lang->line('Last updated on')?> updatedon);?>
  • +
  • lang->line('Last updated by')?> updatedby);?>
--> diff --git a/codepot/src/codepot/views/issue_home.php b/codepot/src/codepot/views/issue_home.php index e6608ddc..efcef2e9 100644 --- a/codepot/src/codepot/views/issue_home.php +++ b/codepot/src/codepot/views/issue_home.php @@ -308,18 +308,19 @@ $this->load->view (
-
lang->line('Issues')?>
-
-lang->line('ISSUE_MSG_TOTAL_NUM_ISSUES'), $total_num_issues); ?> | - -lang->line('New')?> - -lang->line('Search')?> +
+
lang->line('Issues')?>
+ +
+ lang->line('ISSUE_MSG_TOTAL_NUM_ISSUES'), $total_num_issues); ?> | + + lang->line('New')?> + + lang->line('Search')?> +
- -
$('#issue_show_mainarea_edit_description_tabs').tabs (); $('#issue_show_mainarea_edit_description_tabs').bind ('tabsshow', function (event, ui) { @@ -706,46 +711,17 @@ $this->load->view (
-
- lang->line('Issue')?> id)?>: - summary)?> -
-
+ +
+
+ lang->line('Issue')?> id)?>: + summary)?> +
+
lang->line('Type'); - print ': '; - print htmlspecialchars( - array_key_exists($issue->type, $issue_type_array)? - $issue_type_array[$issue->type]: $issue->type - ); - print ' | '; - - print $this->lang->line('Status'); - print ': '; - print htmlspecialchars( - array_key_exists($issue->status, $issue_status_array)? - $issue_status_array[$issue->status]: $issue->status - ); - print ' | '; - - print $this->lang->line('Priority'); - print ': '; - print htmlspecialchars( - array_key_exists($issue->priority, $issue_priority_array)? - $issue_priority_array[$issue->priority]: $issue->priority - ); - if ($issue->owner != '') - { - print ' | '; - print $this->lang->line('Owner'); - print ': '; - print htmlspecialchars($issue->owner); - } - if (isset($login['id']) && $login['id'] != '') { - print ' | '; print ''; print $this->lang->line('Edit'); print ''; @@ -754,8 +730,57 @@ $this->load->view ( print ''; } ?> +
+
+
+
lang->line('State')?>
+
+
    + type, $issue_type_array)? + $issue_type_array[$issue->type]: $issue->type; + + $status = array_key_exists($issue->status, $issue_status_array)? + $issue_status_array[$issue->status]: $issue->status; + + $priority = array_key_exists($issue->priority, $issue_priority_array)? + $issue_priority_array[$issue->priority]: $issue->priority; + + printf ('
  • ', $issue->type); + print $this->lang->line('Type'); + print ': '; + print htmlspecialchars($type); + print '
  • '; + + printf ('
  • ', $issue->status); + print $this->lang->line('Status'); + print ': '; + print htmlspecialchars($status); + print '
  • '; + + printf ('
  • ', $issue->priority); + print $this->lang->line('Priority'); + print ': '; + print htmlspecialchars($priority); + print '
  • '; + + print '
  • '; + if ($issue->owner != '') + { + print $this->lang->line('Owner'); + print ': '; + print htmlspecialchars($issue->owner); + print '
  • '; + } + ?> +
+
+
+ +
'; print ''; print ''; print ''; print '"; - print ""; + print ""; $curdate = $date; $rowcount = 0; } diff --git a/codepot/src/codepot/views/project_home.php b/codepot/src/codepot/views/project_home.php index 6372ac9d..32728bad 100644 --- a/codepot/src/codepot/views/project_home.php +++ b/codepot/src/codepot/views/project_home.php @@ -107,9 +107,9 @@ $this->load->view (
lang->line('Summary')?>
    -
  • lang->line('Created on')?> createdon?>
  • -
  • lang->line('Created by')?> createdby?>
  • -
  • lang->line('Last updated on')?> updatedon?>
  • +
  • lang->line('Created on')?> createdon);?>
  • +
  • lang->line('Created by')?> createdby;?>
  • +
  • lang->line('Last updated on')?> updatedon);?>
  • lang->line('Last updated by')?> updatedby?>
@@ -191,14 +191,18 @@ foreach ($urls as $url) $xdot = $this->converter->AsciiToHex ('.'); foreach ($log_entries as $log) { + if (CODEPOT_DATABASE_STORE_GMT) + $createdon = $log['createdon'] . ' +0000'; + else + $createdon = $log['createdon']; + if ($log['type'] == 'code') { $x = $log['message']; - print ''; print ''; print ''; print ''; print ''; print ''; print ''; print ''; print '
'; print anchor ("file/get/{$project->id}/{$xname}", ' ' . htmlspecialchars($f->filename)); print ''; print htmlspecialchars($f->description); print ''; - print " {$f->md5sum}"; + print "{$f->md5sum}"; + print ''; + print codepot_dbdatetodispdate($f->createdon); + print ''; + print htmlspecialchars($f->createdby); print '
'; - print date ('Y-m-d H:i:s', strtotime($new->updatedon)); + print codepot_dbdatetodispdate($new->updatedon); print ''; @@ -909,7 +934,7 @@ $this->load->view ( print '
'; - print date ('Y-m-d H:i:s', strtotime($issue->createdon)); + print codepot_dbdatetodispdate($issue->createdon); print ''; diff --git a/codepot/src/codepot/views/log.php b/codepot/src/codepot/views/log.php index 0084210e..4e0c15d1 100644 --- a/codepot/src/codepot/views/log.php +++ b/codepot/src/codepot/views/log.php @@ -159,25 +159,21 @@ $this->load->view ( foreach ($log_entries as $log) { - if ($log['type'] == 'code') - { - $code = $log['message']; + if ($log['type'] == 'code') $code = $log['message']; - //$date = substr($code['time'], 0, 10); - //$time = substr($code['time'], 11, 5); - $date = date ('Y-m-d', strtotime($log['createdon'])); - $time = date ('h:i', strtotime($log['createdon'])); - } + if (CODEPOT_DATABASE_STORE_GMT) + $createdon = $log['createdon'] . ' +0000'; else - { - $date = date ('Y-m-d', strtotime($log['createdon'])); - $time = date ('h:i', strtotime($log['createdon'])); - } + $createdon = $log['createdon']; + + $tzoff = strftime ('%z', strtotime($createdon)); + $date = strftime ('%Y-%m-%d', strtotime($createdon)); + $time = strftime ('%H:%M:%S', strtotime($createdon)); if ($curdate != $date) { print "
 
$date
$date ($tzoff)
'; - //print substr($x['time'], 5, 5); - print date ('m-d', strtotime($log['createdon'])); + + print strftime ('%m-%d', strtotime($createdon)); print ''; print anchor ( @@ -240,7 +244,7 @@ foreach ($urls as $url) { print '
'; - print date ('m-d', strtotime($log['createdon'])); + print strftime ('%m-%d', strtotime($createdon)); print ''; diff --git a/codepot/src/codepot/views/site_home.php b/codepot/src/codepot/views/site_home.php index f53e6041..5bb4e987 100644 --- a/codepot/src/codepot/views/site_home.php +++ b/codepot/src/codepot/views/site_home.php @@ -147,14 +147,18 @@ foreach ($latest_projects as $project) $xdot = $this->converter->AsciiToHex ('.'); foreach ($log_entries as $log) { + if (CODEPOT_DATABASE_STORE_GMT) + $createdon = $log['createdon'] . ' +0000'; + else + $createdon = $log['createdon']; + if ($log['type'] == 'code') { $x = $log['message']; print '
'; - //print substr($x['time'], 5, 5); - print date ('m-d', strtotime($log['createdon'])); + print strftime ('%m-%d', strtotime($createdon)); print ''; /* @@ -212,7 +216,7 @@ foreach ($latest_projects as $project) { print '
'; - print date ('m-d', strtotime($log['createdon'])); + print strftime ('%m-%d', strtotime($createdon)); print ''; diff --git a/codepot/src/codepot/views/wiki_show.php b/codepot/src/codepot/views/wiki_show.php index a25ac8bd..e9945026 100644 --- a/codepot/src/codepot/views/wiki_show.php +++ b/codepot/src/codepot/views/wiki_show.php @@ -59,26 +59,8 @@ function render_wiki() } $(function () { - if ($("#wiki_show_mainarea_result_info").is(":visible")) - btn_label = "lang->line('Hide metadata')?>"; - else - btn_label = "lang->line('Show metadata')?>"; - - btn = $("#wiki_show_mainarea_metadata_button").button({"label": btn_label}).click (function () { - - if ($("#wiki_show_mainarea_result_info").is(":visible")) - { - $("#wiki_show_mainarea_result_info").hide("blind",{},200); - $("#wiki_show_mainarea_metadata_button").button( - "option", "label", "lang->line('Show metadata')?>"); - } - else - { - $("#wiki_show_mainarea_result_info").show("blind",{},200); - $("#wiki_show_mainarea_metadata_button").button( - "option", "label", "lang->line('Hide metadata')?>"); - } - return false; + $('#wiki_show_mainarea_metadata').accordion({ + collapsible: true }); render_wiki (); @@ -121,14 +103,51 @@ $this->load->view (
-
name)?>
+
+
name)?>
-
+
+
lang->line('Metadata')?>
+
+ +
+
    +
  • lang->line('Created on')?> createdon); ?>
  • +
  • lang->line('Created by')?> createdby); ?>
  • +
  • lang->line('Last updated on')?> updatedon); ?>
  • +
  • lang->line('Last updated by')?> updatedby); ?>
  • +
+
+ +
+
    + attachments as $att) + { + $hexattname = $this->converter->AsciiToHex ($att->name); + print '
  • '; + print anchor ( + "wiki/attachment/{$project->id}/{$hexname}/{$hexattname}", + htmlspecialchars($att->name) + ); + print '
  • '; + } + ?> +
+
+ +
+
+
+
- -
- -
    -
  • lang->line('Created on')?> createdon ?>
  • -
  • lang->line('Created by')?> createdby ?>
  • -
  • lang->line('Last updated on')?> updatedon ?>
  • -
  • lang->line('Last updated by')?> updatedby ?>
  • -
- -attachments)): ?> -
lang->line('WIKI_ATTACHMENTS') ?>
-
    - attachments as $att) - { - $hexattname = $this->converter->AsciiToHex ($att->name); - print '
  • '; - print anchor ( - "wiki/attachment/{$project->id}/{$hexname}/{$hexattname}", - htmlspecialchars($att->name) - ); - print '
  • '; - } - ?> -
- - -
-
diff --git a/codepot/src/config.php.in b/codepot/src/config.php.in index 10f629da..474a8617 100644 --- a/codepot/src/config.php.in +++ b/codepot/src/config.php.in @@ -51,6 +51,7 @@ function load_ini ($file) array ('database_name', 'string', ''), array ('database_driver', 'string', ''), array ('database_prefix', 'string', ''), + array ('database_store_gmt', 'boolean', FALSE), array ('auth_mysql_hostname', 'string', 'localhost'), array ('auth_mysql_port', 'string', ''), diff --git a/codepot/src/css/common.css b/codepot/src/css/common.css index 1fbca6fc..d2bb0879 100644 --- a/codepot/src/css/common.css +++ b/codepot/src/css/common.css @@ -375,7 +375,7 @@ textarea { } .content .mainarea .result { - min-height: 30em; + /*min-height: 30em;*/ overflow: auto; } @@ -706,6 +706,7 @@ textarea { .prettyprint .fun { color: #4271ae; } } + .content .infostrip { font-size: 0.9em; @@ -725,6 +726,31 @@ textarea { text-decoration: none; } +.content .title-band { + font-size: 0.9em; + + background: #F0F0F0 none repeat scroll 0 0; + /*border: #D4DBE8 1px solid; */ + + margin: 0.3em 0em 0.5em 0em; + padding: 1em 0.5em 1em 0.5em; + text-align: right; + + -moz-border-radius: 3px; + -webkit-border-radius: 3px; + border-radius: 3px; +} + +.content .title-band a { + text-decoration: none; +} + +.content .title-band .title { + float: left; + text-transform: uppercase; + font-weight: bold; +} + .content .sidebar { font-size: 0.9em; float: right; diff --git a/codepot/src/css/file.css b/codepot/src/css/file.css index b52fee0c..77e2ec7c 100644 --- a/codepot/src/css/file.css +++ b/codepot/src/css/file.css @@ -5,10 +5,6 @@ overflow: auto; } -#file_home_mainarea_result_table { - margin-top: 1em; -} - #file_home_mainarea_result_table tr { vertical-align: middle; } @@ -52,12 +48,18 @@ padding-left: 0.5em; padding-right: 0.5em; line-height: 1.5em; + white-space: nowrap; } -#file_edit_mainarea_description { - width: 100%; +#file_show_mainarea_metadata_body, +#file_show_mainarea_files_body { + background-color: #FCFCFC; } +#file_show_mainarea_metadata_body ul { + padding: 0em 0.5em 0em 0.5em; + margin: 0; +} /*----------------------------------------------- * file home view - new file dialog diff --git a/codepot/src/css/issue.css b/codepot/src/css/issue.css index 17c3b13a..43ce8f1c 100644 --- a/codepot/src/css/issue.css +++ b/codepot/src/css/issue.css @@ -1,3 +1,96 @@ +li.issue-type-defect { + background-color: #D9534F; + color: #FFFFFF; +} + +li.issue-type-request { + background-color: #44AD8E; + color: #FFFFFF; +} + +li.issue-type-other { + background-color: #4E8BCA; + color: #FFFFFF; +} + + +li.issue-status-new { + background-color: #44AD8E; + color: #FFFFFF; +} + +li.issue-status-accepted { + background-color: #44AD8E; + color: #FFFFFF; +} + +li.issue-status-rejected { + background-color: #AD448E; + color: #FFFFFF; +} + +li.issue-status-started { + background-color: #44ADAD; + color: #FFFFFF; +} + +li.issue-status-stalled { + background-color: #ADAD8E; + color: #FFFFFF; +} + +li.issue-status-testing { + background-color: #44ADBB; + color: #FFFFFF; +} + +li.issue-status-resolved { + background-color: #34AD56; + color: #FFFFFF; +} + +li.issue-status-worked-around { + background-color: #65AD67; + color: #FFFFFF; +} + +li.issue-status-other { + background-color: #888888; + color: #FFFFFF; +} + +li.issue-type-other { + background-color: #4E8BCA; + color: #FFFFFF; +} + +li.issue-priority-critical { + background-color: #D9534F; + color: #FFFFFF; +} + +li.issue-priority-high { + background-color: #B9534F; + color: #FFFFFF; +} + +li.issue-priority-medium { + background-color: #99534F; + color: #FFFFFF; +} + +li.issue-priority-low { + background-color: #EEE39E; + color: #FFFFFF; +} + +li.issue-priority-other { + background-color: #FFF39E; +} + +li.issue-owner { + background-color: #FFF39E; +} /*--------------------------------------------- * issue home @@ -6,10 +99,6 @@ overflow: auto; } -#issue_home_mainarea_result_table { - margin-top: 1em; -} - #issue_home_mainarea_result_table tr { vertical-align: text-top; } @@ -82,6 +171,23 @@ /*--------------------------------------------- * issue show *---------------------------------------------*/ +#issue_show_mainarea_state_body { + background-color: #FCFCFC; + padding: 1em 1em; +} + +#issue_show_mainarea_state_body ul { + padding: 0; + margin: 0; + list-style: outside none none; +} + +#issue_show_mainarea_state_body ul li { + padding: 0.2em 0.2em 0.2em 0.2em; + margin: 0 0.2em 0 0.2em; + float: left; +} + #issue_show_mainarea_change_form { } diff --git a/codepot/src/css/wiki.css b/codepot/src/css/wiki.css index 6d78a0b8..ba4bb66e 100644 --- a/codepot/src/css/wiki.css +++ b/codepot/src/css/wiki.css @@ -7,6 +7,8 @@ } #wiki_show_mainarea_wiki { + margin-top: 0.5em; + -moz-column-rule: 1px dotted grey; -webkit-column-rule: 1px dotted grey; column-rule: 1px dotted grey; @@ -16,6 +18,37 @@ column-gap: 2em; } +#wiki_show_mainarea_metadata_body { + background-color: #FCFCFC; +} + +#wiki_show_mainarea_metadata_body ul { + padding: 0em 0.5em 0em 0.5em; + margin: 0; +} +#wiki_show_mainarea_metadata_list_div { + float: left; +} +#wiki_show_mainarea_attachment_list_div { + margin-left: 2em; + float: left; +} + +#wiki_show_mainarea_attachment_list { +} + +#wiki_show_mainarea_attachment_list a, +#wiki_show_mainarea_attachment_list a:visited, +#wiki_show_mainarea_attachment_list a:focus { + text-decoration: none; + color: #111111; +} + +#wiki_show_mainarea_attachment_list a:hover { + background-color: #1C94C4; + color: #FFFFFF; +} + /*--------------------------------------------- * wiki edit *---------------------------------------------*/