[Rt-commit] r2536 - in rt/branches/QUEBEC-EXPERIMENTAL: . bin etc
html/Admin html/Admin/Elements html/Admin/Global/CustomFields
html/Admin/Queues html/Admin/Users html/Elements html/NoAuth
html/NoAuth/images html/Ticket html/User lib/RT
lib/RT/Interface/Web lib/t/regression sbin
jesse at bestpractical.com
jesse at bestpractical.com
Mon Mar 28 05:50:48 EST 2005
Author: jesse
Date: Mon Mar 28 05:50:42 2005
New Revision: 2536
Added:
rt/branches/QUEBEC-EXPERIMENTAL/lib/RT/Interface/Web/Standalone.pm (contents, props changed)
rt/branches/QUEBEC-EXPERIMENTAL/lib/t/regression/02basic_web.t
rt/branches/QUEBEC-EXPERIMENTAL/lib/t/regression/03web_compiliation_errors.t
Removed:
rt/branches/QUEBEC-EXPERIMENTAL/lib/t/regression/03basic_web.t
Modified:
rt/branches/QUEBEC-EXPERIMENTAL/ (props changed)
rt/branches/QUEBEC-EXPERIMENTAL/README
rt/branches/QUEBEC-EXPERIMENTAL/bin/standalone_httpd.in
rt/branches/QUEBEC-EXPERIMENTAL/bin/webmux.pl.in
rt/branches/QUEBEC-EXPERIMENTAL/etc/RT_SiteConfig.pm
rt/branches/QUEBEC-EXPERIMENTAL/html/Admin/Elements/EditCustomFields
rt/branches/QUEBEC-EXPERIMENTAL/html/Admin/Elements/PickCustomFields
rt/branches/QUEBEC-EXPERIMENTAL/html/Admin/Global/CustomFields/Groups.html
rt/branches/QUEBEC-EXPERIMENTAL/html/Admin/Global/CustomFields/Queue-Tickets.html
rt/branches/QUEBEC-EXPERIMENTAL/html/Admin/Global/CustomFields/Queue-Transactions.html
rt/branches/QUEBEC-EXPERIMENTAL/html/Admin/Global/CustomFields/Users.html
rt/branches/QUEBEC-EXPERIMENTAL/html/Admin/Queues/CustomFields.html
rt/branches/QUEBEC-EXPERIMENTAL/html/Admin/Queues/index.html
rt/branches/QUEBEC-EXPERIMENTAL/html/Admin/Users/CustomFields.html
rt/branches/QUEBEC-EXPERIMENTAL/html/Admin/Users/Modify.html
rt/branches/QUEBEC-EXPERIMENTAL/html/Admin/Users/index.html
rt/branches/QUEBEC-EXPERIMENTAL/html/Admin/index.html
rt/branches/QUEBEC-EXPERIMENTAL/html/Elements/Header
rt/branches/QUEBEC-EXPERIMENTAL/html/Elements/Login
rt/branches/QUEBEC-EXPERIMENTAL/html/Elements/MessageBox
rt/branches/QUEBEC-EXPERIMENTAL/html/NoAuth/images/autohandler
rt/branches/QUEBEC-EXPERIMENTAL/html/NoAuth/webrt.css
rt/branches/QUEBEC-EXPERIMENTAL/html/Ticket/Update.html
rt/branches/QUEBEC-EXPERIMENTAL/html/User/Prefs.html
rt/branches/QUEBEC-EXPERIMENTAL/lib/RT/CachedGroupMember_Overlay.pm
rt/branches/QUEBEC-EXPERIMENTAL/lib/RT/CurrentUser.pm
rt/branches/QUEBEC-EXPERIMENTAL/lib/RT/CustomField_Overlay.pm
rt/branches/QUEBEC-EXPERIMENTAL/lib/RT/Interface/Web/Handler.pm
rt/branches/QUEBEC-EXPERIMENTAL/lib/RT/Record.pm
rt/branches/QUEBEC-EXPERIMENTAL/lib/RT/Ticket_Overlay.pm
rt/branches/QUEBEC-EXPERIMENTAL/lib/RT/Transaction_Overlay.pm
rt/branches/QUEBEC-EXPERIMENTAL/lib/RT/User_Overlay.pm
rt/branches/QUEBEC-EXPERIMENTAL/sbin/rt-test-dependencies.in
Log:
r10286 at hualien: jesse | 2005-03-28 18:49:49 +0800
* Merge forward from 3.4-RELEASE
Modified: rt/branches/QUEBEC-EXPERIMENTAL/README
==============================================================================
--- rt/branches/QUEBEC-EXPERIMENTAL/README (original)
+++ rt/branches/QUEBEC-EXPERIMENTAL/README Mon Mar 28 05:50:42 2005
@@ -1,17 +1,18 @@
-RT is an enterprise-grade issue tracking system. It allows
-organizations to keep track of their to-do lists, who is working
-on which tasks, what's already been done, and when tasks were
-completed. It is available under the terms of version 2 of the GNU
-General Public License (GPL), so it doesn't cost anything to set
-up and use.
+RT is an enterprise-grade issue tracking system. It allows organizations
+to keep track of what needs to get done, who is working on which tasks,
+what's already been done, and when tasks were (or weren't) completed.
+
+RT doesn't cost anything to use, no matter how much you use it; it
+is freely available under the terms of Version 2 of the GNU General
+Public License.
RT is commercially supported software. To purchase support, training,
-custom development or professional services, please write to
-sales at bestpractical.com.
+custom development or professional services, please get in touch with
+us at sales at bestpractical.com.
- Jesse Vincent
- Best Practical Solutions, LLC
- January, 2005
+ Jesse Vincent
+ Best Practical Solutions, LLC
+ March, 2005
REQUIRED PACKAGES:
@@ -19,29 +20,27 @@
o Perl 5.8.3 or later (http://www.perl.com).
- Perl versions prior to 5.8.3 contain bugs that could result
- in data corruption. We recommend strongly that you use 5.8.3
- or newer. RT may function with perl 5.8.0 and later, but
- is unsupported in that configuration.
+ Perl versions prior to 5.8.3 contain bugs that could result
+ in data corruption. We recommend strongly that you use 5.8.3
+ or newer. RT may function with perl 5.8.0 and later, but
+ is unsupported in that configuration.
+
+o A supported SQL database
-o A DB backend; MySQL is recommended ( http://www.mysql.com )
Currently supported: Mysql 4.0.13 or later with InnoDB support.
Postgres 7.2 or later.
Oracle 9iR2.
SQLite 3.0. (Not recommended for production)
- Beta-quality support for Informix is also available.
-
o Apache version 1.3.x or 2.x (http://httpd.apache.org)
- with mod_perl -- (http://perl.apache.org )
- or a webserver with FastCGI support (www.fastcgi.com)
+ with mod_perl -- (http://perl.apache.org )
+ or a webserver with FastCGI support (www.fastcgi.com)
mod_perl 2.0 isn't quite ready for prime_time just yet;
- Best Practical Solutions strongly recommends that sites use
- Apache 1.3 or FastCGI.
+ We _strongly_ recommend that you use Apache 1.3 or FastCGI.
Compiling mod_perl on Apache 1.3.x as a DSO has been known
- to have massive stability problems and is not recommended.
+ to have massive stability problems and is not recommended.
mod_perl 1.x must be build with EVERYTHING=1
@@ -65,100 +64,112 @@
http://wiki.bestpractical.com/index.cgi?InstallationGuides
-1 Unpack this distribution SOMWHERE OTHER THAN where you want to install RT
+1 Unpack this distribution other than where you want to install RT
- Granted, you've already got it open. To do this cleanly:
+ To do this cleanly, run the following command:
- tar xzvf rt.tar.gz -C /tmp
+ tar xzvf rt.tar.gz -C /tmp
2 Run the "configure" script.
- ./configure --help to see the list of options
- ./configure (with the flags you want)
+ ./configure --help to see the list of options
+ ./configure (with the flags you want)
-3 Make sure that RT has everything it needs to run:
+ RT defaults to installing in /opt/rt3 with MySQL as its database. It
+ tries to guess which of www-data, www, apache or nobody your webserver
+ will run as, but you can override that behavior.
-3.1 Check for missing dependencies:
+3 Make sure that RT has everything it needs to run.
- make testdeps
+ Check for missing dependencies by running:
-3.2 If there are unsatisfied dependencies, install them by hand or run:
+ make testdeps
- make fixdeps
+4 If the script reports any missing dependencies, install them by hand
+ or run the following command as a user who has permission to install perl
+ modules on your system:
-3.3 Check to make sure everything was installed properly:
-
- make testdeps
+ make fixdeps
- It might sometimes be necessary to run "make fixdeps" several times
- to install all necessary perl modules.
+5 Check to make sure everything was installed properly.
+
+ make testdeps
-4 Create a group called 'rt'
+ It might sometimes be necessary to run "make fixdeps" several times
+ to install all necessary perl modules.
-5a FOR A NEW INSTALLATION:
-
- As root, type:
- make install
-
- make initialize-database
+6 If this is a new installation:
+
+ As a user with permission to install RT in your chosen directory, type:
- If the make fails, type:
- make dropdb
- and start over from step 5a
+ make install
+
+ Set up etc/RT_SiteConfig.pm in your RT installation directory.
+ You'll need to add any values you need to change from the defaults
+ in etc/RT_Config.pm
-5b FOR UPGRADING: (Within the RT 3.x series)
+ As a user with permission to read RT's configuration file, type:
+
+ make initialize-database
- Read through the UPGRADING document included in this distribution.
- It may contain important instructions which will help you upgrade
- RT safely.
+ If the make fails, type:
+
+ make dropdb
- As root, type:
- make upgrade
+ and start over from step 6
- This will build new binaries, config files and libraries without
- overwriting your RT database.
+7 If you're upgrading from RT 3.0 or newer:
- You may also need to update RT's database. To find out, type:
+ Read through the UPGRADING document included in this distribution.
+
+ It includes special upgrade instructions that will help you get this
+ new version of RT up and running smoothly.
- ls etc/upgrade
+ As a user with permission to install RT in your chosen installation
+ directory, type:
- For each item in that directory whose name is greater than
- your previously installed RT version, run:
- /opt/rt3/sbin/rt-setup-database --action schema \
- --datadir etc/upgrade/<version>
- /opt/rt3/sbin/rt-setup-database --action acl \
- --datadir etc/upgrade/<version>
- /opt/rt3/sbin/rt-setup-database --action insert \
- --datadir etc/upgrade/<version>
+ make upgrade
- Some of these commands will generate errors related to missing files.
- That just means that no action was needed.
+ This will install new binaries, config files and libraries without
+ overwriting your RT database.
+ Update etc/RT_SiteConfig.pm in your RT installation directory.
+ You'll need to add any new values you need to change from the defaults
+ in etc/RT_Config.pm
-5c FOR UPGRADING: (From RT 2.0.x)
+ You may also need to update RT's database. To find out, type:
- Please upgrade from RT 2.0 to RT 3.2 and then follow the instructions
- for section 5b above.
+ ls etc/upgrade
+
+ For each item in that directory whose name is greater than
+ your previously installed RT version, run:
+
+ /opt/rt3/sbin/rt-setup-database --action schema \
+ --datadir etc/upgrade/<version>
+ /opt/rt3/sbin/rt-setup-database --action acl \
+ --datadir etc/upgrade/<version>
+ /opt/rt3/sbin/rt-setup-database --action insert \
+ --datadir etc/upgrade/<version>
-6 Edit etc/RT_SiteConfig.pm in your RT installation directory, by specifying
- any values you need to change from the defaults in etc/RT_Config.pm
+8 If you're upgrading from RT 2.0:
-7 Configure the email and web gateways, as described below.
+ Please upgrade from RT 2.0 to RT 3.2 and then follow the instructions
+ for section 7.
-8 Stop and start your webserver, so it picks up your configuration changes.
+9 Configure the email and web gateways, as described below.
NOTE: root's password for the web interface is "password"
(without the quotes.) Not changing this is a SECURITY risk
-9 Configure RT per the instructions in RT's manual.
+10 Set up users, groups, queues, scrips and access control.
Until you do this, RT will not be able to send or receive email,
nor will it be more than marginally functional. This is not an
optional step.
-THE WEB INTERFACE
------------------
+SETTING UP THE WEB INTERFACE
+----------------------------
RT's web interface is based around HTML::Mason, which works well with
the mod_perl perl interpreter within Apache httpd and FastCGI
@@ -167,8 +178,13 @@
--------
To install RT with mod_perl, you'll need to install the
-apache database connection cache and add a few lines to your
-Apache configuration file telling it about RT:
+apache database connection cache. To make sure it's installed, run
+the following command:
+
+ perl -MCPAN -e'install Apache::DBI'
+
+Next, add a few lines to your Apache configuration file, so that
+it knows where to find RT:
<VirtualHost your.ip.address>
ServerName your.rt.server.hostname
@@ -179,17 +195,11 @@
PerlRequire /opt/rt3/bin/webmux.pl
<Location />
- SetHandler perl-script
- PerlHandler RT::Mason
+ SetHandler perl-script
+ PerlHandler RT::Mason
</Location>
</VirtualHost>
-To make sure that the Apache database connection cache is installed, run
-the following command:
-
- perl -MCPAN -e'install Apache::DBI'
-
-
FastCGI
-------
@@ -225,26 +235,22 @@
SETTING UP THE MAIL GATEWAY
---------------------------
-RT can accept incoming email using a simple program run as a "pipe"
-by your mail server.
+To let email flow to your RT server, you need to add a few lines of
+configuration to your mail server's "aliases" file. These lines "pipe"
+incoming email messages from your mail server to RT.
-Add the following lines to /etc/aliases (or your local equivalent) :
+Add the following lines to /etc/aliases (or your local equivalent) on your mail server:
-rt: "|/opt/rt3/bin/rt-mailgate --queue general --action correspond --url http://localhost/"
-rt-comment: "|/opt/rt3/bin/rt-mailgate --queue general --action comment --url http://localhost/"
- | | |
- <queue-name>----/ | |
- | |
- <correspond or comment depending on whether | |
- the mail should be resent to the requestor>---/ |
- |
- <URL for RT's web interface>---/
+rt: "|/opt/rt3/bin/rt-mailgate --queue general --action correspond --url http://rt.example.com/"
+rt-comment: "|/opt/rt3/bin/rt-mailgate --queue general --action comment --url http://rt.example.com/"
+You'll need to add similar lines for each queue you want to be able
+to send email to. To find out more about how to configure RT's email
+gateway, type:
+
+ perldoc /opt/rt3/bin/rt-mailgate
-BUGS
-----
-To report a bug, send email to rt-bugs at fsck.com.
GETTING HELP
------------
@@ -259,17 +265,29 @@
<sales at bestpractical.com> to discuss rates and availability.
+
+RT WEBSITE
+----------
+
+For current information about RT, check out the RT website at
+ http://www.bestpractical.com/
+
+You'll find screenshots, a pointer to the current version of RT, contributed
+patches, and lots of other great stuff.
+
+
+
RT-USERS MAILINGLIST
--------------------
To keep up to date on the latest RT tips, techniques and extensions,
you probably want to join the rt-users mailing list. Send a message to:
- rt-users-request at lists.bestpractical.com
+ rt-users-request at lists.bestpractical.com
With the body of the message consisting of only the word:
- subscribe
+ subscribe
If you're interested in hacking on RT, you'll want to subscribe to
rt-devel at lists.bestpractical.com. Subscribe to it with instructions
@@ -281,15 +299,17 @@
<jesse at bestpractical.com>.
-RT WEBSITE
-----------
-
-For current information about RT, check out the RT website at
- http://www.bestpractical.com/
+BUGS
+----
-You'll find screenshots, a pointer to the current version of RT, contributed
-patches, and lots of other great stuff.
+RT's a pretty complex application and as you get up to speed, you might
+run into some trouble. Generally, it's best to ask about things you
+run into on the rt-users mailinglist (or pick up a commercial support
+contract from Best Practical). But, sometimes people do run into bugs. In
+the exceedingly unlikely event that you hit a bug in RT, please report
+it! We'd love to hear about problems you have with RT, so we can fix them.
+To report a bug, send email to rt-bugs at fsck.com.
# BEGIN BPS TAGGED BLOCK {{{
Modified: rt/branches/QUEBEC-EXPERIMENTAL/bin/standalone_httpd.in
==============================================================================
--- rt/branches/QUEBEC-EXPERIMENTAL/bin/standalone_httpd.in (original)
+++ rt/branches/QUEBEC-EXPERIMENTAL/bin/standalone_httpd.in Mon Mar 28 05:50:42 2005
@@ -44,170 +44,23 @@
# those contributions and any derivatives thereof.
#
# END BPS TAGGED BLOCK }}}
-package RT::Mason;
+use warnings;
use strict;
-use vars '$Handler';
-
-BEGIN { require ('@RT_BIN_PATH@/webmux.pl') };
-
-use lib( "@LOCAL_LIB_PATH@", "@RT_LIB_PATH@");
-
-use Socket;
-
-$SIG{CHLD} = 'IGNORE'; # reap child processes
-$SIG{HUP} = sub {
- # on a "kill -HUP", we first close our socket handles.
- close Remote;
- close HTTPDaemon;
-
- # and then, on systems implementing fork(), we make sure
- # we are running with a new pid, so another -HUP will still
- # work on the new process.
- require Config;
- if ($Config::Config{d_fork} and my $pid = fork()) {
- # finally, allow ^C on the parent process to terminate
- # the children.
- waitpid($pid, 0); exit;
- }
-
- # do the exec. if $0 is not executable, try running it with $^X.
- exec { $0 } ( ((-x $0) ? () : ($^X)), $0, @ARGV );
-};
-
-
-RT::Init();
-
-my $port = $RT::WebPort || '8080';
-
-main_loop($port);
-
-sub main_loop {
- my $port = shift;
- my $tcp = getprotobyname('tcp');
-
- socket( HTTPDaemon, PF_INET, SOCK_STREAM, $tcp ) or die "socket: $!";
- setsockopt( HTTPDaemon, SOL_SOCKET, SO_REUSEADDR, pack( "l", 1 ) )
- or warn "setsockopt: $!";
- bind( HTTPDaemon, sockaddr_in( $port, INADDR_ANY ) ) or die "bind: $!";
- listen( HTTPDaemon, SOMAXCONN ) or die "listen: $!";
-
- print("You can connect to your RT server at http://localhost:$port/\n");
-
- while (1) {
-
- for ( ; accept( Remote, HTTPDaemon ); close Remote ) {
- Module::Refresh->refresh if $RT::DevelMode;
-
- binmode *Remote, ':utf8';
- *STDIN = *Remote;
- *STDOUT = *Remote;
-
- my $remote_sockaddr = getpeername(STDIN);
- my ( undef, $iaddr ) = sockaddr_in($remote_sockaddr);
- my $peername = gethostbyaddr( $iaddr, AF_INET ) || "localhost";
- my $peeraddr = inet_ntoa($iaddr) || "127.0.0.1";
-
- my $local_sockaddr = getsockname(STDIN);
- my ( undef, $localiaddr ) = sockaddr_in($local_sockaddr);
- my $localname = gethostbyaddr( $localiaddr, AF_INET )
- || "localhost";
- my $localaddr = inet_ntoa($localiaddr) || "127.0.0.1";
-
- chomp( $_ = <STDIN> );
- my ( $method, $request_uri, $proto, undef ) = split;
-
- #$request_uri =~ s#\\#/#g;
- $RT::Logger->info("<- $peername: $_\n");
- my ( $file, undef, $query_string ) =
- ( $request_uri =~ /([^?]*)(\?(.*))?/ ); # split at ?
- #$file =~ s/%([\dA-Fa-f]{2})/chr(hex($1))/eg; # decode url-escaped entities
-
- last if ( $method !~ /^(GET|POST|HEAD)$/ );
-
- $query_string = '' if !defined $query_string;
-
- build_cgi_env( method => $method,
- query_string => $query_string,
- path => $file,
- protocol => $proto,
- port => $port,
- peername => $peername,
- peeraddr => $peeraddr,
- localname => $localname,
- request_uri => $request_uri );
-
- RT::ConnectToDatabase();
- my $cgi = CGI->new();
-
- print "HTTP/1.0 200 OK\n"; # probably OK by now
-
- if ( ( !$Handler->interp->comp_exists( $cgi->path_info ) )
- && ($Handler->interp->comp_exists( $cgi->path_info . "/index.html" ) )
- ) {
- $cgi->path_info( $cgi->path_info . "/index.html" );
- }
-
- eval { $Handler->handle_cgi_object($cgi); };
- $RT::Logger->crit($@) if ($@);
-
- RT::Interface::Web::Handler->CleanupRequest();
- }
-
- }
+BEGIN {
+ use lib( "@LOCAL_LIB_PATH@", "@RT_LIB_PATH@");
+ use RT;
+ RT::LoadConfig();
+ if ($RT::DevelMode) { require Module::Refresh; }
}
+RT::Init();
+my $port = shift @ARGV || $RT::WebPort || '8080';
+use RT::Interface::Web::Standalone;
+my $server = RT::Interface::Web::Standalone->new;
+$server->port($port);
+$server->run();
-sub build_cgi_env {
- my %args = ( query_string => '',
- path => '',
- port => undef,
- protocol => undef,
- localname => undef,
- method => undef,
- remote_name => undef,
-
-
- @_);
-
- foreach my $var qw(USER_AGENT CONTENT_LENGTH CONTENT_TYPE
- COOKIE SERVER_PORT SERVER_PROTOCOL SERVER_NAME
- PATH_INFO REQUEST_URI REQUEST_METHOD REMOTE_ADDR
- REMOTE_HOST QUERY_STRING SERVER_SOFTWARE) {
- delete $ENV{$var};
- }
- while (<STDIN>) {
- s/[\r\l\n\s]+$//;
- if( /^([\w\-]+): (.+)/i) {
- my $tag = uc($1);
- $tag =~ s/^COOKIES$/COOKIE/;
- my $val = $2;
- $tag =~ s/-/_/g;
- $tag = "HTTP_".$tag unless (grep /^$tag$/, qw(CONTENT_LENGTH CONTENT_TYPE COOKIE));
- if ($ENV{$tag}) {
- $ENV{$tag} .= "; $val";
- }
- else {
- $ENV{$tag} = $val;
- }
- }
- last if (/^$/);
- }
-
-
- $ENV{SERVER_PROTOCOL} = $args{protocol};
- $ENV{SERVER_PORT} = $args{port};
- $ENV{SERVER_NAME} = $args{'localname'};
- $ENV{SERVER_URL} = "http://".$args{'localname'}.":".$args{'port'}."/";
- $ENV{PATH_INFO} = $args{'path'};
- $ENV{REQUEST_URI} = $args{'request_uri'};
- $ENV{REQUEST_METHOD} = $args{method};
- $ENV{REMOTE_ADDR} = $args{'peeraddr'};
- $ENV{REMOTE_HOST} = $args{'peername'};
- $ENV{QUERY_STRING} = $args{'query_string'};
- $ENV{SERVER_SOFTWARE} = "rt-standalone/$RT::VERSION";
- CGI::initialize_globals();
-}
Modified: rt/branches/QUEBEC-EXPERIMENTAL/bin/webmux.pl.in
==============================================================================
--- rt/branches/QUEBEC-EXPERIMENTAL/bin/webmux.pl.in (original)
+++ rt/branches/QUEBEC-EXPERIMENTAL/bin/webmux.pl.in Mon Mar 28 05:50:42 2005
@@ -53,6 +53,9 @@
$ENV{'ENV'} = '' if defined $ENV{'ENV'};
$ENV{'IFS'} = '' if defined $ENV{'IFS'};
+ use CGI qw(-private_tempfiles); #bring this in before mason, to make sure we
+ #set private_tempfiles
+
eval { require Apache2; require Apache::Request; 1 } or
eval { require Apache2; require Apache::compat; 1 } or die $@
if $ENV{'MOD_PERL'}
@@ -65,11 +68,6 @@
package RT::Mason;
-use CGI qw(-private_tempfiles); #bring this in before mason, to make sure we
- #set private_tempfiles
-
-use HTML::Mason; # brings in subpackages: Parser, Interp, etc.
-
use vars qw($Nobody $SystemUser $Handler $r);
#This drags in RT's config.pm
@@ -78,24 +76,14 @@
if ($RT::DevelMode) { require Module::Refresh; }
}
-use Carp;
{
package HTML::Mason::Commands;
use vars qw(%session);
-
- use RT::Interface::Web;
- use MIME::Entity;
- use Text::Wrapper;
- use CGI::Cookie;
- use Time::ParseDate;
- use Time::HiRes;
- use HTML::Entities;
- use HTML::Scrubber;
- use Text::Quoted;
}
+use RT::Interface::Web;
use RT::Interface::Web::Handler;
$Handler = RT::Interface::Web::Handler->new(@RT::MasonParameters);
Modified: rt/branches/QUEBEC-EXPERIMENTAL/etc/RT_SiteConfig.pm
==============================================================================
--- rt/branches/QUEBEC-EXPERIMENTAL/etc/RT_SiteConfig.pm (original)
+++ rt/branches/QUEBEC-EXPERIMENTAL/etc/RT_SiteConfig.pm Mon Mar 28 05:50:42 2005
@@ -1 +1,19 @@
+# Any configuration directives you include here will override
+# RT's default configuration file, RT_Config.pm
+#
+# To include a directive here, just copy the equivalent statement
+# from RT_Config.pm and change the value. We've included a single
+# sample value below.
+#
+# This file is actually a perl module, so you can include valid
+# perl code, as well.
+#
+# The converse is also true, if this file isn't valid perl, you're
+# going to run into trouble. To check your SiteConfig file, use
+# this comamnd:
+#
+# perl -C /opt/rt3/etc/RT_SiteConfig.pm
+
+Set( $rtname => 'example.com');
+
1;
Modified: rt/branches/QUEBEC-EXPERIMENTAL/html/Admin/Elements/EditCustomFields
==============================================================================
--- rt/branches/QUEBEC-EXPERIMENTAL/html/Admin/Elements/EditCustomFields (original)
+++ rt/branches/QUEBEC-EXPERIMENTAL/html/Admin/Elements/EditCustomFields Mon Mar 28 05:50:42 2005
@@ -46,10 +46,10 @@
<& /Elements/ListActions, actions => \@results &>
<FORM ACTION="<%$RT::WebPath%><% $m->request_comp->path |n %>" METHOD="POST" NAME="EditCustomFields">
-<INPUT TYPE=HIDDEN NAME="id" VALUE="<% $Object->Id %>">
-<INPUT TYPE=HIDDEN NAME="ObjectType" VALUE="<% $ObjectType %>">
-<INPUT TYPE=HIDDEN NAME="SubType" VALUE="<% $SubType %>">
-<INPUT TYPE=HIDDEN NAME="UpdateCFs" VALUE="1">
+<INPUT TYPE=HIDDEN NAME="id" VALUE="<% $Object->Id %>"/>
+<INPUT TYPE=HIDDEN NAME="ObjectType" VALUE="<% $ObjectType %>"/>
+<INPUT TYPE=HIDDEN NAME="SubType" VALUE="<% $SubType %>"/>
+<INPUT TYPE=HIDDEN NAME="UpdateCFs" VALUE="1"/>
% if ($Object->Id) {
<h2><&|/l&>Global Custom Fields</&></h2>
Modified: rt/branches/QUEBEC-EXPERIMENTAL/html/Admin/Elements/PickCustomFields
==============================================================================
--- rt/branches/QUEBEC-EXPERIMENTAL/html/Admin/Elements/PickCustomFields (original)
+++ rt/branches/QUEBEC-EXPERIMENTAL/html/Admin/Elements/PickCustomFields Mon Mar 28 05:50:42 2005
@@ -75,7 +75,7 @@
% # show 'move up' unless it's the first item
% if ($count++ and $Checked) {
<TD valign="TOP">
- [<a href="CustomFields.html?id=<%$id%>&SubType=<%$SubType%>&CustomField=<%$CustomFieldObj->id%>&Move=-1"><&|/l&>Move up</&></a>]
+ [<a href="<%$RT::WebPath%><% $m->request_comp->path |n %>?id=<%$id%>&SubType=<%$SubType%>&CustomField=<%$CustomFieldObj->id%>&Move=-1"><&|/l&>Move up</&></a>]
% } else {
<TD valign="TOP" ALIGN=RIGHT>
% }
@@ -83,7 +83,7 @@
% # show 'move down' unless it's the last item
% if ($count != @CustomFields and $Checked) {
% $m->print(' | ') if $count > 1;
- [<a href="CustomFields.html?id=<%$id%>&SubType=<%$SubType%>&CustomField=<%$CustomFieldObj->id%>&Move=1"><&|/l&>Move down</&></a>]
+ [<a href="<%$RT::WebPath%><% $m->request_comp->path |n %>?id=<%$id%>&SubType=<%$SubType%>&CustomField=<%$CustomFieldObj->id%>&Move=1"><&|/l&>Move down</&></a>]
% }
</TD>
</TR>
Modified: rt/branches/QUEBEC-EXPERIMENTAL/html/Admin/Global/CustomFields/Groups.html
==============================================================================
--- rt/branches/QUEBEC-EXPERIMENTAL/html/Admin/Global/CustomFields/Groups.html (original)
+++ rt/branches/QUEBEC-EXPERIMENTAL/html/Admin/Global/CustomFields/Groups.html Mon Mar 28 05:50:42 2005
@@ -1,46 +1,11 @@
-%# BEGIN BPS TAGGED BLOCK {{{
-%#
-%# COPYRIGHT:
-%#
-%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC
-%# <jesse at bestpractical.com>
-%#
-%# (Except where explicitly superseded by other copyright notices)
-%#
-%#
-%# LICENSE:
-%#
-%# This work is made available to you under the terms of Version 2 of
-%# the GNU General Public License. A copy of that license should have
-%# been provided with this software, but in any event can be snarfed
-%# from www.gnu.org.
-%#
-%# This work is distributed in the hope that it will be useful, but
-%# WITHOUT ANY WARRANTY; without even the implied warranty of
-%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-%# General Public License for more details.
-%#
-%# You should have received a copy of the GNU General Public License
-%# along with this program; if not, write to the Free Software
-%# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-%#
-%#
-%# CONTRIBUTION SUBMISSION POLICY:
-%#
-%# (The following paragraph is not intended to limit the rights granted
-%# to you to modify and distribute this software under the terms of
-%# the GNU General Public License and is only of importance to you if
-%# you choose to contribute your changes and enhancements to the
-%# community by submitting them to Best Practical Solutions, LLC.)
-%#
-%# By intentionally submitting any modifications, corrections or
-%# derivatives to this work, or any other work intended for use with
-%# Request Tracker, to Best Practical Solutions, LLC, you confirm that
-%# you are the copyright holder for those contributions and you grant
-%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable,
-%# royalty-free, perpetual, license to use, copy, create derivative
-%# works based on those contributions, and sublicense and distribute
-%# those contributions and any derivatives thereof.
-%#
-%# END BPS TAGGED BLOCK }}}
-<& /Admin/Elements/ObjectCustomFields, %ARGS, ObjectType => 'RT::Group' &>
+<& /Admin/Elements/Header, Title => $title &>
+<& /Admin/Elements/GlobalCustomFieldTabs,
+ current_tab => "Admin/Global/CustomFields/Groups.html",
+ current_subtab => "Admin/Global/CustomFields/Groups.html",
+ Title => $title
+ &>
+ <& /Admin/Elements/EditCustomFields, %ARGS, title => $title, ObjectType => 'RT::Group', Object=> $object &>
+<%INIT>
+ my $title = loc( 'Edit Custom Fields for all groups');
+ my $object = RT::Group->new($session{'CurrentUser'});
+</%INIT>
Modified: rt/branches/QUEBEC-EXPERIMENTAL/html/Admin/Global/CustomFields/Queue-Tickets.html
==============================================================================
--- rt/branches/QUEBEC-EXPERIMENTAL/html/Admin/Global/CustomFields/Queue-Tickets.html (original)
+++ rt/branches/QUEBEC-EXPERIMENTAL/html/Admin/Global/CustomFields/Queue-Tickets.html Mon Mar 28 05:50:42 2005
@@ -1,47 +1,11 @@
-%# BEGIN BPS TAGGED BLOCK {{{
-%#
-%# COPYRIGHT:
-%#
-%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC
-%# <jesse at bestpractical.com>
-%#
-%# (Except where explicitly superseded by other copyright notices)
-%#
-%#
-%# LICENSE:
-%#
-%# This work is made available to you under the terms of Version 2 of
-%# the GNU General Public License. A copy of that license should have
-%# been provided with this software, but in any event can be snarfed
-%# from www.gnu.org.
-%#
-%# This work is distributed in the hope that it will be useful, but
-%# WITHOUT ANY WARRANTY; without even the implied warranty of
-%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-%# General Public License for more details.
-%#
-%# You should have received a copy of the GNU General Public License
-%# along with this program; if not, write to the Free Software
-%# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-%#
-%#
-%# CONTRIBUTION SUBMISSION POLICY:
-%#
-%# (The following paragraph is not intended to limit the rights granted
-%# to you to modify and distribute this software under the terms of
-%# the GNU General Public License and is only of importance to you if
-%# you choose to contribute your changes and enhancements to the
-%# community by submitting them to Best Practical Solutions, LLC.)
-%#
-%# By intentionally submitting any modifications, corrections or
-%# derivatives to this work, or any other work intended for use with
-%# Request Tracker, to Best Practical Solutions, LLC, you confirm that
-%# you are the copyright holder for those contributions and you grant
-%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable,
-%# royalty-free, perpetual, license to use, copy, create derivative
-%# works based on those contributions, and sublicense and distribute
-%# those contributions and any derivatives thereof.
-%#
-%# END BPS TAGGED BLOCK }}}
-<& /Admin/Elements/ObjectCustomFields, %ARGS, ObjectType => 'RT::Queue',
-SubType => 'RT::Ticket' &>
+<& /Admin/Elements/Header, Title => $title &>
+<& /Admin/Elements/GlobalCustomFieldTabs,
+ current_tab => "Admin/Global/CustomFields/Queue-Tickets.html",
+ current_subtab => "Admin/Global/CustomFields/Queue-Tickets.html",
+ Title => $title
+ &>
+ <& /Admin/Elements/EditCustomFields, %ARGS, title => $title, ObjectType => 'RT::Queue', Object=> $object, SubType => 'RT::Ticket' &>
+<%INIT>
+ my $title = loc( 'Edit Custom Fields for tickets in all queues');
+ my $object = RT::Queue->new($session{'CurrentUser'});
+</%INIT>
Modified: rt/branches/QUEBEC-EXPERIMENTAL/html/Admin/Global/CustomFields/Queue-Transactions.html
==============================================================================
--- rt/branches/QUEBEC-EXPERIMENTAL/html/Admin/Global/CustomFields/Queue-Transactions.html (original)
+++ rt/branches/QUEBEC-EXPERIMENTAL/html/Admin/Global/CustomFields/Queue-Transactions.html Mon Mar 28 05:50:42 2005
@@ -1,47 +1,11 @@
-%# BEGIN BPS TAGGED BLOCK {{{
-%#
-%# COPYRIGHT:
-%#
-%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC
-%# <jesse at bestpractical.com>
-%#
-%# (Except where explicitly superseded by other copyright notices)
-%#
-%#
-%# LICENSE:
-%#
-%# This work is made available to you under the terms of Version 2 of
-%# the GNU General Public License. A copy of that license should have
-%# been provided with this software, but in any event can be snarfed
-%# from www.gnu.org.
-%#
-%# This work is distributed in the hope that it will be useful, but
-%# WITHOUT ANY WARRANTY; without even the implied warranty of
-%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-%# General Public License for more details.
-%#
-%# You should have received a copy of the GNU General Public License
-%# along with this program; if not, write to the Free Software
-%# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-%#
-%#
-%# CONTRIBUTION SUBMISSION POLICY:
-%#
-%# (The following paragraph is not intended to limit the rights granted
-%# to you to modify and distribute this software under the terms of
-%# the GNU General Public License and is only of importance to you if
-%# you choose to contribute your changes and enhancements to the
-%# community by submitting them to Best Practical Solutions, LLC.)
-%#
-%# By intentionally submitting any modifications, corrections or
-%# derivatives to this work, or any other work intended for use with
-%# Request Tracker, to Best Practical Solutions, LLC, you confirm that
-%# you are the copyright holder for those contributions and you grant
-%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable,
-%# royalty-free, perpetual, license to use, copy, create derivative
-%# works based on those contributions, and sublicense and distribute
-%# those contributions and any derivatives thereof.
-%#
-%# END BPS TAGGED BLOCK }}}
-<& /Admin/Elements/ObjectCustomFields, %ARGS, ObjectType => 'RT::Queue',
-SubType => 'RT::Transaction' &>
+<& /Admin/Elements/Header, Title => $title &>
+<& /Admin/Elements/GlobalCustomFieldTabs,
+ current_tab => "Admin/Global/CustomFields/Queue-Transactions.html",
+ current_subtab => "Admin/Global/CustomFields/Queue-Transactions.html",
+ Title => $title
+ &>
+ <& /Admin/Elements/EditCustomFields, %ARGS, title => $title, ObjectType => 'RT::Queue', Object=> $object, SubType => 'RT::Ticket-RT::Transaction' &>
+<%INIT>
+ my $title = loc( 'Edit Custom Fields for tickets in all queues');
+ my $object = RT::Queue->new($session{'CurrentUser'});
+</%INIT>
Modified: rt/branches/QUEBEC-EXPERIMENTAL/html/Admin/Global/CustomFields/Users.html
==============================================================================
--- rt/branches/QUEBEC-EXPERIMENTAL/html/Admin/Global/CustomFields/Users.html (original)
+++ rt/branches/QUEBEC-EXPERIMENTAL/html/Admin/Global/CustomFields/Users.html Mon Mar 28 05:50:42 2005
@@ -1,46 +1,11 @@
-%# BEGIN BPS TAGGED BLOCK {{{
-%#
-%# COPYRIGHT:
-%#
-%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC
-%# <jesse at bestpractical.com>
-%#
-%# (Except where explicitly superseded by other copyright notices)
-%#
-%#
-%# LICENSE:
-%#
-%# This work is made available to you under the terms of Version 2 of
-%# the GNU General Public License. A copy of that license should have
-%# been provided with this software, but in any event can be snarfed
-%# from www.gnu.org.
-%#
-%# This work is distributed in the hope that it will be useful, but
-%# WITHOUT ANY WARRANTY; without even the implied warranty of
-%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-%# General Public License for more details.
-%#
-%# You should have received a copy of the GNU General Public License
-%# along with this program; if not, write to the Free Software
-%# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-%#
-%#
-%# CONTRIBUTION SUBMISSION POLICY:
-%#
-%# (The following paragraph is not intended to limit the rights granted
-%# to you to modify and distribute this software under the terms of
-%# the GNU General Public License and is only of importance to you if
-%# you choose to contribute your changes and enhancements to the
-%# community by submitting them to Best Practical Solutions, LLC.)
-%#
-%# By intentionally submitting any modifications, corrections or
-%# derivatives to this work, or any other work intended for use with
-%# Request Tracker, to Best Practical Solutions, LLC, you confirm that
-%# you are the copyright holder for those contributions and you grant
-%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable,
-%# royalty-free, perpetual, license to use, copy, create derivative
-%# works based on those contributions, and sublicense and distribute
-%# those contributions and any derivatives thereof.
-%#
-%# END BPS TAGGED BLOCK }}}
-<& /Admin/Elements/ObjectCustomFields, %ARGS, ObjectType => 'RT::User' &>
+<& /Admin/Elements/Header, Title => $title &>
+<& /Admin/Elements/GlobalCustomFieldTabs,
+ current_tab => "Admin/Global/CustomFields/Users.html",
+ current_subtab => "Admin/Global/CustomFields/Users.html",
+ Title => $title
+ &>
+ <& /Admin/Elements/EditCustomFields, %ARGS, title => $title, ObjectType => 'RT::User', Object=> $object &>
+<%INIT>
+ my $title = loc( 'Edit Custom Fields for all users');
+ my $object = RT::User->new($session{'CurrentUser'});
+</%INIT>
Modified: rt/branches/QUEBEC-EXPERIMENTAL/html/Admin/Queues/CustomFields.html
==============================================================================
--- rt/branches/QUEBEC-EXPERIMENTAL/html/Admin/Queues/CustomFields.html (original)
+++ rt/branches/QUEBEC-EXPERIMENTAL/html/Admin/Queues/CustomFields.html Mon Mar 28 05:50:42 2005
@@ -43,4 +43,28 @@
%# those contributions and any derivatives thereof.
%#
%# END BPS TAGGED BLOCK }}}
-<& /Admin/Elements/ObjectCustomFields, %ARGS, ObjectType => 'RT::Queue' &>
+<& /Admin/Elements/Header, Title => $title &>
+<& /Admin/Elements/QueueTabs,
+ id => $Object->id,
+ current_tab => "Admin/Queues/CustomFields.html?SubType=$SubType&id=$id",
+ current_subtab => "Admin/Queues/CustomFields.html?SubType=$SubType&id=$id",
+ QueueObj => $Object,
+ Title => $title
+ &>
+
+ <& /Admin/Elements/EditCustomFields, %ARGS, title => $title, Object => $Object, ObjectType => 'RT::Queue' &>
+<%INIT>
+my $Object = RT::Queue->new( $session{'CurrentUser'} );
+
+$Object->Load($id) || Abort( loc( "Couldn't load object [_1]", $id ) );
+my $FriendlySubTypes =
+ RT::CustomField->new( $session{'CurrentUser'} )
+ ->FriendlyLookupType( $Object->CustomFieldLookupType );
+
+my $title = loc( 'Edit Custom Fields for [_1]', $Object->Name );
+
+</%INIT>
+<%ARGS>
+$id => undef
+$SubType => 'RT::Queue-RT::Ticket'
+</%ARGS>
Modified: rt/branches/QUEBEC-EXPERIMENTAL/html/Admin/Queues/index.html
==============================================================================
--- rt/branches/QUEBEC-EXPERIMENTAL/html/Admin/Queues/index.html (original)
+++ rt/branches/QUEBEC-EXPERIMENTAL/html/Admin/Queues/index.html Mon Mar 28 05:50:42 2005
@@ -50,13 +50,14 @@
-<%$caption%>:<BR>
+<h1><%$caption%></h1>
+<p><&|/l&>Select a queue</&>:</p>
<UL>
%if ($queues->Count == 0) {
-<LI> <i><&|/l&>No queues matching search criteria found.</&></i>
+<li><i><&|/l&>No queues matching search criteria found.</&></i></li>
% }
%while ( $queue = $queues->Next) {
-<LI><A HREF="Modify.html?id=<%$queue->id%>"><%$queue->Name%></a></LI>
+<li><A HREF="Modify.html?id=<%$queue->id%>"><%$queue->Name%></a></li>
%}
</UL>
<BR>
Modified: rt/branches/QUEBEC-EXPERIMENTAL/html/Admin/Users/CustomFields.html
==============================================================================
--- rt/branches/QUEBEC-EXPERIMENTAL/html/Admin/Users/CustomFields.html (original)
+++ rt/branches/QUEBEC-EXPERIMENTAL/html/Admin/Users/CustomFields.html Mon Mar 28 05:50:42 2005
@@ -43,4 +43,27 @@
%# those contributions and any derivatives thereof.
%#
%# END BPS TAGGED BLOCK }}}
-<& /Admin/Elements/ObjectCustomFields, %ARGS, ObjectType => 'RT::User' &>
+<& /Admin/Elements/Header, Title => $title &>
+<& /Admin/Elements/UserTabs,
+ id => $Object->id,
+ current_tab => "Admin/Users/CustomFields.html?$id=".$id,
+ current_subtab => "Admin/Users/CustomFields.html?id=".$id,
+ UserObj => $Object,
+ Title => $title
+ &>
+
+ <& /Admin/Elements/EditCustomFields, %ARGS, title => $title, Object => $Object, ObjectType => 'RT::User' &>
+<%INIT>
+my $Object = RT::User->new( $session{'CurrentUser'} );
+
+$Object->Load($id) || Abort( loc( "Couldn't load object [_1]", $id ) );
+my $FriendlySubTypes =
+ RT::CustomField->new( $session{'CurrentUser'} )
+ ->FriendlyLookupType( $Object->CustomFieldLookupType );
+
+my $title = loc( 'Edit Custom Fields for [_1]', $Object->Name );
+
+</%INIT>
+<%ARGS>
+$id => undef
+</%ARGS>
Modified: rt/branches/QUEBEC-EXPERIMENTAL/html/Admin/Users/Modify.html
==============================================================================
--- rt/branches/QUEBEC-EXPERIMENTAL/html/Admin/Users/Modify.html (original)
+++ rt/branches/QUEBEC-EXPERIMENTAL/html/Admin/Users/Modify.html Mon Mar 28 05:50:42 2005
@@ -222,12 +222,12 @@
<TR>
<TD colspan="2">
<& /Elements/TitleBoxStart, title => loc('Comments about this user') &>
-<TEXTAREA name="Comments" COLS=80 ROWS=5 WRAP=VIRTUAL><%$UserObj->Comments%></TEXTAREA>
+<TEXTAREA class="comments" name="Comments" COLS=80 ROWS=5 WRAP=VIRTUAL><%$UserObj->Comments%></TEXTAREA>
<& /Elements/TitleBoxEnd &>
%if ($UserObj->Privileged) {
<BR>
<& /Elements/TitleBoxStart, title => loc('Signature') &>
-<TEXTAREA COLS=80 ROWS=5 name="Signature" WRAP=HARD><%$UserObj->Signature%></TEXTAREA>
+<TEXTAREA class="signature" COLS=80 ROWS=5 name="Signature" WRAP=HARD><%$UserObj->Signature%></TEXTAREA>
<& /Elements/TitleBoxEnd &>
% }
Modified: rt/branches/QUEBEC-EXPERIMENTAL/html/Admin/Users/index.html
==============================================================================
--- rt/branches/QUEBEC-EXPERIMENTAL/html/Admin/Users/index.html (original)
+++ rt/branches/QUEBEC-EXPERIMENTAL/html/Admin/Users/index.html Mon Mar 28 05:50:42 2005
@@ -48,13 +48,11 @@
current_subtab => 'Admin/Users/',
Title => loc('Select a user') &>
-
-
-
-<%$caption%>:<BR>
-<UL>
+<h1><%$caption%></h1>
+<p><&|/l&>Select a user</&>:</p>
+<ul>
%if ($users->Count == 0) {
-<LI> <i><&|/l&>No users matching search criteria found.</&></i>
+<li><i><&|/l&>No users matching search criteria found.</&></i></li>
% }
%my @ids;
%while ( $user = $users->Next) {
Modified: rt/branches/QUEBEC-EXPERIMENTAL/html/Admin/index.html
==============================================================================
--- rt/branches/QUEBEC-EXPERIMENTAL/html/Admin/index.html (original)
+++ rt/branches/QUEBEC-EXPERIMENTAL/html/Admin/index.html Mon Mar 28 05:50:42 2005
@@ -5,7 +5,7 @@
%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC
%# <jesse at bestpractical.com>
%#
-%# (Except where explicitly superseded by other copyright notices)
+%# (Except where explicitly superseded by other copyright notices),
%#
%#
%# LICENSE:
@@ -31,7 +31,7 @@
%# to you to modify and distribute this software under the terms of
%# the GNU General Public License and is only of importance to you if
%# you choose to contribute your changes and enhancements to the
-%# community by submitting them to Best Practical Solutions, LLC.)
+%# community by submitting them to Best Practical Solutions, LLC.),
%#
%# By intentionally submitting any modifications, corrections or
%# derivatives to this work, or any other work intended for use with
@@ -47,19 +47,53 @@
<& /Admin/Elements/Tabs, Title => loc('RT Administration') &>
<ul>
-<li><font size="+2"><a href="Users/"><&|/l&>Users</&></a></font><br>
-<&|/l&>Manage users and passwords</&>
-</li>
-<li><font size="+2"><a href="Groups/"><&|/l&>Groups</&></a></font><br>
-<&|/l&>Manage groups and group membership</&>
-</li>
-<li><font size="+2"><a href="Queues/"><&|/l&>Queues</&></a></font><br>
-<&|/l&>Manage queues and queue-specific properties</&>
-</li>
-<li><font size="+2"><a href="CustomFields/"><&|/l&>Custom Fields</&></a></font><br>
-<&|/l&>Manage custom fields and custom field values</&>
-</li>
-<li><font size="+2"><a href="Global/"><&|/l&>Global</&></a></font><br>
-<&|/l&>Manage properties and configuration which apply to all queues</&>
+% foreach my $key (sort keys %$tabs) {
+<li><font size="+2"><a href="<%$RT::WebPath%>/<%$tabs->{$key}->{'path'}|n %>"><%$tabs->{$key} ->{'title'}%></a></font><br>
+<%$tabs->{$key}->{description}%>
</li>
+%}
</ul>
+<%init>
+
+
+
+my $tabs = {
+ A => {
+ title => loc('Users'),
+ path => 'Admin/Users/index.html',
+ description => loc('Manage users and passwords'),
+ },
+ B => {
+ title => loc('Groups'),
+ path => 'Admin/Groups/index.html',
+ description => loc('Manage groups and group membership'),
+ },
+ C => {
+ title => loc('Queues'),
+ path => 'Admin/Queues/index.html',
+ description => loc('Manage queues and queue-specific properties'),
+ },
+ D => {
+ 'title' => loc('Custom Fields'),
+ description => loc('Manage custom fields and custom field values'),
+ path => 'Admin/CustomFields/index.html',
+ },
+ E => {
+ 'title' => loc('Global'),
+ path => 'Admin/Global/index.html',
+ description =>
+ loc('Manage properties and configuration which apply to all queues'),
+ },
+ F => {
+ 'title' => loc('Tools'),
+ path => 'Admin/Tools/index.html',
+ description => loc('Use other RT administrative tools')
+ },
+};
+
+ $m->comp('/Elements/Callback', tabs => $tabs, %ARGS);
+
+
+
+
+</%init>
Modified: rt/branches/QUEBEC-EXPERIMENTAL/html/Elements/Header
==============================================================================
--- rt/branches/QUEBEC-EXPERIMENTAL/html/Elements/Header (original)
+++ rt/branches/QUEBEC-EXPERIMENTAL/html/Elements/Header Mon Mar 28 05:50:42 2005
@@ -77,7 +77,7 @@
>
<table width="100%" border="0" cellspacing="0" cellpadding="0" bgcolor="#FFFFFF">
<tr>
- <td colspan=2><a href="http://bestpractical.com"><img src="<%$RT::WebImagesURL%>/bplogo.gif" alt="" width="230" height="50"></a></td>
+ <td colspan=2><a href="http://bestpractical.com"><img src="<%$RT::WebImagesURL%>/bplogo.gif" alt="<%loc("Best Practical Solutions, LLC corporate logo")%>" width="230" height="50"></a></td>
<td> </td>
<td> </td>
<td width="50%" align="right">
Modified: rt/branches/QUEBEC-EXPERIMENTAL/html/Elements/Login
==============================================================================
--- rt/branches/QUEBEC-EXPERIMENTAL/html/Elements/Login (original)
+++ rt/branches/QUEBEC-EXPERIMENTAL/html/Elements/Login Mon Mar 28 05:50:42 2005
@@ -67,7 +67,7 @@
contentbg=>"#cccccc" &>
% unless ($RT::WebExternalAuth and !$RT::WebFallbackToInternalAuth) {
-<FORM METHOD=POST ACTION="<% (UNIVERSAL::can($r, 'uri') && ($r->uri) =~ m!.*/(.*)!) %>" >
+<FORM id="login" name="login" METHOD=POST ACTION="<% (UNIVERSAL::can($r, 'uri') && ($r->uri) =~ m!.*/(.*)!) %>" >
<TABLE BORDER=0 WIDTH=100%>
<TR ALIGN=RIGHT>
<TD ALIGN=RIGHT><&|/l&>Username</&>:</TD><TD ALIGN=LEFT><input name=user value="<%$user%>"></TD></TR>
Modified: rt/branches/QUEBEC-EXPERIMENTAL/html/Elements/MessageBox
==============================================================================
--- rt/branches/QUEBEC-EXPERIMENTAL/html/Elements/MessageBox (original)
+++ rt/branches/QUEBEC-EXPERIMENTAL/html/Elements/MessageBox Mon Mar 28 05:50:42 2005
@@ -43,7 +43,7 @@
%# those contributions and any derivatives thereof.
%#
%# END BPS TAGGED BLOCK }}}
-<TEXTAREA COLS=<%$Width%> ROWS=<%$Height%> WRAP=<%$Wrap%> NAME="<%$Name%>"><& /Elements/Callback, %ARGS &><% $Default %><%$message%><%$IncludeSignature ? $signature : ''%></TEXTAREA>
+<textarea class="messagebox" COLS=<%$Width%> ROWS=<%$Height%> WRAP=<%$Wrap%> NAME="<%$Name%>"><& /Elements/Callback, %ARGS &><% $Default %><%$message%><%$IncludeSignature ? $signature : ''%></textarea>
<%INIT>
my ($message);
Modified: rt/branches/QUEBEC-EXPERIMENTAL/html/NoAuth/images/autohandler
==============================================================================
--- rt/branches/QUEBEC-EXPERIMENTAL/html/NoAuth/images/autohandler (original)
+++ rt/branches/QUEBEC-EXPERIMENTAL/html/NoAuth/images/autohandler Mon Mar 28 05:50:42 2005
@@ -15,7 +15,10 @@
die unless (-f $file && -r $file);
$r->content_type($type);
open (FILE, "<$file") || die;
-$m->out($_) while (<FILE>);
-close(FILE);
+{
+ local $/ = \16384;
+ $m->out($_) while (<FILE>);
+ close(FILE);
+}
$m->abort;
</%init>
Modified: rt/branches/QUEBEC-EXPERIMENTAL/html/NoAuth/webrt.css
==============================================================================
--- rt/branches/QUEBEC-EXPERIMENTAL/html/NoAuth/webrt.css (original)
+++ rt/branches/QUEBEC-EXPERIMENTAL/html/NoAuth/webrt.css Mon Mar 28 05:50:42 2005
@@ -604,6 +604,17 @@
text-align: right;
}
+textarea.signature {
+ width: 100%;
+}
+textarea.comments {
+ width: 100%;
+}
+
+textarea.messagebox {
+ width: 100%;
+}
+
%# Provide a callback for adding/modifying the style sheet.
%# http://www.w3.org/TR/REC-CSS1 - section 3.2, says:
%# "latter specified rule wins"
Modified: rt/branches/QUEBEC-EXPERIMENTAL/html/Ticket/Update.html
==============================================================================
--- rt/branches/QUEBEC-EXPERIMENTAL/html/Ticket/Update.html (original)
+++ rt/branches/QUEBEC-EXPERIMENTAL/html/Ticket/Update.html Mon Mar 28 05:50:42 2005
@@ -107,7 +107,7 @@
<TD ALIGN=RIGHT><% $CF->Name %>:</TD>
<TD><& /Elements/EditCustomField, CustomField => $CF, NamePrefix =>
"Object-RT::Transaction--CustomField-" &><em><% $CF->FriendlyType %></em></TD>
-</TD></TR>
+</TR>
% } # end if while
% } # end of if
Modified: rt/branches/QUEBEC-EXPERIMENTAL/html/User/Prefs.html
==============================================================================
--- rt/branches/QUEBEC-EXPERIMENTAL/html/User/Prefs.html (original)
+++ rt/branches/QUEBEC-EXPERIMENTAL/html/User/Prefs.html Mon Mar 28 05:50:42 2005
@@ -165,7 +165,7 @@
%if ($UserObj->Privileged) {
<BR>
<& /Elements/TitleBoxStart, title => loc('Signature') &>
-<TEXTAREA COLS=80 ROWS=5 name="Signature" WRAP=HARD>
+<TEXTAREA COLS=80 ROWS=5 name="Signature" class="signature" WRAP=HARD>
<%$UserObj->Signature%></TEXTAREA>
<& /Elements/TitleBoxEnd &>
% }
Modified: rt/branches/QUEBEC-EXPERIMENTAL/lib/RT/CachedGroupMember_Overlay.pm
==============================================================================
--- rt/branches/QUEBEC-EXPERIMENTAL/lib/RT/CachedGroupMember_Overlay.pm (original)
+++ rt/branches/QUEBEC-EXPERIMENTAL/lib/RT/CachedGroupMember_Overlay.pm Mon Mar 28 05:50:42 2005
@@ -242,11 +242,14 @@
sub SetDisabled {
my $self = shift;
my $val = shift;
-
+
+ # if it's already disabled, we're good.
+ return {1} if ($self->__Value('Disabled') == $val);
my $err = $self->SUPER::SetDisabled($val);
- unless ($err) {
- $RT::Logger->error( "Couldn't SetDisabled CachedGroupMember " . $self->Id );
- return (undef);
+ my ($retval, $msg) = $err->as_array();
+ unless ($retval) {
+ $RT::Logger->error( "Couldn't SetDisabled CachedGroupMember " . $self->Id .": $msg");
+ return ($err);
}
my $member = $self->MemberObj();
@@ -260,7 +263,7 @@
my $kid_err = $kid->SetDisabled($val );
unless ($kid_err) {
$RT::Logger->error( "Couldn't SetDisabled CachedGroupMember " . $kid->Id );
- return (undef);
+ return ($kid_err);
}
}
}
Modified: rt/branches/QUEBEC-EXPERIMENTAL/lib/RT/CurrentUser.pm
==============================================================================
--- rt/branches/QUEBEC-EXPERIMENTAL/lib/RT/CurrentUser.pm (original)
+++ rt/branches/QUEBEC-EXPERIMENTAL/lib/RT/CurrentUser.pm Mon Mar 28 05:50:42 2005
@@ -400,7 +400,7 @@
sub loc_fuzzy {
my $self = shift;
- return '' if $_[0] eq '';
+ return '' if (!$_[0] || $_[0] eq '');
# XXX: work around perl's deficiency when matching utf8 data
return $_[0] if Encode::is_utf8($_[0]);
Modified: rt/branches/QUEBEC-EXPERIMENTAL/lib/RT/CustomField_Overlay.pm
==============================================================================
--- rt/branches/QUEBEC-EXPERIMENTAL/lib/RT/CustomField_Overlay.pm (original)
+++ rt/branches/QUEBEC-EXPERIMENTAL/lib/RT/CustomField_Overlay.pm Mon Mar 28 05:50:42 2005
@@ -284,7 +284,8 @@
is($cf->Type, 'Select');
is($cf->MaxValues, 1);
-ok($cf->SetType('SelectMultiple'));
+my ($val, $msg) = $cf->SetMaxValues('0');
+ok($val, $msg);
is($cf->Type, 'Select');
is($cf->MaxValues, 0);
ok(!$cf->SingleValue );
Modified: rt/branches/QUEBEC-EXPERIMENTAL/lib/RT/Interface/Web/Handler.pm
==============================================================================
--- rt/branches/QUEBEC-EXPERIMENTAL/lib/RT/Interface/Web/Handler.pm (original)
+++ rt/branches/QUEBEC-EXPERIMENTAL/lib/RT/Interface/Web/Handler.pm Mon Mar 28 05:50:42 2005
@@ -43,8 +43,23 @@
# those contributions and any derivatives thereof.
#
# END BPS TAGGED BLOCK }}}
+
package RT::Interface::Web::Handler;
+use CGI qw/-private_tempfiles/;
+use MIME::Entity;
+use Text::Wrapper;
+use CGI::Cookie;
+use Time::ParseDate;
+use Time::HiRes;
+use HTML::Entities;
+use HTML::Scrubber;
+use Text::Quoted;
+use RT::Interface::Web::Handler;
+use File::Path qw( rmtree );
+use File::Glob qw( bsd_glob );
+use File::Spec::Unix;
+
sub DefaultHandlerArgs { (
comp_root => [
[ local => $RT::MasonLocalComponentRoot ],
Added: rt/branches/QUEBEC-EXPERIMENTAL/lib/RT/Interface/Web/Standalone.pm
==============================================================================
--- (empty file)
+++ rt/branches/QUEBEC-EXPERIMENTAL/lib/RT/Interface/Web/Standalone.pm Mon Mar 28 05:50:42 2005
@@ -0,0 +1,54 @@
+package RT::Interface::Web::Standalone;
+
+use strict;
+use base 'HTTP::Server::Simple::Mason';
+use RT::Interface::Web::Handler;
+use RT::Interface::Web;
+
+sub new_handler {
+ my $m;
+ $m= RT::Interface::Web::Handler->new(@RT::MasonParameters,
+ # Override mason's default output method so
+ # we can change the binmode to our encoding if
+ # we happen to be handed character data instead
+ # of binary data.
+ #
+ # Cloned from HTML::Mason::CGIHandler
+ out_method =>
+ sub {
+ my $m = HTML::Mason::Request->instance;
+ my $r = $m->cgi_request;
+ # Send headers if they have not been sent by us or by user.
+ # We use instance here because if we store $request we get a
+ # circular reference and a big memory leak.
+ unless ($r->http_header_sent) {
+ $r->send_http_header();
+ }
+ {
+ if ($r->content_type =~ /charset=([\w-]+)$/ ) {
+ my $enc = $1;
+ binmode *STDOUT, ":encoding($enc)";
+ }
+ # We could perhaps install a new, faster out_method here that
+ # wouldn't have to keep checking whether headers have been
+ # sent and what the $r->method is. That would require
+ # additions to the Request interface, though.
+ print STDOUT grep {defined} @_;
+ }
+ }
+ );
+ return ($m);
+}
+
+sub handle_request {
+
+ my $self = shift;
+ my $cgi = shift;
+ $self->SUPER::handle_request($cgi);
+ $RT::Logger->crit($@) if ($@);
+
+ RT::Interface::Web::Handler->CleanupRequest();
+
+}
+
+1;
Modified: rt/branches/QUEBEC-EXPERIMENTAL/lib/RT/Record.pm
==============================================================================
--- rt/branches/QUEBEC-EXPERIMENTAL/lib/RT/Record.pm (original)
+++ rt/branches/QUEBEC-EXPERIMENTAL/lib/RT/Record.pm Mon Mar 28 05:50:42 2005
@@ -474,12 +474,33 @@
$args{'Value'} = 0;
}
- $self->_SetLastUpdated();
- my ( $val, $msg ) = $self->SUPER::_Set(
+ my $old_val = $self->__Value($args{'Field'});
+ $self->_SetLastUpdated();
+ my $ret = $self->SUPER::_Set(
Field => $args{'Field'},
Value => $args{'Value'},
IsSQL => $args{'IsSQL'}
);
+ my ($status, $msg) = $ret->as_array();
+
+ # @values has two values, a status code and a message.
+
+ # $ret is a Class::ReturnValue object. as such, in a boolean context, it's a bool
+ # we want to change the standard "success" message
+ if ($status) {
+ $msg =
+ $self->loc(
+ "[_1] changed from [_2] to [_3]",
+ $args{'Field'},
+ ( $old_val ? "'$old_val'" : $self->loc("(no value)") ),
+ '"' . $self->__Value( $args{'Field'}) . '"'
+ );
+ } else {
+
+ $msg = $self->CurrentUser->loc_fuzzy($msg);
+ }
+ return wantarray ? ($status, $msg) : $ret;
+
}
# }}}
@@ -871,12 +892,12 @@
next if ( $value eq $self->$attribute() );
my $method = "Set$attribute";
my ( $code, $msg ) = $self->$method($value);
-
my ($prefix) = ref($self) =~ /RT::(\w+)/;
- push @results,
- $self->loc( "$prefix [_1]", $self->id ) . ': '
- . $self->loc($attribute) . ': '
- . $self->CurrentUser->loc_fuzzy($msg);
+
+ # Default to $id, but use name if we can get it.
+ my $label = $self->id;
+ $label = $self->Name if (UNIVERSAL::can($self,'Name'));
+ push @results, $self->loc( "$prefix [_1]", $label ) . ': '. $msg;
=for loc
"[_1] could not be set to [_2].", # loc
@@ -1014,10 +1035,12 @@
my ($rid, $rmsg)= $t1->Resolve();
ok(!$rid, $rmsg);
-ok($t2->Resolve);
+my ($rid2, $rmsg2) = $t2->Resolve();
+ok ($rid2, $rmsg2);
($rid, $rmsg)= $t1->Resolve();
ok(!$rid, $rmsg);
-ok($t3->Resolve);
+my ($rid3,$rmsg3) = $t3->Resolve;
+ok ($rid3,$rmsg3);
($rid, $rmsg)= $t1->Resolve();
ok($rid, $rmsg);
Modified: rt/branches/QUEBEC-EXPERIMENTAL/lib/RT/Ticket_Overlay.pm
==============================================================================
--- rt/branches/QUEBEC-EXPERIMENTAL/lib/RT/Ticket_Overlay.pm (original)
+++ rt/branches/QUEBEC-EXPERIMENTAL/lib/RT/Ticket_Overlay.pm Mon Mar 28 05:50:42 2005
@@ -3448,7 +3448,7 @@
OldValue => $Old,
TimeTaken => $args{'TimeTaken'},
);
- return ( $Trans, scalar $TransObj->Description );
+ return ( $Trans, scalar $TransObj->BriefDescription );
}
else {
return ( $ret, $msg );
Modified: rt/branches/QUEBEC-EXPERIMENTAL/lib/RT/Transaction_Overlay.pm
==============================================================================
--- rt/branches/QUEBEC-EXPERIMENTAL/lib/RT/Transaction_Overlay.pm (original)
+++ rt/branches/QUEBEC-EXPERIMENTAL/lib/RT/Transaction_Overlay.pm Mon Mar 28 05:50:42 2005
@@ -424,7 +424,7 @@
}
#if they ain't got rights to see, return an empty object
- else {
+ elsif ($self->__Value('ObjectType') eq "RT::Ticket") {
unless ( $self->CurrentUserHasRight('ShowTicket') ) {
return ( $self->{'attachments'} );
}
@@ -505,7 +505,7 @@
}
#if they ain't got rights to see, don't let em
- else {
+ elsif ($self->__Value('ObjectType') eq "RT::Ticket") {
unless ( $self->CurrentUserHasRight('ShowTicket') ) {
return ($self->loc("Permission Denied") );
}
@@ -531,7 +531,6 @@
sub BriefDescription {
my $self = shift;
-
#If it's a comment or a comment email record,
# we need to be extra special careful
if ( $self->__Value('Type') =~ /^Comment/ ) {
@@ -541,44 +540,67 @@
}
#if they ain't got rights to see, don't let em
- else {
+ elsif ( $self->__Value('ObjectType') eq "RT::Ticket" ) {
unless ( $self->CurrentUserHasRight('ShowTicket') ) {
return ( $self->loc("Permission Denied") );
}
}
- my $type = $self->Type; #cache this, rather than calling it 30 times
+ my $type = $self->Type; #cache this, rather than calling it 30 times
- if ( !defined( $type ) ) {
+ if ( !defined($type) ) {
return $self->loc("No transaction type specified");
}
my $obj_type = $self->FriendlyObjectType;
if ( $type eq 'Create' ) {
- return ($self->loc("[_1] created", $obj_type));
+ return ( $self->loc( "[_1] created", $obj_type ) );
}
elsif ( $type =~ /Status/ ) {
if ( $self->Field eq 'Status' ) {
if ( $self->NewValue eq 'deleted' ) {
- return ($self->loc("[_1] deleted", $obj_type));
+ return ( $self->loc( "[_1] deleted", $obj_type ) );
}
else {
- return ( $self->loc("Status changed from [_1] to [_2]", $self->loc($self->OldValue), $self->loc($self->NewValue) ));
+ return (
+ $self->loc(
+ "Status changed from [_1] to [_2]",
+ "'" . $self->loc( $self->OldValue ) . "'",
+ "'" . $self->loc( $self->NewValue ) . "'"
+ )
+ );
}
}
# Generic:
- my $no_value = $self->loc("(no value)");
- return ( $self->loc( "[_1] changed from [_2] to [_3]", $self->Field , ( $self->OldValue || $no_value ) , $self->NewValue ));
+ my $no_value = $self->loc("(no value)");
+ return (
+ $self->loc(
+ "[_1] changed from [_2] to [_3]",
+ $self->Field,
+ ( $self->OldValue ? "'" . $self->OldValue . "'" : $no_value ),
+ "'" . $self->NewValue . "'"
+ )
+ );
}
- if (my $code = $_BriefDescriptions{$type}) {
+ if ( my $code = $_BriefDescriptions{$type} ) {
return $code->($self);
}
- return $self->loc( "Default: [_1]/[_2] changed from [_3] to [_4]", $type, $self->Field, $self->OldValue, $self->NewValue );
+ return $self->loc(
+ "Default: [_1]/[_2] changed from [_3] to [_4]",
+ $type,
+ $self->Field,
+ (
+ $self->OldValue
+ ? "'" . $self->OldValue . "'"
+ : $self->loc("(no value)")
+ ),
+ "'" . $self->NewValue . "'"
+ );
}
%_BriefDescriptions = (
@@ -742,7 +764,10 @@
},
Set => sub {
my $self = shift;
- if ( $self->Field eq 'Queue' ) {
+ if ( $self->Field eq 'Password' ) {
+ return $self->loc('Password changed');
+ }
+ elsif ( $self->Field eq 'Queue' ) {
my $q1 = new RT::Queue( $self->CurrentUser );
$q1->Load( $self->OldValue );
my $q2 = new RT::Queue( $self->CurrentUser );
@@ -759,7 +784,7 @@
return $self->loc( "[_1] changed from [_2] to [_3]", $self->Field, $t2->AsString, $t1->AsString );
}
else {
- return $self->loc( "[_1] changed from [_2] to [_3]", $self->Field, $self->OldValue, $self->NewValue );
+ return $self->loc( "[_1] changed from [_2] to [_3]", $self->Field, ($self->OldValue? "'".$self->OldValue ."'" : $self->loc("(no value)")) , "'". $self->NewValue."'" );
}
},
PurgeTransaction => sub {
@@ -861,7 +886,7 @@
#if they ain't got rights to see, don't let em
- else {
+ elsif ($self->__Value('ObjectType') eq "RT::Ticket") {
unless ( $self->CurrentUserHasRight('ShowTicket') ) {
return (undef);
}
Modified: rt/branches/QUEBEC-EXPERIMENTAL/lib/RT/User_Overlay.pm
==============================================================================
--- rt/branches/QUEBEC-EXPERIMENTAL/lib/RT/User_Overlay.pm (original)
+++ rt/branches/QUEBEC-EXPERIMENTAL/lib/RT/User_Overlay.pm Mon Mar 28 05:50:42 2005
@@ -121,41 +121,41 @@
my $u1 = RT::User->new($RT::SystemUser);
is(ref($u1), 'RT::User');
-my ($id, $msg) = $u1->Create(Name => 'CreateTest1', EmailAddress => 'create-test-1 at example.com');
+my ($id, $msg) = $u1->Create(Name => 'CreateTest1'.$$, EmailAddress => $$.'create-test-1 at example.com');
ok ($id, "Creating user CreateTest1 - " . $msg );
# Make sure we can't create a second user with the same name
my $u2 = RT::User->new($RT::SystemUser);
-($id, $msg) = $u2->Create(Name => 'CreateTest1', EmailAddress => 'create-test-2 at example.com');
+($id, $msg) = $u2->Create(Name => 'CreateTest1'.$$, EmailAddress => $$.'create-test-2 at example.com');
ok (!$id, $msg);
# Make sure we can't create a second user with the same EmailAddress address
my $u3 = RT::User->new($RT::SystemUser);
-($id, $msg) = $u3->Create(Name => 'CreateTest2', EmailAddress => 'create-test-1 at example.com');
+($id, $msg) = $u3->Create(Name => 'CreateTest2'.$$, EmailAddress => $$.'create-test-1 at example.com');
ok (!$id, $msg);
# Make sure we can create a user with no EmailAddress address
my $u4 = RT::User->new($RT::SystemUser);
-($id, $msg) = $u4->Create(Name => 'CreateTest3');
+($id, $msg) = $u4->Create(Name => 'CreateTest3'.$$);
ok ($id, $msg);
# make sure we can create a second user with no EmailAddress address
my $u5 = RT::User->new($RT::SystemUser);
-($id, $msg) = $u5->Create(Name => 'CreateTest4');
+($id, $msg) = $u5->Create(Name => 'CreateTest4'.$$);
ok ($id, $msg);
# make sure we can create a user with a blank EmailAddress address
my $u6 = RT::User->new($RT::SystemUser);
-($id, $msg) = $u6->Create(Name => 'CreateTest6', EmailAddress => '');
+($id, $msg) = $u6->Create(Name => 'CreateTest6'.$$, EmailAddress => '');
ok ($id, $msg);
# make sure we can create a second user with a blankEmailAddress address
my $u7 = RT::User->new($RT::SystemUser);
-($id, $msg) = $u7->Create(Name => 'CreateTest7', EmailAddress => '');
+($id, $msg) = $u7->Create(Name => 'CreateTest7'.$$, EmailAddress => '');
ok ($id, $msg);
# Can we change the email address away from from "";
-($id,$msg) = $u7->SetEmailAddress('foo at bar');
+($id,$msg) = $u7->SetEmailAddress('foo at bar'.$$);
ok ($id, $msg);
# can we change the address back to "";
($id,$msg) = $u7->SetEmailAddress('');
@@ -211,7 +211,7 @@
$args{'Password'} = '*NO-PASSWORD*';
}
elsif ( length( $args{'Password'} ) < $RT::MinimumPasswordLength ) {
- return ( 0, $self->loc("Password too short") );
+ return ( 0, $self->loc("Password needs to be at least [_1] characters long",$RT::MinimumPasswordLength) );
}
else {
@@ -1032,7 +1032,7 @@
return ( 0, $self->loc("No password set") );
}
elsif ( length($password) < $RT::MinimumPasswordLength ) {
- return ( 0, $self->loc("Password too short") );
+ return ( 0, $self->loc("Password needs to be at least [_1] characters long", $RT::MinimumPasswordLength) );
}
else {
$password = $self->_GeneratePassword($password);
@@ -1282,7 +1282,7 @@
ok ($rootq->CurrentUser->HasRight(Right=> 'CreateTicket', Object => $rootq), "Root can create tickets");
my $new_user = RT::User->new($RT::SystemUser);
-my ($id, $msg) = $new_user->Create(Name => 'ACLTest');
+my ($id, $msg) = $new_user->Create(Name => 'ACLTest'.$$);
ok ($id, "Created a new user for acl test $msg");
@@ -1313,7 +1313,7 @@
ok (!$new_user->HasRight( Object => $new_tick, Right => 'ModifyTicket'), "User can't modify the ticket without group membership");
# Create a new group
my $group = RT::Group->new($RT::SystemUser);
-$group->CreateUserDefinedGroup(Name => 'ACLTest');
+$group->CreateUserDefinedGroup(Name => 'ACLTest'.$$);
ok($group->Id, "Created a new group Ok");
# Grant a group the right to modify tickets in a queue
ok(my ($gv,$gm) = $group->PrincipalObj->GrantRight( Object => $q, Right => 'ModifyTicket'),"Granted the group the right to modify tickets");
@@ -1348,7 +1348,7 @@
# Create a subgroup
my $subgroup = RT::Group->new($RT::SystemUser);
-$subgroup->CreateUserDefinedGroup(Name => 'Subgrouptest');
+$subgroup->CreateUserDefinedGroup(Name => 'Subgrouptest',$$);
ok($subgroup->Id, "Created a new group ".$subgroup->Id."Ok");
#Add the subgroup as a subgroup of the group
my ($said, $samsg) = $group->AddMember($subgroup->PrincipalId);
@@ -1363,8 +1363,8 @@
# {{{ Deal with making sure that members of subgroups of a disabled group don't have rights
my ($id, $msg);
- ($id, $msg) = $group->SetDisabled(1);
- ok ($id,$msg);
+($id, $msg) = $group->SetDisabled(1);
+ok ($id,$msg);
ok (!$new_user->HasRight( Object => $new_tick2, Right => 'ModifyTicket'), "User can't modify the ticket when the group ".$group->Id. " is disabled");
($id, $msg) = $group->SetDisabled(0);
ok($id,$msg);
@@ -1762,7 +1762,7 @@
OldValue => $Old,
TimeTaken => $args{'TimeTaken'},
);
- return ( $Trans, scalar $TransObj->Description );
+ return ( $Trans, scalar $TransObj->BriefDescription );
}
else {
return ( $ret, $msg );
Added: rt/branches/QUEBEC-EXPERIMENTAL/lib/t/regression/02basic_web.t
==============================================================================
--- (empty file)
+++ rt/branches/QUEBEC-EXPERIMENTAL/lib/t/regression/02basic_web.t Mon Mar 28 05:50:42 2005
@@ -0,0 +1,150 @@
+#!/usr/bin/perl
+
+use strict;
+use Test::More 'no_plan';
+use WWW::Mechanize;
+use HTTP::Request::Common;
+use HTTP::Cookies;
+use LWP;
+use Encode;
+
+my $cookie_jar = HTTP::Cookies->new;
+my $agent = WWW::Mechanize->new();
+
+# give the agent a place to stash the cookies
+
+$agent->cookie_jar($cookie_jar);
+
+use RT;
+RT::LoadConfig();
+# get the top page
+my $url = "http://localhost:".$RT::WebPort.$RT::WebPath."/";
+diag $url;
+$agent->get($url);
+
+is ($agent->{'status'}, 200, "Loaded a page");
+
+
+# {{{ test a login
+
+# follow the link marked "Login"
+
+ok($agent->{form}->find_input('user'));
+
+ok($agent->{form}->find_input('pass'));
+ok ($agent->{'content'} =~ /username:/i);
+$agent->field( 'user' => 'root' );
+$agent->field( 'pass' => 'password' );
+# the field isn't named, so we have to click link 0
+$agent->click(0);
+is($agent->{'status'}, 200, "Fetched the page ok");
+ok( $agent->{'content'} =~ /Logout/i, "Found a logout link");
+
+
+
+$agent->get($url."Ticket/Create.html?Queue=1");
+is ($agent->{'status'}, 200, "Loaded Create.html");
+$agent->form(3);
+# Start with a string containing characters in latin1
+my $string = "I18N Web Testing æøå";
+Encode::from_to($string, 'iso-8859-1', 'utf8');
+$agent->field('Subject' => "Ticket with utf8 body");
+$agent->field('Content' => $string);
+ok($agent->submit(), "Created new ticket with $string as Content");
+like( $agent->{'content'}, qr{$string} , "Found the content");
+$agent->get($url."Ticket/Create.html?Queue=1");
+is ($agent->{'status'}, 200, "Loaded Create.html");
+$agent->form(3);
+# Start with a string containing characters in latin1
+my $string = "I18N Web Testing æøå";
+Encode::from_to($string, 'iso-8859-1', 'utf8');
+$agent->field('Subject' => $string);
+$agent->field('Content' => "Ticket with utf8 subject");
+ok($agent->submit(), "Created new ticket with $string as Subject");
+
+like( $agent->{'content'}, qr{$string} , "Found the content");
+
+
+
+# }}}
+
+# {{{ Query Builder tests
+
+my $response = $agent->get($url."Search/Build.html");
+ok( $response->is_success, "Fetched " . $url."Search/Build.html" );
+
+# Parsing TicketSQL
+#
+# Adding items
+
+# set the first value
+ok($agent->form_name('BuildQuery'));
+$agent->field("AttachmentField", "Subject");
+$agent->field("AttachmentOp", "LIKE");
+$agent->field("ValueOfAttachment", "aaa");
+$agent->submit("AddClause");
+
+# set the next value
+ok($agent->form_name('BuildQuery'));
+$agent->field("AttachmentField", "Subject");
+$agent->field("AttachmentOp", "LIKE");
+$agent->field("ValueOfAttachment", "bbb");
+$agent->submit("AddClause");
+
+ok($agent->form_name('BuildQuery'));
+
+# get the query
+my $query = $agent->current_form->find_input("Query")->value;
+# strip whitespace from ends
+$query =~ s/^\s*//g;
+$query =~ s/\s*$//g;
+
+# collapse other whitespace
+$query =~ s/\s+/ /g;
+
+is ($query, "Subject LIKE 'aaa' AND Subject LIKE 'bbb'");
+
+# - new items go one level down
+# - add items at currently selected level
+# - if nothing is selected, add at end, one level down
+#
+# move left
+# - error if nothing selected
+# - same item should be selected after move
+# - can't move left if you're at the top level
+#
+# move right
+# - error if nothing selected
+# - same item should be selected after move
+# - can always move right (no max depth...should there be?)
+#
+# move up
+# - error if nothing selected
+# - same item should be selected after move
+# - can't move up if you're first in the list
+#
+# move down
+# - error if nothing selected
+# - same item should be selected after move
+# - can't move down if you're last in the list
+#
+# toggle
+# - error if nothing selected
+# - change all aggregators in the grouping
+# - don't change any others
+#
+# delete
+# - error if nothing selected
+# - delete currently selected item
+# - delete all children of a grouping
+# - if delete leaves a node with no children, delete that, too
+# - what should be selected?
+#
+# Clear
+# - clears entire query
+# - clears it from the session, too
+
+# }}}
+
+
+1;
Added: rt/branches/QUEBEC-EXPERIMENTAL/lib/t/regression/03web_compiliation_errors.t
==============================================================================
--- (empty file)
+++ rt/branches/QUEBEC-EXPERIMENTAL/lib/t/regression/03web_compiliation_errors.t Mon Mar 28 05:50:42 2005
@@ -0,0 +1,67 @@
+#!/usr/bin/perl
+
+use strict;
+use Test::More qw/no_plan/;
+use WWW::Mechanize;
+use HTTP::Request::Common;
+use HTTP::Cookies;
+use LWP;
+use Encode;
+
+my $cookie_jar = HTTP::Cookies->new;
+my $agent = WWW::Mechanize->new();
+
+# give the agent a place to stash the cookies
+
+$agent->cookie_jar($cookie_jar);
+
+
+use RT;
+RT::LoadConfig();
+# get the top page
+my $url = "http://localhost:".$RT::WebPort.$RT::WebPath."/";
+diag $url;
+$agent->get($url);
+
+is ($agent->{'status'}, 200, "Loaded a page");
+
+
+# {{{ test a login
+
+# follow the link marked "Login"
+
+ok($agent->{form}->find_input('user'));
+
+ok($agent->{form}->find_input('pass'));
+ok ($agent->{'content'} =~ /username:/i);
+$agent->field( 'user' => 'root' );
+$agent->field( 'pass' => 'password' );
+# the field isn't named, so we have to click link 0
+$agent->click(0);
+is($agent->{'status'}, 200, "Fetched the page ok");
+ok( $agent->{'content'} =~ /Logout/i, "Found a logout link");
+
+
+use File::Find;
+find ( \&wanted , 'html/');
+
+sub wanted {
+ -f && /\.html$/ && $_ !~ /Logout.html$/ && test_get($File::Find::name);
+}
+
+sub test_get {
+ my $file = shift;
+
+
+ $file =~ s#^html/##;
+ ok ($agent->get("$url/$file", "GET $url/$file"));
+ is ($agent->{'status'}, 200, "Loaded $file");
+# ok( $agent->{'content'} =~ /Logout/i, "Found a logout link on $file ");
+ ok( $agent->{'content'} !~ /Not logged in/i, "Still logged in for $file");
+ ok( $agent->{'content'} !~ /System error/i, "Didn't get a Mason compilation error on $file");
+
+}
+
+# }}}
+
+1;
Modified: rt/branches/QUEBEC-EXPERIMENTAL/sbin/rt-test-dependencies.in
==============================================================================
--- rt/branches/QUEBEC-EXPERIMENTAL/sbin/rt-test-dependencies.in (original)
+++ rt/branches/QUEBEC-EXPERIMENTAL/sbin/rt-test-dependencies.in Mon Mar 28 05:50:42 2005
@@ -162,6 +162,8 @@
Storable 2.08
Apache::Session 1.53
XML::RSS
+HTTP::Server::Simple 0.07
+HTTP::Server::Simple::Mason 0.03
.
$deps{'MAILGATE'} = [ _( << '.') ];
More information about the Rt-commit
mailing list