From 439014b0b134e3d44636968a4bb8bf031d27df7b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20d=27Anterroches?= Date: Thu, 2 Sep 2010 14:16:41 +0200 Subject: [PATCH] Fixed ticket 479, project editing inconsistency. --- src/IDF/Form/Admin/ProjectCreate.php | 9 +++++++++ src/IDF/Form/Admin/ProjectUpdate.php | 9 +++++++++ src/IDF/templates/idf/gadmin/projects/create.html | 8 ++++++++ src/IDF/templates/idf/gadmin/projects/update.html | 8 ++++++++ 4 files changed, 34 insertions(+) diff --git a/src/IDF/Form/Admin/ProjectCreate.php b/src/IDF/Form/Admin/ProjectCreate.php index e2414e9..d297f14 100644 --- a/src/IDF/Form/Admin/ProjectCreate.php +++ b/src/IDF/Form/Admin/ProjectCreate.php @@ -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 diff --git a/src/IDF/Form/Admin/ProjectUpdate.php b/src/IDF/Form/Admin/ProjectUpdate.php index cd9995e..4157851 100644 --- a/src/IDF/Form/Admin/ProjectUpdate.php +++ b/src/IDF/Form/Admin/ProjectUpdate.php @@ -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(); } } diff --git a/src/IDF/templates/idf/gadmin/projects/create.html b/src/IDF/templates/idf/gadmin/projects/create.html index 1c1cddf..a2f70b8 100644 --- a/src/IDF/templates/idf/gadmin/projects/create.html +++ b/src/IDF/templates/idf/gadmin/projects/create.html @@ -29,6 +29,14 @@ +{$form.f.shortdesc.labelTag}: + +{if $form.f.shortdesc.errors}{$form.f.shortdesc.fieldErrors}{/if} +{$form.f.shortdesc|unsafe}
+{$form.f.shortdesc.help_text} + + + {$form.f.scm.labelTag}: {if $form.f.scm.errors}{$form.f.scm.fieldErrors}{/if} {$form.f.scm|unsafe} diff --git a/src/IDF/templates/idf/gadmin/projects/update.html b/src/IDF/templates/idf/gadmin/projects/update.html index 5442e72..e6a40eb 100644 --- a/src/IDF/templates/idf/gadmin/projects/update.html +++ b/src/IDF/templates/idf/gadmin/projects/update.html @@ -18,6 +18,14 @@ +{$form.f.shortdesc.labelTag}: + +{if $form.f.shortdesc.errors}{$form.f.shortdesc.fieldErrors}{/if} +{$form.f.shortdesc|unsafe}
+{$form.f.shortdesc.help_text} + + + {$form.f.owners.labelTag}: {if $form.f.owners.errors}{$form.f.owners.fieldErrors}{/if}