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 ('
'; - print codepot_dbdatetodispdate($new->updatedon); - print ' | '; - - print '';
-
- print " ";
- print " ';
+
+ print '";
+ print ' ';
+
+ print '';
+ printf (' ";
+ print '%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 "';
+ if(isset($login['id']) && $login['id'] != '')
+ {
+ printf ("%s", $i, $this->lang->line('Edit'));
+ }
+ print ' ';
+ print '';
+ 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 ' ';
-
- print '
| ';
- print '