Changing ticket creation to current user

This is my first post to this list, so apologies for the newbism.

I’m trying to change the Create ticket page to default to the logged in
user. Actually, I’ll probably change it at a later date so it doesn’t
even give the option (and it’ll just data fill from the current user).

Is it as simple as changing the /opt/rt3/share/html/Ticket.html from

<& /Elements/SelectOwner, Name => "Owner", QueueObj => $QueueObj, Default => $ARGS{Owner}||undef &>

to
… Default => $session{‘CurrentUser’}||undef &>

I searched the archives and didn’t see anything down this road, but I
can’t be the first person that’s wanted the owner to default to the
logged in user. Anyone else changed this?

John

to
… Default => $session{‘CurrentUser’}||undef &>

I searched the archives and didn’t see anything down this road, but I
can’t be the first person that’s wanted the owner to default to the
logged in user. Anyone else changed this?

Try it… but I’m pretty sure you’ll need:

$session{‘CurrentUser’}->Id()

(judging by the code in Elements/SelectOwner

-R

to
… Default => $session{‘CurrentUser’}||undef &>

I searched the archives and didn’t see anything down this road, but
I
can’t be the first person that’s wanted the owner to default to the
logged in user. Anyone else changed this?

Try it… but I’m pretty sure you’ll need:

$session{‘CurrentUser’}->Id()

(judging by the code in Elements/SelectOwner

I tried it both ways and no dice. I obviously dont understand the
default selection and it’s interaction with mod_perl. On a separate
line I could use
<% $session{‘CurrentUser’}->Name %>
and see the name of the person who was logged in. If I substituted this
string (with or without <% enclosing) for either the “undef” or
$session{'Current…} it either ignored it or broke it (error upon
compilation).

So I’m close. I know the variable is $sesson…Name, just no clue where
to paste it in. All my Perl books are at home and my O-Reilly “Writing
Apache Modules” mod_perl pullout didn’t help much. I’m not sure I’d
have figured it out with my books anyway :slight_smile: as I’ve only worked with
Perl for about 3 months.

FWIW, ID gave the ID of the user (in this case, 37, which is odd because
there aren’t more than 13 users), and using Id() broke the code.

Thanks…any other ideas??

John

John Schubert wrote:

to
… Default => $session{‘CurrentUser’}||undef &>

I searched the archives and didn’t see anything down this road, but I
can’t be the first person that’s wanted the owner to default to the
logged in user. Anyone else changed this?

Try it… but I’m pretty sure you’ll need:

$session{‘CurrentUser’}->Id()

(judging by the code in Elements/SelectOwner

I tried it both ways and no dice. I obviously dont understand the
default selection and it’s interaction with mod_perl. On a separate
line I could use
<% $session{‘CurrentUser’}->Name %>
and see the name of the person who was logged in. If I substituted this
string (with or without <% enclosing) for either the “undef” or
$session{'Current…} it either ignored it or broke it (error upon
compilation).

So I’m close. I know the variable is $sesson…Name, just no clue where
to paste it in. All my Perl books are at home and my O-Reilly “Writing
Apache Modules” mod_perl pullout didn’t help much. I’m not sure I’d
have figured it out with my books anyway :slight_smile: as I’ve only worked with
Perl for about 3 months.

In Ticket/Create.html:
In the <& /Elements/SelectOwner, … &> tag:
Change: $ARGS{Owner}||undef

FWIW, ID gave the ID of the user (in this case, 37, which is odd because
there aren’t more than 13 users), and using Id() broke the code.

No, its not odd, because groups are also assigned Ids from the same
sequence.

Max.