[Bps-public-commit] RT-Extension-TicketLocking branch, master, updated. b7453429240c4d3fd0cb7f31f48226f319d4e9b4

Ruslan Zakirov ruz at bestpractical.com
Thu Oct 10 12:31:22 EDT 2013


The branch, master has been updated
       via  b7453429240c4d3fd0cb7f31f48226f319d4e9b4 (commit)
       via  dfbecf5c3a8380cd0d517f7e4cdcc11fbf8fb7e4 (commit)
      from  17aac95e931080b8b04a0eddcef1523eff3e68a6 (commit)

Summary of changes:
 Changes                                            |  4 +++
 MANIFEST                                           |  1 +
 META.yml                                           |  2 +-
 .../Elements/Tabs/Privileged                       | 37 ++++++++++++++++++++++
 lib/RT/Extension/TicketLocking.pm                  |  2 +-
 5 files changed, 44 insertions(+), 2 deletions(-)
 create mode 100644 html/Callbacks/RT-Extension-TicketLocking/Elements/Tabs/Privileged

- Log -----------------------------------------------------------------
commit dfbecf5c3a8380cd0d517f7e4cdcc11fbf8fb7e4
Author: Ruslan Zakirov <ruz at bestpractical.com>
Date:   Thu Oct 10 20:23:08 2013 +0400

    tabs that work in RT 4.0+

diff --git a/MANIFEST b/MANIFEST
index 3e55ee4..403016e 100644
--- a/MANIFEST
+++ b/MANIFEST
@@ -1,6 +1,7 @@
 Changes
 html/Callbacks/RT-Extension-TicketLocking/autohandler/Default
 html/Callbacks/RT-Extension-TicketLocking/Elements/Header/Head
+html/Callbacks/RT-Extension-TicketLocking/Elements/Tabs/Privileged
 html/Callbacks/RT-Extension-TicketLocking/NoAuth/Logout.html/BeforeSessionDelete
 html/Callbacks/RT-Extension-TicketLocking/RTIR/Create.html/BeforeActionList
 html/Callbacks/RT-Extension-TicketLocking/RTIR/Create.html/BeforeDisplay
diff --git a/html/Callbacks/RT-Extension-TicketLocking/Elements/Tabs/Privileged b/html/Callbacks/RT-Extension-TicketLocking/Elements/Tabs/Privileged
new file mode 100644
index 0000000..7c9b32d
--- /dev/null
+++ b/html/Callbacks/RT-Extension-TicketLocking/Elements/Tabs/Privileged
@@ -0,0 +1,37 @@
+<%INIT>
+my $request_path = $HTML::Mason::Commands::r->path_info;
+
+return unless $request_path =~ m{^/Ticket/};
+return unless ( $DECODED_ARGS->{'id'} || '' ) =~ /^(\d+)$/;
+my $id  = $1;
+
+my $Ticket = RT::Ticket->new( $session{'CurrentUser'} );
+$Ticket->Load($id);
+return unless $Ticket->id;
+
+if ( my $right = $RT::Ticket::CheckRightOnLock{'Hard'} ) {
+    return unless $Ticket->CurrentUserHasRight( $right );
+}
+
+if ( my $Lock = $Ticket->Locked ) {
+    if ( $Lock->Content->{'User'} == $session{'CurrentUser'}->id ) {
+        PageMenu()->child('actions')->child(
+            'unlock',
+            path  => "/Ticket/Display.html?Lock=remove&id=" . $Ticket->Id,
+            title => loc('Unlock'),
+        );
+    } else {
+        PageMenu()->child('actions')->child(
+            'break-lock',
+            path  => "/Ticket/Display.html?Lock=break&id=" . $Ticket->Id,
+            title => loc('Break lock'),
+        );
+    }
+} else {
+    PageMenu()->child('actions')->child(
+        'lock',
+        path  => "/Ticket/Display.html?Lock=add&id=". $Ticket->Id,
+        title => loc('Lock'),
+    );
+}
+</%INIT>
\ No newline at end of file

commit b7453429240c4d3fd0cb7f31f48226f319d4e9b4
Author: Ruslan Zakirov <ruz at bestpractical.com>
Date:   Thu Oct 10 20:31:03 2013 +0400

    bump version, 0.12

diff --git a/Changes b/Changes
index 0210d0b..e8b66aa 100644
--- a/Changes
+++ b/Changes
@@ -1,3 +1,7 @@
+0.12 2013-10-10
+
+    * port menu items over RT 4.0+
+
 0.11 2013-10-08
 
     * update installer
diff --git a/META.yml b/META.yml
index 935c544..b5ab6cb 100644
--- a/META.yml
+++ b/META.yml
@@ -24,4 +24,4 @@ requires:
   perl: 5.8.3
 resources:
   license: http://opensource.org/licenses/gpl-2.0.php
-version: 0.11
+version: 0.12
diff --git a/lib/RT/Extension/TicketLocking.pm b/lib/RT/Extension/TicketLocking.pm
index 3a35722..e3c567e 100644
--- a/lib/RT/Extension/TicketLocking.pm
+++ b/lib/RT/Extension/TicketLocking.pm
@@ -52,7 +52,7 @@ use warnings;
 
 package RT::Extension::TicketLocking;
 
-our $VERSION = '0.11';
+our $VERSION = '0.12';
 
 =head1 NAME
 

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



More information about the Bps-public-commit mailing list