[Rt-commit] r8283 - in rt/branches/3.7-EXPERIMENTAL-TUNIS: .
html/Ticket html/Ticket/Elements
thayes at bestpractical.com
thayes at bestpractical.com
Wed Jul 25 13:03:52 EDT 2007
Author: thayes
Date: Wed Jul 25 13:03:50 2007
New Revision: 8283
Modified:
rt/branches/3.7-EXPERIMENTAL-TUNIS/ (props changed)
rt/branches/3.7-EXPERIMENTAL-TUNIS/html/Elements/ShowLock
rt/branches/3.7-EXPERIMENTAL-TUNIS/html/Ticket/Display.html
rt/branches/3.7-EXPERIMENTAL-TUNIS/html/Ticket/Elements/Tabs
rt/branches/3.7-EXPERIMENTAL-TUNIS/html/Ticket/Update.html
Log:
r8424 at toth: toth | 2007-07-25 13:03:27 -0400
* Fixed calling syntax to locking methods
Modified: rt/branches/3.7-EXPERIMENTAL-TUNIS/html/Elements/ShowLock
==============================================================================
--- rt/branches/3.7-EXPERIMENTAL-TUNIS/html/Elements/ShowLock (original)
+++ rt/branches/3.7-EXPERIMENTAL-TUNIS/html/Elements/ShowLock Wed Jul 25 13:03:50 2007
@@ -16,7 +16,7 @@
</div>
%}
<%init>
-return unless (my $Lock = $Ticket->RT::Ticket::Locked());
+return unless (my $Lock = $Ticket->Locked());
my $u = RT::User->new($session{'CurrentUser'});
$u->Load($Lock->Content->{'User'});
Modified: rt/branches/3.7-EXPERIMENTAL-TUNIS/html/Ticket/Display.html
==============================================================================
--- rt/branches/3.7-EXPERIMENTAL-TUNIS/html/Ticket/Display.html (original)
+++ rt/branches/3.7-EXPERIMENTAL-TUNIS/html/Ticket/Display.html Wed Jul 25 13:03:50 2007
@@ -127,7 +127,7 @@
if ( defined $ARGS{'Action'} ) {
if ($ARGS{'Action'} =~ /^(Steal|Kill|Take|SetTold)$/) {
my $action = $1;
- my $lock = $TicketObj->RT::Ticket::Locked();
+ my $lock = $TicketObj->Locked();
if($lock && $lock->Content->{'User'} != $session{'CurrentUser'}->id)
{
my $u = RT::User->new($session{'CurrentUser'});
@@ -136,7 +136,7 @@
}
elsif(!$lock)
{
- $TicketObj->RT::Ticket::Lock();
+ $TicketObj->Lock();
my ($res, $msg) = $TicketObj->$action();
push(@Actions, $msg);
}
@@ -145,14 +145,14 @@
if ( defined $ARGS{'Lock'} ) {
if ( $ARGS{'Lock'} eq 'add' ) {
- if ( $TicketObj->RT::Ticket::Lock() ) {
+ if ( $TicketObj->Lock() ) {
push @Actions, loc('You now have a lock on this ticket');
} else {
push @Actions, loc('Your attempt to lock this ticket failed');
}
} elsif ( $ARGS{'Lock'} eq 'remove' ) {
- my $lock = $TicketObj->RT::Ticket::Locked();
+ my $lock = $TicketObj->Locked();
if ( !$lock ) {
push @Actions, loc('This ticket was not locked');
@@ -160,7 +160,7 @@
$duration = time() - $lock->Content->{'Timestamp'};
my $date = RT::Date->new($session{'CurrentUser'});
$duration = $date->DurationAsString($duration);
- $TicketObj->RT::Ticket::Unlock();
+ $TicketObj->Unlock();
push @Actions, loc('You have unlocked this ticket (locked for ' . $duration . ')');
} else {
push @Actions,
Modified: rt/branches/3.7-EXPERIMENTAL-TUNIS/html/Ticket/Elements/Tabs
==============================================================================
--- rt/branches/3.7-EXPERIMENTAL-TUNIS/html/Ticket/Elements/Tabs (original)
+++ rt/branches/3.7-EXPERIMENTAL-TUNIS/html/Ticket/Elements/Tabs Wed Jul 25 13:03:50 2007
@@ -235,7 +235,29 @@
($searchtab =~ /^_/) ? $tabs->{"s".$searchtab} = $searchtabs->{$searchtab} : $tabs->{"z_".$searchtab} = $searchtabs->{$searchtab};
}
}
+if ($Ticket) {
+ if (my $Lock = $Ticket->Locked()) {
+ if ($Lock->Content->{'User'} == $session{'CurrentUser'}->id) {
+ $actions->{'Lock'} = {
+ path => "Ticket/Display.html?Lock=remove&id=" . $Ticket->Id,
+ title => loc('Unlock')
+ };
+ } else {
+ $actions->{'Lock'} = {
+ path => "Ticket/Display.html?Lock=break&id=" . $Ticket->Id,
+ title => loc('Break lock')
+ };
+ }
+ } else {
+ $actions->{'Lock'} = {
+ path => "Ticket/Display.html?Lock=add&id=" . $Ticket->Id,
+ title => loc('Lock')
+ };
+
+
+ }
+}
</%INIT>
Modified: rt/branches/3.7-EXPERIMENTAL-TUNIS/html/Ticket/Update.html
==============================================================================
--- rt/branches/3.7-EXPERIMENTAL-TUNIS/html/Ticket/Update.html (original)
+++ rt/branches/3.7-EXPERIMENTAL-TUNIS/html/Ticket/Update.html Wed Jul 25 13:03:50 2007
@@ -150,7 +150,7 @@
my $TicketObj = LoadTicket($id);
-$TicketObj->RT::Ticket::Lock() unless $TicketObj->RT::Ticket::Locked();
+$TicketObj->Lock() unless $TicketObj->Locked();
unless($DefaultStatus){
$DefaultStatus=($ARGS{'Status'} ||$TicketObj->Status());
More information about the Rt-commit
mailing list