[Rt-commit] r10769 - in rt/branches/3.999-DANGEROUS: . html/Search/Elements html/Tools lib/RT lib/RT/Model lib/RT/View lib/RT/View/Admin sbin
jesse at bestpractical.com
jesse at bestpractical.com
Thu Feb 7 23:50:57 EST 2008
Author: jesse
Date: Thu Feb 7 23:50:56 2008
New Revision: 10769
Added:
rt/branches/3.999-DANGEROUS/lib/RT/View/
rt/branches/3.999-DANGEROUS/lib/RT/View.pm
rt/branches/3.999-DANGEROUS/lib/RT/View/Admin/
rt/branches/3.999-DANGEROUS/lib/RT/View/Admin/Groups.pm
rt/branches/3.999-DANGEROUS/lib/RT/View/Admin/Users.pm
Modified:
rt/branches/3.999-DANGEROUS/ (props changed)
rt/branches/3.999-DANGEROUS/html/Search/Elements/BuildFormatString
rt/branches/3.999-DANGEROUS/html/Tools/MyDay.html
rt/branches/3.999-DANGEROUS/lib/RT/Model/GroupCollection.pm
rt/branches/3.999-DANGEROUS/sbin/rt-test-dependencies.in
rt/branches/3.999-DANGEROUS/t/web/custom_search.t
Log:
r27453 at 31b: jesse | 2008-02-06 23:50:42 -0500
r27469 at 31b: jesse | 2008-02-07 21:33:26 -0500
* YAY! one fewer failing test
r27496 at 31b: jesse | 2008-02-07 23:50:09 -0500
* fix groupcollection to use more modern api for implicit clauses that doesn't break on collection reuse
r27497 at 31b: jesse | 2008-02-07 23:50:49 -0500
/admin/groups and /admin/users - VERY BASIC crud views
Modified: rt/branches/3.999-DANGEROUS/html/Search/Elements/BuildFormatString
==============================================================================
--- rt/branches/3.999-DANGEROUS/html/Search/Elements/BuildFormatString (original)
+++ rt/branches/3.999-DANGEROUS/html/Search/Elements/BuildFormatString Thu Feb 7 23:50:56 2008
@@ -69,7 +69,7 @@
Status ExtendedStatus UpdateStatus
Type
- owner_name Requestors Cc AdminCc CreatedBy LastUpdatedBy
+ owner_name requestors cc admin_cc created_by last_updated_by
Priority initial_priority final_priority
Modified: rt/branches/3.999-DANGEROUS/html/Tools/MyDay.html
==============================================================================
--- rt/branches/3.999-DANGEROUS/html/Tools/MyDay.html (original)
+++ rt/branches/3.999-DANGEROUS/html/Tools/MyDay.html Thu Feb 7 23:50:56 2008
@@ -53,7 +53,7 @@
<&|/l, Jifty->web->current_user->name&>(displaying new and open tickets for %1)</&>
<form method="post" action="MyDay.html">
<table width="100%" cellpadding="0" cellspacing="0">
-% while ( my $Ticket = $Tickets->next()) {
+% while ( my $Ticket = $tickets->next()) {
% my $class;
% $i++;
% if ($i % 2 ) {
@@ -107,11 +107,9 @@
}
-my $Tickets = RT::Model::TicketCollection->new();
-$Tickets->limit_owner(value => Jifty->web->current_user->id);
-$Tickets->limit_status( value => 'open' );
-$Tickets->limit_status ( value => 'new');
-$Tickets->order_by ( column => 'Priority', order => 'DESC');
+my $tickets = RT::Model::TicketCollection->new();
+$tickets->from_sql("Status = 'new' or Status = 'open' AND owner = '".Jift->web->current_user->id"'");
+$tickets->order_by ( column => 'priority', order => 'DESC');
</%INIT>
Modified: rt/branches/3.999-DANGEROUS/lib/RT/Model/GroupCollection.pm
==============================================================================
--- rt/branches/3.999-DANGEROUS/lib/RT/Model/GroupCollection.pm (original)
+++ rt/branches/3.999-DANGEROUS/lib/RT/Model/GroupCollection.pm Thu Feb 7 23:50:56 2008
@@ -84,19 +84,15 @@
# {{{ sub _init
-sub _init {
+sub implicit_clauses {
my $self = shift;
- $self->{'table'} = "Groups";
- $self->{'primary_key'} = "id";
-
- my @result = $self->SUPER::_init(@_);
-
$self->order_by(
alias => 'main',
column => 'name',
order => 'ASC'
);
+ warn "joining!";
# XXX: this code should be generalized
$self->{'princalias'} = $self->join(
alias1 => 'main',
@@ -108,13 +104,11 @@
# even if this condition is useless and ids in the Groups table
# only match principals with type 'Group' this could speed up
# searches in some DBs.
- $self->limit(
- alias => $self->{'princalias'},
+ $self->limit( alias => $self->{'princalias'},
column => 'principal_type',
value => 'Group',
);
- return (@result);
}
# }}}
Added: rt/branches/3.999-DANGEROUS/lib/RT/View.pm
==============================================================================
--- (empty file)
+++ rt/branches/3.999-DANGEROUS/lib/RT/View.pm Thu Feb 7 23:50:56 2008
@@ -0,0 +1,13 @@
+use warnings;
+use strict;
+
+package RT::View;
+use Jifty::View::Declare -base;
+
+require RT::View::Admin::Groups;
+alias RT::View::Admin::Groups under 'admin/groups/';
+
+require RT::View::Admin::Users;
+alias RT::View::Admin::Users under 'admin/groups/';
+
+1;
Added: rt/branches/3.999-DANGEROUS/lib/RT/View/Admin/Groups.pm
==============================================================================
--- (empty file)
+++ rt/branches/3.999-DANGEROUS/lib/RT/View/Admin/Groups.pm Thu Feb 7 23:50:56 2008
@@ -0,0 +1,23 @@
+use warnings;
+use strict;
+
+package RT::View::Admin::Groups;
+use Jifty::View::Declare -base;
+use base 'Jifty::View::Declare::CRUD';
+
+__PACKAGE__->use_mason_wrapper;
+
+
+#sub per_page {50}
+sub object_type {'Group'}
+sub display_columns { qw(id name description) }
+
+sub _current_collection {
+ my $self = shift;
+ my $c = $self->SUPER::_current_collection();
+ warn $c;
+ $c->limit_to_user_defined_groups();
+ return $c;
+}
+
+1;
Added: rt/branches/3.999-DANGEROUS/lib/RT/View/Admin/Users.pm
==============================================================================
--- (empty file)
+++ rt/branches/3.999-DANGEROUS/lib/RT/View/Admin/Users.pm Thu Feb 7 23:50:56 2008
@@ -0,0 +1,15 @@
+use warnings;
+use strict;
+
+package RT::View::Admin::Users;
+use Jifty::View::Declare -base;
+use base 'Jifty::View::Declare::CRUD';
+
+__PACKAGE__->use_mason_wrapper;
+
+
+sub per_page {50}
+sub object_type {'User'}
+sub display_columns { qw(id name email) }
+
+1;
Modified: rt/branches/3.999-DANGEROUS/sbin/rt-test-dependencies.in
==============================================================================
--- rt/branches/3.999-DANGEROUS/sbin/rt-test-dependencies.in (original)
+++ rt/branches/3.999-DANGEROUS/sbin/rt-test-dependencies.in Thu Feb 7 23:50:56 2008
@@ -1,4 +1,4 @@
-#!@PERL@
+#!/usr/bin/env perl
# BEGIN BPS TAGGED BLOCK {{{
#
# COPYRIGHT:
@@ -80,8 +80,8 @@
'with-CLI' => 1,
'with-OPENID' => 0,
'with-MAILGATE' => 1,
- 'with-DEV' => @RT_DEVEL_MODE@,
- 'with-STANDALONE' => @RT_STANDALONE@,
+ 'with-DEV' => 1,
+ 'with-STANDALONE' => 1,
);
$args{$_} = $default{$_} foreach grep !exists $args{$_}, keys %default;
@@ -331,7 +331,6 @@
check_perl_version();
-check_users();
my %Missing_By_Type = ();
foreach my $type (sort grep $args{$_}, keys %args) {
@@ -415,7 +414,7 @@
unless ( $configured ) {
print <<END;
You didn't configure CPAN shell yet.
-Please run `@PERL@ -MCPAN -e shell` tool and configure it.
+Please run `perl -MCPAN -e shell` tool and configure it.
END
exit(1);
}
@@ -440,9 +439,9 @@
1) use a different tool to install dependencies by running setting the following
shell environment variable and rerunning this tool:
- RT_FIX_DEPS_CMD='@PERL@ -MCPAN -e"install %s"'
+ RT_FIX_DEPS_CMD='perl -MCPAN -e"install %s"'
2) Attempt to configure CPAN by running:
- `@PERL@ -MCPAN -e shell` program from shell.
+ `perl -MCPAN -e shell` program from shell.
If this fails, you may have to manually upgrade CPAN (see below)
3) Try to update the CPAN client. Download it from:
http://search.cpan.org/dist/CPAN and try again
@@ -514,15 +513,6 @@
}
}
-sub check_users {
- section("users");
- print_found("rt group (@RTGROUP@)", defined getgrnam("@RTGROUP@"));
- print_found("bin owner (@BIN_OWNER@)", defined getpwnam("@BIN_OWNER@"));
- print_found("libs owner (@LIBS_OWNER@)", defined getpwnam("@LIBS_OWNER@"));
- print_found("libs group (@LIBS_GROUP@)", defined getgrnam("@LIBS_GROUP@"));
- print_found("web owner (@WEB_USER@)", defined getpwnam("@WEB_USER@"));
- print_found("web group (@WEB_GROUP@)", defined getgrnam("@WEB_GROUP@"));
-}
Modified: rt/branches/3.999-DANGEROUS/t/web/custom_search.t
==============================================================================
--- rt/branches/3.999-DANGEROUS/t/web/custom_search.t (original)
+++ rt/branches/3.999-DANGEROUS/t/web/custom_search.t Thu Feb 7 23:50:56 2008
@@ -29,7 +29,7 @@
# add Requestor to the fields
$m->form_name ('build_query');
# can't use submit form for mutli-valued select as it uses set_fields
-$m->field (SelectDisplayColumns => ['Requestors']);
+$m->field (SelectDisplayColumns => ['requestors']);
$m->click_button (name => 'AddCol') ;
$m->form_name ('build_query');
@@ -38,7 +38,6 @@
$m->get( $url );
$m->content_contains ('customsearch at localhost', 'requestor now displayed ');
-
# now remove Requestor from the fields
$m->get ($cus_hp);
More information about the Rt-commit
mailing list