Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
bugzilla
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
etersoft
bugzilla
Commits
6f647ebd
Commit
6f647ebd
authored
Mar 18, 2020
by
Давид Добряков
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add productive_time field
parent
81974a9a
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
49 additions
and
13 deletions
+49
-13
.gitignore
.gitignore
+1
-0
Bug.pm
Bugzilla/Bug.pm
+8
-2
Comment.pm
Bugzilla/Comment.pm
+10
-0
Constants.pm
Bugzilla/Constants.pm
+1
-1
Field.pm
Bugzilla/Field.pm
+1
-0
DB.pm
Bugzilla/Install/DB.pm
+2
-0
DB.pm~
Bugzilla/Install/DB.pm~
+0
-0
Bug.pm
Bugzilla/WebService/Bug.pm
+1
-1
process_bug.cgi
process_bug.cgi
+4
-3
.show.html.tmpl.swp
template/ru/default/bug/activity/.show.html.tmpl.swp
+0
-0
comments.html.tmpl
template/ru/default/bug/comments.html.tmpl
+16
-1
edit.html.tmpl
template/ru/default/bug/edit.html.tmpl
+5
-5
edit.html.tmpl~
template/ru/default/bug/edit.html.tmpl~
+0
-0
No files found.
.gitignore
View file @
6f647ebd
...
@@ -9,6 +9,7 @@
...
@@ -9,6 +9,7 @@
/data
/data
/localconfig
/localconfig
/index.html
/index.html
*.*~
/skins/contrib/Dusk/admin.css
/skins/contrib/Dusk/admin.css
/skins/contrib/Dusk/bug.css
/skins/contrib/Dusk/bug.css
Bugzilla/Bug.pm
View file @
6f647ebd
...
@@ -1074,6 +1074,11 @@ sub update {
...
@@ -1074,6 +1074,11 @@ sub update {
LogActivityEntry
(
$self
->
id
,
"work_time"
,
""
,
$comment
->
work_time
,
$user
->
id
,
LogActivityEntry
(
$self
->
id
,
"work_time"
,
""
,
$comment
->
work_time
,
$user
->
id
,
$delta_ts
);
$delta_ts
);
}
}
if
(
$comment
->
productive_time
)
{
LogActivityEntry
(
$self
->
id
,
"productive_time"
,
""
,
$comment
->
productive_time
,
$user
->
id
,
$delta_ts
);
}
}
}
# Comment Privacy
# Comment Privacy
...
@@ -2494,7 +2499,7 @@ sub set_all {
...
@@ -2494,7 +2499,7 @@ sub set_all {
}
}
}
}
if
(
exists
$params
->
{
'comment'
}
or
exists
$params
->
{
'work_time'
})
{
if
(
exists
$params
->
{
'comment'
}
or
exists
$params
->
{
'work_time'
}
or
exists
$params
->
{
'productive_time'
}
)
{
# Add a comment as needed to each bug. This is done early because
# Add a comment as needed to each bug. This is done early because
# there are lots of things that want to check if we added a comment.
# there are lots of things that want to check if we added a comment.
...
@@ -2502,7 +2507,8 @@ sub set_all {
...
@@ -2502,7 +2507,8 @@ sub set_all {
$params
->
{
'comment'
}
->
{
'body'
},
$params
->
{
'comment'
}
->
{
'body'
},
{
{
isprivate
=>
$params
->
{
'comment'
}
->
{
'is_private'
},
isprivate
=>
$params
->
{
'comment'
}
->
{
'is_private'
},
work_time
=>
$params
->
{
'work_time'
}
work_time
=>
$params
->
{
'work_time'
},
productive_time
=>
$params
->
{
'productive_time'
}
}
}
);
);
}
}
...
...
Bugzilla/Comment.pm
View file @
6f647ebd
...
@@ -38,6 +38,7 @@ use constant DB_COLUMNS => qw(
...
@@ -38,6 +38,7 @@ use constant DB_COLUMNS => qw(
who
who
bug_when
bug_when
work_time
work_time
productive_time
thetext
thetext
isprivate
isprivate
already_wrapped
already_wrapped
...
@@ -64,6 +65,7 @@ use constant VALIDATORS => {
...
@@ -64,6 +65,7 @@ use constant VALIDATORS => {
who
=>
\&
_check_who
,
who
=>
\&
_check_who
,
bug_when
=>
\&
_check_bug_when
,
bug_when
=>
\&
_check_bug_when
,
work_time
=>
\&
_check_work_time
,
work_time
=>
\&
_check_work_time
,
productive_time
=>
\&
_check_work_time
,
thetext
=>
\&
_check_thetext
,
thetext
=>
\&
_check_thetext
,
isprivate
=>
\&
_check_isprivate
,
isprivate
=>
\&
_check_isprivate
,
extra_data
=>
\&
_check_extra_data
,
extra_data
=>
\&
_check_extra_data
,
...
@@ -194,6 +196,14 @@ sub work_time {
...
@@ -194,6 +196,14 @@ sub work_time {
return
0
if
$_
[
0
]
->
{
'work_time'
}
+
0
==
0
;
return
0
if
$_
[
0
]
->
{
'work_time'
}
+
0
==
0
;
return
$_
[
0
]
->
{
'work_time'
};
return
$_
[
0
]
->
{
'work_time'
};
}
}
sub
productive_time
{
# Work_time-like function
return
0
if
$_
[
0
]
->
{
'productive_time'
}
+
0
==
0
;
return
$_
[
0
]
->
{
'productive_time'
};
}
sub
type
{
return
$_
[
0
]
->
{
'type'
};
}
sub
type
{
return
$_
[
0
]
->
{
'type'
};
}
sub
extra_data
{
return
$_
[
0
]
->
{
'extra_data'
}
}
sub
extra_data
{
return
$_
[
0
]
->
{
'extra_data'
}
}
...
...
Bugzilla/Constants.pm
View file @
6f647ebd
...
@@ -433,7 +433,7 @@ use constant ABNORMAL_SELECTS =>
...
@@ -433,7 +433,7 @@ use constant ABNORMAL_SELECTS =>
# The fields from fielddefs that are blocked from non-timetracking users.
# The fields from fielddefs that are blocked from non-timetracking users.
# work_time is sometimes called actual_time.
# work_time is sometimes called actual_time.
use
constant
TIMETRACKING_FIELDS
=>
use
constant
TIMETRACKING_FIELDS
=>
qw(estimated_time remaining_time work_time actual_time percentage_complete)
;
qw(estimated_time remaining_time work_time actual_time percentage_complete
productive_time
)
;
# The maximum number of days a token will remain valid.
# The maximum number of days a token will remain valid.
use
constant
MAX_TOKEN_AGE
=>
3
;
use
constant
MAX_TOKEN_AGE
=>
3
;
...
...
Bugzilla/Field.pm
View file @
6f647ebd
...
@@ -365,6 +365,7 @@ use constant DEFAULT_FIELDS => (
...
@@ -365,6 +365,7 @@ use constant DEFAULT_FIELDS => (
{
name
=>
'requestees.login_name'
,
desc
=>
'Flag Requestee'
},
{
name
=>
'requestees.login_name'
,
desc
=>
'Flag Requestee'
},
{
name
=>
'setters.login_name'
,
desc
=>
'Flag Setter'
},
{
name
=>
'setters.login_name'
,
desc
=>
'Flag Setter'
},
{
name
=>
'work_time'
,
desc
=>
'Hours Worked'
,
buglist
=>
1
,
is_numeric
=>
1
},
{
name
=>
'work_time'
,
desc
=>
'Hours Worked'
,
buglist
=>
1
,
is_numeric
=>
1
},
{
name
=>
'productive_time'
,
desc
=>
'Productive hours worked'
,
buglist
=>
1
,
is_numeric
=>
1
},
{
{
name
=>
'percentage_complete'
,
name
=>
'percentage_complete'
,
desc
=>
'Percentage Complete'
,
desc
=>
'Percentage Complete'
,
...
...
Bugzilla/Install/DB.pm
View file @
6f647ebd
...
@@ -268,6 +268,8 @@ sub update_table_definitions {
...
@@ -268,6 +268,8 @@ sub update_table_definitions {
$dbh
->
bz_add_column
(
"bugs"
,
"remaining_time"
,
$dbh
->
bz_add_column
(
"bugs"
,
"remaining_time"
,
{
TYPE
=>
'decimal(5,2)'
,
NOTNULL
=>
1
,
DEFAULT
=>
'0'
});
{
TYPE
=>
'decimal(5,2)'
,
NOTNULL
=>
1
,
DEFAULT
=>
'0'
});
$dbh
->
bz_add_column
(
"bugs"
,
"deadline"
,
{
TYPE
=>
'DATETIME'
});
$dbh
->
bz_add_column
(
"bugs"
,
"deadline"
,
{
TYPE
=>
'DATETIME'
});
$dbh
->
bz_add_column
(
"longdescs"
,
"productive_time"
,
{
TYPE
=>
'decimal(5,2)'
,
NOTNULL
=>
1
,
DEFAULT
=>
'0'
});
_use_ip_instead_of_hostname_in_logincookies
();
_use_ip_instead_of_hostname_in_logincookies
();
...
...
Bugzilla/Install/DB.pm~
deleted
100644 → 0
View file @
81974a9a
This source diff could not be displayed because it is too large. You can
view the blob
instead.
Bugzilla/WebService/Bug.pm
View file @
6f647ebd
...
@@ -1003,7 +1003,7 @@ sub add_comment {
...
@@ -1003,7 +1003,7 @@ sub add_comment {
# Append comment
# Append comment
$bug
->
add_comment
(
$comment
,
$bug
->
add_comment
(
$comment
,
{
isprivate
=>
$params
->
{
is_private
},
work_time
=>
$params
->
{
work_time
}});
{
isprivate
=>
$params
->
{
is_private
},
work_time
=>
$params
->
{
work_time
}
,
productive_time
=>
$params
->
{
productive_time
});
$bug
->
update
();
$bug
->
update
();
my
$new_comment_id
=
$bug
->
{
added_comments
}[
0
]
->
id
;
my
$new_comment_id
=
$bug
->
{
added_comments
}[
0
]
->
id
;
...
...
process_bug.cgi
View file @
6f647ebd
...
@@ -105,6 +105,8 @@ print $cgi->header() unless Bugzilla->usage_mode == USAGE_MODE_EMAIL;
...
@@ -105,6 +105,8 @@ print $cgi->header() unless Bugzilla->usage_mode == USAGE_MODE_EMAIL;
# an individual bug.
# an individual bug.
my
$delta_ts
=
$cgi
->
param
(
'delta_ts'
)
||
''
;
my
$delta_ts
=
$cgi
->
param
(
'delta_ts'
)
||
''
;
my
$productive_time
=
$cgi
->
param
(
'productive_time'
)
||
''
;
if
(
$delta_ts
)
{
if
(
$delta_ts
)
{
my
$delta_ts_z
=
datetime_from
(
$delta_ts
)
my
$delta_ts_z
=
datetime_from
(
$delta_ts
)
or
ThrowCodeError
(
'invalid_timestamp'
,
{
timestamp
=>
$delta_ts
});
or
ThrowCodeError
(
'invalid_timestamp'
,
{
timestamp
=>
$delta_ts
});
...
@@ -206,7 +208,7 @@ my @set_fields = qw(op_sys rep_platform priority bug_severity
...
@@ -206,7 +208,7 @@ my @set_fields = qw(op_sys rep_platform priority bug_severity
component target_milestone version
component target_milestone version
bug_file_loc status_whiteboard short_desc
bug_file_loc status_whiteboard short_desc
deadline remaining_time estimated_time
deadline remaining_time estimated_time
work_time set_default_assignee set_default_qa_contact
work_time
productive_time
set_default_assignee set_default_qa_contact
cclist_accessible reporter_accessible
cclist_accessible reporter_accessible
product confirm_product_change
product confirm_product_change
bug_status resolution dup_id bug_ignored)
;
bug_status resolution dup_id bug_ignored)
;
...
@@ -220,6 +222,7 @@ my %field_translation = (
...
@@ -220,6 +222,7 @@ my %field_translation = (
set_default_assignee
=>
'reset_assigned_to'
,
set_default_assignee
=>
'reset_assigned_to'
,
set_default_qa_contact
=>
'reset_qa_contact'
,
set_default_qa_contact
=>
'reset_qa_contact'
,
confirm_product_change
=>
'product_change_confirmed'
,
confirm_product_change
=>
'product_change_confirmed'
,
productive_time
=>
'productive_time'
,
);
);
my
%
set_all_fields
=
(
other_bugs
=>
\
@bug_objects
);
my
%
set_all_fields
=
(
other_bugs
=>
\
@bug_objects
);
...
@@ -232,7 +235,6 @@ foreach my $field_name (@set_fields) {
...
@@ -232,7 +235,6 @@ foreach my $field_name (@set_fields) {
if
(
should_set
(
'keywords'
))
{
if
(
should_set
(
'keywords'
))
{
my
$action
=
$cgi
->
param
(
'keywordaction'
)
||
''
;
my
$action
=
$cgi
->
param
(
'keywordaction'
)
||
''
;
# Backward-compatibility for Bugzilla 3.x and older.
# Backward-compatibility for Bugzilla 3.x and older.
$action
=
'remove'
if
$action
eq
'delete'
;
$action
=
'remove'
if
$action
eq
'delete'
;
$action
=
'set'
if
$action
eq
'makeexact'
;
$action
=
'set'
if
$action
eq
'makeexact'
;
...
@@ -358,7 +360,6 @@ if (defined $cgi->param('id')) {
...
@@ -358,7 +360,6 @@ if (defined $cgi->param('id')) {
my
(
$flags
,
$new_flags
)
my
(
$flags
,
$new_flags
)
=
Bugzilla::
Flag
->
extract_flags_from_cgi
(
$first_bug
,
undef
,
$vars
);
=
Bugzilla::
Flag
->
extract_flags_from_cgi
(
$first_bug
,
undef
,
$vars
);
$first_bug
->
set_flags
(
$flags
,
$new_flags
);
$first_bug
->
set_flags
(
$flags
,
$new_flags
);
# Tags can only be set to one bug at once.
# Tags can only be set to one bug at once.
if
(
should_set
(
'tag'
))
{
if
(
should_set
(
'tag'
))
{
my
@new_tags
=
grep
{
trim
(
$_
)
}
split
(
/,/
,
$cgi
->
param
(
'tag'
));
my
@new_tags
=
grep
{
trim
(
$_
)
}
split
(
/,/
,
$cgi
->
param
(
'tag'
));
...
...
template/ru/default/bug/activity/.show.html.tmpl.swp
deleted
100644 → 0
View file @
81974a9a
File deleted
template/ru/default/bug/comments.html.tmpl
View file @
6f647ebd
...
@@ -202,6 +202,8 @@
...
@@ -202,6 +202,8 @@
<br>
<br>
Отработанное время:
Отработанное время:
[% PROCESS formattimeunit time_unit=comment.work_time %]
[% PROCESS formattimeunit time_unit=comment.work_time %]
Продуктивное время:
<span class="productive-time">[% PROCESS formattimeunit time_unit=comment.productive_time %]</span>
[% END %]
[% END %]
[% IF user.id && Param('comment_taggers_group') %]
[% IF user.id && Param('comment_taggers_group') %]
...
@@ -222,7 +224,6 @@
...
@@ -222,7 +224,6 @@
</span>
</span>
</div>
</div>
[% END %]
[% END %]
[%# Don't indent the <pre> block, since then the spaces are displayed in the
[%# Don't indent the <pre> block, since then the spaces are displayed in the
# generated HTML
# generated HTML
#%]
#%]
...
@@ -235,4 +236,18 @@
...
@@ -235,4 +236,18 @@
[% Hook.process('a_comment-end', 'bug/comments.html.tmpl') %]
[% Hook.process('a_comment-end', 'bug/comments.html.tmpl') %]
</div>
</div>
[% END %]
[% END %]
<script type="text/javascript">
let productiveTimes = document.querySelectorAll('.productive-time');
// parse float and get sum
let sum = 0;
for (let i = 0; i < productiveTimes.length; i++) {
sum += parseFloat(productiveTimes[i].innerText);
}
// write in table:
document.querySelector('#productive_time_amount').innerHTML += sum;
</script>
[% END %]
[% END %]
template/ru/default/bug/edit.html.tmpl
View file @
6f647ebd
...
@@ -1091,15 +1091,15 @@
...
@@ -1091,15 +1091,15 @@
time_unit=(bug.actual_time + bug.remaining_time) %]
time_unit=(bug.actual_time + bug.remaining_time) %]
</td>
</td>
<td>
<td>
[% PROCESS formattimeunit time_unit=bug.actual_time %]
+
[% PROCESS formattimeunit time_unit=bug.actual_time %]
<input name="work_time" id="work_time"
<input name="work_time" id="work_time"
value="0" size="3" maxlength="6"
value="0" size="3" maxlength="6"
onchange="adjustRemainingTime();">
onchange="adjustRemainingTime();"
hidden
>
</td>
</td>
<td>
<td
id="productive_time_amount"
>
[% PROCESS formattimeunit time_unit=bug.productive_time %]
[% PROCESS formattimeunit time_unit=bug.productive_time %]
<input name="productive_time" id="productive_time"
<input name="productive_time" id="productive_time"
value="0" size="3" maxlength="6">
value="0" size="3" maxlength="6"
hidden
>
</td>
</td>
<td>
<td>
<input name="remaining_time" id="remaining_time"
<input name="remaining_time" id="remaining_time"
...
...
template/ru/default/bug/edit.html.tmpl~
deleted
100644 → 0
View file @
81974a9a
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment