[Rt-commit] [svn] r962 - in RT-Scope/trunk: . html html/Scope html/Scope/Elements inc inc/.author inc/Module inc/Module/Install lib lib/RT

jesse at pallas.eruditorum.org jesse at pallas.eruditorum.org
Thu May 27 21:40:04 EDT 2004


Author: jesse
Date: Thu May 27 21:40:04 2004
New Revision: 962

Added:
   RT-Scope/trunk/MANIFEST
   RT-Scope/trunk/META.yml
   RT-Scope/trunk/Makefile.PL
   RT-Scope/trunk/html/
   RT-Scope/trunk/html/Scope/
   RT-Scope/trunk/html/Scope/Action.html
   RT-Scope/trunk/html/Scope/Elements/
   RT-Scope/trunk/html/Scope/Elements/Header
   RT-Scope/trunk/html/Scope/Elements/MessageBox
   RT-Scope/trunk/html/Scope/Elements/ShowHistory
   RT-Scope/trunk/html/Scope/Elements/ShowHistoryView
   RT-Scope/trunk/html/Scope/Elements/ShowMessageHeaders
   RT-Scope/trunk/html/Scope/Elements/ShowMessageStanza
   RT-Scope/trunk/html/Scope/Elements/ShowSummary
   RT-Scope/trunk/html/Scope/Elements/ShowTransaction
   RT-Scope/trunk/html/Scope/History.html
   RT-Scope/trunk/html/Scope/Search.html
   RT-Scope/trunk/html/Scope/Update.html
   RT-Scope/trunk/html/Scope/View.html
   RT-Scope/trunk/html/Scope/Work.html
   RT-Scope/trunk/html/Scope/index.html
   RT-Scope/trunk/inc/
   RT-Scope/trunk/inc/.author/
   RT-Scope/trunk/inc/Module/
   RT-Scope/trunk/inc/Module/Install/
   RT-Scope/trunk/inc/Module/Install.pm
   RT-Scope/trunk/inc/Module/Install/Base.pm
   RT-Scope/trunk/inc/Module/Install/Can.pm
   RT-Scope/trunk/inc/Module/Install/Fetch.pm
   RT-Scope/trunk/inc/Module/Install/Makefile.pm
   RT-Scope/trunk/inc/Module/Install/Metadata.pm
   RT-Scope/trunk/inc/Module/Install/RTx.pm
   RT-Scope/trunk/inc/Module/Install/Win32.pm
   RT-Scope/trunk/inc/Module/Install/WriteAll.pm
   RT-Scope/trunk/lib/
   RT-Scope/trunk/lib/RT/
   RT-Scope/trunk/lib/RT/Scope.pm
Log:
Initial version checkin

Added: RT-Scope/trunk/MANIFEST
==============================================================================
--- (empty file)
+++ RT-Scope/trunk/MANIFEST	Thu May 27 21:40:04 2004
@@ -0,0 +1,29 @@
+html/Scope/Action.html
+html/Scope/Elements/Header
+html/Scope/Elements/MessageBox
+html/Scope/Elements/ShowHistory
+html/Scope/Elements/ShowHistoryView
+html/Scope/Elements/ShowMessageHeaders
+html/Scope/Elements/ShowMessageStanza
+html/Scope/Elements/ShowSummary
+html/Scope/Elements/ShowTransaction
+html/Scope/History.html
+html/Scope/index.html
+html/Scope/Search.html
+html/Scope/Update.html
+html/Scope/View.html
+html/Scope/Work.html
+inc/Module/Install.pm
+inc/Module/Install/Base.pm
+inc/Module/Install/Can.pm
+inc/Module/Install/Fetch.pm
+inc/Module/Install/Makefile.pm
+inc/Module/Install/Metadata.pm
+inc/Module/Install/RTx.pm
+inc/Module/Install/Win32.pm
+inc/Module/Install/WriteAll.pm
+lib/RT/Scope.pm
+Makefile
+Makefile.PL
+MANIFEST			This list of files
+META.yml

Added: RT-Scope/trunk/META.yml
==============================================================================
--- (empty file)
+++ RT-Scope/trunk/META.yml	Thu May 27 21:40:04 2004
@@ -0,0 +1,11 @@
+name: RT-Scope
+version: 0.01_01
+abstract: RT Scope Extension
+author: Jesse Vincent <jesse at bestpractical.com>
+license: GPLv2
+distribution_type: module
+no_index:
+  directory:
+    - html
+    - inc
+generated_by: Module::Install version 0.33

Added: RT-Scope/trunk/Makefile.PL
==============================================================================
--- (empty file)
+++ RT-Scope/trunk/Makefile.PL	Thu May 27 21:40:04 2004
@@ -0,0 +1,6 @@
+use inc::Module::Install;
+RTx('RT-Scope');
+version_from ('lib/RT/Scope.pm');
+author('Jesse Vincent <jesse at bestpractical.com>');
+license('GPLv2');
+&WriteAll;

Added: RT-Scope/trunk/html/Scope/Action.html
==============================================================================
--- (empty file)
+++ RT-Scope/trunk/html/Scope/Action.html	Thu May 27 21:40:04 2004
@@ -0,0 +1,16 @@
+<%init>
+my @Actions;
+
+my $TicketObj = LoadTicket($ARGS{'id'});
+
+ at Actions = ProcessTicketBasics(ARGSRef =>\%ARGS, TicketObj => $TicketObj);
+
+
+</%init>
+<& Elements/Header &>
+<b>#<%$TicketObj->id%>: <%$TicketObj->Subject%></b><br>
+% if ($#Actions >= 0)  {
+<& /Elements/ListActions, actions => \@Actions &>
+% } else {
+No action performed.
+% }

Added: RT-Scope/trunk/html/Scope/Elements/Header
==============================================================================
--- (empty file)
+++ RT-Scope/trunk/html/Scope/Elements/Header	Thu May 27 21:40:04 2004
@@ -0,0 +1,60 @@
+%# BEGIN LICENSE BLOCK
+%# 
+%# Copyright (c) 1996-2003 Jesse Vincent <jesse at bestpractical.com>
+%# 
+%# (Except where explictly superceded by other copyright notices)
+%# 
+%# 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.
+%# 
+%# Unless otherwise specified, all modifications, corrections or
+%# extensions to this work which alter its source code become the
+%# property of Best Practical Solutions, LLC when submitted for
+%# inclusion in the work.
+%# 
+%# 
+%# END LICENSE BLOCK
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<HTML>
+<HEAD>
+<TITLE><%$Title%></TITLE>
+% if ($Refresh > 0) {
+<META HTTP-EQUIV="REFRESH" CONTENT="<%$Refresh%>">
+% }
+
+<link rel="shortcut icon" href="<%$RT::WebImagesURL%>/favicon.png" type="image/png">
+<link rel="stylesheet" href="<%$RT::WebPath%>/NoAuth/webrt.css" type="text/css">
+</HEAD>
+<BODY BGCOLOR="<%$BgColor%>"
+% if ($Focus) {
+ONLOAD="
+    var tmp = (document.getElementsByName('<% $Focus %>'));
+    if (tmp.length > 0) tmp[tmp.length-1].focus();
+"
+% }
+>
+<%INIT>
+
+$r->header_out('Pragma' => 'no-cache');
+$r->header_out('Cache-control' => 'no-cache');
+</%INIT>
+
+<%ARGS>
+$Prefs => '/User/Prefs.html'
+$Focus => 'focus'
+$Title => undef
+$Code => undef
+$Refresh => 0
+$Why => undef
+$BgColor => '#ffffff'
+$ShowBar => 1
+$LoggedIn => 1
+$URL => undef
+</%ARGS>

Added: RT-Scope/trunk/html/Scope/Elements/MessageBox
==============================================================================
--- (empty file)
+++ RT-Scope/trunk/html/Scope/Elements/MessageBox	Thu May 27 21:40:04 2004
@@ -0,0 +1,48 @@
+%# BEGIN LICENSE BLOCK
+%# 
+%# Copyright (c) 1996-2003 Jesse Vincent <jesse at bestpractical.com>
+%# 
+%# (Except where explictly superceded by other copyright notices)
+%# 
+%# 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.
+%# 
+%# Unless otherwise specified, all modifications, corrections or
+%# extensions to this work which alter its source code become the
+%# property of Best Practical Solutions, LLC when submitted for
+%# inclusion in the work.
+%# 
+%# 
+%# END LICENSE BLOCK
+<TEXTAREA COLS=<%$Width%> ROWS=<%$Length%> WRAP=HARD NAME="<%$Name%>"><& /Elements/Callback, %ARGS &><% $Default %><%$message%><%$signature%></TEXTAREA>
+<%INIT>
+
+my ($message);
+
+if ($QuoteTransaction) {
+    my $transaction=RT::Transaction->new($session{'CurrentUser'});
+    $transaction->Load($QuoteTransaction);
+    $message=$transaction->Content(Quote => 1);
+}
+
+my $signature = '';
+if ($session{'CurrentUser'}->UserObj->Signature) {
+	$signature = "-- \n".$session{'CurrentUser'}->UserObj->Signature;
+}
+
+</%INIT>
+<%ARGS>
+$QuoteTransaction => undef
+$Name => 'Content'
+$Default => ''
+$Width => 72
+$Length=> 8
+</%ARGS>
+

Added: RT-Scope/trunk/html/Scope/Elements/ShowHistory
==============================================================================
--- (empty file)
+++ RT-Scope/trunk/html/Scope/Elements/ShowHistory	Thu May 27 21:40:04 2004
@@ -0,0 +1,88 @@
+%# BEGIN LICENSE BLOCK
+%# 
+%# Copyright (c) 1996-2003 Jesse Vincent <jesse at bestpractical.com>
+%# 
+%# (Except where explictly superceded by other copyright notices)
+%# 
+%# 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.
+%# 
+%# Unless otherwise specified, all modifications, corrections or
+%# extensions to this work which alter its source code become the
+%# property of Best Practical Solutions, LLC when submitted for
+%# inclusion in the work.
+%# 
+%# 
+%# END LICENSE BLOCK
+<%perl>
+ if ($ShowDisplayModes or $ShowTitle) {
+my $title;
+my $titleright;
+if ($ShowTitle) {
+    $title = loc('History');
+}
+else {
+    $title = '&nbsp;';
+}
+$titleright = loc('Display mode') . ":";
+if ($ShowHeaders) {
+    $titleright .= "[<A HREF=\"" . $URIFile . "?id="
+      . $Ticket->id . "\">"
+      . loc("Brief headers")
+      . "</a>] <b>["
+      . loc("Full headers") . "]</b>";
+}
+else {
+    $titleright .= "<b>["
+      . loc("Brief headers")
+      . "]</b> [<A HREF=\""
+      . $URIFile
+      . "?ShowHeaders=1"
+      . "&id="
+      . $Ticket->id . "\">"
+      . loc("Full headers") . "</a>]";
+}
+</%perl>
+<& /Elements/TitleBoxStart, title => $title, titleright => $titleright, bodyclass=> ''&>
+% }
+
+<TABLE WIDTH="100%" CELLSPACING=0 CELLPADDING=2 BORDER=0>
+% while (my $Transaction = $Transactions->Next) {
+% my $skip = 0;
+% $m->comp('/Elements/Callback', _CallbackName => 'SkipTransaction', Transaction => $Transaction, skip => \$skip, %ARGS);
+% next if $skip;
+% $i++;
+%	if ($Transactions->IsLast) {
+	<a name="lasttrans"></a>
+% 	}
+	    <& ShowTransaction, Ticket => $Ticket, Transaction => $Transaction, ShowHeaders => $ShowHeaders, Collapsed => $Collapsed, RowNum => $i, ShowTitleBarCommands => $ShowTitleBarCommands  &>
+% }
+</TABLE>
+% if ($ShowDisplayModes or $ShowTitle) {
+<& /Elements/TitleBoxEnd &>
+% }
+<A name="end">&nbsp;</a>
+
+<%INIT>
+
+my $Transactions = $Ticket->Transactions;
+my $i;
+
+
+</%INIT>
+<%ARGS>
+$URIFile => 'Display.html'
+$Ticket => undef
+$ShowHeaders => 0
+$Collapsed => undef
+$ShowTitle => 1
+$ShowDisplayModes => 1
+$ShowTitleBarCommands => 1
+</%ARGS>

Added: RT-Scope/trunk/html/Scope/Elements/ShowHistoryView
==============================================================================
--- (empty file)
+++ RT-Scope/trunk/html/Scope/Elements/ShowHistoryView	Thu May 27 21:40:04 2004
@@ -0,0 +1,45 @@
+%# BEGIN LICENSE BLOCK
+%# 
+%# Copyright (c) 1996-2003 Jesse Vincent <jesse at bestpractical.com>
+%# 
+%# (Except where explictly superceded by other copyright notices)
+%# 
+%# 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.
+%# 
+%# Unless otherwise specified, all modifications, corrections or
+%# extensions to this work which alter its source code become the
+%# property of Best Practical Solutions, LLC when submitted for
+%# inclusion in the work.
+%# 
+%# 
+%# END LICENSE BLOCK
+<& ShowSummary,  Ticket => $Ticket &>
+
+<& ShowHistory , Ticket => $Ticket, ShowHeaders => $ARGS{'ShowHeaders'}, URIFile => 'History.html' &> 
+<%ARGS>
+$id => undef
+</%ARGS>
+
+<%INIT>
+
+  
+
+my $Ticket = LoadTicket ($id);
+
+unless ($Ticket->CurrentUserHasRight('ShowTicket')) {
+	Abort("No permission to view ticket");
+}
+
+</%INIT>
+
+
+
+

Added: RT-Scope/trunk/html/Scope/Elements/ShowMessageHeaders
==============================================================================
--- (empty file)
+++ RT-Scope/trunk/html/Scope/Elements/ShowMessageHeaders	Thu May 27 21:40:04 2004
@@ -0,0 +1,34 @@
+%# BEGIN LICENSE BLOCK
+%# 
+%# Copyright (c) 1996-2003 Jesse Vincent <jesse at bestpractical.com>
+%# 
+%# (Except where explictly superceded by other copyright notices)
+%# 
+%# 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.
+%# 
+%# Unless otherwise specified, all modifications, corrections or
+%# extensions to this work which alter its source code become the
+%# property of Best Practical Solutions, LLC when submitted for
+%# inclusion in the work.
+%# 
+%# 
+%# END LICENSE BLOCK
+<%$content|n%>
+<%INIT>
+my $content = $Headers;
+RT::Interface::Web::EscapeUTF8(\$content);
+$m->comp('/Elements/Callback', content => \$content, %ARGS);
+$content =~ s/\n/<br>/gi;
+
+</%INIT>
+<%ARGS>
+$Headers => undef
+</%ARGS>

Added: RT-Scope/trunk/html/Scope/Elements/ShowMessageStanza
==============================================================================
--- (empty file)
+++ RT-Scope/trunk/html/Scope/Elements/ShowMessageStanza	Thu May 27 21:40:04 2004
@@ -0,0 +1,51 @@
+%# BEGIN LICENSE BLOCK
+%# 
+%# Copyright (c) 1996-2003 Jesse Vincent <jesse at bestpractical.com>
+%# 
+%# (Except where explictly superceded by other copyright notices)
+%# 
+%# 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.
+%# 
+%# Unless otherwise specified, all modifications, corrections or
+%# extensions to this work which alter its source code become the
+%# property of Best Practical Solutions, LLC when submitted for
+%# inclusion in the work.
+%# 
+%# 
+%# END LICENSE BLOCK
+<%perl>
+foreach my $stanza (@$Message) {
+    if ( ref $stanza eq "ARRAY" ) {
+        $m->comp( 'ShowMessageStanza',
+                  Depth   => $Depth + 1,
+                  Transaction => $Transaction,
+                  Message => $stanza );
+    }
+    elsif ( ref $stanza eq "HASH" ) {
+        my $content = $stanza->{raw};
+        RT::Interface::Web::EscapeUTF8(\$content);
+        $m->comp('/Elements/Callback', content => \$content, %ARGS);
+                $content =~ s/\n/<br>/gi;
+
+</%perl>
+<font color="<%$colors[$Depth]%>"><%$content |n%><br></font>
+%       }
+% }
+<%INIT>
+use URI::URL;
+my $server = 'fsck.com';
+my @colors = ('#000000', '#660000', '#006600', '#000066', '#cc0000', '#00cc00', '#0000cc', '#ff0000', '#00ff00', '#0000ff');
+</%INIT>
+<%ARGS>
+$Message => undef
+$Depth => 0
+$Transaction => undef
+</%ARGS>

Added: RT-Scope/trunk/html/Scope/Elements/ShowSummary
==============================================================================
--- (empty file)
+++ RT-Scope/trunk/html/Scope/Elements/ShowSummary	Thu May 27 21:40:04 2004
@@ -0,0 +1,77 @@
+%# BEGIN LICENSE BLOCK
+%# 
+%# Copyright (c) 1996-2003 Jesse Vincent <jesse at bestpractical.com>
+%# 
+%# (Except where explictly superceded by other copyright notices)
+%# 
+%# 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.
+%# 
+%# Unless otherwise specified, all modifications, corrections or
+%# extensions to this work which alter its source code become the
+%# property of Best Practical Solutions, LLC when submitted for
+%# inclusion in the work.
+%# 
+%# 
+%# END LICENSE BLOCK
+      <TABLE WIDTH="100%" class="ticketsummary" >
+      <TR>
+	<TD VALIGN=TOP WIDTH="50%">
+	  <& /Elements/TitleBoxStart, title => loc('The Basics'), 
+		title_class=> 'inverse',  
+		color => "#993333" &>
+	        <& /Ticket/Elements/ShowBasics, Ticket => $Ticket &>
+	  <& /Elements/TitleBoxEnd &>
+          <br>
+% if ($Ticket->QueueObj->CustomFields()->First) {
+	  <& /Elements/TitleBoxStart, title => loc('Custom Fields'), 
+		title_class=> 'inverse',  
+		color => "#993333" &>
+	        <& /Ticket/Elements/ShowCustomFields, Ticket => $Ticket &>
+	  <& /Elements/TitleBoxEnd &>
+
+<br>
+% }
+	  <& /Elements/TitleBoxStart, title => loc('People'), 
+		title_class=> 'inverse',  
+		color => "#333399" &>
+	  <& /Ticket/Elements/ShowPeople, Ticket => $Ticket &>
+	  <& /Elements/TitleBoxEnd &>
+	<BR>
+	</TD>
+	<TD VALIGN=TOP WIDTH="50%">
+
+	  <& /Elements/TitleBoxStart, title => loc("Dates"),
+		title_class=> 'inverse',  
+		 color => "#663366" &>
+	  <& /Ticket/Elements/ShowDates, Ticket => $Ticket &>
+	  <& /Elements/TitleBoxEnd &>
+	<BR>  
+	  <& /Elements/TitleBoxStart, title => loc('Relationships'), 
+		title_class=> 'inverse',  
+		titleright => '', color=> "#336633" &>
+	        <& /Elements/ShowLinks, Ticket => $Ticket &>
+	<& /Elements/TitleBoxEnd &>
+        <BR>
+	  <& /Ticket/Elements/ShowAttachments, Ticket => $Ticket &>
+
+	  <& /Ticket/Elements/ShowRequestor, Ticket => $Ticket &>
+
+
+	</TD>
+      </TR>
+    </TABLE>
+<%ARGS>
+$Ticket => undef
+</%ARGS>
+
+
+
+

Added: RT-Scope/trunk/html/Scope/Elements/ShowTransaction
==============================================================================
--- (empty file)
+++ RT-Scope/trunk/html/Scope/Elements/ShowTransaction	Thu May 27 21:40:04 2004
@@ -0,0 +1,171 @@
+%# BEGIN LICENSE BLOCK
+%# 
+%# Copyright (c) 1996-2003 Jesse Vincent <jesse at bestpractical.com>
+%# 
+%# (Except where explictly superceded by other copyright notices)
+%# 
+%# 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.
+%# 
+%# Unless otherwise specified, all modifications, corrections or
+%# extensions to this work which alter its source code become the
+%# property of Best Practical Solutions, LLC when submitted for
+%# inclusion in the work.
+%# 
+%# 
+%# END LICENSE BLOCK
+<TR class="<% $RowNum%2 ? 'oddline' : 'evenline'%>" >
+<TD bgcolor="<%$bgcolor%>"><A NAME="txn-<%$Transaction->Id%>" href="#txn-<%$Transaction->Id%>">#</A>&nbsp;</TD>
+<TD>&nbsp&nbsp;</TD>
+<TD><font size=-2><% $transdate|n %></font>&nbsp;</TD>
+% my $desc = $Transaction->BriefDescription;
+% $m->comp('/Elements/Callback', _CallbackName => 'ModifyDisplay', text => \$desc, Transaction => $Transaction, %ARGS);
+<TD ALIGN="LEFT"><b><%$Transaction->CreatorObj->Name%> - <%$TicketString%> <%$desc%>
+
+</b></TD>
+<TD><%$TimeTaken%>&nbsp;</TD>
+<TD ALIGN="RIGHT"><font size=-1><%$titlebar_commands|n%></font></TD>
+</TR>
+<%PERL>
+
+unless ($Collapsed) {
+ $attachments->GotoFirstItem;
+ while (my $message=$attachments->Next) {
+     #we don't want to show any empty transactions, unless they have kids
+     next unless ($message->ContentLength || $message->Children->Count);
+
+  my ($headers, $quoted);
+      if ($ShowHeaders) {
+	  $headers = $message->Headers;
+      } else {
+	  $headers = $message->NiceHeaders;
+      }
+      chomp $headers;
+      if ($headers) {
+	   # localize the common headers (like 'Subject:'), too.
+	   eval {$headers =~ s/^([^:]+)(?=:)/loc($1)/em; } # we eval here to catch errors when 5.6 panics
+      }
+     # 13456 is a random # of about the biggest size we want to see inline text
+     # It's here to catch anyone who hasn't updated RT_Config.pm since this
+     # constant was moved out there.
+     my $MAX_INLINE_BODY = $RT::MaxInlineBody || 13456;
+     if ($message->ContentType =~ m{^(text/plain|message|text$)}i && 
+				    $message->ContentLength < $MAX_INLINE_BODY ) {
+         require Text::Quoted;
+	 $quoted = Text::Quoted::extract($message->Content); 
+     }
+        
+</%PERL>
+<TR class="<% $RowNum%2 ? 'oddline' : 'evenline'%>" >                                
+      <TD BGCOLOR="<%$bgcolor%>">&nbsp;&nbsp;</TD>
+      <TD>&nbsp;&nbsp;</TD>
+      <TD COLSPAN=3 VALIGN=TOP>
+<span class="message">
+	<TT>
+<& ShowMessageHeaders, Headers => $headers, Transaction => $Transaction &>
+</TT>
+<& ShowMessageStanza, Depth => 0, Message => $quoted, Transaction => $Transaction &>
+</span>
+      </TD>
+      <TD VALIGN=TOP ALIGN=RIGHT>
+	
+% if ($message->Parent == 0  ) {
+<BR>
+% }
+<%PERL>
+my $size = $message->ContentLength;
+
+if ($size) {
+    if ($size > 1024) {
+	$size = loc("[_1]k", int($size/102.4)/10);
+    }
+    else {
+	$size = loc("[_1]b", $size);
+    }
+</%PERL>
+<font size=-1><A HREF="<%$RT::WebPath%>/Ticket/Attachment/<%$Transaction->Id%>/<%$message->Id%>/<%$message->Filename | u%>"><&|/l&>Download</&> <% $message->Filename|| loc('(untitled)') %></a> <% $size %></font>
+% }
+</TD>
+</TR>
+% }
+% }
+
+
+
+<%ARGS>
+$Ticket => undef
+$Transaction => undef
+$ShowHeaders => 0
+$Collapsed => undef
+$ShowTitleBarCommands => 1
+$RowNum => 1
+</%ARGS>
+
+<%INIT>
+
+
+my ($TimeTaken, $TicketString, $bgcolor);
+
+my $transdate = $Transaction->CreatedAsString();
+$transdate =~ s/\s/&nbsp;/g;
+
+if ($Transaction->Type =~ /^(Create|Correspond|Comment$)/) {
+	if ($Transaction->IsInbound) {
+		$bgcolor="#336699";
+	}
+	else {
+		$bgcolor="#339999";
+	}
+} elsif (($Transaction->Field =~ /^Owner$/) or 
+	 ($Transaction->Type =~ /^(AddWatcher|DelWatcher)$/)) {
+	$bgcolor="#333399";
+
+} elsif ($Transaction->Type =~ /^(AddLink|DeleteLink)$/) {
+	$bgcolor="#336633";
+} elsif ($Transaction->Type =~ /^(Status|Set|Told)$/) {
+	if ($Transaction->Field =~ /^(Told|Starts|Started|Due)$/) {
+		$bgcolor="#663366";	
+	}
+	else {
+		$bgcolor="#993333";
+	}
+}
+else {
+	$bgcolor="#cccccc";
+}
+
+if ($Ticket->Id != $Transaction->Ticket) {
+	$TicketString = "Ticket ".$Transaction->Ticket .": ";
+}
+
+if ($Transaction->TimeTaken > 0) {
+	$TimeTaken = $Transaction->TimeTaken." min"
+}
+my $attachments = $Transaction->Attachments;
+
+my $titlebar_commands='&nbsp;';
+
+# If the transaction has anything attached to it at all
+if ($Transaction->Attachments->First && $ShowTitleBarCommands) {
+	if ($Transaction->TicketObj->CurrentUserHasRight('ReplyToTicket')) {
+		$titlebar_commands .= 
+	  	  "[<a target=\"Update\" href=\"Update.html?id=".
+		  $Transaction->Ticket . "&QuoteTransaction=".$Transaction->Id.
+		  "&Action=Respond\">". loc('Reply') ."</a>]&nbsp;";
+	}
+	if ($Transaction->TicketObj->CurrentUserHasRight('CommentOnTicket')) {
+	     $titlebar_commands .= 
+	     "[<a target=\"Update\" href=\"Update.html?id=".$Transaction->Ticket. 
+	     "&QuoteTransaction=".$Transaction->Id.
+	     "&Action=Comment\">". loc('Comment') ."</a>]";
+	}
+}
+
+</%INIT>

Added: RT-Scope/trunk/html/Scope/History.html
==============================================================================
--- (empty file)
+++ RT-Scope/trunk/html/Scope/History.html	Thu May 27 21:40:04 2004
@@ -0,0 +1,32 @@
+%# BEGIN LICENSE BLOCK
+%# 
+%# Copyright (c) 1996-2003 Jesse Vincent <jesse at bestpractical.com>
+%# 
+%# (Except where explictly superceded by other copyright notices)
+%# 
+%# 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.
+%# 
+%# Unless otherwise specified, all modifications, corrections or
+%# extensions to this work which alter its source code become the
+%# property of Best Practical Solutions, LLC when submitted for
+%# inclusion in the work.
+%# 
+%# 
+%# END LICENSE BLOCK
+% tied(%session)->release_all_locks();
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<HTML>
+<HEAD>
+<link rel="shortcut icon" href="<%$RT::WebImagesURL%>/favicon.png" type="image/png">
+<link rel="stylesheet" href="<%$RT::WebPath%>/NoAuth/webrt.css" type="text/css">
+</HEAD>
+<BODY>
+<& Elements/ShowHistoryView, %ARGS &>;

Added: RT-Scope/trunk/html/Scope/Search.html
==============================================================================
--- (empty file)
+++ RT-Scope/trunk/html/Scope/Search.html	Thu May 27 21:40:04 2004
@@ -0,0 +1,142 @@
+<%args>
+$query => undef
+$per_page => 25
+$page => 1
+</%args>
+<%init>
+my $tix = RT::Tickets->new($session{'CurrentUser'});
+$tix->FromSQL($query);
+my $i;
+</%init>
+<& Elements/Header &>
+%# {{{ javascript
+<script>
+var oldcurrent;
+var oldcurrentcolor;
+function hilite(num) {
+    if (oldcurrent) {
+    setbgcolor(oldcurrent, oldcurrentcolor);
+    }
+    oldcurrentcolor=getbgcolor(num);
+    setbgcolor(num, "#ff9999");
+    oldcurrent = num; 
+}
+
+function getbgcolor(num) {
+    idstring = "ticket" + num;
+    chunk = document.getElementById(idstring);
+    return chunk.style.backgroundColor;
+
+}
+function setbgcolor(num, color) {
+    idstring = "ticket" + num;
+    chunk = document.getElementById(idstring);
+    chunk.style.backgroundColor = color;
+    idstring = "ticket-actions" + num;
+    chunk = document.getElementById(idstring);
+    chunk.style.backgroundColor = color;
+    
+}
+
+function hide(num) {
+    idstring = "ticket" + num;
+    chunk = document.getElementById(idstring);
+    chunk.style.display = "none";
+    idstring = "ticket-actions" + num;
+    chunk = document.getElementById(idstring);
+    chunk.style.display = "none";
+}
+</script>
+%#  }}}
+% if ($tix->Count) {
+<font size="-1">
+Found <%$tix->Count%> tickets.
+%$tix->RowsPerPage($per_page);
+%$tix->GotoPage($page-1);
+(displaying <%$tix->FirstRow+1%> through <%$tix->FirstRow+ $tix->RowsPerPage%>)
+</font>
+% }
+<br>
+<br>
+<center>
+% if ($page-1 > 0 ) {
+<a
+href="Search.html?query=<%$query|un%>&page=<%$page-1%>&per_page=<%$per_page%>">&lt;&lt; Page <%$page -1%></a>
+% }
+ - Page <%$page%> - 
+% if  (($page * $per_page) <  $tix->Count) {
+<a
+href="Search.html?query=<%$query|un%>&page=<%$page+1%>&per_page=<%$per_page%>">Page
+<%$page+1%> &gt;&gt;</a>
+
+% }
+</center>
+<br>
+<table width="100%" cellspacing=0 cellpadding="3">
+% while ( my $ticket = $tix->Next) {
+% $i++;
+<tr id="ticket<% $ticket->id %>"
+ onclick="window.open('Work.html?id=<%$ticket->id%>','View'); hilite(<%$ticket->Id%>);"
+ class="<%$i%2 ? 'evenline' : 'oddline'%>">
+<td rowspan="2" align="right">
+	<a href="Work.html?id=<%$ticket->id%>" 
+    onClick="hilite(<%$ticket->Id%>)" 
+    target="View" ><span id="id-<%$ticket->Id%>"><%$ticket->Id%></span></a></td>
+<td colspan="4" wrap="1"><font size="-2">
+	<a href="Work.html?id=<%$ticket->Id%>" 
+		target="View"
+    		onClick="hilite(<%$ticket->Id%>)" 
+    
+    >
+<%$ticket->Subject%>
+</a>
+</font>
+<br>
+<font size="-3">
+<%$ticket->OwnerObj->Name%> - <b><%$ticket->Status%></b> 
+</form>
+</td>
+</tr>
+<tr class="<%$i%2 ? 'evenline' : 'oddline'%>" 
+ onclick="hilite(<%$ticket->Id%>);"
+ id="ticket-actions<%$ticket->id%>">
+<td align="left" colspan="4">
+<font size="-2"><a href="Update.html?id=<%$ticket->Id%>&SubmitTicket=1&Owner=<%$session{CurrentUser}->Id%>" target="Update">Take</a></font>
+ - <font size="-2"><a href="Update.html?id=<%$ticket->Id%>&SubmitTicket=1&Status=resolved" target="Update">Resolve</a></font>
+ - <font size="-2"><a 
+href="Action.html?id=<%$ticket->Id%>&Status=deleted"
+   onClick="hide('<%$ticket->Id%>')" 
+   target="Update">Delete</a></font>
+ - <font size="-2"><a href="<%$RT::WebPath%>/Ticket/Display.html?id=<%$ticket->Id%>"  target="_blank">Details...</a></font>
+</td>
+
+</tr>
+</div>
+% }
+</table>
+<form method="post" action="index.html" target="_top">
+
+<br>
+Search:<br>
+<%perl>
+my $inaweek = RT::Date->new($session{'CurrentUser'});
+$inaweek->SetToNow;
+$inaweek->AddDays(7);
+my $q1 ="Status = 'open' OR Status = 'new' AND Owner = '".$session{'CurrentUser'}->Name."'";
+my $q2 ="Status = 'open' OR Status = 'new' AND Owner = '".$session{'CurrentUser'}->Name."' AND Due <= ".$inaweek->ISO;
+my $q3 = "Owner = 'Nobody' AND (Status = 'open' OR Status = 'new')";
+</%perl>
+<ul>
+<li><a target="_top" href="index.html?query=<%$q1%>">My new and open tickets</a>
+<li><a target="_top" href="index.html?query=<%$q2%>">My tickets due within 7 days</a>
+<li><a target="_top" href="index.html?query=<%$q3%>">New, unowned tickets</a>
+
+<br>
+
+<font size="-1"><textarea rows=3 cols=40 name="query"><%$query%></textarea>
+Show <input size="3" value="<%$per_page%>" name="per_page"> tickets per
+page.<br>
+</font>
+<input type="submit" value="<&|/l&>Go</&>">
+</form>
+%$m->abort();

Added: RT-Scope/trunk/html/Scope/Update.html
==============================================================================
--- (empty file)
+++ RT-Scope/trunk/html/Scope/Update.html	Thu May 27 21:40:04 2004
@@ -0,0 +1,205 @@
+%# BEGIN LICENSE BLOCK
+%# 
+%# Copyright (c) 1996-2003 Jesse Vincent <jesse at bestpractical.com>
+%# 
+%# (Except where explictly superceded by other copyright notices)
+%# 
+%# 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.
+%# 
+%# Unless otherwise specified, all modifications, corrections or
+%# extensions to this work which alter its source code become the
+%# property of Best Practical Solutions, LLC when submitted for
+%# inclusion in the work.
+%# 
+%# 
+%# END LICENSE BLOCK
+
+<& Elements/Header &>
+<b>#<%$Ticket->id%>: <%$Ticket->Subject%></b><br>
+<font
+size=-2>(<i><%$Ticket->Requestors->MemberEmailAddressesAsString%></i>)</font>
+<br>
+
+% if ($Actions[0]) {
+<& /Elements/ListActions, actions => \@Actions &>
+% }
+
+<FORM ACTION="Update.html" NAME="TicketUpdate" 
+	METHOD=POST enctype="multipart/form-data">
+<input type="hidden" name="QuoteTransaction" value="<% $ARGS{QuoteTransaction} %>">
+<input type="hidden" name="DefaultStatus" value="<% $DefaultStatus %>">
+<input type="hidden" name="Action" value="<% $ARGS{Action} %>">
+
+<span style="font-size: 10pt;">
+<TABLE BORDER=0>
+
+<tr><td align=right><&|/l&>Status</&>:</td>
+<td>
+<& /Elements/SelectStatus, Name=>"Status", Default => $DefaultStatus &>
+<&|/l&>Owner</&>:  
+<& /Elements/SelectOwner, Name=>"Owner", Default => ($ARGS{'Owner'} || $Ticket->OwnerObj->Id()), QueueObj => $Ticket->QueueObj, TicketObj => $Ticket &>
+<&|/l&>Worked</&>: <input size=4 name="UpdateTimeWorked" value="<% $ARGS{UpdateTimeWorked}%>"> <&|/l&>minutes</&></td></tr>
+<tr><td align=right><&|/l&>Update Type</&>:</td>
+<td><select name="UpdateType">
+% if ($CanComment) {
+  <option value="private" <%$CommentDefault%>><&|/l&>Comments (Not sent to requestors)</&></option>
+% }
+% if ($CanRespond) {
+   <option value="response" <%$ResponseDefault%>><&|/l&>Response to requestors</&></option>
+% }
+</select> 
+</td></tr>
+<tr><td align=right><&|/l&>Subject</&>:</td><td> <input name="UpdateSubject" size=60 value="<% ($ARGS{UpdateSubject}) ? $ARGS{UpdateSubject} : $Ticket->Subject()%>"></td></tr>
+%#<tr><td align=right><&|/l&>Cc</&>:</td><td> <input name="UpdateCc" size=60 value=<% $ARGS{UpdateCc} %>>
+%#</td></tr>
+%#<tr><td align=right><&|/l&>Bcc</&>:</td><td> <input name="UpdateBcc" size=60 VALUE="<%$ARGS{UpdateBcc}%>">
+%#</td></tr>
+%#% if (exists $session{'Attachments'}) {
+%#<TD>
+%#<&|/l&>Attached file</&>:
+%#</TD>
+%#<TD COLSPAN=5>
+%#<&|/l&>Check box to delete</&><BR>
+%#% foreach my $attach_name (keys %{$session{'Attachments'}}) {
+%#<input type="checkbox" name="DeleteAttach-<%$attach_name%>"><%$attach_name%><BR>
+%#% } # end of foreach
+%#</TD>
+%#</TR>
+%#<TR>
+%#% } # end of if
+%#<tr><td align=right><&|/l&>Attach</&>:</td><td><input name="Attach" type="file"><INPUT TYPE=SUBMIT NAME="AddMoreAttach" VALUE="<&|/l&>Add More Files</&>"><input type="hidden" name="UpdateAttach" value="1">
+%#</td></tr>
+<tr>
+<td colspan="2">
+<font size="-2">
+<& /Elements/Callback, _CallbackName => 'BeforeMessageBox', %ARGS &>
+% if (exists $ARGS{UpdateContent}) {
+% delete $ARGS{'QuoteTransaction'};
+<& Elements/MessageBox, Name=>"UpdateContent", Default=>$ARGS{UpdateContent}, %ARGS&>
+% } else {
+<& Elements/MessageBox, Name=>"UpdateContent", %ARGS &>
+% }
+</font>
+</td></tr>
+		<INPUT TYPE=HIDDEN NAME=id VALUE="<%$Ticket->Id%>"><br>
+</table>
+
+
+</span>
+
+<& /Elements/Submit, Name => 'SubmitTicket' &>
+  </FORM>
+
+
+
+<%INIT>
+
+my $CanRespond = 0;
+my $CanComment = 0;
+my $title;
+my @Actions;
+my $Ticket = LoadTicket($id);
+
+unless($DefaultStatus){
+    $DefaultStatus=($ARGS{'Status'} ||$Ticket->Status());
+}
+
+if ($DefaultStatus =~ '^new$'){
+        $DefaultStatus='open';
+}
+
+if ($DefaultStatus eq 'resolved') {
+    $title = loc("Resolve ticket #[_1] ([_2])", $Ticket->id, $Ticket->Subject);
+} else {
+    $title = loc("Update ticket #[_1] ([_2])", $Ticket->id, $Ticket->Subject);
+}
+
+# Things needed in the template - we'll do the processing here, just
+# for the convenience:
+
+my ($CommentDefault, $ResponseDefault);
+if (($Action eq 'Comment') or ($ARGS{'UpdateType'} eq 'private')) {
+   $CommentDefault = "SELECTED"; 
+} else {
+    $ResponseDefault = "SELECTED";
+}
+
+
+$CanRespond = 1 if ( $Ticket->CurrentUserHasRight('ReplyToTicket') or
+                     $Ticket->CurrentUserHasRight('ModifyTicket') ); 
+
+$CanComment = 1 if ( $Ticket->CurrentUserHasRight('CommentOnTicket') or
+                     $Ticket->CurrentUserHasRight('ModifyTicket') ); 
+
+
+# {{{ deal with deleting uploaded attachments
+foreach my $key (keys %ARGS) {
+    if ($key =~ m/^DeleteAttach-(.+)$/) {
+	delete $session{'Attachments'}{$1};
+    }
+    $session{'Attachments'} = { %{$session{'Attachments'} || {}} };
+}
+
+# {{{ store the uploaded attachment in session
+if ($ARGS{'Attach'}) {			# attachment?
+    $session{'Attachments'} = {} unless defined $session{'Attachments'};
+
+    my $subject = "$ARGS{'Attach'}";
+    # since CGI.pm deutf8izes the magic field, we need to add it back.
+    Encode::_utf8_on($subject);
+    # strip leading directories
+    $subject =~ s#^.*[\\/]##;
+
+    my $attachment = MakeMIMEEntity(
+        Subject             => $subject,
+        Body                => "",
+        AttachmentFieldName => 'Attach'
+    );
+
+    $session{'Attachments'} = { %{$session{'Attachments'} || {}},
+				$ARGS{'Attach'} => $attachment };
+}
+# }}}
+
+# delete temporary storage entry to make WebUI clean
+unless (keys %{$session{'Attachments'}} and $ARGS{'UpdateAttach'}) {
+    delete $session{'Attachments'};
+}
+# }}}
+
+if ( exists $ARGS{SubmitTicket} ) {
+    if ( $ARGS{'UpdateContent'} ) {
+        $ARGS{'UpdateContent'} =~ s/\r\n/\n/g;
+        if (    $ARGS{'UpdateContent'} ne ''
+             && $ARGS{'UpdateContent'} ne "-- \n"
+             . $session{'CurrentUser'}->UserObj->Signature ) {
+            $ARGS{UpdateAttachments} = $session{'Attachments'};
+            ProcessUpdateMessage( ARGSRef   => \%ARGS,
+                                  Actions   => \@Actions,
+                                  TicketObj => $Ticket );
+            delete $session{'Attachments'};
+        }
+    }
+#Process status updates
+my @BasicActions = ProcessTicketBasics(ARGSRef => \%ARGS, TicketObj=>$Ticket);
+my @results = ProcessTicketLinks( TicketObj => $Ticket, ARGSRef => \%ARGS);                            
+
+push (@Actions, @BasicActions, @results);
+	
+}
+</%INIT>
+
+<%ARGS>
+$id => undef
+$Action => undef
+$DefaultStatus => undef
+$Length => 8
+</%ARGS>

Added: RT-Scope/trunk/html/Scope/View.html
==============================================================================
--- (empty file)
+++ RT-Scope/trunk/html/Scope/View.html	Thu May 27 21:40:04 2004
@@ -0,0 +1,7 @@
+<frameset rows="50%,50%">
+<frame src="" name="History">
+<frame  src="" name="Update">
+</frameset>
+<%args>
+$query => "Owner = 'Nobody' AND (Status = 'open' OR Status = 'new')"
+</%args>

Added: RT-Scope/trunk/html/Scope/Work.html
==============================================================================
--- (empty file)
+++ RT-Scope/trunk/html/Scope/Work.html	Thu May 27 21:40:04 2004
@@ -0,0 +1,14 @@
+<frameset rows="50%,50%">
+% if ($id) {
+<frame name="History" src="History.html?id=<%$id%>#lasttrans">
+</frame>
+<frame name="Update" src="Update.html?id=<%$id%>">
+</frame>
+% } else {
+<frame name="History">
+<frame name="Update">
+% }
+</frameset>
+<%ARGS>
+$id => undef
+</%ARGS>

Added: RT-Scope/trunk/html/Scope/index.html
==============================================================================
--- (empty file)
+++ RT-Scope/trunk/html/Scope/index.html	Thu May 27 21:40:04 2004
@@ -0,0 +1,10 @@
+<frameset cols="350,*">
+<frame name="Search"
+src="Search.html?query=<%$query%>&per_page=<%$per_page%>&page=<%$page%>">
+<frame name="View" src="View.html">
+</frameset>
+<%args>
+$per_page => 25
+$page => 1
+$query => ''
+</%args>

Added: RT-Scope/trunk/inc/Module/Install.pm
==============================================================================
--- (empty file)
+++ RT-Scope/trunk/inc/Module/Install.pm	Thu May 27 21:40:04 2004
@@ -0,0 +1,171 @@
+#line 1 "inc/Module/Install.pm - /usr/local/share/perl/5.8.3/Module/Install.pm"
+# $File: //depot/cpan/Module-Install/lib/Module/Install.pm $ $Author: autrijus $
+# $Revision: #67 $ $Change: 1885 $ $DateTime: 2004/03/11 05:55:27 $ vim: expandtab shiftwidth=4
+
+package Module::Install;
+$VERSION = '0.33';
+
+die << "." unless $INC{join('/', inc => split(/::/, __PACKAGE__)).'.pm'};
+Please invoke ${\__PACKAGE__} with:
+
+    use inc::${\__PACKAGE__};
+
+not:
+
+    use ${\__PACKAGE__};
+
+.
+
+use strict 'vars';
+use Cwd ();
+use File::Find ();
+use File::Path ();
+
+ at inc::Module::Install::ISA = 'Module::Install';
+
+#line 129
+
+sub import {
+    my $class = shift;
+    my $self = $class->new(@_);
+
+    if (not -f $self->{file}) {
+        require "$self->{path}/$self->{dispatch}.pm";
+        File::Path::mkpath("$self->{prefix}/$self->{author}");
+        $self->{admin} = 
+          "$self->{name}::$self->{dispatch}"->new(_top => $self);
+        $self->{admin}->init;
+        @_ = ($class, _self => $self);
+        goto &{"$self->{name}::import"};
+    }
+
+    *{caller(0) . "::AUTOLOAD"} = $self->autoload;
+
+    # Unregister loader and worker packages so subdirs can use them again
+    delete $INC{"$self->{file}"};
+    delete $INC{"$self->{path}.pm"};
+}
+
+#line 156
+
+sub autoload {
+    my $self = shift;
+    my $caller = caller;
+
+    my $cwd = Cwd::cwd();
+    my $sym = "$caller\::AUTOLOAD";
+
+    $sym->{$cwd} = sub {
+        my $pwd = Cwd::cwd();
+        if (my $code = $sym->{$pwd}) {
+            goto &$code unless $cwd eq $pwd; # delegate back to parent dirs
+        }
+        $$sym =~ /([^:]+)$/ or die "Cannot autoload $caller";
+        unshift @_, ($self, $1);
+        goto &{$self->can('call')} unless uc($1) eq $1;
+    };
+}
+
+#line 181
+
+sub new {
+    my ($class, %args) = @_;
+
+    return $args{_self} if $args{_self};
+
+    $args{dispatch} ||= 'Admin';
+    $args{prefix}   ||= 'inc';
+    $args{author}   ||= '.author';
+    $args{bundle}   ||= 'inc/BUNDLES';
+
+    $class =~ s/^\Q$args{prefix}\E:://;
+    $args{name}     ||= $class;
+    $args{version}  ||= $class->VERSION;
+
+    unless ($args{path}) {
+        $args{path}  = $args{name};
+        $args{path}  =~ s!::!/!g;
+    }
+    $args{file}     ||= "$args{prefix}/$args{path}.pm";
+
+    bless(\%args, $class);
+}
+
+#line 210
+
+sub call {
+    my $self   = shift;
+    my $method = shift;
+    my $obj = $self->load($method) or return;
+
+    unshift @_, $obj;
+    goto &{$obj->can($method)};
+}
+
+#line 225
+
+sub load {
+    my ($self, $method) = @_;
+
+    $self->load_extensions(
+        "$self->{prefix}/$self->{path}", $self
+    ) unless $self->{extensions};
+
+    foreach my $obj (@{$self->{extensions}}) {
+        return $obj if $obj->can($method);
+    }
+
+    my $admin = $self->{admin} or die << "END";
+The '$method' method does not exist in the '$self->{prefix}' path!
+Please remove the '$self->{prefix}' directory and run $0 again to load it.
+END
+
+    my $obj = $admin->load($method, 1);
+    push @{$self->{extensions}}, $obj;
+
+    $obj;
+}
+
+#line 255
+
+sub load_extensions {
+    my ($self, $path, $top_obj) = @_;
+
+    unshift @INC, $self->{prefix}
+        unless grep { $_ eq $self->{prefix} } @INC;
+
+    local @INC = ($path, @INC);
+    foreach my $rv ($self->find_extensions($path)) {
+        my ($file, $pkg) = @{$rv};
+        next if $self->{pathnames}{$pkg};
+
+        eval { require $file; 1 } or (warn($@), next);
+        $self->{pathnames}{$pkg} = delete $INC{$file};
+        push @{$self->{extensions}}, $pkg->new( _top => $top_obj );
+    }
+}
+
+#line 279
+
+sub find_extensions {
+    my ($self, $path) = @_;
+    my @found;
+
+    File::Find::find(sub {
+        my $file = $File::Find::name;
+        return unless $file =~ m!^\Q$path\E/(.+)\.pm\Z!is;
+        return if $1 eq $self->{dispatch};
+
+        $file = "$self->{path}/$1.pm";
+        my $pkg = "$self->{name}::$1"; $pkg =~ s!/!::!g;
+        push @found, [$file, $pkg];
+    }, $path) if -d $path;
+
+    @found;
+}
+
+1;
+
+__END__
+
+#line 614

Added: RT-Scope/trunk/inc/Module/Install/Base.pm
==============================================================================
--- (empty file)
+++ RT-Scope/trunk/inc/Module/Install/Base.pm	Thu May 27 21:40:04 2004
@@ -0,0 +1,57 @@
+#line 1 "inc/Module/Install/Base.pm - /usr/local/share/perl/5.8.3/Module/Install/Base.pm"
+# $File: //depot/cpan/Module-Install/lib/Module/Install/Base.pm $ $Author: autrijus $
+# $Revision: #10 $ $Change: 1847 $ $DateTime: 2003/12/31 23:14:54 $ vim: expandtab shiftwidth=4
+
+package Module::Install::Base;
+
+#line 31
+
+sub new {
+    my ($class, %args) = @_;
+
+    foreach my $method (qw(call load)) {
+        *{"$class\::$method"} = sub {
+            +shift->_top->$method(@_);
+        } unless defined &{"$class\::$method"};
+    }
+
+    bless(\%args, $class);
+}
+
+#line 49
+
+sub AUTOLOAD {
+    my $self = shift;
+    goto &{$self->_top->autoload};
+}
+
+#line 60
+
+sub _top { $_[0]->{_top} }
+
+#line 71
+
+sub admin {
+    my $self = shift;
+    $self->_top->{admin} or Module::Install::Base::FakeAdmin->new;
+}
+
+sub is_admin {
+    my $self = shift;
+    $self->admin->VERSION;
+}
+
+sub DESTROY {}
+
+package Module::Install::Base::FakeAdmin;
+
+my $Fake;
+sub new { $Fake ||= bless(\@_, $_[0]) }
+sub AUTOLOAD {}
+sub DESTROY {}
+
+1;
+
+__END__
+
+#line 115

Added: RT-Scope/trunk/inc/Module/Install/Can.pm
==============================================================================
--- (empty file)
+++ RT-Scope/trunk/inc/Module/Install/Can.pm	Thu May 27 21:40:04 2004
@@ -0,0 +1,41 @@
+#line 1 "inc/Module/Install/Can.pm - /usr/local/share/perl/5.8.3/Module/Install/Can.pm"
+# $File: //depot/cpan/Module-Install/lib/Module/Install/Can.pm $ $Author: autrijus $
+# $Revision: #6 $ $Change: 1840 $ $DateTime: 2003/12/28 19:42:02 $ vim: expandtab shiftwidth=4
+
+package Module::Install::Can;
+use Module::Install::Base; @ISA = qw(Module::Install::Base);
+$VERSION = '0.01';
+
+use strict;
+use Config ();
+use File::Spec ();
+use ExtUtils::MakeMaker ();
+
+# check if we can run some command
+sub can_run {
+    my ($self, $cmd) = @_;
+
+    my $_cmd = $cmd;
+    return $_cmd if (-x $_cmd or $_cmd = MM->maybe_command($_cmd));
+
+    for my $dir ((split /$Config::Config{path_sep}/, $ENV{PATH}), '.') {
+        my $abs = File::Spec->catfile($dir, $_[1]);
+        return $abs if (-x $abs or $abs = MM->maybe_command($abs));
+    }
+
+    return;
+}
+
+sub can_cc {
+    my $self = shift;
+    my @chunks = split(/ /, $Config::Config{cc}) or return;
+
+    # $Config{cc} may contain args; try to find out the program part
+    while (@chunks) {
+        return $self->can_run("@chunks") || (pop(@chunks), next);
+    }
+
+    return;
+}
+
+1;

Added: RT-Scope/trunk/inc/Module/Install/Fetch.pm
==============================================================================
--- (empty file)
+++ RT-Scope/trunk/inc/Module/Install/Fetch.pm	Thu May 27 21:40:04 2004
@@ -0,0 +1,89 @@
+#line 1 "inc/Module/Install/Fetch.pm - /usr/local/share/perl/5.8.3/Module/Install/Fetch.pm"
+# $File: //depot/cpan/Module-Install/lib/Module/Install/Fetch.pm $ $Author: autrijus $
+# $Revision: #8 $ $Change: 1374 $ $DateTime: 2003/03/18 11:50:15 $ vim: expandtab shiftwidth=4
+
+package Module::Install::Fetch;
+use Module::Install::Base; @ISA = qw(Module::Install::Base);
+
+$VERSION = '0.01';
+
+sub get_file {
+    my ($self, %args) = @_;
+    my ($scheme, $host, $path, $file) = 
+        $args{url} =~ m|^(\w+)://([^/]+)(.+)/(.+)| or return;
+
+    if ($scheme eq 'http' and !eval { require LWP::Simple; 1 }) {
+        $args{url} = $args{ftp_url}
+            or (warn("LWP support unavailable!\n"), return);
+        ($scheme, $host, $path, $file) = 
+            $args{url} =~ m|^(\w+)://([^/]+)(.+)/(.+)| or return;
+    }
+
+    $|++;
+    print "Fetching '$file' from $host... ";
+
+    unless (eval { require Socket; Socket::inet_aton($host) }) {
+        warn "'$host' resolve failed!\n";
+        return;
+    }
+
+    return unless $scheme eq 'ftp' or $scheme eq 'http';
+
+    require Cwd;
+    my $dir = Cwd::getcwd();
+    chdir $args{local_dir} or return if exists $args{local_dir};
+
+    if (eval { require LWP::Simple; 1 }) {
+        LWP::Simple::mirror($args{url}, $file);
+    }
+    elsif (eval { require Net::FTP; 1 }) { eval {
+        # use Net::FTP to get past firewall
+        my $ftp = Net::FTP->new($host, Passive => 1, Timeout => 600);
+        $ftp->login("anonymous", 'anonymous at example.com');
+        $ftp->cwd($path);
+        $ftp->binary;
+        $ftp->get($file) or (warn("$!\n"), return);
+        $ftp->quit;
+    } }
+    elsif (my $ftp = $self->can_run('ftp')) { eval {
+        # no Net::FTP, fallback to ftp.exe
+        require FileHandle;
+        my $fh = FileHandle->new;
+
+        local $SIG{CHLD} = 'IGNORE';
+        unless ($fh->open("|$ftp -n")) {
+            warn "Couldn't open ftp: $!\n";
+            chdir $dir; return;
+        }
+
+        my @dialog = split(/\n/, << ".");
+open $host
+user anonymous anonymous\@example.com
+cd $path
+binary
+get $file $file
+quit
+.
+        foreach (@dialog) { $fh->print("$_\n") }
+        $fh->close;
+    } }
+    else {
+        warn "No working 'ftp' program available!\n";
+        chdir $dir; return;
+    }
+
+    unless (-f $file) {
+        warn "Fetching failed: $@\n";
+        chdir $dir; return;
+    }
+
+    return if exists $args{size} and -s $file != $args{size};
+    system($args{run}) if exists $args{run};
+    unlink($file) if $args{remove};
+
+    print(((!exists $args{check_for} or -e $args{check_for})
+        ? "done!" : "failed! ($!)"), "\n");
+    chdir $dir; return !$?;
+}
+
+1;

Added: RT-Scope/trunk/inc/Module/Install/Makefile.pm
==============================================================================
--- (empty file)
+++ RT-Scope/trunk/inc/Module/Install/Makefile.pm	Thu May 27 21:40:04 2004
@@ -0,0 +1,146 @@
+#line 1 "inc/Module/Install/Makefile.pm - /usr/local/share/perl/5.8.3/Module/Install/Makefile.pm"
+# $File: //depot/cpan/Module-Install/lib/Module/Install/Makefile.pm $ $Author: autrijus $
+# $Revision: #53 $ $Change: 1847 $ $DateTime: 2003/12/31 23:14:54 $ vim: expandtab shiftwidth=4
+
+package Module::Install::Makefile;
+use Module::Install::Base; @ISA = qw(Module::Install::Base);
+
+$VERSION = '0.01';
+
+use strict 'vars';
+use vars '$VERSION';
+
+use ExtUtils::MakeMaker ();
+
+sub Makefile { $_[0] }
+
+sub prompt { 
+    shift;
+    goto &ExtUtils::MakeMaker::prompt;
+}
+
+sub makemaker_args {
+    my $self = shift;
+    my $args = ($self->{makemaker_args} ||= {});
+    %$args = ( %$args, @_ ) if @_;
+    $args;
+}
+
+sub clean_files {
+    my $self = shift;
+    my $clean = $self->makemaker_args->{clean} ||= {};
+    %$clean = (
+        %$clean, 
+        FILES => join(" ", grep length, $clean->{FILES}, @_),
+    );
+}
+
+sub libs {
+    my $self = shift;
+    my $libs = ref $_[0] ? shift : [shift];
+    $self->makemaker_args( LIBS => $libs );
+}
+
+sub inc {
+    my $self = shift;
+    $self->makemaker_args( INC => shift );
+}
+
+sub write {
+    my $self = shift;
+    die "&Makefile->write() takes no arguments\n" if @_;
+
+    my $args = $self->makemaker_args;
+
+    $args->{DISTNAME} = $self->name;
+    $args->{NAME} = $self->module_name || $self->name || $self->determine_NAME($args);
+    $args->{VERSION} = $self->version || $self->determine_VERSION($args);
+    $args->{NAME} =~ s/-/::/g;
+
+    if ($] >= 5.005) {
+	$args->{ABSTRACT} = $self->abstract;
+	$args->{AUTHOR} = $self->author;
+    }
+    if ( eval($ExtUtils::MakeMaker::VERSION) >= 6.10 ) {
+        $args->{NO_META} = 1;
+    }
+    if ( eval($ExtUtils::MakeMaker::VERSION) > 6.17 ) {
+	$args->{SIGN} = 1 if $self->sign;
+    }
+    delete $args->{SIGN} unless $self->is_admin;
+
+    # merge both kinds of requires into prereq_pm
+    my $prereq = ($args->{PREREQ_PM} ||= {});
+    %$prereq = ( %$prereq, map { @$_ } map { @$_ } grep $_,
+                 ($self->build_requires, $self->requires) );
+
+    # merge both kinds of requires into prereq_pm
+    my $dir = ($args->{DIR} ||= []);
+    if ($self->bundles) {
+        push @$dir, map "$_->[1]", @{$self->bundles};
+        delete $prereq->{$_->[0]} for @{$self->bundles};
+    }
+
+    if (my $perl_version = $self->perl_version) {
+        eval "use $perl_version; 1"
+            or die "ERROR: perl: Version $] is installed, ".
+                   "but we need version >= $perl_version";
+    }
+
+    my %args = map {($_ => $args->{$_})} grep {defined($args->{$_})} keys %$args;
+
+    if ($self->admin->preop) {
+        $args{dist} = $self->admin->preop;
+    }
+
+    ExtUtils::MakeMaker::WriteMakefile(%args);
+
+    $self->fix_up_makefile();
+}
+
+sub fix_up_makefile {
+    my $self = shift;
+    my $top_class = ref($self->_top) || '';
+    my $top_version = $self->_top->VERSION || '';
+
+    my $preamble = $self->preamble 
+       ? "# Preamble by $top_class $top_version\n" . $self->preamble
+       : '';
+    my $postamble = "# Postamble by $top_class $top_version\n" . 
+                    ($self->postamble || '');
+
+    open MAKEFILE, '< Makefile' or die $!;
+    my $makefile = do { local $/; <MAKEFILE> };
+    close MAKEFILE;
+
+    $makefile =~ s/\b(test_harness\(\$\(TEST_VERBOSE\), )/$1'inc', /;
+    $makefile =~ s/( -I\$\(INST_ARCHLIB\))/ -Iinc$1/g;
+    $makefile =~ s/( "-I\$\(INST_LIB\)")/ "-Iinc"$1/g;
+
+    $makefile =~ s/^(FULLPERL = .*)/$1 -Iinc/m;
+    $makefile =~ s/^(PERL = .*)/$1 -Iinc/m;
+
+    open MAKEFILE, '> Makefile' or die $!;
+    print MAKEFILE "$preamble$makefile$postamble";
+    close MAKEFILE;
+}
+
+sub preamble {
+    my ($self, $text) = @_;
+    $self->{preamble} = $text . $self->{preamble} if defined $text;
+    $self->{preamble};
+}
+
+sub postamble {
+    my ($self, $text) = @_;
+
+    $self->{postamble} ||= $self->admin->postamble;
+    $self->{postamble} .= $text if defined $text;
+    $self->{postamble}
+}
+
+1;
+
+__END__
+
+#line 276

Added: RT-Scope/trunk/inc/Module/Install/Metadata.pm
==============================================================================
--- (empty file)
+++ RT-Scope/trunk/inc/Module/Install/Metadata.pm	Thu May 27 21:40:04 2004
@@ -0,0 +1,190 @@
+#line 1 "inc/Module/Install/Metadata.pm - /usr/local/share/perl/5.8.3/Module/Install/Metadata.pm"
+# $File: //depot/cpan/Module-Install/lib/Module/Install/Metadata.pm $ $Author: autrijus $
+# $Revision: #32 $ $Change: 1885 $ $DateTime: 2004/03/11 05:55:27 $ vim: expandtab shiftwidth=4
+
+package Module::Install::Metadata;
+use Module::Install::Base; @ISA = qw(Module::Install::Base);
+
+$VERSION = '0.04';
+
+use strict 'vars';
+use vars qw($VERSION);
+
+sub Meta { shift }
+
+my @scalar_keys = qw(
+    name module_name version abstract author license
+    distribution_type sign perl_version
+);
+my @tuple_keys  = qw(build_requires requires recommends bundles);
+
+foreach my $key (@scalar_keys) {
+    *$key = sub {
+        my $self = shift;
+        return $self->{'values'}{$key} unless @_;
+        $self->{'values'}{$key} = shift;
+        return $self;
+    };
+}
+
+foreach my $key (@tuple_keys) {
+    *$key = sub {
+        my $self = shift;
+        return $self->{'values'}{$key} unless @_;
+        my @rv;
+        while (@_) {
+            my $module  = shift or last;
+            my $version = shift || 0;
+            if ($module eq 'perl') {
+                $version =~ s{^(\d+)\.(\d+)\.(\d+)}
+                             {$1 + $2/1_000 + $3/1_000_000}e;
+                $self->perl_version($version);
+                next;
+            }
+            my $rv = [$module, $version];
+            push @{$self->{'values'}{$key}}, $rv;
+            push @rv, $rv;
+        }
+        return @rv;
+    };
+}
+
+sub features {
+    my $self = shift;
+    while (my ($name, $mods) = splice(@_, 0, 2)) {
+        my $count = 0;
+        push @{$self->{'values'}{'features'}}, ($name => [
+            map { (++$count % 2 and ref($_) and ($count += $#$_)) ? @$_ : $_ } @$mods
+        ] );
+    }
+    return @{$self->{'values'}{'features'}};
+}
+
+sub no_index {
+    my $self = shift;
+    my $type = shift;
+    push @{$self->{'values'}{'no_index'}{$type}}, @_ if $type;
+    return $self->{'values'}{'no_index'};
+}
+
+sub _dump {
+    my $self = shift;
+    my $package = ref($self->_top);
+    my $version = $self->_top->VERSION;
+    my %values = %{$self->{'values'}};
+
+    delete $values{sign};
+    if (my $perl_version = delete $values{perl_version}) {
+        # Always canonical to three-dot version 
+        $perl_version =~ s{^(\d+)\.(\d\d\d)(\d*)}{join('.', $1, int($2), int($3))}e
+            if $perl_version >= 5.006;
+        $values{requires} = [
+            [perl => $perl_version],
+            @{$values{requires}||[]},
+        ];
+    }
+
+    warn "No license specified, setting license = 'unknown'\n"
+        unless $values{license};
+
+    $values{license} ||= 'unknown';
+    $values{distribution_type} ||= 'module';
+    $values{name} ||= do {
+        my $name = $values{module_name};
+        $name =~ s/::/-/g;
+        $name;
+    } if $values{module_name};
+
+    if ($values{name} =~ /::/) {
+        my $name = $values{name};
+        $name =~ s/::/-/g;
+        die "Error in name(): '$values{name}' should be '$name'!\n";
+    }
+
+    my $dump = '';
+    foreach my $key (@scalar_keys) {
+        $dump .= "$key: $values{$key}\n" if exists $values{$key};
+    }
+    foreach my $key (@tuple_keys) {
+        next unless exists $values{$key};
+        $dump .= "$key:\n";
+        foreach (@{$values{$key}}) {
+            $dump .= "  $_->[0]: $_->[1]\n";
+        }
+    }
+
+    if (my $no_index = $values{no_index}) {
+        push @{$no_index->{'directory'}}, 'inc';
+        require YAML;
+        local $YAML::UseHeader = 0;
+        $dump .= YAML::Dump({ no_index => $no_index});
+    }
+    else {
+        $dump .= << "META";
+no_index:
+  directory:
+    - inc
+META
+    }
+    
+    $dump .= "generated_by: $package version $version\n";
+    return $dump;
+}
+
+sub read {
+    my $self = shift;
+    $self->include_deps( 'YAML', 0 );
+    require YAML;
+    my $data = YAML::LoadFile( 'META.yml' );
+    # Call methods explicitly in case user has already set some values.
+    while ( my ($key, $value) = each %$data ) {
+        next unless $self->can( $key );
+        if (ref $value eq 'HASH') {
+            while (my ($module, $version) = each %$value) {
+                $self->$key( $module => $version );
+            }
+        }
+        else {
+            $self->$key( $value );
+        }
+    }
+    return $self;
+}
+
+sub write {
+    my $self = shift;
+    return $self unless $self->is_admin;
+
+    META_NOT_OURS: {
+        local *FH;
+        if (open FH, "META.yml") {
+            while (<FH>) {
+                last META_NOT_OURS if /^generated_by: Module::Install\b/;
+            }
+            return $self if -s FH;
+        }
+    }
+
+    warn "Writing META.yml\n";
+    open META, "> META.yml" or warn "Cannot write to META.yml: $!";
+    print META $self->_dump;
+    close META;
+    return $self;
+}
+
+sub version_from {
+    my ($self, $version_from) = @_;
+    require ExtUtils::MM_Unix;
+    $self->version(ExtUtils::MM_Unix->parse_version($version_from));
+}
+
+sub abstract_from {
+    my ($self, $abstract_from) = @_;
+    require ExtUtils::MM_Unix;
+    $self->abstract(
+        bless( { DISTNAME => $self->name }, 'ExtUtils::MM_Unix')
+            ->parse_abstract($abstract_from)
+    );
+}
+
+1;

Added: RT-Scope/trunk/inc/Module/Install/RTx.pm
==============================================================================
--- (empty file)
+++ RT-Scope/trunk/inc/Module/Install/RTx.pm	Thu May 27 21:40:04 2004
@@ -0,0 +1,162 @@
+#line 1 "inc/Module/Install/RTx.pm - /usr/local/share/perl/5.8.4/Module/Install/RTx.pm"
+# $File: //member/autrijus/Module-Install-RTx/lib/Module/Install/RTx.pm $ $Author: autrijus $
+# $Revision: #15 $ $Change: 10598 $ $DateTime: 2004/05/13 01:27:54 $ vim: expandtab shiftwidth=4
+
+package Module::Install::RTx;
+use Module::Install::Base; @ISA = qw(Module::Install::Base);
+
+$Module::Install::RTx::VERSION = '0.07';
+
+use strict;
+use FindBin;
+use File::Glob;
+use File::Basename;
+
+sub RTx {
+    my ($self, $name) = @_;
+    my $RTx = 'RTx';
+    $RTx = $1 if $name =~ s/^(\w+)-//;
+
+    $self->name("$RTx-$name")
+        unless $self->name;
+    $self->abstract("RT $name Extension")
+        unless $self->abstract;
+    $self->version_from (-e "$name.pm" ? "$name.pm" : "lib/$RTx/$name.pm")
+        unless $self->version;
+
+    my @prefixes = (qw(/opt /usr/local /home /usr /sw ));
+    my $prefix = $ENV{PREFIX};
+    @ARGV = grep { /PREFIX=(.*)/ ? (($prefix = $1), 0) : 1 } @ARGV;
+
+    if ($prefix) {
+        $RT::LocalPath = $prefix;
+        $INC{'RT.pm'} = "$RT::LocalPath/lib/RT.pm";
+    }
+    else {
+        local @INC = (
+            @INC,
+            $ENV{RTHOME},
+            map {( "$_/rt3/lib", "$_/lib/rt3", "$_/lib" )} grep $_, @prefixes
+        );
+        until ( eval { require RT; $RT::LocalPath } ) {
+            warn "Cannot find the location of RT.pm that defines \$RT::LocalPath. ($@)\n";
+            $_ = $self->prompt("Path to your RT.pm:") or exit;
+            push @INC, $_, "$_/rt3/lib", "$_/lib/rt3";
+        }
+
+        package RT;
+        RT::LoadConfig();
+    }
+
+    my $lib_path = dirname($INC{'RT.pm'});
+    print "Using RT configurations from $INC{'RT.pm'}:\n";
+
+    $RT::LocalVarPath	||= $RT::VarPath;
+    $RT::LocalPoPath	||= $RT::LocalLexiconPath;
+    $RT::LocalHtmlPath	||= $RT::MasonComponentRoot;
+
+    my %path;
+    my $with_subdirs = $ENV{WITH_SUBDIRS};
+    @ARGV = grep { /WITH_SUBDIRS=(.*)/ ? (($with_subdirs = $1), 0) : 1 } @ARGV;
+    my %subdirs = map { $_ => 1 } split(/\s*,\s*/, $with_subdirs);
+
+    foreach (qw(bin etc html po sbin var)) {
+        next unless -d "$FindBin::Bin/$_";
+        next if %subdirs and !$subdirs{$_};
+        $self->no_index( directory => $_ );
+
+        no strict 'refs';
+        my $varname = "RT::Local" . ucfirst($_) . "Path";
+        $path{$_} = ${$varname} || "$RT::LocalPath/$_";
+    }
+
+    $path{$_} .= "/$name" for grep $path{$_}, qw(etc po var);
+    my $args = join(', ', map "q($_)", %path);
+    $path{lib} = "$RT::LocalPath/lib" unless %subdirs and !$subdirs{'lib'};
+    print "./$_\t=> $path{$_}\n" for sort keys %path;
+
+    if (my @dirs = map { (-D => $_) } grep $path{$_}, qw(bin html sbin)) {
+        my @po = map { (-o => $_) } grep -f, File::Glob::bsd_glob("po/*.po");
+        $self->postamble(<< ".") if @po;
+lexicons ::
+\t\$(NOECHO) \$(PERL) -MLocale::Maketext::Extract::Run=xgettext -e \"xgettext(qw(@dirs @po))\"
+.
+    }
+
+    my $postamble = << ".";
+install ::
+\t\$(NOECHO) \$(PERL) -MExtUtils::Install -e \"install({$args})\"
+.
+
+    if ($path{var} and -d $RT::MasonDataDir) {
+        my ($uid, $gid) = (stat($RT::MasonDataDir))[4, 5];
+        $postamble .= << ".";
+\t\$(NOECHO) chown -R $uid:$gid $path{var}
+.
+    }
+
+    my %has_etc;
+    if (File::Glob::bsd_glob("$FindBin::Bin/etc/schema.*")) {
+        # got schema, load factory module
+        $has_etc{schema}++;
+        $self->load('RTxFactory');
+        $self->postamble(<< ".");
+factory ::
+\t\$(NOECHO) \$(PERL) -Ilib -I"$lib_path" -Minc::Module::Install -e"RTxFactory(qw($RTx $name))"
+
+dropdb ::
+\t\$(NOECHO) \$(PERL) -Ilib -I"$lib_path" -Minc::Module::Install -e"RTxFactory(qw($RTx $name drop))"
+
+.
+    }
+    if (File::Glob::bsd_glob("$FindBin::Bin/etc/acl.*")) {
+        $has_etc{acl}++;
+    }
+    if (-e 'etc/initialdata') {
+        $has_etc{initialdata}++;
+    }
+
+    $self->postamble("$postamble\n");
+    if (%subdirs and !$subdirs{'lib'}) {
+        $self->makemaker_args(
+            PM => { "" => "" },
+        )
+    }
+    else {
+        $self->makemaker_args( INSTALLSITELIB => "$RT::LocalPath/lib" );
+    }
+
+    if (%has_etc) {
+        RTxInit();
+        $RT::SbinPath = $RT::LocalPath;
+        $RT::SbinPath =~ s/local$/sbin/;
+
+        print "For first-time installation, type 'make initdb'.\n";
+        my $initdb = "initdb ::\n";
+        $initdb .= <<"." if $has_etc{schema};
+\t\$(NOECHO) \$(PERL) -Ilib -I"$lib_path" "$RT::SbinPath/rt-setup-database" --action=schema --datadir ./etc/ --prompt-for-dba-password --dba $RT::DatabaseUser
+.
+        $initdb .= <<"." if $has_etc{acl};
+\t\$(NOECHO) \$(PERL) -Ilib -I"$lib_path" "$RT::SbinPath/rt-setup-database" --action=acl --datadir ./etc/ --prompt-for-dba-password --dba $RT::DatabaseUser
+.
+        $initdb .= <<"." if $has_etc{initialdata};
+\t\$(NOECHO) \$(PERL) -Ilib -I"$lib_path" "$RT::SbinPath/rt-setup-database" --action=insert --datafile=etc/initialdata --dba $RT::DatabaseUser
+.
+        $self->postamble("$initdb\n");
+    }
+}
+
+sub RTxInit {
+    unshift @INC, substr(delete($INC{'RT.pm'}), 0, -5) if $INC{'RT.pm'};
+    require RT;
+    RT::LoadConfig();
+    RT::ConnectToDatabase();
+
+    die "Cannot load RT" unless $RT::Handle and $RT::DatabaseType;
+}
+
+1;
+
+__END__
+
+#line 238

Added: RT-Scope/trunk/inc/Module/Install/Win32.pm
==============================================================================
--- (empty file)
+++ RT-Scope/trunk/inc/Module/Install/Win32.pm	Thu May 27 21:40:04 2004
@@ -0,0 +1,66 @@
+#line 1 "inc/Module/Install/Win32.pm - /usr/local/share/perl/5.8.3/Module/Install/Win32.pm"
+# $File: //depot/cpan/Module-Install/lib/Module/Install/Win32.pm $ $Author: autrijus $
+# $Revision: #9 $ $Change: 1789 $ $DateTime: 2003/11/11 01:22:54 $ vim: expandtab shiftwidth=4
+
+package Module::Install::Win32;
+use Module::Install::Base; @ISA = qw(Module::Install::Base);
+
+$VERSION = '0.02';
+
+use strict;
+
+# determine if the user needs nmake, and download it if needed
+sub check_nmake {
+    my $self = shift;
+    $self->load('can_run');
+    $self->load('get_file');
+
+    require Config;
+    return unless (
+        $Config::Config{make}                   and
+        $Config::Config{make} =~ /^nmake\b/i    and
+        $^O eq 'MSWin32'                        and
+        !$self->can_run('nmake')
+    );
+
+    print "The required 'nmake' executable not found, fetching it...\n";
+
+    require File::Basename;
+    my $rv = $self->get_file(
+        url         => 'http://download.microsoft.com/download/vc15/Patch/1.52/W95/EN-US/Nmake15.exe',
+        ftp_url     => 'ftp://ftp.microsoft.com/Softlib/MSLFILES/Nmake15.exe',
+        local_dir   => File::Basename::dirname($^X),
+        size        => 51928,
+        run         => 'Nmake15.exe /o > nul',
+        check_for   => 'Nmake.exe',
+        remove      => 1,
+    );
+
+    if (!$rv) {
+        die << '.';
+
+-------------------------------------------------------------------------------
+
+Since you are using Microsoft Windows, you will need the 'nmake' utility
+before installation. It's available at:
+
+  http://download.microsoft.com/download/vc15/Patch/1.52/W95/EN-US/Nmake15.exe
+      or
+  ftp://ftp.microsoft.com/Softlib/MSLFILES/Nmake15.exe
+
+Please download the file manually, save it to a directory in %PATH% (e.g.
+C:\WINDOWS\COMMAND\), then launch the MS-DOS command line shell, "cd" to
+that directory, and run "Nmake15.exe" from there; that will create the
+'nmake.exe' file needed by this module.
+
+You may then resume the installation process described in README.
+
+-------------------------------------------------------------------------------
+.
+    }
+}
+
+1;
+
+__END__
+

Added: RT-Scope/trunk/inc/Module/Install/WriteAll.pm
==============================================================================
--- (empty file)
+++ RT-Scope/trunk/inc/Module/Install/WriteAll.pm	Thu May 27 21:40:04 2004
@@ -0,0 +1,39 @@
+#line 1 "inc/Module/Install/WriteAll.pm - /usr/local/share/perl/5.8.3/Module/Install/WriteAll.pm"
+# $File: //depot/cpan/Module-Install/lib/Module/Install/WriteAll.pm $ $Author: autrijus $
+# $Revision: #3 $ $Change: 1885 $ $DateTime: 2004/03/11 05:55:27 $ vim: expandtab shiftwidth=4
+
+package Module::Install::WriteAll;
+use Module::Install::Base; @ISA = qw(Module::Install::Base);
+
+sub WriteAll {
+    my $self = shift;
+    my %args = (
+        meta => 1,
+        sign => 0,
+        inline => 0,
+        check_nmake => 1,
+        @_
+    );
+
+    $self->sign(1) if $args{sign};
+    $self->Meta->write if $args{meta};
+    $self->admin->WriteAll(%args) if $self->is_admin;
+
+    if ($0 =~ /Build.PL$/i) {
+	$self->Build->write;
+    }
+    else {
+	$self->check_nmake if $args{check_nmake};
+        $self->makemaker_args( PL_FILES => {} )
+            unless $self->makemaker_args->{'PL_FILES'};
+
+        if ($args{inline}) {
+            $self->Inline->write;
+        }
+        else {
+            $self->Makefile->write;
+        }
+    }
+}
+
+1;

Added: RT-Scope/trunk/lib/RT/Scope.pm
==============================================================================
--- (empty file)
+++ RT-Scope/trunk/lib/RT/Scope.pm	Thu May 27 21:40:04 2004
@@ -0,0 +1,14 @@
+# Copyright 1996-2004 Best Practical Solutions, LLC
+#
+
+use strict;
+use warnings;
+
+package RT::Scope;
+
+our $VERSION = "0.01_01";
+
+
+
+
+1;


More information about the Rt-commit mailing list