[rt-devel] WAP access to rt?

Fletch fletch at phydeaux.org
Tue Jan 8 10:05:11 EST 2002


>>>>> "Steve" == Steve Radich <stever at bitshop.com> writes:

    Steve> Anybody written any WAP / cell phone interfaces to RT? I've
    Steve> been considering doing something for a year and never have,
    Steve> I don't quite have the need for it like I did a year ago
    Steve> but still may start on something if there is interest.

        Funny you mention this.  I've just gotten a web capable phone
(Motorola i1000+) and started thinking of doing something similar.
The only initial problem I saw with the initial mockup page I did was
that the main Mason autohandler appends HTML </body></html> tags to
the end.  Other than that, Mason generates WML just as happily as it
does HTML.


        Here's the test page I did:

--------------------------------------------------
<?xml version="1.0"?>
<!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN" 
 "http://www.wapforum.org/DTD/wml_1.1.xml"> 

% if( $no_cache ) {
<wml>
  <head>
    <meta http-equiv="Cache-Control" content="no-cache" />
  </head>
% } else {
<wml>
% }
  <card id="rtmain" title="RT List">
    <p>
<%perl>
my @ids = map { $_->[0] } 
          sort { $a->[1] cmp $b->[1] } 
          map { [ $_, $stats{$_}->{"_name"} ] } keys %stats;
foreach( @ids ) {
</%perl>
     <a href="#<% $stats{$_}->{"_name"} %>"><% $stats{$_}->{"_name"} %></a><br />
% }
    </p>
  </card>

% foreach( @ids ) {
% my $name = $stats{$_}->{_name};
  <card id="<% $name %>" title="<% $name %>">
    <p mode="nowrap">
      Queue: <% $name %><br />
      New: <% $stats{$_}->{new} %><br />
      Open: <% $stats{$_}->{open} %><br />
      Stalled: <% $stats{$_}->{stalled} %><br />
    </p>
  </card>
% }

</wml>
<%init>
my %stats;

my $Queues = RT::Queues->new( $session{ 'CurrentUser' } );
$Queues->UnLimit();
my $Tickets = RT::Tickets->new( $session{ 'CurrentUser' } );
while( my $queue = $Queues->Next ) {
  $stats{$queue->id}->{_name} = $queue->Name;

  $Tickets->ClearRestrictions;
  $Tickets->LimitStatus( VALUE => "open" );
  $Tickets->LimitQueue( VALUE => $queue->id, OPERATOR => "=" );
  $stats{$queue->id}->{open} = $Tickets->Count( );

  $Tickets->ClearRestrictions;
  $Tickets->LimitStatus( VALUE => "new" );
  $Tickets->LimitQueue( VALUE => $queue->id, OPERATOR => "=" );
  $stats{$queue->id}->{new} = $Tickets->Count( );

  $Tickets->ClearRestrictions;
  $Tickets->LimitStatus( VALUE => "stalled" );
  $Tickets->LimitQueue( VALUE => $queue->id, OPERATOR => "=" );
  $stats{$queue->id}->{stalled} = $Tickets->Count( );
}
</%init>
<%args>
$no_cache => 1
</%args>
--------------------------------------------------

-- 
Fletch                | "If you find my answers frightening,       __`'/|
fletch at phydeaux.org   |  Vincent, you should cease askin'          \ o.O'
770 933-0600 x211(w)  |  scary questions." -- Jules                =(___)=
                      |                                               U




More information about the Rt-devel mailing list