Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Request Tracker: Commit
rt branch, 4.0/hide-create-ticket-widget-if-no-right, created. rt-4.0.5-117-ga510085
 

Index | Next | Previous | View Flat


sunnavy at bestpractical

Apr 18, 2012, 11:27 AM


Views: 149
Permalink
rt branch, 4.0/hide-create-ticket-widget-if-no-right, created. rt-4.0.5-117-ga510085

The branch, 4.0/hide-create-ticket-widget-if-no-right has been created
at a5100851a6c26fc12e1c41802cdec019a5fd705e (commit)

- Log -----------------------------------------------------------------
commit a5100851a6c26fc12e1c41802cdec019a5fd705e
Author: sunnavy <sunnavy [at] bestpractical>
Date: Thu Apr 19 01:38:36 2012 +0800

show CreateTicket widget only if user can create ticket

diff --git a/share/html/Elements/Tabs b/share/html/Elements/Tabs
index f65f909..be2674b 100755
--- a/share/html/Elements/Tabs
+++ b/share/html/Elements/Tabs
@@ -811,7 +811,20 @@ my $build_main_nav = sub {
}

PageWidgets()->child( simple_search => raw_html => $m->scomp('SimpleSearch') );
- PageWidgets()->child( create_ticket => raw_html => $m->scomp('CreateTicket') );
+
+ my $can_create_ticket;
+ my $queues = RT::Queues->new( $session{'CurrentUser'} );
+ $queues->UnLimit;
+
+ while ( my $queue = $queues->Next ) {
+ next unless $queue->CurrentUserHasRight('CreateTicket');
+ $can_create_ticket = 1;
+ last;
+ }
+
+ if ( $can_create_ticket ) {
+ PageWidgets()->child( create_ticket => raw_html => $m->scomp('CreateTicket') );
+ }

$m->callback( CallbackName => 'Privileged' );
};

-----------------------------------------------------------------------
_______________________________________________
Rt-commit mailing list
Rt-commit [at] lists
http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-commit

Subject User Time
rt branch, 4.0/hide-create-ticket-widget-if-no-right, created. rt-4.0.5-117-ga510085 sunnavy at bestpractical Apr 18, 2012, 11:27 AM

  Index | Next | Previous | View Flat
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.