Indefero

Indefero Commit Details


Date:2012-04-26 10:14:41 (12 years 7 months ago)
Author:Simon Holywell
Branch:develop
Commit:85f247909e8f92ae95eafde7133eca86d07a3438
Parents: 11b3811e17c8c8041742e8c21f455ac9210fcfdd
Message:Remove local Date field types and use Pluf newly added ones instead

Changes:

File differences

src/IDF/Form/Field/Date.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
<?php
/* -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
# ***** BEGIN LICENSE BLOCK *****
# This file is part of InDefero, an open source project management application.
# Copyright (C) 2008-2011 Céondo Ltd and contributors.
#
# InDefero is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# InDefero is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#
# ***** END LICENSE BLOCK ***** */
class IDF_Form_Field_Date extends Pluf_Form_Field_Date
{
public function clean($value) {
try {
return parent::clean($value);
} catch (Pluf_Form_Invalid $e) {
if(false === $this->required and empty($value)) {
return null;
}
throw $e;
}
}
}
src/IDF/Form/Field/Datetime.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
<?php
/* -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
# ***** BEGIN LICENSE BLOCK *****
# This file is part of InDefero, an open source project management application.
# Copyright (C) 2008-2011 Céondo Ltd and contributors.
#
# InDefero is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# InDefero is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#
# ***** END LICENSE BLOCK ***** */
class IDF_Form_Field_Datetime extends Pluf_Form_Field_Datetime
{
public function clean($value) {
try {
return parent::clean($value);
} catch (Pluf_Form_Invalid $e) {
if(false === $this->required and empty($value)) {
return null;
}
throw $e;
}
}
}
src/IDF/Form/IssueCreate.php
112112
113113
114114
115
115
116116
117117
118118
'size' => 15,
),
));
$this->fields['due_dtime'] = new IDF_Form_Field_Date(
$this->fields['due_dtime'] = new Pluf_Form_Field_Date(
array('required' => false,
'label' => __('Due date'),
'initial' => '',
src/IDF/Form/IssueUpdate.php
103103
104104
105105
106
106
107107
108108
109109
'size' => 15,
),
));
$this->fields['due_dtime'] = new IDF_Form_Field_Date(
$this->fields['due_dtime'] = new Pluf_Form_Field_Date(
array('required' => false,
'label' => __('Due date'),
'initial' => $this->issue->due_dtime,

Archive Download the corresponding diff file

Page rendered in 0.08469s using 13 queries.