Indefero

Indefero Commit Details


Date:2012-04-13 08:07:18 (12 years 8 months ago)
Author:Simon Holywell
Branch:develop
Commit:3e78376be3e36fb30d60eb538027ee38c455086b
Parents: cf2f9d419e0cb9fa788d2e57053cb3424619c0d6
Message:Issue #13 Due time handling (local time / UTC)

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/IssueCreate.php
112112
113113
114114
115
115
116116
117117
118118
'size' => 15,
),
));
$this->fields['due_dtime'] = new IDF_Form_Field_Datetime(
$this->fields['due_dtime'] = new IDF_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_Datetime(
$this->fields['due_dtime'] = new IDF_Form_Field_Date(
array('required' => false,
'label' => __('Due date'),
'initial' => $this->issue->due_dtime,
src/IDF/Issue.php
156156
157157
158158
159
160
161
162
159163
160164
161165
162166
163167
168
169
170
164171
165172
166173
IDF_Search::remove($this);
}
function restore() {
$this->due_dtime = substr($this->due_dtime, 0, 10);
}
function preSave($create=false)
{
if ($this->id == '') {
$this->creation_dtime = gmdate('Y-m-d H:i:s');
}
if($this->due_dtime) {
$this->due_dtime .= ' 23:59:59';
}
$this->modif_dtime = gmdate('Y-m-d H:i:s');
}
src/IDF/Views/Issue.php
484484
485485
486486
487
488487
489488
490489
......
731730
732731
733732
734
735733
736734
737735
'date_1_week' => date('Y-m-d', strtotime('+1 week')),
'date_two_weeks' => date('Y-m-d', strtotime('+2 week')),
'date_one_month' => date('Y-m-d', strtotime('+1 month')),
'default_time' => Pluf::f('issue_default_due_date_time'),
),
self::autoCompleteArrays($prj)
);
'date_1_week' => date('Y-m-d', strtotime('+1 week')),
'date_two_weeks' => date('Y-m-d', strtotime('+2 week')),
'date_one_month' => date('Y-m-d', strtotime('+1 month')),
'default_time' => Pluf::f('issue_default_due_date_time'),
),
$arrays),
$request);
src/IDF/conf/idf.php-dist
506506
507507
508508
509
509
510510
511511
512512
......
533533
534534
535535
536
536
537537
538538
539539
......
544544
545545
546546
547
548
549
550
551
552
547
# submitted as value of the HTTP header 'Post-Commit-Hook-Hmac' during
# such a request. Since newer versions of Indefero use the same authentication
# mechanism (based on the same secret key) for other web hooks of the same
# project as well, the name of this HTTP header was no longer appropriate
# project as well, the name of this HTTP header was no longer appropriate
# and as such changed to simply 'Web-Hook-Hmac'.
#
# Setting the following configuration option to 'compat' now restores the
'wiki' => 2,
'downloads' => 1,
'review' => 1,
);
);
# Here you can define the timespan in days how long the activity calculation
# process should look into the history to get meaningful activity values for
# high enough to show a proper activity index for those projects as well.
$cfg['activity_lookback'] = 7;
# Configure the default time that should be used when setting an issue due date
# via the quick (COB, EOW, etc) menu or via the date picker
$cfg['issue_default_due_date_time'] = '17:30';
return $cfg;
return $cfg;
src/IDF/templates/idf/issues/create.html
129129
130130
131131
132
133132
134133
135134
......
137136
138137
139138
140
141
142
143
139
144140
145141
146142
{/block}
{block javascript}
<script type="text/javascript">
var default_time = '{$default_time}';
document.getElementById('id_summary').focus();{literal}
$(document).ready(function(){
$("#id_due_dtime").datepicker({
changeMonth: true,
yearRange: '-0:+5',
constrainInput: false,
dateFormat: 'yy-mm-dd',
onSelect: function(dateText, inst) {
this.value = dateText + ' ' + default_time;
}
dateFormat: 'yy-mm-dd'
});
$('#due_dtime_wrapper').mouseover(function(){
$('#due_dtime_more_shortcuts').show();
src/IDF/templates/idf/issues/view.html
233233
234234
235235
236
237236
238237
239238
......
241240
242241
243242
244
245
246
247
243
248244
249245
250246
{/block}
{block javascript}{if $form}{include 'idf/issues/js-autocomplete.html'}
<script type="text/javascript">
var default_time = '{$default_time}';
{literal}
$(document).ready(function(){
$("#id_due_dtime").datepicker({
changeMonth: true,
yearRange: '-0:+5',
constrainInput: false,
dateFormat: 'yy-mm-dd',
onSelect: function(dateText, inst) {
this.value = dateText + ' ' + default_time;
}
dateFormat: 'yy-mm-dd'
});
$('#due_dtime_wrapper').mouseover(function(){
$('#due_dtime_more_shortcuts').show();

Archive Download the corresponding diff file

Page rendered in 0.10673s using 14 queries.