[Rt-commit] rt branch, 4.4/ticket-timer-fixes, created. rt-4.2.11-207-gd8b4efd

Shawn Moore shawn at bestpractical.com
Mon Sep 28 21:02:56 EDT 2015


The branch, 4.4/ticket-timer-fixes has been created
        at  d8b4efd881072ecbe2e9d0c855eefbdd828870ac (commit)

- Log -----------------------------------------------------------------
commit 36a82ec6129126efccaf5423a4e2155c83782828
Author: Shawn M Moore <shawn at bestpractical.com>
Date:   Tue Sep 29 00:44:36 2015 +0000

    Fix failing tests due to ticket timer

diff --git a/share/html/Ticket/Elements/PopupTimerLink b/share/html/Ticket/Elements/PopupTimerLink
index bcfe4e7..737641f 100644
--- a/share/html/Ticket/Elements/PopupTimerLink
+++ b/share/html/Ticket/Elements/PopupTimerLink
@@ -1,3 +1,50 @@
+%# 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 }}}
 <%ARGS>
 $id
 </%ARGS>
diff --git a/t/security/CVE-2012-4732-csrf-blacklist.t b/t/security/CVE-2012-4732-csrf-blacklist.t
index e44bba5..51d7412 100644
--- a/t/security/CVE-2012-4732-csrf-blacklist.t
+++ b/t/security/CVE-2012-4732-csrf-blacklist.t
@@ -18,7 +18,7 @@ ok $m->login, 'logged in';
 $m->add_header(Referer => $baseurl);
 $m->get_ok($test_page);
 $m->content_lacks("Possible cross-site request forgery");
-$m->content_contains("star.png");
+$m->content_contains("star-full.png");
 
 # come from an external source
 $m->add_header(Referer => 'http://example.com');
@@ -36,7 +36,7 @@ $m->title_is('Possible cross-site request forgery');
 $m->follow_link(text_regex => qr{resume your request});
 $m->content_lacks("Possible cross-site request forgery");
 like($m->response->request->uri, qr{^http://[^/]+\Q$test_path\E\?CSRF_Token=\w+$});
-$m->content_contains("star.png");
+$m->content_contains("star-empty.png");
 
 undef $m;
 done_testing;

commit 0bb6b3041fb8e614c8035d76706406f345bce36d
Author: Shawn M Moore <shawn at bestpractical.com>
Date:   Tue Sep 29 00:44:56 2015 +0000

    Markup improvements in Helpers/TicketTimer

diff --git a/share/html/Helpers/TicketTimer b/share/html/Helpers/TicketTimer
index fb5c800..c697651 100644
--- a/share/html/Helpers/TicketTimer
+++ b/share/html/Helpers/TicketTimer
@@ -177,8 +177,8 @@ jQuery( function() {
         <div class="readout"></div>
 
         <div class="control-line">
-            <a href="#" class="playpause"><img src="<% $pause_img %>" alt="<% loc('Pause Timer') %>" data-toggle-alt="<% loc('Unpause Timer') %>" title="<% loc('Pause Timer') %>" /></a>
-            <a href="#" class="submit-time"><img src="<% RT->Config->Get('WebPath') %>/static/images/submit.png" alt="<% loc('Submit Timer') %>" alt="<% loc('Submit Timer') %>" /></a>
+            <a href="#" class="playpause"><img src="<% $pause_img %>" alt="<% loc('Pause Timer') %>" data-toggle-alt="<% loc('Resume Timer') %>" title="<% loc('Pause Timer') %>" /></a>
+            <a href="#" class="submit-time"><img src="<% RT->Config->Get('WebPath') %>/static/images/submit.png" alt="<% loc('Submit Timer') %>" title="<% loc('Submit Timer') %>" /></a>
             <a href="#" class="close-popup hidden"><img src="<% RT->Config->Get('WebPath') %>/static/images/close.png" alt="<% loc('Close Window') %>" title="<% loc('Close Window') %>" /></a>
         </div>
     </div>

commit 221968cb8f8bb0feedc53f78bc1c99291039f2c3
Author: Shawn M Moore <shawn at bestpractical.com>
Date:   Tue Sep 29 00:46:40 2015 +0000

    Shrink response so "Worked X minutes" doesn't wrap

diff --git a/share/html/Helpers/TicketTimer b/share/html/Helpers/TicketTimer
index c697651..95cac55 100644
--- a/share/html/Helpers/TicketTimer
+++ b/share/html/Helpers/TicketTimer
@@ -140,6 +140,7 @@ jQuery( function() {
             timeout: 30000, /* 30 seconds */
             success: function (response) {
                 if (response.ok) {
+                    readout.addClass('response');
                     readout.text(response.msg);
                     jQuery('.control-line .close-popup').show().removeClass('hidden');
                 }
diff --git a/share/static/css/base/ticket-timer.css b/share/static/css/base/ticket-timer.css
index 5b27335..6ece49e 100644
--- a/share/static/css/base/ticket-timer.css
+++ b/share/static/css/base/ticket-timer.css
@@ -54,3 +54,7 @@
     display: block;
     color: red;
 }
+
+.ticket-timer .readout.response {
+    font-size: 1.25em;
+}

commit c82be3e0bb9de0427826f8e0e53f5765394b6acd
Author: Shawn M Moore <shawn at bestpractical.com>
Date:   Tue Sep 29 00:55:54 2015 +0000

    Fix image borders for bookmark and ticket timer
    
        IE8 was showing a border for ticket timer. Bookmark was hiding its border
        in markup, so move that to CSS.

diff --git a/share/html/Ticket/Elements/Bookmark b/share/html/Ticket/Elements/Bookmark
index 1abb69e..17e6df6 100644
--- a/share/html/Ticket/Elements/Bookmark
+++ b/share/html/Ticket/Elements/Bookmark
@@ -65,9 +65,9 @@ $Toggle => 0
 % my $url = RT->Config->Get('WebPath') ."/Helpers/Toggle/TicketBookmark?id=". $id;
 <a align="right" href="<% $url %>" onclick="jQuery.get(<% $url |n,j %>, function(data){ jQuery('.toggle-bookmark-'+<% $id |n,j%>).replaceWith(data) }); return false;" >
 % if ( $is_bookmarked ) {
-<img src="<% RT->Config->Get('WebPath') %>/static/images/star-full.png" alt="<% loc('Remove Bookmark') %>" style="border-style: none" />
+<img src="<% RT->Config->Get('WebPath') %>/static/images/star-full.png" alt="<% loc('Remove Bookmark') %>" />
 % } else {
-<img src="<% RT->Config->Get('WebPath') %>/static/images/star-empty.png" alt="<% loc('Add Bookmark') %>" style="border-style: none" />
+<img src="<% RT->Config->Get('WebPath') %>/static/images/star-empty.png" alt="<% loc('Add Bookmark') %>" />
 % }
 </a>
 </span>
diff --git a/share/static/css/base/misc.css b/share/static/css/base/misc.css
index 2b4d33d..5e088ff 100644
--- a/share/static/css/base/misc.css
+++ b/share/static/css/base/misc.css
@@ -83,4 +83,5 @@ textarea.messagebox, #cke_Content, #cke_UpdateContent {
 .toggle-bookmark a img {
     height: 1em;
     width: 1em;
+    border-style: none;
 }
diff --git a/share/static/css/base/nav.css b/share/static/css/base/nav.css
index d851259..538aab8 100644
--- a/share/static/css/base/nav.css
+++ b/share/static/css/base/nav.css
@@ -18,6 +18,7 @@
 #li-page-bookmark .toggle-bookmark a,
 #li-page-timer .timer-link a {
     padding: 0.5em 1em;
+    border-style: none;
 }
 
 #li-page-bookmark a img,
diff --git a/share/static/css/base/ticket-timer.css b/share/static/css/base/ticket-timer.css
index 6ece49e..14498a9 100644
--- a/share/static/css/base/ticket-timer.css
+++ b/share/static/css/base/ticket-timer.css
@@ -4,6 +4,11 @@
 
 .ticket-timer img {
     height: 1.5em;
+    border-style: none;
+}
+
+.timer-link a img {
+    border-style: none;
 }
 
 .ticket-timer .ticket-link img {

commit d8b4efd881072ecbe2e9d0c855eefbdd828870ac
Author: Shawn M Moore <shawn at bestpractical.com>
Date:   Tue Sep 29 01:01:01 2015 +0000

    Only show timer link if the user has ModifyTicket

diff --git a/share/html/Elements/Tabs b/share/html/Elements/Tabs
index d38c48d..9a39f5e 100644
--- a/share/html/Elements/Tabs
+++ b/share/html/Elements/Tabs
@@ -630,11 +630,6 @@ my $build_main_nav = sub {
 
             if ( $obj and $obj->id ) {
                 my $actions = PageMenu()->child( actions => title => loc('Actions'), sort_order  => 95 );
-                my $tabs = PageMenu();
-                $tabs->child( bookmark => raw_html => $m->scomp( '/Ticket/Elements/Bookmark', id => $id ), sort_order => 98 );
-                $tabs->child( timer => raw_html => $m->scomp( '/Ticket/Elements/PopupTimerLink', id => $id ), sort_order => 99 );
-                $tabs->child( display => title => loc('Display'), path => "/Ticket/Display.html?id=" . $id );
-                $tabs->child( history => title => loc('History'), path => "/Ticket/History.html?id=" . $id );
 
                 my %can = %{ $obj->CurrentUser->PrincipalObj->HasRights( Object => $obj ) };
                 $can{'_ModifyOwner'} = $obj->CurrentUserCanSetOwner();
@@ -647,6 +642,16 @@ my $build_main_nav = sub {
                     }
                 };
 
+                my $tabs = PageMenu();
+                $tabs->child( bookmark => raw_html => $m->scomp( '/Ticket/Elements/Bookmark', id => $id ), sort_order => 98 );
+
+                if ($can->('ModifyTicket')) {
+                    $tabs->child( timer => raw_html => $m->scomp( '/Ticket/Elements/PopupTimerLink', id => $id ), sort_order => 99 );
+                }
+
+                $tabs->child( display => title => loc('Display'), path => "/Ticket/Display.html?id=" . $id );
+                $tabs->child( history => title => loc('History'), path => "/Ticket/History.html?id=" . $id );
+
                 # comment out until we can do it for an individual custom field
                 #if ( $can->('ModifyTicket') || $can->('ModifyCustomField') ) {
                 $tabs->child( basics => title => loc('Basics'), path => "/Ticket/Modify.html?id=" . $id );

-----------------------------------------------------------------------


More information about the rt-commit mailing list