[Rt-commit] rt branch, 4.4/timeworked-per-user, repushed
Todd Wade
todd at bestpractical.com
Thu Aug 13 12:17:24 EDT 2015
The branch 4.4/timeworked-per-user was deleted and repushed:
was edd13c0c291fb9701358df0929c19406d1b00c2b
now 2e8aa7d49c8de20db46c1256787d7a935c8766a4
1: 081f4d1 = 1: 081f4d1 add a way for tests to get ticket pages besides the display page
2: 890234b ! 2: 01f3b2f Automatically update the timeworked field of a ticket's parent tickets
@@ -12,13 +12,50 @@
--- a/etc/initialdata
+++ b/etc/initialdata
@@
- },
+ { Name => 'Send Forward', # loc
+ Description => 'Send forwarded message', # loc
+ ExecModule => 'SendForward', },
++ { Name => 'Update Parent TimeWorked', # loc
++ Description => 'Update Parent TimeWorked', # loc
++ ExecModule => 'UpdateParentTimeWorked',
++ },
+ );
+
+ @ScripConditions = (
+@@
+ ApplicableTransTypes => 'Status,Set',
+ ExecModule => 'ReopenTicket',
},
++ {
++ Name => 'On TimeWorked Change', # loc
++ Description => 'When TimeWorked Change', # loc
++ ApplicableTransTypes => 'Any',
++ ExecModule => 'TimeWorkedChange',
++ },
+
);
-+
-+# timeworked related functionality that was cored from extensions
-+
-+push @ScripActions => (
+
+@@
+ ScripCondition => 'On Forward Ticket',
+ ScripAction => 'Send Forward',
+ Template => 'Forward Ticket' },
++ { Description => 'On TimeWorked Change Update Parent TimeWorked',
++ ScripCondition => 'On TimeWorked Change',
++ ScripAction => 'Update Parent TimeWorked',
++ Template => 'Blank' },
+ );
+
+ @ACL = (
+
+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
@@ -26,51 +63,16 @@
+ },
+);
+
-+
-+push @ScripConditions => (
++our @ScripConditions = (
+ {
-+ Name => 'On TimeWorked Change', # loc
++ Name => 'On TimeWorked Change', # loc
+ Description => 'When TimeWorked Change', # loc
+ ApplicableTransTypes => 'Any',
+ ExecModule => 'TimeWorkedChange',
+ },
+);
+
-+push @Scrips => (
-+ {
-+ Description => 'On TimeWorked Change Update Parent TimeWorked',
-+ ScripCondition => 'On TimeWorked Change',
-+ ScripAction => 'Update Parent TimeWorked',
-+ Template => 'Blank',
-+ },
-+);
-+
-+1;
-
-diff --git a/etc/upgrade/4.4.0rc1/content b/etc/upgrade/4.4.0rc1/content
-new file mode 100644
---- /dev/null
-+++ b/etc/upgrade/4.4.0rc1/content
-@@
-+ 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 = (
++our @Scrips = (
+ {
+ Description => 'On TimeWorked Change Update Parent TimeWorked',
+ ScripCondition => 'On TimeWorked Change',
@@ -87,11 +89,74 @@
--- /dev/null
+++ 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;
@@ -129,6 +194,12 @@
+ }
+}
+
++=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
@@ -136,11 +207,71 @@
--- /dev/null
+++ 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;
@@ -153,6 +284,11 @@
+ return 0;
+}
+
++=head1 AUTHOR
++
++Best Practical Solutions, LLC E<lt>modules at bestpractical.comE<gt>
++
++=cut
+
+1;
@@ -237,5 +373,4 @@
+
+undef $m;
+done_testing();
-\ No newline at end of file
-
+
3: edd13c0 ! 3: 2e8aa7d Break out the time worked on a ticket per user
@@ -12,6 +12,32 @@
diff --git a/etc/initialdata b/etc/initialdata
--- a/etc/initialdata
+++ b/etc/initialdata
+@@
+ Description => 'Update Parent TimeWorked', # loc
+ ExecModule => 'UpdateParentTimeWorked',
+ },
++ { Name => 'Update User TimeWorked', # loc
++ Description => 'Update User TimeWorked', # loc
++ ExecModule => 'UpdateUserTimeWorked',
++ },
+ );
+
+ @ScripConditions = (
+@@
+ ScripCondition => 'On TimeWorked Change',
+ ScripAction => 'Update Parent TimeWorked',
+ Template => 'Blank' },
++ { Description => 'On TimeWorked Change Update User TimeWorked',
++ ScripCondition => 'On TimeWorked Change',
++ ScripAction => 'Update User TimeWorked',
++ Template => 'Blank' },
+ );
+
+ @ACL = (
+
+diff --git a/etc/upgrade/4.3.8/content b/etc/upgrade/4.3.8/content
+--- a/etc/upgrade/4.3.8/content
++++ b/etc/upgrade/4.3.8/content
@@
Description => 'Update Parent TimeWorked', # loc
ExecModule => 'UpdateParentTimeWorked',
@@ -23,60 +49,14 @@
+ },
);
-
-@@
- ScripAction => 'Update Parent TimeWorked',
++
+ our @ScripConditions = (
+ {
+ Name => 'On TimeWorked Change', # loc
+@@
Template => 'Blank',
+ Disabled => 1,
},
-+ {
-+ Description => 'On TimeWorked Change Update User TimeWorked',
-+ ScripCondition => 'On TimeWorked Change',
-+ ScripAction => 'Update User TimeWorked',
-+ Template => 'Blank',
-+ },
- );
--
--1;
-
-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',
-+ },
-+);
-+
-+
-+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',
@@ -84,131 +64,8 @@
+ 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
@@ -311,91 +168,6 @@
+=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
@@ -501,39 +273,6 @@
+ margin-left: 10px;
+}
-diff --git a/share/static/js/util.js b/share/static/js/util.js
---- a/share/static/js/util.js
-+++ b/share/static/js/util.js
-@@
- jQuery('select.chosen').chosen({ width: '20em', placeholder_text_multiple: ' ', no_results_text: ' ', search_contains: true });
- AddAttachmentWarning();
- });
-+
-+// timeworked javascript
-+jQuery( function () {
-+ jQuery('a[data-ticket-class=add_time_worked]').click( function () {
-+ var form = jQuery(this).siblings('form');
-+ form.find('input[name=TimeWorked]').focus();
-+ return false;
-+ });
-+
-+ jQuery('form.add_time_worked.template input[name=ActivityDate]').val(
-+ jQuery('input[name=ActivityDate]:first').val());
-+
-+ var form_template = jQuery('form.add_time_worked.template');
-+ jQuery('a[data-ticket-class=add_time_worked]').each( function ( index, e ) {
-+ var id = jQuery(this).attr('data-ticket-id');
-+ var form = form_template.clone();
-+ form.insertAfter(e);
-+ form.find('input[name=Ticket]').val(id);
-+ form.removeClass('hidden template');
-+ });
-+
-+ jQuery('input[name=ActivityDate]:first').change( function() {
-+ jQuery(this).closest('form').submit();
-+ });
-+});
-
diff --git a/t/web/ticket_timeworked.t b/t/web/ticket_timeworked.t
--- a/t/web/ticket_timeworked.t
+++ b/t/web/ticket_timeworked.t
@@ -676,6 +415,4 @@
+}
undef $m;
--done_testing();
-\ No newline at end of file
-+done_testing();
+ done_testing();
More information about the rt-commit
mailing list