diff --git a/codepot/src/codepot/controllers/issue.php b/codepot/src/codepot/controllers/issue.php index 76700abc..7448fbc2 100644 --- a/codepot/src/codepot/controllers/issue.php +++ b/codepot/src/codepot/controllers/issue.php @@ -146,6 +146,7 @@ class Issue extends Controller { $this->load->model ('ProjectModel', 'projects'); $this->load->model ('IssueModel', 'issues'); + $this->load->model ('CodeModel', 'code'); $login = $this->login->getUser (); if (CODEPOT_SIGNIN_COMPULSORY && $login['id'] == '') @@ -217,11 +218,16 @@ class Issue extends Controller } else { + + $related_code_revisions = $this->code->getRelatedRevisions ($project->id, $issue->id); + if ($related_code_revisions === FALSE) $related_code_revisions = array(); + $data['issue_type_array'] = $this->issuehelper->_get_type_array($this->lang); $data['issue_status_array'] = $this->issuehelper->_get_status_array($this->lang); $data['issue_priority_array'] = $this->issuehelper->_get_priority_array($this->lang); $data['project'] = $project; $data['issue'] = $issue; + $data['related_code_revisions'] = $related_code_revisions; $this->load->view ($this->VIEW_SHOW, $data); } } diff --git a/codepot/src/codepot/models/codemodel.php b/codepot/src/codepot/models/codemodel.php index 30629db8..c9da28e4 100644 --- a/codepot/src/codepot/models/codemodel.php +++ b/codepot/src/codepot/models/codemodel.php @@ -39,6 +39,29 @@ class CodeModel extends Model return $query->result(); } + function getRelatedRevisions ($projectid, $issueid) + { + $this->db->trans_begin (); + + $this->db->from ('issue'); + $this->db->join ('issue_coderev', 'issue.projectid = issue_coderev.projectid AND issue.id = issue_coderev.issueid'); + $this->db->where ('issue_coderev.projectid', (string)$projectid); + $this->db->where ('issue_coderev.issueid', $issueid); + $this->db->order_by ('issue_coderev.projectid ASC'); + $this->db->order_by ('issue_coderev.coderev ASC'); + $this->db->select ('issue_coderev.projectid, issue_coderev.coderev'); + $query = $this->db->get (); + if ($this->db->trans_status() === FALSE) + { + $this->errmsg = $this->db->_error_message(); + $this->db->trans_rollback (); + return FALSE; + } + + $this->db->trans_commit (); + return $query->result(); + } + function getReviews ($projectid, $revision) { $this->db->trans_begin (); diff --git a/codepot/src/codepot/views/issue_show.php b/codepot/src/codepot/views/issue_show.php index 413d3c50..a22a6b6e 100644 --- a/codepot/src/codepot/views/issue_show.php +++ b/codepot/src/codepot/views/issue_show.php @@ -1001,7 +1001,7 @@ function print_issue_state ($con, $issue, $old, $issue_type_array, $issue_status
  • lang->line('Last updated on')?> updatedon); ?>
  • lang->line('Last updated by')?> updatedby); ?>
  • - + '; } diff --git a/codepot/src/css/common.css b/codepot/src/css/common.css index 65f93b3a..39caa812 100644 --- a/codepot/src/css/common.css +++ b/codepot/src/css/common.css @@ -1046,6 +1046,12 @@ ul.codepot-horizontal-list li { float: left; } +.codepot-opacity-85 { + filter:alpha(opacity=85); /* IE */ + opacity: 0.85; /* Safari, Opera */ + -moz-opacity:0.85; /* FireFox */ +} + /* === common issue class === */ .codepot-issue-type-defect { diff --git a/codepot/src/css/issue.css b/codepot/src/css/issue.css index aded3a2e..c44ca10f 100644 --- a/codepot/src/css/issue.css +++ b/codepot/src/css/issue.css @@ -132,6 +132,12 @@ textarea.codepot-issue-edit-comment { #issue_show_metadata_list li { margin-top: 0.1em; margin-bottom: 0.2em; + + background-color: #EAEAEA !important; + color: #000000 !important; + -moz-border-radius: 3px; + -webkit-border-radius: 3px; + border-radius: 3px; } #issue_show_state_list, @@ -140,12 +146,22 @@ textarea.codepot-issue-edit-comment { border-top: 1px dashed #EAEAEA } -#issue_show_metadata_list li { - background-color: #EAEAEA !important; - color: #000000 !important; +#issue_show_coderev_list { + margin-top: 2em; +} + +#issue_show_coderev_list a { + color: #FFFFFF; + background-color: #45A067; + padding: 0.3em; + -moz-border-radius: 3px; -webkit-border-radius: 3px; border-radius: 3px; + + filter:alpha(opacity=85); /* IE */ + opacity: 0.85; /* Safari, Opera */ + -moz-opacity:0.85; /* FireFox */ } #issue_show_change_form {