Indefero

Indefero Commit Details


Date:2012-03-10 17:16:12 (12 years 9 months ago)
Author:Simon Holywell
Branch:develop
Commit:d676727c1ee4cae4f97c45cabd0e12a42b55091e
Parents: e0da21cbf82ccfd5a3ef6b678c199a5903ed78f3
Message:Allow for non-mandantory date time fields

Changes:

File differences

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 Pluf_Form_Field_Datetime(
$this->fields['due_dtime'] = new IDF_Form_Field_Datetime(
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 Pluf_Form_Field_Datetime(
$this->fields['due_dtime'] = new IDF_Form_Field_Datetime(
array('required' => false,
'label' => __('Due date'),
'initial' => $this->issue->due_dtime,

Archive Download the corresponding diff file

Page rendered in 0.08234s using 13 queries.