[Rt-commit] rt branch, 4.4/timeworked-per-user, repushed
Todd Wade
todd at bestpractical.com
Tue Aug 11 07:33:10 EDT 2015
The branch 4.4/timeworked-per-user was deleted and repushed:
was 36e9b6c76d8d91d982107d657ac8cf7d6ef5c4ca
now edd13c0c291fb9701358df0929c19406d1b00c2b
1: c7d13c7 ! 1: 081f4d1 add a way for tests to get ticket pages besides the display page
@@ -1,6 +1,6 @@
Author: Todd Wade <todd at bestpractical.com>
- add a way for to get ticket pages besides the display page
+ add a way for tests to get ticket pages besides the display page
diff --git a/lib/RT/Test/Web.pm b/lib/RT/Test/Web.pm
--- a/lib/RT/Test/Web.pm
2: 3ba0df4 = 2: 890234b Automatically update the timeworked field of a ticket's parent tickets
3: f02663e ! 3: edd13c0 Break out the time worked on a ticket per user
@@ -38,25 +38,45 @@
-
-1;
-diff --git a/etc/upgrade/4.4.0rc1/content b/etc/upgrade/4.4.0rc1/content
---- a/etc/upgrade/4.4.0rc1/content
-+++ b/etc/upgrade/4.4.0rc1/content
-@@
- Description => 'Update Parent TimeWorked', # loc
- ExecModule => 'UpdateParentTimeWorked',
- },
+diff --git a/etc/upgrade/4.3.8/content b/etc/upgrade/4.3.8/content
+new file mode 100644
+--- /dev/null
++++ b/etc/upgrade/4.3.8/content
+@@
++use warnings;
++use strict;
++
++our @ScripActions = (
++ {
++ Name => 'Update Parent TimeWorked', # loc
++ Description => 'Update Parent TimeWorked', # loc
++ ExecModule => 'UpdateParentTimeWorked',
++ },
+ {
+ Name => 'Update User TimeWorked', # loc
+ Description => 'Update User TimeWorked', # loc
+ ExecModule => 'UpdateUserTimeWorked',
+ },
- );
-
-
-@@
- Template => 'Blank',
- Disabled => 1,
- },
++);
++
++
++our @ScripConditions = (
++ {
++ Name => 'On TimeWorked Change', # loc
++ Description => 'When TimeWorked Change', # loc
++ ApplicableTransTypes => 'Any',
++ ExecModule => 'TimeWorkedChange',
++ },
++);
++
++our @Scrips = (
++ {
++ Description => 'On TimeWorked Change Update Parent TimeWorked',
++ ScripCondition => 'On TimeWorked Change',
++ ScripAction => 'Update Parent TimeWorked',
++ Template => 'Blank',
++ Disabled => 1,
++ },
+ {
+ Description => 'On TimeWorked Change Update User TimeWorked',
+ ScripCondition => 'On TimeWorked Change',
@@ -64,8 +84,131 @@
+ Template => 'Blank',
+ Disabled => 1,
+ },
- );
-
++);
++
++1;
+
+diff --git a/etc/upgrade/4.4.0rc1/content b/etc/upgrade/4.4.0rc1/content
+deleted file mode 100644
+--- a/etc/upgrade/4.4.0rc1/content
++++ /dev/null
+@@
+- at ScripActions = (
+- {
+- Name => 'Update Parent TimeWorked', # loc
+- Description => 'Update Parent TimeWorked', # loc
+- ExecModule => 'UpdateParentTimeWorked',
+- },
+-);
+-
+-
+- at ScripConditions = (
+- {
+- Name => 'On TimeWorked Change', # loc
+- Description => 'When TimeWorked Change', # loc
+- ApplicableTransTypes => 'Any',
+- ExecModule => 'TimeWorkedChange',
+- },
+-);
+-
+- at Scrips = (
+- {
+- Description => 'On TimeWorked Change Update Parent TimeWorked',
+- ScripCondition => 'On TimeWorked Change',
+- ScripAction => 'Update Parent TimeWorked',
+- Template => 'Blank',
+- Disabled => 1,
+- },
+-);
+-
+-1;
+
+diff --git a/lib/RT/Action/UpdateParentTimeWorked.pm b/lib/RT/Action/UpdateParentTimeWorked.pm
+--- a/lib/RT/Action/UpdateParentTimeWorked.pm
++++ b/lib/RT/Action/UpdateParentTimeWorked.pm
+@@
++# BEGIN BPS TAGGED BLOCK {{{
++#
++# COPYRIGHT:
++#
++# This software is Copyright (c) 1996-2015 Best Practical Solutions, LLC
++# <sales at bestpractical.com>
++#
++# (Except where explicitly superseded by other copyright notices)
++#
++#
++# LICENSE:
++#
++# This work is made available to you under the terms of Version 2 of
++# the GNU General Public License. A copy of that license should have
++# been provided with this software, but in any event can be snarfed
++# from www.gnu.org.
++#
++# This work 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 Street, Fifth Floor, Boston, MA
++# 02110-1301 or visit their web page on the internet at
++# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html.
++#
++#
++# CONTRIBUTION SUBMISSION POLICY:
++#
++# (The following paragraph is not intended to limit the rights granted
++# to you to modify and distribute this software under the terms of
++# the GNU General Public License and is only of importance to you if
++# you choose to contribute your changes and enhancements to the
++# community by submitting them to Best Practical Solutions, LLC.)
++#
++# By intentionally submitting any modifications, corrections or
++# derivatives to this work, or any other work intended for use with
++# Request Tracker, to Best Practical Solutions, LLC, you confirm that
++# you are the copyright holder for those contributions and you grant
++# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable,
++# royalty-free, perpetual, license to use, copy, create derivative
++# works based on those contributions, and sublicense and distribute
++# those contributions and any derivatives thereof.
++#
++# END BPS TAGGED BLOCK }}}
++
+ use strict;
+ use warnings;
+
+ package RT::Action::UpdateParentTimeWorked;
+ use base 'RT::Action';
+
++=head1 NAME
++
++RT::Action::UpdateParentTimeWorked - RT's scrip action to set/update the time
++worked on a parent ticket when a child ticket's TimeWorked is added to.
++
++=head1 DESCRIPTION
++
++This action is used as an action for the 'On TimeWorked Change' condition.
++
++When it fires it finds a ticket's parent tickets and increments the time on
++those tickets along with the built in behavior of incrementing the TimeWorked
++on the current ticket.
++
++=cut
++
+ sub Prepare {
+ my $self = shift;
+ my $ticket = $self->TicketObj;
+@@
+ }
+ }
+
++=head1 AUTHOR
++
++Best Practical Solutions, LLC E<lt>modules at bestpractical.comE<gt>
++
++=cut
++
1;
diff --git a/lib/RT/Action/UpdateUserTimeWorked.pm b/lib/RT/Action/UpdateUserTimeWorked.pm
@@ -73,11 +216,73 @@
--- /dev/null
+++ b/lib/RT/Action/UpdateUserTimeWorked.pm
@@
++# BEGIN BPS TAGGED BLOCK {{{
++#
++# COPYRIGHT:
++#
++# This software is Copyright (c) 1996-2015 Best Practical Solutions, LLC
++# <sales at bestpractical.com>
++#
++# (Except where explicitly superseded by other copyright notices)
++#
++#
++# LICENSE:
++#
++# This work is made available to you under the terms of Version 2 of
++# the GNU General Public License. A copy of that license should have
++# been provided with this software, but in any event can be snarfed
++# from www.gnu.org.
++#
++# This work 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 Street, Fifth Floor, Boston, MA
++# 02110-1301 or visit their web page on the internet at
++# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html.
++#
++#
++# CONTRIBUTION SUBMISSION POLICY:
++#
++# (The following paragraph is not intended to limit the rights granted
++# to you to modify and distribute this software under the terms of
++# the GNU General Public License and is only of importance to you if
++# you choose to contribute your changes and enhancements to the
++# community by submitting them to Best Practical Solutions, LLC.)
++#
++# By intentionally submitting any modifications, corrections or
++# derivatives to this work, or any other work intended for use with
++# Request Tracker, to Best Practical Solutions, LLC, you confirm that
++# you are the copyright holder for those contributions and you grant
++# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable,
++# royalty-free, perpetual, license to use, copy, create derivative
++# works based on those contributions, and sublicense and distribute
++# those contributions and any derivatives thereof.
++#
++# END BPS TAGGED BLOCK }}}
++
+use strict;
+use warnings;
+
+package RT::Action::UpdateUserTimeWorked;
+use base 'RT::Action';
++
++=head1 NAME
++
++RT::Action::UpdateUserTimeWorked - RT's scrip action to set/update the time
++worked for a user each time they log time worked on a ticket
++
++=head1 DESCRIPTION
++
++This action is used as an action for the 'On TimeWorked Change' condition.
++
++When it fires, a ticket attribute stores the amount of time the user updating
++the ticket worked on it.
++
++=cut
+
+sub Prepare {
+ return 1;
@@ -99,7 +304,98 @@
+ }
+}
+
++=head1 AUTHOR
++
++Best Practical Solutions, LLC E<lt>modules at bestpractical.comE<gt>
++
++=cut
++
+1;
+
+diff --git a/lib/RT/Condition/TimeWorkedChange.pm b/lib/RT/Condition/TimeWorkedChange.pm
+--- a/lib/RT/Condition/TimeWorkedChange.pm
++++ b/lib/RT/Condition/TimeWorkedChange.pm
+@@
++# BEGIN BPS TAGGED BLOCK {{{
++#
++# COPYRIGHT:
++#
++# This software is Copyright (c) 1996-2015 Best Practical Solutions, LLC
++# <sales at bestpractical.com>
++#
++# (Except where explicitly superseded by other copyright notices)
++#
++#
++# LICENSE:
++#
++# This work is made available to you under the terms of Version 2 of
++# the GNU General Public License. A copy of that license should have
++# been provided with this software, but in any event can be snarfed
++# from www.gnu.org.
++#
++# This work 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 Street, Fifth Floor, Boston, MA
++# 02110-1301 or visit their web page on the internet at
++# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html.
++#
++#
++# CONTRIBUTION SUBMISSION POLICY:
++#
++# (The following paragraph is not intended to limit the rights granted
++# to you to modify and distribute this software under the terms of
++# the GNU General Public License and is only of importance to you if
++# you choose to contribute your changes and enhancements to the
++# community by submitting them to Best Practical Solutions, LLC.)
++#
++# By intentionally submitting any modifications, corrections or
++# derivatives to this work, or any other work intended for use with
++# Request Tracker, to Best Practical Solutions, LLC, you confirm that
++# you are the copyright holder for those contributions and you grant
++# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable,
++# royalty-free, perpetual, license to use, copy, create derivative
++# works based on those contributions, and sublicense and distribute
++# those contributions and any derivatives thereof.
++#
++# END BPS TAGGED BLOCK }}}
++
+ use strict;
+ use warnings;
+
+ package RT::Condition::TimeWorkedChange;
+ use base 'RT::Condition';
+
++=head1 NAME
++
++RT::Condition::TimeWorkedChange - RT's scrip condition that fires when the
++TimeWorked field has a value at form submission.
++
++=head1 DESCRIPTION
++
++This condition is true when the transaction has a TimeTaken value or the
++TimeWorked field is being updated.
++
++=cut
++
+ sub IsApplicable {
+ my $self = shift;
+ my $txn = $self->TransactionObj;
+@@
+ return 0;
+ }
+
++=head1 AUTHOR
++
++Best Practical Solutions, LLC E<lt>modules at bestpractical.comE<gt>
++
++=cut
+
+ 1;
diff --git a/lib/RT/Interface/Web.pm b/lib/RT/Interface/Web.pm
--- a/lib/RT/Interface/Web.pm
@@ -120,11 +416,17 @@
--- a/share/html/Ticket/Elements/ShowBasics
+++ b/share/html/Ticket/Elements/ShowBasics
@@
+ % }
+ % $m->callback( %ARGS, CallbackName => 'AfterTimeEstimated', TicketObj => $Ticket );
+ % if ($Ticket->TimeWorked) {
+- <tr class="time worked">
++ <tr class="time worked sum">
+ <td class="label"><&|/l&>Worked</&>:</td>
<td class="value"><& ShowTime, minutes => $Ticket->TimeWorked &></td>
</tr>
% }
+% if ( keys %$time_worked ) {
-+<tr class="time worked">
++<tr class="time worked by-user">
+ <td class="label"><&|/l&>Users</&>:</td>
+ <td>
+ <table>
@@ -377,4 +679,3 @@
-done_testing();
\ No newline at end of file
+done_testing();
-
4: 36e9b6c < -: ------- cleanup for policy tests / move upgrade file to better location
More information about the rt-commit
mailing list