[Rt-commit] rt branch, 4.4/ticket-timer, updated. rt-4.2.11-185-g8a4f8b1
Shawn Moore
shawn at bestpractical.com
Mon Sep 21 18:08:51 EDT 2015
The branch, 4.4/ticket-timer has been updated
via 8a4f8b18344d93a02c932a4ca7f4eb558c50447d (commit)
via 51dee65b70a4cdeb676a57930dc526be3f913b35 (commit)
from 9b28830d02102b70a2e909714ad8a0b92133565e (commit)
Summary of changes:
share/html/Elements/EditTimeValue | 5 +++++
share/html/Elements/Header | 3 +++
share/html/Helpers/{Toggle/TicketBookmark => TicketTimer} | 10 +++++++---
share/html/Ticket/Elements/PopupTimerLink | 11 +++++++++++
share/html/Ticket/Update.html | 1 +
share/static/css/base/misc.css | 4 ++++
6 files changed, 31 insertions(+), 3 deletions(-)
copy share/html/Helpers/{Toggle/TicketBookmark => TicketTimer} (85%)
create mode 100644 share/html/Ticket/Elements/PopupTimerLink
- Log -----------------------------------------------------------------
commit 51dee65b70a4cdeb676a57930dc526be3f913b35
Author: Shawn M Moore <shawn at bestpractical.com>
Date: Mon Sep 21 22:08:19 2015 +0000
Add ShowHeader for controlling inclusion of header title
diff --git a/share/html/Elements/Header b/share/html/Elements/Header
index bf3e6f9..dd54368 100644
--- a/share/html/Elements/Header
+++ b/share/html/Elements/Header
@@ -106,7 +106,9 @@
<& /Elements/PersonalQuickbar, %ARGS &>
</div>
% }
+% if ($ShowTitle) {
<div id="header"><h1><% $Title %></h1></div>
+% }
<%INIT>
$r->headers_out->{'Pragma'} = 'no-cache';
$r->headers_out->{'Cache-control'} = 'no-cache';
@@ -149,6 +151,7 @@ $Focus => ''
$Title => 'RT'
$Refresh => 0
$ShowBar => 1
+$ShowTitle => 1
$URL => undef
$RSSAutoDiscovery => undef
$onload => undef
commit 8a4f8b18344d93a02c932a4ca7f4eb558c50447d
Author: Shawn M Moore <shawn at bestpractical.com>
Date: Mon Sep 21 22:08:37 2015 +0000
Pop up timer window
diff --git a/share/html/Elements/EditTimeValue b/share/html/Elements/EditTimeValue
index d7b1511..bee4760 100644
--- a/share/html/Elements/EditTimeValue
+++ b/share/html/Elements/EditTimeValue
@@ -47,12 +47,17 @@
%# END BPS TAGGED BLOCK }}}
<input name="<% $ValueName %>" value="<% $Default || '' %>" size="5" />
<& /Elements/SelectTimeUnits, Name => $UnitName, Default => $InUnits &>
+
+% if ($TimerForTicket) {
+<& /Ticket/Elements/PopupTimerLink, id => $TimerForTicket->id &>
+% }
<%ARGS>
$Default => ''
$Name => ''
$ValueName => ''
$UnitName => ''
$InUnits => ''
+$TimerForTicket => undef
</%ARGS>
<%INIT>
$ValueName ||= $Name;
diff --git a/share/html/Elements/EditTimeValue b/share/html/Helpers/TicketTimer
similarity index 77%
copy from share/html/Elements/EditTimeValue
copy to share/html/Helpers/TicketTimer
index d7b1511..f70f86e 100644
--- a/share/html/Elements/EditTimeValue
+++ b/share/html/Helpers/TicketTimer
@@ -45,23 +45,15 @@
%# those contributions and any derivatives thereof.
%#
%# END BPS TAGGED BLOCK }}}
-<input name="<% $ValueName %>" value="<% $Default || '' %>" size="5" />
-<& /Elements/SelectTimeUnits, Name => $UnitName, Default => $InUnits &>
<%ARGS>
-$Default => ''
-$Name => ''
-$ValueName => ''
-$UnitName => ''
-$InUnits => ''
+$id
</%ARGS>
<%INIT>
-$ValueName ||= $Name;
-$UnitName ||= ($Name||$ValueName) . '-TimeUnits';
-$InUnits ||= $m->request_args->{ $UnitName };
-$InUnits ||= RT->Config->Get('DefaultTimeUnitsToHours', $session{'CurrentUser'}) ? 'hours' : 'minutes';
-
-if ($Default && $InUnits eq 'hours') {
- # 0+ here is to remove the ending 0s
- $Default = 0 + sprintf '%.2f', $Default / 60;
-}
+my $Ticket = RT::Ticket->new( $session{'CurrentUser'} );
+$Ticket->Load( $id );
</%INIT>
+<& /Elements/Header, Title => loc('Timer for #[_1]: [_2]', $Ticket->Id, $Ticket->Subject), RichText => 0, ShowBar => 0, ShowTitle => 0 &>
+
+<a href="<%RT->Config->Get('WebPath')%>/Ticket/Display.html?id=<%$Ticket->Id%>"><%$Ticket->Id%>: <%$Ticket->Subject%></a>
+
+% $m->abort();
diff --git a/share/html/Ticket/Elements/PopupTimerLink b/share/html/Ticket/Elements/PopupTimerLink
new file mode 100644
index 0000000..f0fd384
--- /dev/null
+++ b/share/html/Ticket/Elements/PopupTimerLink
@@ -0,0 +1,11 @@
+<%ARGS>
+$id
+</%ARGS>
+<%INIT>
+my $url = RT->Config->Get('WebPath') ."/Helpers/TicketTimer?id=". $id;
+</%INIT>
+<span class="timer-link">
+ <a href="<% $url %>" onclick="window.open(<% $url |n,j %>, '_blank', 'height=200,width=200'); return false;" >
+ <img src="<% RT->Config->Get('WebPath') %>/static/images/stopwatch.png" alt="<% loc('Open Timer') %>" />
+ </a>
+</span>
diff --git a/share/html/Ticket/Update.html b/share/html/Ticket/Update.html
index d8c9575..48ff54f 100644
--- a/share/html/Ticket/Update.html
+++ b/share/html/Ticket/Update.html
@@ -111,6 +111,7 @@
args => {
Name => 'UpdateTimeWorked',
Default => $ARGS{UpdateTimeWorked}||'',
+ TimerForTicket => $TicketObj,
}
},
]
diff --git a/share/static/css/base/misc.css b/share/static/css/base/misc.css
index a76bf00..7fbc32f 100644
--- a/share/static/css/base/misc.css
+++ b/share/static/css/base/misc.css
@@ -79,3 +79,7 @@ textarea.messagebox, #cke_Content, #cke_UpdateContent {
.datepicker {
width: 17em;
}
+
+.timer-link img {
+ height: 1.5em;
+}
-----------------------------------------------------------------------
More information about the rt-commit
mailing list