Issue 584: Ability to add a due date to a ticket - beginnings thereof
This commit is contained in:
parent
9bd5912884
commit
f697d97b6a
@ -112,6 +112,12 @@ class IDF_Form_IssueCreate extends Pluf_Form
|
|||||||
'size' => 15,
|
'size' => 15,
|
||||||
),
|
),
|
||||||
));
|
));
|
||||||
|
$this->fields['due_dtime'] = new Pluf_Form_Field_Datetime(
|
||||||
|
array('required' => false,
|
||||||
|
'label' => __('Due Date'),
|
||||||
|
'initial' => '',
|
||||||
|
'widget_attrs' => array('size' => 15,),
|
||||||
|
));
|
||||||
|
|
||||||
$this->fields['relation_type0'] = new Pluf_Form_Field_Varchar(
|
$this->fields['relation_type0'] = new Pluf_Form_Field_Varchar(
|
||||||
array('required' => false,
|
array('required' => false,
|
||||||
@ -368,6 +374,7 @@ class IDF_Form_IssueCreate extends Pluf_Form
|
|||||||
$issue->status = new IDF_Tag($_t[0]); // first one is the default
|
$issue->status = new IDF_Tag($_t[0]); // first one is the default
|
||||||
$issue->owner = null;
|
$issue->owner = null;
|
||||||
}
|
}
|
||||||
|
$issue->due_dtime = $this->cleaned_data['due_dtime'];
|
||||||
$issue->summary = trim($this->cleaned_data['summary']);
|
$issue->summary = trim($this->cleaned_data['summary']);
|
||||||
$issue->create();
|
$issue->create();
|
||||||
foreach ($tags as $tag) {
|
foreach ($tags as $tag) {
|
||||||
|
@ -103,6 +103,12 @@ class IDF_Form_IssueUpdate extends IDF_Form_IssueCreate
|
|||||||
'size' => 15,
|
'size' => 15,
|
||||||
),
|
),
|
||||||
));
|
));
|
||||||
|
$this->fields['due_dtime'] = new Pluf_Form_Field_Datetime(
|
||||||
|
array('required' => false,
|
||||||
|
'label' => __('Due Date'),
|
||||||
|
'initial' => $this->issue->due_dtime,
|
||||||
|
'widget_attrs' => array('size' => 15,),
|
||||||
|
));
|
||||||
|
|
||||||
$idx = 0;
|
$idx = 0;
|
||||||
// note: clean_relation_type0 and clean_relation_issue0 already
|
// note: clean_relation_type0 and clean_relation_issue0 already
|
||||||
@ -385,6 +391,10 @@ class IDF_Form_IssueUpdate extends IDF_Form_IssueCreate
|
|||||||
or ((!is_null($owner) and !is_null($this->issue->get_owner())) and $owner->id != $this->issue->get_owner()->id)) {
|
or ((!is_null($owner) and !is_null($this->issue->get_owner())) and $owner->id != $this->issue->get_owner()->id)) {
|
||||||
$changes['ow'] = (is_null($owner)) ? '---' : $owner->login;
|
$changes['ow'] = (is_null($owner)) ? '---' : $owner->login;
|
||||||
}
|
}
|
||||||
|
$due_dtime = $this->cleaned_data['due_dtime'];
|
||||||
|
if (trim($this->issue->due_dtime) != trim($this->cleaned_data['due_dtime'])) {
|
||||||
|
$changes['du'] = trim($this->cleaned_data['due_dtime']);
|
||||||
|
}
|
||||||
// Issue relations - additions
|
// Issue relations - additions
|
||||||
foreach ($this->cleaned_data['_added_issue_relations'] as $verb => $ids) {
|
foreach ($this->cleaned_data['_added_issue_relations'] as $verb => $ids) {
|
||||||
$other_verb = $this->relation_types[$verb];
|
$other_verb = $this->relation_types[$verb];
|
||||||
@ -431,6 +441,7 @@ class IDF_Form_IssueUpdate extends IDF_Form_IssueCreate
|
|||||||
$this->issue->summary = trim($this->cleaned_data['summary']);
|
$this->issue->summary = trim($this->cleaned_data['summary']);
|
||||||
$this->issue->status = $status;
|
$this->issue->status = $status;
|
||||||
$this->issue->owner = $owner;
|
$this->issue->owner = $owner;
|
||||||
|
$this->issue->due_dtime = $due_dtime;
|
||||||
}
|
}
|
||||||
// Create the comment
|
// Create the comment
|
||||||
$comment = new IDF_IssueComment();
|
$comment = new IDF_IssueComment();
|
||||||
|
@ -91,6 +91,12 @@ class IDF_Issue extends Pluf_Model
|
|||||||
'model' => 'IDF_Tag',
|
'model' => 'IDF_Tag',
|
||||||
'verbose' => __('labels'),
|
'verbose' => __('labels'),
|
||||||
),
|
),
|
||||||
|
'due_dtime' =>
|
||||||
|
array(
|
||||||
|
'type' => 'Pluf_DB_Field_Datetime',
|
||||||
|
'blank' => true,
|
||||||
|
'verbose' => __('due date'),
|
||||||
|
),
|
||||||
'status' =>
|
'status' =>
|
||||||
array(
|
array(
|
||||||
'type' => 'Pluf_DB_Field_Foreignkey',
|
'type' => 'Pluf_DB_Field_Foreignkey',
|
||||||
|
@ -63,6 +63,11 @@
|
|||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
|
<th>{$form.f.due_dtime.labelTag}:</th>
|
||||||
|
<td>{if $form.f.due_dtime.errors}{$form.f.due_dtime.fieldErrors}{/if}
|
||||||
|
{$form.f.due_dtime|unsafe}
|
||||||
|
</td>
|
||||||
|
<tr>
|
||||||
<th>{$form.f.relation_type0.labelTag}:</th>
|
<th>{$form.f.relation_type0.labelTag}:</th>
|
||||||
<td>
|
<td>
|
||||||
{if $form.f.relation_type0.errors}{$form.f.relation_type0.fieldErrors}{/if}
|
{if $form.f.relation_type0.errors}{$form.f.relation_type0.fieldErrors}{/if}
|
||||||
|
@ -128,6 +128,11 @@
|
|||||||
{$form.f.owner|unsafe}
|
{$form.f.owner|unsafe}
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
<th>{$form.f.due_dtime.labelTag}:</th>
|
||||||
|
<td>{if $form.f.due_dtime.errors}{$form.f.due_dtime.fieldErrors}{/if}
|
||||||
|
{$form.f.due_dtime|unsafe}
|
||||||
|
</td>
|
||||||
|
<tr>
|
||||||
<tr>
|
<tr>
|
||||||
<th>{$form.f.relation_type0.labelTag}:</th>
|
<th>{$form.f.relation_type0.labelTag}:</th>
|
||||||
<td>
|
<td>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user