[rt-users] QuickCreate

Roy El-Hames rfh at pipex.net
Mon Sep 25 09:06:03 EDT 2006


Yeah sure ... Sorry I don't know how to do patch files ..but the diff of 
QuickCreate is:

52c52,54
< <&|/l&>Subject</&>:<br /><input size="15" name="Subject" />
---
 > <&|/l&>Subject</&>:<br /><input size="35" name="Subject" />
 > </td><td>
 > <&|/l&>Requestor</&>:<br /><input size="35" name="requestor" />
63c65
< %#<tr><td colspan="3"><textarea cols="50" rows="3"></textarea></td></tr>
---
 > <tr><td colspan="3"><textarea cols="80" rows="4" 
name="Tickettext"></textarea></td></tr>

And in index.html in the <init> change :

if ($ARGS{'QuickCreate'} ) {
    my $ticket = RT::Ticket->new($session{'CurrentUser'});
    my ($tid, $trans, $tmsg) = $ticket->Create(Queue => $ARGS{'Queue'},
                    Owner => $ARGS{'Owner'},
                    Requestor => 
$session{'CurrentUser'}->UserObj->EmailAddress,
                    Subject => $ARGS{'Subject'});


    push (@results, $tmsg);
}

to:

if ($ARGS{'QuickCreate'} ) {
    my $txt = $ARGS{'Tickettext'};
    $RT::Logger->debug("the TText is :".$txt);
    my $Mime = MIME::Entity->build(
                        Type => 'text/plain',
                        Data => $txt
                        );
    my $MimeMessage = $Mime->stringify();
    my $parser = RT::EmailParser->new();
    $parser->ParseMIMEEntityFromScalar($MimeMessage);
    my $ticket = RT::Ticket->new($session{'CurrentUser'});
    my ($tid, $trans, $tmsg) = $ticket->Create(Queue => $ARGS{'Queue'},
                    Owner => $ARGS{'Owner'},
                    #Requestor => 
$session{'CurrentUser'}->UserObj->EmailAddress,
                    Requestor => $ARGS{'requestor'} || 
$session{'CurrentUser'}->UserObj->EmailAddress,
                    Subject => $ARGS{'Subject'},
                    MIMEObj => $parser->Entity);
    push (@results, $tmsg);
}

Regards;
Roy
Torsten Brumm wrote:
> Hi Roy,
>
> can you share your QuickCreate?
>
> Thanks
>
> Torsten
>
> 2006/9/25, Roy El-Hames <rfh at pipex.net>:
>>
>> Thanks Stephen .. I was wondering if the Create Ticket would take care
>> of that ..
>> Created the Mime Obj and it works fine.
>> Regards;
>> Roy
>>
>> Stephen Turner wrote:
>> > At Friday 9/22/2006 01:28 PM, Roy El-Hames wrote:
>> >> Hi;
>> >> RT-3.6.1
>> >> I would like to expand Quickcreate section to include requestor and
>> >> text area for problem description (I noticed in QuickCreate someone
>> >> did start on this but it commented out) ..
>> >> Its easy enough to process the requestor in index.html, however I am
>> >> not sure what to do about the text, do I need to create a mime object
>> >> first or can I pass the text to the $ticket->Create function ?? if
>> >> the later then whats the argument for it
>> >> Many thanks;
>> >> Roy
>> >
>> > Hello Roy,
>> >
>> > You'll need to create a mime object and pass it in.
>> >
>> > Steve
>> >
>>
>> _______________________________________________
>> http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-users
>>
>> Community help: http://wiki.bestpractical.com
>> Commercial support: sales at bestpractical.com
>>
>>
>> Discover RT's hidden secrets with RT Essentials from O'Reilly Media.
>> Buy a copy at http://rtbook.bestpractical.com
>>
>
>
>




More information about the rt-users mailing list