A working MyDay.html - patch included

It looks like MyDay.html has been in the Tools area forever, but
incomplete - it displayed a terrific looking form but didn’t actually
act on the Submit button - talk about a let-down :).

I have a very crude but working fix for this. I’d like feedback on what
else needs to be done to make it safe/sane. I don’t know enough about
how the RT internals work to know whether I’m doing really stupid stuff
here or not. Do I need to be checking the permissions on each ticket
update to make sure the user has the appropriate permissions, for example?

Anyway, here it is - I hope others find it useful. I know our techs are
going to love being able to update all their tickets in one spot!

[chobbs@webservices rt3]$ diff ~/MyDay.html share/html/Tools/MyDay.html
< # Added 2007-01-11 by chris_hobbs@nhusd.k12.ca.us
< # Marches through POST’ed ARGS and acts accordingly.
< # This does the updating of the tickets.
< my $arg;
< foreach $arg (keys %ARGS)
< {
< if ($ARGS{$arg}) { # only true if there’s content in a POST’ed var
< my $action;
< my $value;
< my $ticketID;
< ($action, $ticketID) = split ("-", $arg);
< $value = $ARGS{$arg};
< my $ticket = LoadTicket($ticketID);
< if ($action =~ /UpdateStatus/)
< {
< $ticket->SetStatus($value);
< }
< if ($action =~ /UpdateTimeWorked/)
< {
< $ticket->SetTimeWorked($ticket->TimeWorked +
$value);
< if ($ticket->TimeLeft >= $value) {
< # in addition to incrementing
TimeWorked, decrement TimeLeft
< $ticket->SetTimeLeft($ticket->TimeLeft -
$value);
< } else {
< $ticket->SetTimeLeft(0);
< }
< }
< if ($action =~ /UpdateContent/)
< {
< $ticket->Comment(Content => ($value));
< }
< }
< }

Chris Hobbs wrote:

It looks like MyDay.html has been in the Tools area forever, but
incomplete - it displayed a terrific looking form but didn’t actually
act on the Submit button - talk about a let-down :).

I have a very crude but working fix for this. I’d like feedback on
what else needs to be done to make it safe/sane. I don’t know enough
about how the RT internals work to know whether I’m doing really
stupid stuff here or not. Do I need to be checking the permissions on
each ticket update to make sure the user has the appropriate
permissions, for example?

Anyway, here it is - I hope others find it useful. I know our techs
are going to love being able to update all their tickets in one spot!

Thanks. I Finally got a chance to go through and implement a proper
patch based (in spirit) on this one. It’ll be in the next release.

Best,
Jesse