[Rt-commit] rt branch, 4.2/bookmarks-in-lib, updated. rt-4.0.0rc6-158-g45136c1
Shawn Moore
sartak at bestpractical.com
Tue Mar 8 12:50:38 EST 2011
The branch, 4.2/bookmarks-in-lib has been updated
via 45136c18819e95d8793c720bb887fa869527559c (commit)
from 93ff22864bca07ad2aae6ccc87faf60c38d8b5a3 (commit)
Summary of changes:
lib/RT/Ticket.pm | 10 +++++-----
share/html/Ticket/Elements/Bookmark | 8 ++++----
2 files changed, 9 insertions(+), 9 deletions(-)
- Log -----------------------------------------------------------------
commit 45136c18819e95d8793c720bb887fa869527559c
Author: Shawn M Moore <sartak at bestpractical.com>
Date: Tue Mar 8 12:50:21 2011 -0500
Various tidyings
diff --git a/lib/RT/Ticket.pm b/lib/RT/Ticket.pm
index 28a2611..cc60390 100644
--- a/lib/RT/Ticket.pm
+++ b/lib/RT/Ticket.pm
@@ -3714,14 +3714,14 @@ sub ToggleBookmark {
push @ids, $ticket->Merged;
}
- my $bookmarked;
+ my $is_bookmarked;
- if ( grep $bookmarks->{ $_ }, @ids ) {
+ if ( grep { $bookmarks->{ $_ } } @ids ) {
delete $bookmarks->{ $_ } foreach @ids;
- $bookmarked = 0;
+ $is_bookmarked = 0;
} else {
$bookmarks->{ $id } = 1;
- $bookmarked = 1;
+ $is_bookmarked = 1;
}
$self->CurrentUser->UserObj->SetAttribute(
@@ -3729,7 +3729,7 @@ sub ToggleBookmark {
Content => $bookmarks,
);
- return $bookmarked;
+ return $is_bookmarked;
}
1;
diff --git a/share/html/Ticket/Elements/Bookmark b/share/html/Ticket/Elements/Bookmark
index 665dbc5..493f373 100644
--- a/share/html/Ticket/Elements/Bookmark
+++ b/share/html/Ticket/Elements/Bookmark
@@ -49,12 +49,12 @@
my $ticket = RT::Ticket->new( $session{'CurrentUser'} );
$ticket->Load( $id );
-my $bookmarked;
+my $is_bookmarked;
if ($Toggle) {
- $bookmarked = $ticket->ToggleBookmark;
+ $is_bookmarked = $ticket->ToggleBookmark;
}
else {
- $bookmarked = $ticket->IsBookmarked;
+ $is_bookmarked = $ticket->IsBookmarked;
}
</%INIT>
<%ARGS>
@@ -64,7 +64,7 @@ $Toggle => 0
<span class="toggle-bookmark-<% $id %>">
% my $url = RT->Config->Get('WebPath') ."/Helpers/Toggle/TicketBookmark?id=". $id;
<a align="right" href="<% $url %>" onclick="jQuery('.toggle-bookmark-<% $id |n%>').load('<% $url |n %>'); return false;" >
-% if ( $bookmarked ) {
+% if ( $is_bookmarked ) {
<img src="<% RT->Config->Get('WebPath') %>/NoAuth/images/star.gif" alt="<% loc('Remove Bookmark') %>" style="border-style: none" />
% } else {
<img src="<% RT->Config->Get('WebPath') %>/NoAuth/images/empty_star.gif" alt="<% loc('Add Bookmark') %>" style="border-style: none" />
-----------------------------------------------------------------------
More information about the Rt-commit
mailing list