Fixed the review backend to support multiple patches per review and line level comments.

This commit is contained in:
Loic d'Anterroches
2009-07-16 10:04:58 +02:00
parent dd56d681b3
commit 99992442f5
12 changed files with 270 additions and 243 deletions

View File

@@ -76,13 +76,17 @@ class IDF_Form_ReviewFileComment extends Pluf_Form
if (!$this->isValid()) {
throw new Exception(__('Cannot save the model from an invalid form.'));
}
// create a base comment
$bc = new IDF_Review_Comment();
$bc->patch = $this->patch;
$bc->submitter = $this->user;
$bc->create();
foreach ($this->files as $filename => $def) {
if (!empty($this->cleaned_data[md5($filename)])) {
// Add a comment.
$c = new IDF_Review_FileComment();
$c->patch = $this->patch;
$c->comment = $bc;
$c->cfile = $filename;
$c->submitter = $this->user;
$c->content = $this->cleaned_data[md5($filename)];
$c->create();
}