[freeside-commits] freeside/rt/share/html/m/tickets requested, NONE, 1.1 search, NONE, 1.1
Mark Wells
mark at wavetail.420.am
Wed Apr 27 01:31:05 PDT 2011
- Previous message: [freeside-commits] freeside/rt/share/html/m/ticket create, NONE, 1.1 history, NONE, 1.1 modify, NONE, 1.1 reply, NONE, 1.1 select_create_queue, NONE, 1.1 show, NONE, 1.1
- Next message: [freeside-commits] freeside/FS/FS cdr.pm,1.66.2.4,1.66.2.5
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
Update of /home/cvs/cvsroot/freeside/rt/share/html/m/tickets
In directory wavetail.420.am:/tmp/cvs-serv23959/rt/share/html/m/tickets
Added Files:
requested search
Log Message:
RT mobile UI, #11630
--- NEW FILE: requested ---
<%init>
$m->comp('../_elements/ticket_list', %ARGS, query => 'Requestors.EmailAddress = "'.$session{CurrentUser}->EmailAddress.'" AND (Status != "resolved" AND Status != "rejected" AND Status != "stalled")');
$m->abort();
</%init>
--- NEW FILE: search ---
<%args>
$page => 1
$order_by => 'id'
$order => 'desc'
$name => undef
</%args>
<%init>
use RT::Search::Googleish;
my $query = $ARGS{'query'};
if ($ARGS{'q'}) {
my $tickets = RT::Tickets->new( $session{'CurrentUser'} );
my %args = (
Argument => $ARGS{q},
TicketsObj => $tickets,
);
my $search = RT::Search::Googleish->new(%args);
$query = $search->QueryToSQL();
}
elsif ($ARGS{'name'}) {
my $search_arg;
my $search;
if ($name) {
($search) = RT::System->new( $session{'CurrentUser'} )->Attributes->Named( 'Search - ' . $name );
unless ( $search && $search->Id ) {
my (@custom_searches) = RT::System->new( $session{'CurrentUser'} )->Attributes->Named('SavedSearch');
foreach my $custom (@custom_searches) {
if ( $custom->Description eq $name ) { $search = $custom; last }
}
unless ( $search && $search->id ) {
$m->out("Predefined search $name not found");
return;
}
}
$search_arg = $session{'CurrentUser'}->UserObj->Preferences( $search, $search->Content );
}
foreach ($search_arg) {
if ( $_->{'Query'} =~ /__Bookmarks__/ ) {
$_->{'Rows'} = 999;
# DEPRECATED: will be here for a while up to 3.10/4.0
my $bookmarks = $session{'CurrentUser'}->UserObj->FirstAttribute('Bookmarks');
$bookmarks = $bookmarks->Content if $bookmarks;
$bookmarks ||= {};
my $query = join( " OR ", map " id = '$_' ", grep $bookmarks->{$_}, keys %$bookmarks ) || 'id=0';
$_->{'Query'} =~ s/__Bookmarks__/( $query )/g;
}
}
$query = $search_arg->{Query};
$order_by = $search_arg->{OrderBy};
$order = $search_arg->{Order};
}
$m->comp('../_elements/ticket_list', query => $query, page => $page, order_by => $order_by, order => $order);
$m->abort();
</%init>
- Previous message: [freeside-commits] freeside/rt/share/html/m/ticket create, NONE, 1.1 history, NONE, 1.1 modify, NONE, 1.1 reply, NONE, 1.1 select_create_queue, NONE, 1.1 show, NONE, 1.1
- Next message: [freeside-commits] freeside/FS/FS cdr.pm,1.66.2.4,1.66.2.5
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
More information about the freeside-commits
mailing list