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

@@ -40,13 +40,13 @@ class IDF_Review_FileComment extends Pluf_Model
'type' => 'Pluf_DB_Field_Sequence',
'blank' => true,
),
'patch' =>
'comment' =>
array(
'type' => 'Pluf_DB_Field_Foreignkey',
'model' => 'IDF_Review_Patch',
'model' => 'IDF_Review_Comment',
'blank' => false,
'verbose' => __('patch'),
'relate_name' => 'filecomments',
'verbose' => __('comment'),
),
'cfile' =>
array(
@@ -55,32 +55,25 @@ class IDF_Review_FileComment extends Pluf_Model
'size' => 250,
'help_text' => 'The changed file, for example src/foo/bar.txt, this is the path to access it in the repository.',
),
'cline' =>
array(
'type' => 'Pluf_DB_Field_Integer',
'blank' => false,
'default' => 0,
'help_text' => 'The commented line, negative value is the old file, positive the new, 0 general comment.',
),
'content' =>
array(
'type' => 'Pluf_DB_Field_Text',
'blank' => false,
'verbose' => __('comment'),
),
'submitter' =>
array(
'type' => 'Pluf_DB_Field_Foreignkey',
'model' => 'Pluf_User',
'blank' => false,
'verbose' => __('submitter'),
'relate_name' => 'commented_patched_files',
),
'creation_dtime' =>
array(
'type' => 'Pluf_DB_Field_Datetime',
'blank' => true,
'verbose' => __('creation date'),
),
);
$this->_a['idx'] = array(
'creation_dtime_idx' =>
array(
'col' => 'creation_dtime',
'type' => 'normal',
'index' => true,
),
);
}
@@ -92,12 +85,11 @@ class IDF_Review_FileComment extends Pluf_Model
function preDelete()
{
IDF_Timeline::remove($this);
}
function preSave($create=false)
{
if ($this->id == '') {
if ($create) {
$this->creation_dtime = gmdate('Y-m-d H:i:s');
}
}