diff --git a/codepot/src/codepot/models/issuemodel.php b/codepot/src/codepot/models/issuemodel.php index f629ed5c..3d18bb24 100644 --- a/codepot/src/codepot/models/issuemodel.php +++ b/codepot/src/codepot/models/issuemodel.php @@ -984,7 +984,7 @@ class IssueModel extends Model { $this->db->trans_begin (); // manual transaction. not using trans_start(). - $this->db->where ('projectid', $projectod); + $this->db->where ('projectid', $projectid); $this->db->where ('id', $issueid); $query = $this->db->get ('issue'); if ($this->db->trans_status() === FALSE) diff --git a/codepot/src/codepot/models/subversionmodel.php b/codepot/src/codepot/models/subversionmodel.php index d83fe88e..8ffb2581 100644 --- a/codepot/src/codepot/models/subversionmodel.php +++ b/codepot/src/codepot/models/subversionmodel.php @@ -266,7 +266,11 @@ class SubversionModel extends Model $fileinfo['created_rev'] = $info[0]['last_changed_rev']; else $fileinfo['created_rev'] = $info[0]['revision']; - $fileinfo['last_author'] = $info[0]['last_changed_author']; + + if (array_key_exists('last_changed_author', $info[0])) + $fileinfo['last_author'] = $info[0]['last_changed_author']; + else + $fileinfo['last_author'] = ''; } else return FALSE; diff --git a/codepot/src/codepot/views/issue_show.php b/codepot/src/codepot/views/issue_show.php index 3debc02c..0a8ba77c 100644 --- a/codepot/src/codepot/views/issue_show.php +++ b/codepot/src/codepot/views/issue_show.php @@ -223,6 +223,21 @@ function preview_issue_change_comment(input_text) prettyPrint (); } +function preview_edit_comment (input_text, no) +{ + + creole_render_wiki_with_input_text ( + input_text, + "issue_show_edit_comment_preview_" + no, + "", + "/", + true + ); + + prettyPrint (); +} + + var work_in_progress = false; var original_file_name = [ @@ -230,7 +245,7 @@ var original_file_name = [ for ($i = 0; $i < $issue_file_count; $i++) { $f = $issue->files[$i]; - printf ("%s\t'%s'", (($i == 0)? '': ",\n"), addslashes($f->filename)); + printf ("%s\t%s", (($i == 0)? '': ",\n"), codepot_json_encode($f->filename)); } print "\n"; ?> @@ -241,7 +256,7 @@ var original_file_desc = [ for ($i = 0; $i < $issue_file_count; $i++) { $f = $issue->files[$i]; - printf ("%s\t'%s'", (($i == 0)? '': ",\n"), addslashes($f->description)); + printf ("%s\t%s", (($i == 0)? '': ",\n"), codepot_json_encode($f->description)); } print "\n"; ?> @@ -729,7 +744,14 @@ $(function () { } ); - $('#issue_show_undo_change_confirm').dialog ( + $('#issue_show_change_form_open_bottom').button().click ( + function () { + $('#issue_show_change_form').dialog('open'); + return false; + } + ); + + /*$('#issue_show_undo_change_confirm').dialog ( { title: 'lang->line('Undo')?>', resizable: false, @@ -754,7 +776,7 @@ $(function () { $('#issue_show_undo_change_confirm').dialog('open'); return false; } - ); + );*/ $('#issue_change_comment_preview_button').button().click( function () { @@ -800,6 +822,15 @@ $(function () { return false; } ); + + $('#issue_show_edit_comment_preview_button_' + i).button().click( + function () { + var id = $(this).attr('id'); + var comment_no = id.replace('issue_show_edit_comment_preview_button_', ''); + preview_edit_comment ($('#issue_show_edit_comment_text_' + comment_no).val(), comment_no); + return false; + } + ); } @@ -841,6 +872,57 @@ $this->load->view ( ) ) ); + +function print_issue_state ($con, $issue, $old, $issue_type_array, $issue_status_array, $issue_priority_array) +{ + $type = array_key_exists($issue->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; + + if ($old == NULL || $issue->type != $old->type) + { + printf ('
  • ', $issue->type); + print $con->lang->line('Type'); + print ': '; + print htmlspecialchars($type); + print '
  • '; + } + + if ($old == NULL || $issue->status != $old->status) + { + printf ('
  • ', $issue->status); + print $con->lang->line('Status'); + print ': '; + print htmlspecialchars($status); + print '
  • '; + } + + if ($old == NULL || $issue->priority != $old->priority) + { + printf ('
  • ', $issue->priority); + print $con->lang->line('Priority'); + print ': '; + print htmlspecialchars($priority); + print '
  • '; + } + + if ($old == NULL || $issue->owner != $old->owner) + { + print '
  • '; + if ($issue->owner != '') + { + print $con->lang->line('Owner'); + print ': '; + print htmlspecialchars($issue->owner); + print '
  • '; + } + } +} ?> @@ -872,51 +954,16 @@ $this->load->view (
    lang->line('State')?>
    -
    @@ -985,37 +1032,67 @@ $this->load->view ( $msgfmt_changed_from_to = $this->lang->line ('ISSUE_MSG_CHANGED_X_FROM_Y_TO_Z'); $msgfmt_changed_to = $this->lang->line ('ISSUE_MSG_CHANGED_X_TO_Z'); - print ''; -// TODO: displa changes[0]; + $new = $issue->changes[0]; + + print '
    '; + print '
    '; + print '
    '; + printf ('
    %s
    ', codepot_dbdatetodispdate($new->updatedon)); + print '
    '; + $user_icon_url = codepot_merge_path (site_url(), '/user/icon/' . $this->converter->AsciiToHex($new->updatedby)); + print " "; + print htmlspecialchars($new->updatedby); + print '
    '; + + print '
    '; + print '
    '; + print '
    '; + print '
    '; + + print ''; + print '
    '; + print '
    '; + for ($i = 1; $i < $change_count; $i++) { $new = $issue->changes[$i]; $old = $issue->changes[$i - 1]; - print ''; + print '
    '; - print '
    '; - - print ''; - print ''; } - - print '
    '; - print codepot_dbdatetodispdate($new->updatedon); - print ''; - - print "
    "; - print "
    "; + print '
    '; + printf ('
    %s
    ', codepot_dbdatetodispdate($new->updatedon)); + print '
    '; $user_icon_url = codepot_merge_path (site_url(), '/user/icon/' . $this->converter->AsciiToHex($new->updatedby)); print " "; print htmlspecialchars($new->updatedby); - print "
    "; - printf ("", $i, $this->lang->line('Edit')); - print "
    "; - print "
    "; + print '
    '; + + print '
    '; + if(isset($login['id']) && $login['id'] != '') + { + printf ("%s", $i, $this->lang->line('Edit')); + } + print '
    '; + print '
    '; + print '
    '; + + print '
      '; + print_issue_state ($this, $new, $old, $issue_type_array, $issue_status_array, $issue_priority_array); + print '
    '; + + print '
    '; $escaped_comment = htmlspecialchars($new->comment); if(isset($login['id']) && $login['id'] != '') { print "
    "; + printf ('%s', $i, $this->lang->line('Preview')); printf ('', $i, addslashes($new->sno)); printf ('', $i, $escaped_comment); + printf ('
    ', $i); print '
    '; } @@ -1023,70 +1100,23 @@ $this->load->view ( printf ("
    %s
    ", $i, $escaped_comment); print ''; - print '
    '; - print '
      '; - if ($new->type != $old->type) - { - printf ("
    • {$msgfmt_changed_from_to}
    • ", - strtolower($this->lang->line('Type')), - htmlspecialchars( - array_key_exists($old->type, $issue_type_array)? - $issue_type_array[$old->type]: $old->type), - htmlspecialchars( - array_key_exists($new->type, $issue_type_array)? - $issue_type_array[$new->type]: $new->type)); - } + - if ($new->status != $old->status) - { - printf ("
    • {$msgfmt_changed_from_to}
    • ", - strtolower($this->lang->line('Status')), - htmlspecialchars( - array_key_exists($old->status, $issue_status_array)? - $issue_status_array[$old->status]: $old->status), - htmlspecialchars( - array_key_exists($new->status, $issue_status_array)? - $issue_status_array[$new->status]: $new->status)); - } - - if ($new->priority != $old->priority) - { - printf ("
    • {$msgfmt_changed_from_to}
    • ", - strtolower($this->lang->line('Priority')), - htmlspecialchars( - array_key_exists($old->priority, $issue_priority_array)? - $issue_priority_array[$old->priority]: $old->priority), - htmlspecialchars( - array_key_exists($new->priority, $issue_priority_array)? - $issue_priority_array[$new->priority]: $new->priority)); - } - - if ($new->owner != $old->owner) - { - if ($old->owner == '') - { - printf ("
    • {$msgfmt_changed_to}
    • ", - strtolower($this->lang->line('Owner')), - htmlspecialchars($new->owner)); - } - else - { - printf ("
    • {$msgfmt_changed_from_to}
    • ", - strtolower($this->lang->line('Owner')), - htmlspecialchars($old->owner), htmlspecialchars($new->owner)); - } - } - print '
    '; print '
    '; - - print '
    '; ?> +
    +
    + '; + print $this->lang->line('Change'); + print ''; + ?> +
    + +
    @@ -1230,7 +1260,7 @@ $this->load->view (
    - lang->line ('ISSUE_MSG_CONFIRM_UNDO')?> + lang->line ('ISSUE_MSG_CONFIRM_UNDO'); ?>
    diff --git a/codepot/src/css/issue.css b/codepot/src/css/issue.css index 6b45e8d2..859df1a8 100644 --- a/codepot/src/css/issue.css +++ b/codepot/src/css/issue.css @@ -1,7 +1,49 @@ +ul.codepot-issue-horizontal-list { + clear: both; + padding: 0; + margin: 0; + list-style: outside none none !important; +} + +ul.codepot-issue-horizontal-list li { + padding: 0.2em 0.2em 0.2em 0.2em; + margin: 0 0.2em 0 0.2em; + float: left; +} + +.codepot-issue-change ul.codepot-issue-horizontal-list { + padding: 0.3em 0 0.3em 0; +} + +.codepot-issue-start, +.codepot-issue-change { + padding: 0.3em 0 0.3em 0; +} + +.codepot-issue-change { + border-top: 1px solid #cccccc; +} + +.codepot-issue-change-topline { + background-color: #EEEEEE; + padding: 0.3em; + + -moz-border-radius: 3px; + -webkit-border-radius: 3px; + border-radius: 3px; + + line-height: 1.5em; +} + +.codepot-issue-change-date, .codepot-issue-comment-updater { float: left; } +.codepot-issue-comment-updater { + margin-left: 0.5em; +} + .codepot-issue-comment-actions { float: right; } @@ -21,7 +63,6 @@ textarea.codepot-issue-edit-comment { font-size: 0.9em; } - li.issue-type-defect { background-color: #D9534F; color: #FFFFFF; @@ -208,25 +249,10 @@ li.issue-owner { padding: 1em 1em; } -#issue_show_metadata_list, -#issue_show_state_list { - clear: both; - padding: 0; - margin: 0; - list-style: outside none none; -} - #issue_show_state_list { padding-top: 0.2em; } -#issue_show_metadata_list li, -#issue_show_state_list li { - padding: 0.2em 0.2em 0.2em 0.2em; - margin: 0 0.2em 0 0.2em; - float: left; -} - #issue_show_metadata_list li { background-color: #EAEAEA !important; color: #000000 !important; @@ -271,34 +297,6 @@ li.issue-owner { overflow: auto; } -#issue_show_changes_table td { - padding: 0.3em 0.3em 0.3em 0.3em; - white-space: normal; - word-wrap: break-word; -} - -#issue_show_changes_table td.date { - min-width: 5em; - width: 1px; - vertical-align: top; -} - -#issue_show_changes_table td.details { - overflow: auto; -} - -#issue_show_changes_table td.details .list { - background-color: #F1F1FF; -} - -#issue_show_changes_table td.details .list ul { - padding: 0; - margin: 0.2em 0.5em 0.5em 1em; -} - -#issue_show_changes_table td.details .list ul li { - padding: 0.1em; -} #issue_change_comment_preview_button.ui-button { font-size: 0.8em;