Fixed ticket 479, project editing inconsistency.

This commit is contained in:
Loïc d'Anterroches
2010-09-02 14:16:41 +02:00
parent f6fc5ae466
commit 439014b0b1
4 changed files with 34 additions and 0 deletions

View File

@@ -64,6 +64,14 @@ class IDF_Form_Admin_ProjectCreate extends Pluf_Form
'help_text' => __('It must be unique for each project and composed only of letters, digits and dash (-) like "my-project".'),
));
$this->fields['shortdesc'] = new Pluf_Form_Field_Varchar(
array('required' => true,
'label' => __('short description'),
'help_text' => __('A one line description of the project.'),
'initial' => '',
'widget_attrs' => array('size' => '35'),
));
$this->fields['scm'] = new Pluf_Form_Field_Varchar(
array('required' => true,
'label' => __('Repository type'),
@@ -272,6 +280,7 @@ class IDF_Form_Admin_ProjectCreate extends Pluf_Form
$project = new IDF_Project();
$project->name = $this->cleaned_data['name'];
$project->shortname = $this->cleaned_data['shortname'];
$project->shortdesc = $this->cleaned_data['shortdesc'];
if ($this->cleaned_data['template'] != '--') {
// Find the template project

View File

@@ -43,6 +43,14 @@ class IDF_Form_Admin_ProjectUpdate extends Pluf_Form
'initial' => $this->project->name,
));
$this->fields['shortdesc'] = new Pluf_Form_Field_Varchar(
array('required' => true,
'label' => __('short description'),
'help_text' => __('A one line description of the project.'),
'initial' => $this->project->shortdesc,
'widget_attrs' => array('size' => '35'),
));
$this->fields['owners'] = new Pluf_Form_Field_Varchar(
array('required' => false,
'label' => __('Project owners'),
@@ -80,6 +88,7 @@ class IDF_Form_Admin_ProjectUpdate extends Pluf_Form
$this->cleaned_data);
$this->project->membershipsUpdated();
$this->project->name = $this->cleaned_data['name'];
$this->project->shortdesc = $this->cleaned_data['shortdesc'];
$this->project->update();
}
}