Added longer description for the downloads.

This commit is contained in:
Loic d'Anterroches
2009-06-22 21:08:33 +02:00
parent 0873d44162
commit 3848bd8d22
10 changed files with 535 additions and 298 deletions

View File

@@ -46,6 +46,16 @@ class IDF_Form_UpdateUpload extends Pluf_Form
'size' => 67,
),
));
$this->fields['changelog'] = new Pluf_Form_Field_Varchar(
array('required' => false,
'label' => __('Description'),
'initial' => $this->upload->changelog,
'widget' => 'Pluf_Form_Widget_TextareaInput',
'widget_attrs' => array(
'cols' => 58,
'rows' => 13,
),
));
$tags = $this->upload->get_tags_list();
for ($i=1;$i<7;$i++) {
$initial = '';
@@ -132,6 +142,7 @@ class IDF_Form_UpdateUpload extends Pluf_Form
}
// Create the upload
$this->upload->summary = trim($this->cleaned_data['summary']);
$this->upload->changelog = trim($this->cleaned_data['changelog']);
$this->upload->modif_dtime = gmdate('Y-m-d H:i:s');
$this->upload->update();
$this->upload->batchAssoc('IDF_Tag', $tags);

View File

@@ -44,6 +44,16 @@ class IDF_Form_Upload extends Pluf_Form
'size' => 67,
),
));
$this->fields['changelog'] = new Pluf_Form_Field_Varchar(
array('required' => false,
'label' => __('Description'),
'initial' => '',
'widget' => 'Pluf_Form_Widget_TextareaInput',
'widget_attrs' => array(
'cols' => 58,
'rows' => 13,
),
));
$this->fields['file'] = new Pluf_Form_Field_File(
array('required' => true,
'label' => __('File'),
@@ -155,6 +165,7 @@ class IDF_Form_Upload extends Pluf_Form
$upload->project = $this->project;
$upload->submitter = $this->user;
$upload->summary = trim($this->cleaned_data['summary']);
$upload->changelog = trim($this->cleaned_data['changelog']);
$upload->file = $this->cleaned_data['file'];
$upload->filesize = filesize(Pluf::f('upload_path').'/'.$this->project->shortname.'/files/'.$this->cleaned_data['file']);
$upload->downloads = 0;