Re: [rt-users] Hide "Bulk Update" from menu

2015-12-27 Thread Daniel Schwager
Hi Matt,
 
thanks for your help. In the previous E-Mail (the enter-key was faster than 
me!) you found my implementation of hiding the "Bulk Update" menu dependent of 
the membership.

Best regards
Danny



smime.p7s
Description: S/MIME cryptographic signature


Re: [rt-users] Hide "Bulk Update" from menu

2015-12-27 Thread Daniel Schwager
Hi Matt,

thanks for your help. 


z-rt4app-a:/opt/site/rt4/local/html/Callbacks/mbi/Elements/Tabs/Privileged
<%init>
# Now, let's remove the 'Bulk Update' if we are not member of a 
defined group
if ( $Path =~ m/Search/ ) {
   my $in_group = 'FuntionBulkUpdate';
   my $group = RT::Group->new( $session{CurrentUser} );
   $group->LoadUserDefinedGroup( $in_group );
   if (!$group->HasMemberRecursively( $session{CurrentUser} -> 
id )) {
# Remove the "Reply" link from the actions...
$RT::Logger->debug("Remove BulkUpdate menu");
PageMenu->delete('bulk');
   }
}


<%args>
$Path


> -Original Message-
> From: Matt Zagrabelny [mailto:mzagr...@d.umn.edu]
> Sent: Tuesday, December 22, 2015 5:28 PM
> To: Daniel Schwager
> Cc: rt-users@lists.bestpractical.com
> Subject: Re: [rt-users] Hide "Bulk Update" from menu
> 
> Hi Daniel,
> 
> On Tue, Dec 22, 2015 at 10:18 AM, Daniel Schwager
>  wrote:
> > Hi everybody,
> >
> > is there a possibility to hide the "Bulk Update" menu from every privileged 
> > user who is not member
> of a "Bulk-Update"-Group?
> 
> Maybe.
> 
> 
> > I cannot find a corresponding Callback in share/html/Elements/Tabs
> > nor ./share/html/Search/Results.html to change the menu hiding "Bulk 
> > Update".
> 
> We remove the "Reply" action from the menu. The callback file is:
> 
> /Elements/Tabs/Privileged
> 
> Here is the contents:
> 
> <%init>
> # Now (and only to the Privileged) remove the default Reply link.
> # We add a "Reply" link (with status=open) via the life cycle.
> if (
> $Path =~ m{/Ticket/}
> &&
> $DECODED_ARGS->{id}
> &&
> $DECODED_ARGS->{id} =~ /^\d+$/
> ) {
> my $Ticket = RT::Ticket->new($session{CurrentUser});
> $Ticket->Load($DECODED_ARGS->{id});
> if (
> $Ticket
> &&
> $Ticket->Status eq 'new'
> ) {
> # Remove the "Reply" link from the actions...
> if (my $actions = PageMenu->child('actions')) {
> $actions->delete('reply');
> }
> }
> }
> 
> <%args>
> $Path
> 
> 
> You should be able to tweak other parts of the tabs. Using some of the
> code above as a guide.
> 
> Cheers,
> 
> -m


smime.p7s
Description: S/MIME cryptographic signature


Re: [rt-users] Hide "Bulk Update" from menu

2015-12-22 Thread Matt Zagrabelny
Hi Daniel,

On Tue, Dec 22, 2015 at 10:18 AM, Daniel Schwager
 wrote:
> Hi everybody,
>
> is there a possibility to hide the "Bulk Update" menu from every privileged 
> user who is not member of a "Bulk-Update"-Group?

Maybe.


> I cannot find a corresponding Callback in share/html/Elements/Tabs
> nor ./share/html/Search/Results.html to change the menu hiding "Bulk Update".

We remove the "Reply" action from the menu. The callback file is:

/Elements/Tabs/Privileged

Here is the contents:

<%init>
# Now (and only to the Privileged) remove the default Reply link.
# We add a "Reply" link (with status=open) via the life cycle.
if (
$Path =~ m{/Ticket/}
&&
$DECODED_ARGS->{id}
&&
$DECODED_ARGS->{id} =~ /^\d+$/
) {
my $Ticket = RT::Ticket->new($session{CurrentUser});
$Ticket->Load($DECODED_ARGS->{id});
if (
$Ticket
&&
$Ticket->Status eq 'new'
) {
# Remove the "Reply" link from the actions...
if (my $actions = PageMenu->child('actions')) {
$actions->delete('reply');
}
}
}

<%args>
$Path


You should be able to tweak other parts of the tabs. Using some of the
code above as a guide.

Cheers,

-m


[rt-users] Hide "Bulk Update" from menu

2015-12-22 Thread Daniel Schwager
Hi everybody,

is there a possibility to hide the "Bulk Update" menu from every privileged 
user who is not member of a "Bulk-Update"-Group?

I cannot find a corresponding Callback in share/html/Elements/Tabs
nor ./share/html/Search/Results.html to change the menu hiding "Bulk Update".

Thanks for any hint helping me to implement this small feature.

Best regards
Danny





smime.p7s
Description: S/MIME cryptographic signature