Merge branch 'feature.issue-due-date' of github.com:treffynnon/Indefero into feature.issue-due-date

Conflicts:
	src/IDF/Form/IssueUpdate.php
This commit is contained in:
Simon Holywell 2012-04-26 16:16:45 +01:00
commit 7207cdcd46
2 changed files with 7 additions and 7 deletions

View File

@ -104,9 +104,10 @@ class IDF_Form_IssueUpdate extends IDF_Form_IssueCreate
), ),
)); ));
$this->fields['due_dtime'] = new Pluf_Form_Field_Date( $this->fields['due_dtime'] = new Pluf_Form_Field_Date(
$due_dtime = substr($this->issue->due_dtime, 0, 10);
array('required' => false, array('required' => false,
'label' => __('Due date'), 'label' => __('Due date'),
'initial' => $this->issue->due_dtime, 'initial' => $due_dtime,
'widget_attrs' => array('size' => 15,), 'widget_attrs' => array('size' => 15,),
)); ));

View File

@ -156,17 +156,16 @@ class IDF_Issue extends Pluf_Model
IDF_Search::remove($this); IDF_Search::remove($this);
} }
function restore() {
$this->due_dtime = substr($this->due_dtime, 0, 10);
}
function preSave($create=false) function preSave($create=false)
{ {
if ($this->id == '') { if ($this->id == '') {
$this->creation_dtime = gmdate('Y-m-d H:i:s'); $this->creation_dtime = gmdate('Y-m-d H:i:s');
} }
if($this->due_dtime) { if($this->due_dtime and !empty($this->due_dtime)) {
$this->due_dtime .= ' 23:59:59'; $datetime = $this->due_dtime . ' 23:59:59';
if(date('Y-m-d', strtotime($datetime)) === $this->due_dtime) {
$this->due_dtime = $datetime;
}
} }
$this->modif_dtime = gmdate('Y-m-d H:i:s'); $this->modif_dtime = gmdate('Y-m-d H:i:s');
} }