diff --git a/codepot/README b/codepot/README index 8fc0ff26..1dcf8455 100644 --- a/codepot/README +++ b/codepot/README @@ -7,6 +7,15 @@ CODEPOT multiple subversion repositories independent of each other. Going beyond it, you can track issues, write documents, and upload release files. +UPGRADING FROM 0.2.0 + + The code_hide_details column in the user_settings table has been renamed + to code_hide_metadata. You must rename your existing database manually. + + mysql> ALTER TABLE user_settings CHANGE code_hide_details code_hide_metadata char(1) NOT NULL; + oracle> ALTER TABLE user_settings RENAME COLUMN code_hide_details TO code_hide_metadata; + + INSTALLATION ON CENTOS A RPM package is provided for RedHat/CentOS Linux. The RPM package specifies diff --git a/codepot/etc/codepot.mysql b/codepot/etc/codepot.mysql index d199150a..f4d02cc4 100644 --- a/codepot/etc/codepot.mysql +++ b/codepot/etc/codepot.mysql @@ -192,7 +192,7 @@ CREATE TABLE log ( CREATE TABLE user_settings ( userid VARCHAR(32) PRIMARY KEY, code_hide_line_num CHAR(1) NOT NULL, - code_hide_details CHAR(1) NOT NULL, + code_hide_metadata CHAR(1) NOT NULL, icon_name VARCHAR(255) UNIQUE NULL ) charset=utf8 engine=InnoDB; diff --git a/codepot/src/codepot/controllers/project.php b/codepot/src/codepot/controllers/project.php index 3bbf8794..fd94d7bf 100644 --- a/codepot/src/codepot/controllers/project.php +++ b/codepot/src/codepot/controllers/project.php @@ -37,6 +37,7 @@ class Project extends Controller $search->id = ''; $search->name = ''; $search->summary = ''; + $search->or = ''; } else { @@ -44,6 +45,7 @@ class Project extends Controller if (!array_key_exists ('id', $search)) $search['id'] = ''; if (!array_key_exists ('name', $search)) $search['name'] = ''; if (!array_key_exists ('summary', $search)) $search['summary'] = ''; + if (!array_key_exists ('or', $search)) $search['or'] = ''; $search = (object) $search; } @@ -486,6 +488,7 @@ class Project extends Controller $search->id = ''; $search->name = ''; $search->summary = ''; + $search->or = ''; } else { @@ -493,6 +496,7 @@ class Project extends Controller if (!array_key_exists ('id', $search)) $search['id'] = ''; if (!array_key_exists ('name', $search)) $search['name'] = ''; if (!array_key_exists ('summary', $search)) $search['summary'] = ''; + if (!array_key_exists ('or', $search)) $search['or'] = ''; $search = (object) $search; } @@ -581,7 +585,8 @@ class Project extends Controller foreach ($projects as &$p) { - if ($p->id != $p->value) $p->value = $p->id . ' - ' . $p->value; + $p->label = ($p->id != $p->value)? ($p->id . ' - ' . $p->value): $p->value; + //$p->value = $p->id; } print codepot_json_encode ($projects); diff --git a/codepot/src/codepot/controllers/user.php b/codepot/src/codepot/controllers/user.php index 8c07e4fe..84e0bc10 100644 --- a/codepot/src/codepot/controllers/user.php +++ b/codepot/src/codepot/controllers/user.php @@ -200,7 +200,7 @@ class User extends Controller } $settings->code_hide_line_num = $this->input->post('code_hide_line_num'); - $settings->code_hide_details = $this->input->post('code_hide_details'); + $settings->code_hide_metadata = $this->input->post('code_hide_metadata'); $settings->icon_name = $icon_fname; $settings->uploaded_icon_name = $uploaded_fname; @@ -227,7 +227,7 @@ class User extends Controller { if ($settings === FALSE) $data['message'] = 'DATABASE ERROR'; $settings->code_hide_line_num = ' '; - $settings->code_hide_details = ' '; + $settings->code_hide_metadata = ' '; $settings->icon_name = ''; } diff --git a/codepot/src/codepot/language/english/common_lang.php b/codepot/src/codepot/language/english/common_lang.php index 874b3dc8..031637d6 100644 --- a/codepot/src/codepot/language/english/common_lang.php +++ b/codepot/src/codepot/language/english/common_lang.php @@ -1,6 +1,7 @@ diff --git a/codepot/src/codepot/language/english/user_lang.php b/codepot/src/codepot/language/english/user_lang.php index a134b0f6..20f1c9f3 100644 --- a/codepot/src/codepot/language/english/user_lang.php +++ b/codepot/src/codepot/language/english/user_lang.php @@ -1,4 +1,4 @@ diff --git a/codepot/src/codepot/language/indonesian/common_lang.php b/codepot/src/codepot/language/indonesian/common_lang.php index a935fcff..1cec63b6 100644 --- a/codepot/src/codepot/language/indonesian/common_lang.php +++ b/codepot/src/codepot/language/indonesian/common_lang.php @@ -1,6 +1,7 @@ diff --git a/codepot/src/codepot/language/korean/user_lang.php b/codepot/src/codepot/language/korean/user_lang.php index f84f6d35..01d13db9 100644 --- a/codepot/src/codepot/language/korean/user_lang.php +++ b/codepot/src/codepot/language/korean/user_lang.php @@ -1,4 +1,4 @@ diff --git a/codepot/src/codepot/models/projectmodel.php b/codepot/src/codepot/models/projectmodel.php index a9ad2563..7fd21c1a 100644 --- a/codepot/src/codepot/models/projectmodel.php +++ b/codepot/src/codepot/models/projectmodel.php @@ -58,9 +58,19 @@ class ProjectModel extends Model $this->db->select ('count(id) as count'); $this->db->order_by ('name', 'asc'); - if (!empty($search->id)) $this->db->like ('id', $search->id); - if (!empty($search->name)) $this->db->like ('name', $search->name); - if (!empty($search->summary)) $this->db->like ('summary', $search->summary); + + if ($search->or == 'Y') + { + if (!empty($search->id)) $this->db->or_like ('id', $search->id); + if (!empty($search->name)) $this->db->or_like ('name', $search->name); + if (!empty($search->summary)) $this->db->or_like ('summary', $search->summary); + } + else + { + if (!empty($search->id)) $this->db->like ('id', $search->id); + if (!empty($search->name)) $this->db->like ('name', $search->name); + if (!empty($search->summary)) $this->db->like ('summary', $search->summary); + } $query = $this->db->get ('project'); if ($this->db->trans_status() === FALSE) @@ -83,9 +93,19 @@ class ProjectModel extends Model { $this->db->trans_start (); $this->db->order_by ('name', 'asc'); - if (!empty($search->id)) $this->db->like ('id', $search->id); - if (!empty($search->name)) $this->db->like ('name', $search->name); - if (!empty($search->summary)) $this->db->like ('summary', $search->summary); + + if ($search->or == 'Y') + { + if (!empty($search->id)) $this->db->or_like ('id', $search->id); + if (!empty($search->name)) $this->db->or_like ('name', $search->name); + if (!empty($search->summary)) $this->db->or_like ('summary', $search->summary); + } + else + { + if (!empty($search->id)) $this->db->like ('id', $search->id); + if (!empty($search->name)) $this->db->like ('name', $search->name); + if (!empty($search->summary)) $this->db->like ('summary', $search->summary); + } $query = $this->db->get ('project', $limit, $offset); $this->db->trans_complete (); if ($this->db->trans_status() === FALSE) return FALSE; @@ -332,8 +352,8 @@ class ProjectModel extends Model $this->db->set ('type', 'project'); $this->db->set ('action', 'delete'); $this->db->set ('projectid', $project->id); - $this->db->set ('userid', $userid); - $this->db->set ('message', $project->name); + $this->db->set ('userid', $userid); + $this->db->set ('message', $project->name); $this->db->insert ('log'); if ($this->db->trans_status() === FALSE) diff --git a/codepot/src/codepot/models/usermodel.php b/codepot/src/codepot/models/usermodel.php index 6798e951..c18247e2 100644 --- a/codepot/src/codepot/models/usermodel.php +++ b/codepot/src/codepot/models/usermodel.php @@ -53,7 +53,7 @@ class UserModel extends Model { $this->db->set ('userid', $userid); $this->db->set ('code_hide_line_num', (string)$settings->code_hide_line_num); - $this->db->set ('code_hide_details', (string)$settings->code_hide_details); + $this->db->set ('code_hide_metadata', (string)$settings->code_hide_metadata); if ($icon_name_set) $this->db->set ('icon_name', (string)$settings->icon_name); $this->db->insert ('user_settings'); } @@ -61,7 +61,7 @@ class UserModel extends Model { $this->db->where ('userid', $userid); $this->db->set ('code_hide_line_num', (string)$settings->code_hide_line_num); - $this->db->set ('code_hide_details', (string)$settings->code_hide_details); + $this->db->set ('code_hide_metadata', (string)$settings->code_hide_metadata); if ($icon_name_set) $this->db->set ('icon_name', (string)$settings->icon_name); $this->db->update ('user_settings'); } @@ -90,7 +90,7 @@ class UserModel extends Model $this->db->where ('userid', $userid); $this->db->set ('code_hide_line_num', (string)$settings->code_hide_line_num); - $this->db->set ('code_hide_details', (string)$settings->code_hide_details); + $this->db->set ('code_hide_metadata', (string)$settings->code_hide_metadata); if (strlen($icon_name_set) $this->db->set ('icon_name', (string)$settings->icon_name); $this->db->update ('user_settings'); @@ -104,7 +104,7 @@ class UserModel extends Model { $this->db->set ('userid', $userid); $this->db->set ('code_hide_line_num', (string)$settings->code_hide_line_num); - $this->db->set ('code_hide_details', (string)$settings->code_hide_details); + $this->db->set ('code_hide_metadata', (string)$settings->code_hide_metadata); $this->db->insert ('user_settings'); if ($this->db->trans_status() === FALSE) diff --git a/codepot/src/codepot/views/code_blame.php b/codepot/src/codepot/views/code_blame.php index 0285c2d8..2c53bca0 100644 --- a/codepot/src/codepot/views/code_blame.php +++ b/codepot/src/codepot/views/code_blame.php @@ -30,23 +30,23 @@ $(function () { ?> if ($("#code_blame_mainarea_result_info").is(":visible")) - btn_label = "lang->line('Hide details')?>"; + btn_label = "lang->line('Hide metadata')?>"; else - btn_label = "lang->line('Show details')?>"; + btn_label = "lang->line('Show metadata')?>"; - btn = $("#code_blame_mainarea_details_button").button({"label": btn_label}).click (function () { + btn = $("#code_blame_mainarea_metadata_button").button({"label": btn_label}).click (function () { if ($("#code_blame_mainarea_result_info").is(":visible")) { $("#code_blame_mainarea_result_info").hide("blind",{},200); - $("#code_blame_mainarea_details_button").button( - "option", "label", "lang->line('Show details')?>"); + $("#code_blame_mainarea_metadata_button").button( + "option", "label", "lang->line('Show metadata')?>"); } else { $("#code_blame_mainarea_result_info").show("blind",{},200); - $("#code_blame_mainarea_details_button").button( - "option", "label", "lang->line('Hide details')?>"); + $("#code_blame_mainarea_metadata_button").button( + "option", "label", "lang->line('Hide metadata')?>"); } }); @@ -189,7 +189,7 @@ print anchor ("code/fetch/{$project->id}/${xpar}{$revreq}", $this->lang->line('D print ' | '; printf ('%s: %s', $this->lang->line('Size'), $file['size']); ?> - lang->line('Details')?> + lang->line('Metadata')?>