More work on the issue relation infrastructure

- actually query data for the incoming query
- exclude the current issue from being linked with itself
- allow multiple issues to be given in the second input field
- add the form fields to the ticket update view as well
This commit is contained in:
Thomas Keller
2011-05-10 16:21:29 +02:00
parent 9171bfd1ab
commit 7e226b43d3
5 changed files with 78 additions and 13 deletions

View File

@@ -69,11 +69,11 @@ class IDF_Form_IssueUpdate extends IDF_Form_IssueCreate
// case of someone allowing the upload path to be accessible
// to everybody.
for ($i=1;$i<4;$i++) {
$filename = substr($md5, 0, 2).'/'.substr($md5, 2, 2).'/'.substr($md5, 4).'/%s.dummy';
$filename = substr($md5, 0, 2).'/'.substr($md5, 2, 2).'/'.substr($md5, 4).'/%s.dummy';
$this->fields['attachment'.$i] = new Pluf_Form_Field_File(
array('required' => false,
'label' => __('Attach a file'),
'move_function_params' =>
'move_function_params' =>
array('upload_path' => $upload_path,
'upload_path_create' => true,
'file_name' => $filename,
@@ -102,6 +102,22 @@ class IDF_Form_IssueUpdate extends IDF_Form_IssueCreate
'size' => 15,
),
));
$relation_types = $extra['project']->getRelationsFromConfig();
$this->fields['relation_type'] = new Pluf_Form_Field_Varchar(
array('required' => false,
'label' => __('This issue'),
'initial' => $relation_types[0],
'widget_attrs' => array('size' => 15),
));
$this->fields['relation_issue'] = new Pluf_Form_Field_Varchar(
array('required' => false,
'label' => null,
'initial' => '',
'widget_attrs' => array('size' => 10),
));
$tags = $this->issue->get_tags_list();
for ($i=1;$i<7;$i++) {
$initial = '';