diff options
Diffstat (limited to 'rt/webrt/Elements')
42 files changed, 1080 insertions, 0 deletions
diff --git a/rt/webrt/Elements/Checkbox b/rt/webrt/Elements/Checkbox new file mode 100755 index 000000000..964c482ba --- /dev/null +++ b/rt/webrt/Elements/Checkbox @@ -0,0 +1,17 @@ +%# $Header: /home/cvs/cvsroot/freeside/rt/webrt/Elements/Attic/Checkbox,v 1.1 2002-08-12 06:17:08 ivan Exp $ +<INPUT TYPE="Checkbox" NAME ="<%$Name%>" <%$IsChecked%>> + +<%ARGS> +$Name => undef +$Default => undef +$True => undef +$False => undef +$IsChecked => undef +</%ARGS> + +<%INIT> +$IsChecked = + ($Default && $Default =~ /checked/i) + ? " CHECKED " : ""; +1; +</%INIT> diff --git a/rt/webrt/Elements/CreateTicket b/rt/webrt/Elements/CreateTicket new file mode 100644 index 000000000..1270f6ebe --- /dev/null +++ b/rt/webrt/Elements/CreateTicket @@ -0,0 +1 @@ +<FORM ACTION="<% $RT::WebPath%>/Ticket/Create.html"><input type=submit value="New ticket in"> <& /Elements/SelectNewTicketQueue &></FORM> diff --git a/rt/webrt/Elements/CustomHomepageHeader b/rt/webrt/Elements/CustomHomepageHeader new file mode 100644 index 000000000..e69de29bb --- /dev/null +++ b/rt/webrt/Elements/CustomHomepageHeader diff --git a/rt/webrt/Elements/Error b/rt/webrt/Elements/Error new file mode 100755 index 000000000..ec2cf511f --- /dev/null +++ b/rt/webrt/Elements/Error @@ -0,0 +1,23 @@ +<& /Elements/Header, Code => $Code, Why => $Why &> +<& /Elements/Tabs &> +<& /Elements/TitleBoxStart, title => $Title &> +<%$Why%> +<br> +<font size=-1> +<%$Details%> +</font> +<& /Elements/TitleBoxEnd &> +</body> +</HTML> + + +<%args> +$Code => undef +$Details => undef +$Title => "RT Error" +$Why => "the calling component did not specify why" +</%args> + +<%INIT> +$RT::Logger->error("WebRT: $Why ($Details)"); +</%INIT> diff --git a/rt/webrt/Elements/Footer b/rt/webrt/Elements/Footer new file mode 100755 index 000000000..776c219bb --- /dev/null +++ b/rt/webrt/Elements/Footer @@ -0,0 +1,10 @@ +% if ($Debug) { +<HR> +<b>Time to display: <%time - $m->{'rt_base_time'} %></b> +% } +</BODY> +</HTML> + +<%ARGS> +$Debug => 0 +</%ARGS> diff --git a/rt/webrt/Elements/GotoTicket b/rt/webrt/Elements/GotoTicket new file mode 100644 index 000000000..21d2bcdf8 --- /dev/null +++ b/rt/webrt/Elements/GotoTicket @@ -0,0 +1 @@ +<FORM ACTION="<%$RT::WebPath%>/Ticket/Display.html"><input type=submit value="Goto ticket"> <input size=5 name=id></FORM> diff --git a/rt/webrt/Elements/Header b/rt/webrt/Elements/Header new file mode 100755 index 000000000..471331be2 --- /dev/null +++ b/rt/webrt/Elements/Header @@ -0,0 +1,61 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> +<HTML> +<HEAD> +<TITLE><%$Title%></TITLE> +<META HTTP-EQUIV="PRAGMA" CONTENT="NO-CACHE"> + +%# TODO this gets called from error. but I have no idea what it might +%# be used for. can we whack it? -jesse +% if ($Code) { +<META HTTP-EQUIV VALUE="<%$Code%> <%$Why%>"> +% } +% if ($Refresh > 0) { +<META HTTP-EQUIV="REFRESH" CONTENT="<%$Refresh%>"> +% } + +<link rel="stylesheet" href="<%$RT::WebPath%>/NoAuth/webrt.css" type="text/css"> +</HEAD> +<BODY BGCOLOR="<%$BgColor%>"> +% if ($ShowBar) { +<TABLE BORDER=0 WIDTH=100% CELLSPACING=0 BGCOLOR="#993333"> +<TR VALIGN=TOP> +<TD><IMG SRC="<%$RT::LogoURL%>" alt="RT"></TD> +<TD VALIGN=CENTER ALIGN=LEFT> +<font size=+2 color="#ffffff"> +<B> +<%$Title%> +</B> +</font> +</TD> +<TD ALIGN=RIGHT> +<font color="#ffffff"> +% if ($session{'CurrentUser'}) { +Signed in as <b><%$session{'CurrentUser'}->Name%></b>.<BR> +% if ($session{'CurrentUser'}->HasSystemRight('ModifySelf')) { +[<A class='inverse' HREF="<%$RT::WebPath%>/User/Prefs.html" >Preferences</A>] +% } +% unless ($RT::WebExternalAuth) { +[<A class='inverse' HREF="<%$RT::WebPath%>/NoAuth/Logout.html">Logout</a>] +% } +% } else { +Not logged in. +% } +</font> +</TD> +</TR> +</TABLE> + +<BR> +% } +<%ARGS> +$Title => 'WebRT' +$Code => undef +$Refresh => undef +$Why => undef +$BgColor => '#ffffff' +$ShowBar => 1 +</%ARGS> +<%INIT> +$Title = "RT/$RT::rtname: ".$Title; +</%INIT> + diff --git a/rt/webrt/Elements/ListActions b/rt/webrt/Elements/ListActions new file mode 100755 index 000000000..3fc9b0ba5 --- /dev/null +++ b/rt/webrt/Elements/ListActions @@ -0,0 +1,14 @@ +% if (@actions ) { +<& /Elements/TitleBoxStart, title => 'Results' &> +<UL> +% foreach my $action (@actions) { +% next unless ($action); +<LI><%$action%></LI> +% } +</UL> +<& /Elements/TitleBoxEnd &> +<BR> +% } +<%ARGS> +@actions => undef +</%ARGS> diff --git a/rt/webrt/Elements/Login b/rt/webrt/Elements/Login new file mode 100755 index 000000000..27ec98281 --- /dev/null +++ b/rt/webrt/Elements/Login @@ -0,0 +1,69 @@ +<& /Elements/Header, Title=>"Login" , &> + +<DIV ALIGN=CENTER> +% if ($Error) { +<& /Elements/TitleBoxStart, title => 'Error' &> +<% $Error %> +<& /Elements/TitleBoxEnd &> +% } +<BR> +<& /Elements/TitleBoxStart, width=> "40%", titleright => "RT $RT::VERSION for $RT::rtname", title => 'Login' , +contentbg=>"#cccccc" &> + + +% unless ($RT::WebExternalAuth) { +<FORM METHOD=POST > +<TABLE BORDER=0 WIDTH=100%> +<TR ALIGN=RIGHT> +<TD ALIGN=RIGHT>Username:</TD><TD ALIGN=LEFT><input name=user value="<%$user%>"></TD></TR> +<TR><TD ALIGN=RIGHT>Password:</TD><TD ALIGN=LEFT><input type=password name=pass></TD></TR> +<TR><TD colspan=2 align=right> +<input type=submit Value="Login"> +</TD></TR> +</TABLE> +<&/Elements/TitleBoxEnd&> +% # From mason 1.0.1 forward, this doesn't work. in fact, it breaks things. +% if (0) { +% # The code below iterates through everything in the passed in arguments +% # Preserving all the old parameters +% # This would be easier, except mason is 'smart' and calls multiple values +% # arrays rather than multiple hash keys +% my $key; my $val; +% foreach $key (keys %ARGS) { +% if (($key ne 'user') and ($key ne 'pass')) { +% if (ref($ARGS{$key}) =~ /ARRAY/) { +% foreach $val (@{$ARGS{$key}}) { +<input type=hidden name="<%$key %>" value="<% $val %>"> +% } +% } +% else { +<input type="hidden" name="<% $key %>" value="<% $ARGS{$key} %>"> +% } +% } +%} +% } +</FORM> +% } +</DIV> + +<BR> +<!-- TODO: not yet implemented +If you've forgotten your username or password, RT can <A +href="/NoAuth/Reminder.html">send you a reminder</a>. +--> +<BR> +<HR> +RT is © Copyright 1996-2002 Jesse Vincent <jesse@bestpractical.com>. It is +distributed under <a href="http://www.gnu.org/copyleft/gpl.html">Version 2 of the GNU General Public License.</a> + + +<%ARGS> +$user => "" +$pass => undef +$goto => undef +$Error => undef +</%ARGS> + +<%INIT> +SetContentType('text/html'); +</%INIT> diff --git a/rt/webrt/Elements/MessageBox b/rt/webrt/Elements/MessageBox new file mode 100644 index 000000000..aa081a380 --- /dev/null +++ b/rt/webrt/Elements/MessageBox @@ -0,0 +1,30 @@ +<TEXTAREA COLS=<%$Width%> ROWS=15 WRAP=HARD NAME="<%$Name%>"><% $Default %><%$message%><%$signature%></TEXTAREA> +<%INIT> + +my ($message); + +if ($MessageURI) { + my $code; + ($code, $Default)=RT::Link->GetContent($MessageURI); +} +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 => '' +$DefaultURI => undef +$Width => 72 +$MessageURI => undef +</%ARGS> + diff --git a/rt/webrt/Elements/MyRequests b/rt/webrt/Elements/MyRequests new file mode 100644 index 000000000..67817296c --- /dev/null +++ b/rt/webrt/Elements/MyRequests @@ -0,0 +1,45 @@ +<& /Elements/TitleBoxStart, title => "25 highest priority tickets I requested..." &> +<TABLE BORDER=0 cellspacing=0 cellpadding=1 WIDTH=100%> +<TR> +<TH align=right>#</TH> +<TH align=left>Subject</TH> +<TH align=left>Queue</TH> +<TH align=left>Status</TH> +<TH align=left>Owner</TH> +<TH> </TH> +</TR> +% while (my $Ticket = $MyTickets->Next) { +<TR> +<TD ALIGN=RIGHT> +<%$Ticket->Id%> +</TD> +<TD> +<A HREF="<% $RT::WebPath %>/Ticket/Display.html?id=<%$Ticket->Id%>"> +<%$Ticket->Subject || '[no subject]'%> +</A> +</TD> +<TD> +<%$Ticket->QueueObj->Name%> +</TD><TD> +<%$Ticket->Status%> +</TD><TD> +<%$Ticket->OwnerObj->Name%> +</TD><TD ALIGN=RIGHT> +[<A HREF="<% $RT::WebPath %>/Ticket/Display.html?id=<%$Ticket->Id%>">Display</A>] +</TD> +</TR> +% } +</TABLE> +<& /Elements/TitleBoxEnd &> + + +<%INIT> +my $MyTickets; +$MyTickets = new RT::Tickets ($session{'CurrentUser'}); +$MyTickets->LimitRequestor(VALUE => $session{'CurrentUser'}->EmailAddress); +$MyTickets->LimitStatus(VALUE => "open"); +$MyTickets->LimitStatus(VALUE => "new"); +$MyTickets->OrderBy(FIELD => 'Priority', ORDER => 'DESC'); +$MyTickets->RowsPerPage(25); + +</%INIT> diff --git a/rt/webrt/Elements/MyTickets b/rt/webrt/Elements/MyTickets new file mode 100644 index 000000000..64a2ba7cc --- /dev/null +++ b/rt/webrt/Elements/MyTickets @@ -0,0 +1,43 @@ +<& /Elements/TitleBoxStart, title => "25 highest priority tickets I own..." &> +<TABLE BORDER=0 cellspacing=0 cellpadding=1 WIDTH=100%> +<TR> +<TH ALIGN=RIGHT>#</TH> +<TH ALIGN=LEFT>Subject</TH> +<TH ALIGN=LEFT>Queue</TH> +<TH ALIGN=LEFT>Status</TH> +<TH ALIGN=LEFT> </TH> +</TR> +% while (my $Ticket = $MyTickets->Next) { +<TR> +<TD ALIGN=RIGHT> +<%$Ticket->Id%> +</TD> +<TD> +<A HREF="<% $RT::WebPath %>/Ticket/Display.html?id=<%$Ticket->Id%>"> +<%$Ticket->Subject || '[no subject]'%> +</A> +</TD> +<TD> +<%$Ticket->QueueObj->Name%> +</TD><TD> +<%$Ticket->Status%> +</TD> +<TD ALIGN=RIGHT> +[<A HREF="<% $RT::WebPath %>/Ticket/Update.html?id=<%$Ticket->Id%>">Update</A>] +</TD> +</TR> +% } +</TABLE> +<& /Elements/TitleBoxEnd &> + + +<%INIT> +my $MyTickets; +$MyTickets = new RT::Tickets ($session{'CurrentUser'}); +$MyTickets->LimitOwner(VALUE => $session{'CurrentUser'}->Id); +$MyTickets->LimitStatus(VALUE => "open"); +$MyTickets->LimitStatus(VALUE => "new"); +$MyTickets->OrderBy(FIELD => 'Priority', ORDER => 'DESC'); +$MyTickets->RowsPerPage(25); + +</%INIT> diff --git a/rt/webrt/Elements/Quicksearch b/rt/webrt/Elements/Quicksearch new file mode 100644 index 000000000..d44c996fa --- /dev/null +++ b/rt/webrt/Elements/Quicksearch @@ -0,0 +1,41 @@ +<& /Elements/TitleBoxStart, title => "Find new/open tickets", titleright => "<A class='inverse' href=\"$RT::WebPath/Search/Listing.html?NewSearch=1\">Advanced Search</A>" &> + +<TABLE BORDER=0 cellspacing=0 cellpadding=1 WIDTH=100%> +<tr> + <th align=left>Queue</th> + <th align=left><font size=-1>New</font></th> + <th align=left><font size=-1>Open</font></th> + <th align=left><font size=-1>Stalled</font></th> +</tr> + +<%PERL> +while (my $queue = $Queues->Next) { + $Tickets->ClearRestrictions; + $Tickets->LimitStatus(VALUE => "open"); + $Tickets->LimitQueue(VALUE => $queue->id, OPERATOR => '='); + my $open = $Tickets->Count(); + + $Tickets->ClearRestrictions; + $Tickets->LimitStatus(VALUE => "new"); + $Tickets->LimitQueue(VALUE => $queue->id, OPERATOR => '='); + my $new = $Tickets->Count(); + + $Tickets->ClearRestrictions; + $Tickets->LimitStatus(VALUE => "stalled"); + $Tickets->LimitQueue(VALUE => $queue->id, OPERATOR => '='); + my $stalled = $Tickets->Count(); +</%PERL> +<TR><TD><A HREF="<% $RT::WebPath%>/Search/Listing.html?ValueOfStatus=open&ValueOfStatus=new&StatusOp=%3D&QueueOp=%3D&ValueOfQueue=<%$queue->Id%>&RowsPerPage=50&NewSearch=1"><%$queue->Name%></a></TD> +<TD><%$new%></TD> +<TD><%$open%></TD> +<TD><%$stalled%></TD> +</TR> +% } +</TABLE> +<& /Elements/TitleBoxEnd &> + +<%INIT> +my $Queues = new RT::Queues($session{'CurrentUser'}); +$Queues->UnLimit(); +my $Tickets = new RT::Tickets ($session{'CurrentUser'}); +</%INIT> diff --git a/rt/webrt/Elements/Refresh b/rt/webrt/Elements/Refresh new file mode 100644 index 000000000..6949d8c24 --- /dev/null +++ b/rt/webrt/Elements/Refresh @@ -0,0 +1,22 @@ +<SELECT NAME="<%$Name%>"> +<OPTION VALUE="-1" +%unless ($Default) { + SELECTED +%} +>Don't refresh this page.</OPTION> +%foreach my $value (@refreshevery) { +<OPTION VALUE="<%$value%>" +% if ($value == $Default) { +SELECTED +% } +>Refresh this page every <%$value/60%> minutes. +%} +</SELECT> + +<%INIT> +my @refreshevery = qw(120 300 600 1200 3600 7200); +</%INIT> +<%ARGS> +$Name => undef +$Default => undef +</%ARGS> diff --git a/rt/webrt/Elements/Section b/rt/webrt/Elements/Section new file mode 100755 index 000000000..067311d9e --- /dev/null +++ b/rt/webrt/Elements/Section @@ -0,0 +1,11 @@ +<TABLE WIDTH=100%> +<TR> +<TD> +<font size=+4><%$title%></font> +</TD> +</TR> +</TABLE> + +<%ARGS> +$title => undef +</%ARGS>
\ No newline at end of file diff --git a/rt/webrt/Elements/SelectBoolean b/rt/webrt/Elements/SelectBoolean new file mode 100755 index 000000000..93b78ce76 --- /dev/null +++ b/rt/webrt/Elements/SelectBoolean @@ -0,0 +1,24 @@ +%# $Header: /home/cvs/cvsroot/freeside/rt/webrt/Elements/Attic/SelectBoolean,v 1.1 2002-08-12 06:17:08 ivan Exp $ +<SELECT NAME ="<%$Name%>"> +<OPTION VALUE="<%$TrueVal%>" <%$TrueDefault%>><%$True%></OPTION> +<OPTION VALUE="<%$FalseVal%>" <%$FalseDefault%>><%$False%></OPTION> +</SELECT> + +<%ARGS> +$Name => undef +$True => "is" +$Default => 'true' +$TrueVal => 1 +$FalseVal => 0 +$False => "isn't" +</%ARGS> + +<%INIT> +my ($TrueDefault, $FalseDefault); +if ($Default && $Default !~ /true/i) { + $FalseDefault = "SELECTED"; +} +else { + $TrueDefault = "SELECTED"; +} +</%INIT> diff --git a/rt/webrt/Elements/SelectDate b/rt/webrt/Elements/SelectDate new file mode 100755 index 000000000..6fafbf170 --- /dev/null +++ b/rt/webrt/Elements/SelectDate @@ -0,0 +1,25 @@ +<INPUT NAME="<%$Name%>" VALUE="<%$Default%>" size=16> + +<%init> +unless ((defined $Default) or + ($current <= 0)) { + my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = + localtime($current); + $Default = sprintf("%04d-%02d-%02d %02d:%02d", + $year+1900,$mon+1,$mday, + $hour,$min); +} + +unless ($Name) { + $Name = $menu_prefix. "_Date"; +} +</%init> + +<%args> + +$ShowTime => undef +$menu_prefix=>'' +$current=>time +$Default => undef +$Name => undef +</%args> diff --git a/rt/webrt/Elements/SelectDateRelation b/rt/webrt/Elements/SelectDateRelation new file mode 100755 index 000000000..c5849c8e2 --- /dev/null +++ b/rt/webrt/Elements/SelectDateRelation @@ -0,0 +1,14 @@ +%# $Header: /home/cvs/cvsroot/freeside/rt/webrt/Elements/Attic/SelectDateRelation,v 1.1 2002-08-12 06:17:08 ivan Exp $ +<SELECT NAME ="<%$Name%>"> +<OPTION VALUE="<"><%$Before%></OPTION> +<OPTION VALUE="="><%$On%></OPTION> +<OPTION VALUE=">"><%$After%></OPTION> +</SELECT> + +<%ARGS> +$Name => undef +$Default => undef +$Before => 'Before' +$On => 'On' +$After => 'After' +</%ARGS> diff --git a/rt/webrt/Elements/SelectDateType b/rt/webrt/Elements/SelectDateType new file mode 100755 index 000000000..65c0e9b4b --- /dev/null +++ b/rt/webrt/Elements/SelectDateType @@ -0,0 +1,12 @@ +<SELECT NAME="<%$Name%>"> +<OPTION VALUE="Created">Created</OPTION> +<OPTION VALUE="Started">Started</OPTION> +<OPTION VALUE="Resolved">Resolved</OPTION> +<OPTION VALUE="Told">Last Contacted</OPTION> +<OPTION VALUE="LastUpdated">Last Updated</OPTION> +<OPTION VALUE="StartsBy">Starts By</OPTION> +<OPTION VALUE="Due">Due</OPTION> +</SELECT> +<%ARGS> +$Name => 'DateType' +</%ARGS> diff --git a/rt/webrt/Elements/SelectEqualityOperator b/rt/webrt/Elements/SelectEqualityOperator new file mode 100755 index 000000000..f93dc1af2 --- /dev/null +++ b/rt/webrt/Elements/SelectEqualityOperator @@ -0,0 +1,18 @@ +%# $Header: /home/cvs/cvsroot/freeside/rt/webrt/Elements/Attic/SelectEqualityOperator,v 1.1 2002-08-12 06:17:08 ivan Exp $ +<SELECT NAME ="<%$Name%>"> +% while (my $option = shift @Options) { +% my $value = shift @Values; +<OPTION VALUE="<%$value%>" +% if ($Default eq '$value') { +SELECTED +% } +><%$option%></OPTION> +% } +</SELECT> + +<%ARGS> +$Name => undef +@Options => ('less than', 'equal to', 'greater than', 'not equal to') +@Values => qw(< = > !=) +$Default => undef +</%ARGS> diff --git a/rt/webrt/Elements/SelectKeyword b/rt/webrt/Elements/SelectKeyword new file mode 100644 index 000000000..c4bd9e1aa --- /dev/null +++ b/rt/webrt/Elements/SelectKeyword @@ -0,0 +1,38 @@ +<SELECT NAME=<%$Name%> <%$Size%> <%$Multiple%>> +<OPTION VALUE="">-</OPTION> +<OPTION VALUE="NULL">(empty)</OPTION> +% foreach my $kid ( keys %{$Descendents} ) { +<OPTION VALUE="<% $kid %>" +%if ($kid == $Default) { +SELECTED +%} +><% $Descendents->{$kid} %></OPTION> +% } +</SELECT> + + +<%INIT> + +unless (defined $KeywordObj) { + $KeywordObj = new RT::Keyword($session{'CurrentUser'}); + $KeywordObj->Load($Root); +} +my $Descendents = $KeywordObj->Descendents(); + +if ($Multiple) { + $Multiple = "MULTIPLE"; +} +if ($Size) { + $Size="SIZE=$Size"; +} + + +</%INIT> +<%ARGS> +$Multiple => undef +$Size => undef +$Name => 'Keyword' +$KeywordObj => undef +$Root => 0 +$Default => undef +</%ARGS> diff --git a/rt/webrt/Elements/SelectKeywordOptions b/rt/webrt/Elements/SelectKeywordOptions new file mode 100644 index 000000000..f56dfe52c --- /dev/null +++ b/rt/webrt/Elements/SelectKeywordOptions @@ -0,0 +1,18 @@ +<PERL> +while (my $keyword = $keywords->Next()) { + my ($selected); + if $keyword->Id == $default +</PERL> +<OPTION VALUE="<%$keyword->id%>"><% '-' x $depth %><%$keyword->Name%></OPTION> +<& SelectKeywordOptions, depth => ($depth+1), root => $keyword->id &> +%} +<%INIT> + +my $keywords = new RT::Keywords($session{'CurrentUser'}); +$keywords->LimitToParent($root); + +</%INIT> +<%ARGS> +$root => undef +$depth => 0 +</%ARGS>
\ No newline at end of file diff --git a/rt/webrt/Elements/SelectLinkType b/rt/webrt/Elements/SelectLinkType new file mode 100644 index 000000000..22cde3dff --- /dev/null +++ b/rt/webrt/Elements/SelectLinkType @@ -0,0 +1,16 @@ +%# $Header: /home/cvs/cvsroot/freeside/rt/webrt/Elements/Attic/SelectLinkType,v 1.1 2002-08-12 06:17:08 ivan Exp $ + +<SELECT NAME ="<%$Name%>"> +% foreach ('MemberOf', 'DependsOn', 'RefersTo') { # TODO: Merging! +<OPTION VALUE="<%$_%>"><%$_%></OPTION> +% } +</SELECT> + +<%ARGS> +$Name => "LinkType" +$Default => undef +</%ARGS> + +<%INIT> +# TODO handle Default +</%INIT> diff --git a/rt/webrt/Elements/SelectMatch b/rt/webrt/Elements/SelectMatch new file mode 100644 index 000000000..7f3a94fae --- /dev/null +++ b/rt/webrt/Elements/SelectMatch @@ -0,0 +1,31 @@ +%# $Header: /home/cvs/cvsroot/freeside/rt/webrt/Elements/Attic/SelectMatch,v 1.1 2002-08-12 06:17:08 ivan Exp $ +<SELECT NAME ="<%$Name%>"> +<OPTION VALUE="LIKE" <%$LikeDefault%>><%$Like%></OPTION> +<OPTION VALUE="NOT LIKE" <%$NotLikeDefault%>><%$NotLike%></OPTION> +<OPTION VALUE="=" <%$TrueDefault%>><%$True%></OPTION> +<OPTION VALUE="!=" <%$FalseDefault%>><%$False%></OPTION> +</SELECT> + +<%ARGS> +$Name => undef +$Like => 'contains' +$NotLike => "doesn't contain" +$True => 'is' +$False => "isn't" +$Default => undef +</%ARGS> +<%INIT> +my ($TrueDefault, $FalseDefault, $LikeDefault, $NotLikeDefault); +if ($Default && $Default !~ /true/i) { + $FalseDefault = "SELECTED"; +} +elsif ($Default && $Default !~ /false/i) { + $TrueDefault = "SELECTED"; +} +elsif ($Default && $Default !~ /notlike/i) { + $NotLikeDefault = "SELECTED"; +} +else { + $LikeDefault = "SELECTED"; +} +</%INIT> diff --git a/rt/webrt/Elements/SelectNewTicketQueue b/rt/webrt/Elements/SelectNewTicketQueue new file mode 100755 index 000000000..9f5cd2871 --- /dev/null +++ b/rt/webrt/Elements/SelectNewTicketQueue @@ -0,0 +1,9 @@ +%# $Header: /home/cvs/cvsroot/freeside/rt/webrt/Elements/Attic/SelectNewTicketQueue,v 1.1 2002-08-12 06:17:08 ivan Exp $ +<& SelectQueue, Name => $Name, Verbose => $Verbose, Default => $Default, + ShowAllQueues => 0, ShowNullOption => 0 &> + +<%ARGS> +$Name => 'Queue' +$Verbose => undef +$Default => undef +</%ARGS> diff --git a/rt/webrt/Elements/SelectOwner b/rt/webrt/Elements/SelectOwner new file mode 100755 index 000000000..59ebf3631 --- /dev/null +++ b/rt/webrt/Elements/SelectOwner @@ -0,0 +1,22 @@ +<SELECT NAME="<%$Name%>"> +<OPTION VALUE="">-</OPTION> +<OPTION <% ($RT::Nobody->Id() == $Default) && "SELECTED" %> VALUE="<%$RT::Nobody->Id%>"><%$RT::Nobody->Name%></OPTION> +%while ( my $User = $Users->Next()) { +% if ((!defined $QueueObj) || ($User->HasQueueRight(Right => 'OwnTicket', QueueObj => $QueueObj, TicketObj => $TicketObj))){ +<OPTION VALUE="<%$User->Id()%>" <% ($User->Id() == $Default) && "SELECTED" %>><%$User->Name()%></OPTION> +% } +%} +</SELECT> + +<%INIT> +my $Users = RT::Users->new($session{CurrentUser}); +$Users->LimitToPrivileged; +</%INIT> + +<%ARGS> +$QueueObj => undef +$Name => undef +$Default => undef +$User => undef +$TicketObj => undef +</%ARGS> diff --git a/rt/webrt/Elements/SelectQueue b/rt/webrt/Elements/SelectQueue new file mode 100755 index 000000000..d63b17b4e --- /dev/null +++ b/rt/webrt/Elements/SelectQueue @@ -0,0 +1,38 @@ +%# $Header: /home/cvs/cvsroot/freeside/rt/webrt/Elements/Attic/SelectQueue,v 1.1 2002-08-12 06:17:08 ivan Exp $ + +% if ($Lite) { +<INPUT NAME="<%$Name%>" size=25 DEFAULT="<%$d->Name%>"> +% } else { +<SELECT NAME ="<%$Name%>"> +% if ($ShowNullOption) { +<OPTION VALUE="">-</OPTION> +% } +% while (my $queue=$q->Next) { +% if ($ShowAllQueues || $queue->CurrentUserHasRight('CreateTicket')) { +<OPTION VALUE="<%$queue->Id%>" <%($queue->Id == $Default) && 'SELECTED'%>><%$queue->Name%> +% if (($Verbose) and ($queue->Description) ){ +(<%$queue->Description%>) +% } +</OPTION> +% } +% } +</SELECT> +% } +<%ARGS> +$ShowNullOption => 1 +$ShowAllQueues => 1 +$Name => undef +$Verbose => undef +$Default => undef +$Lite => 0 +</%ARGS> + +<%INIT> + +my $q=new RT::Queues($session{'CurrentUser'}); +$q->UnLimit; + +my $d = new RT::Queue($session{'CurrentUser'}); +$d->Load($Default); + +</%INIT> diff --git a/rt/webrt/Elements/SelectResultsPerPage b/rt/webrt/Elements/SelectResultsPerPage new file mode 100644 index 000000000..0699c6868 --- /dev/null +++ b/rt/webrt/Elements/SelectResultsPerPage @@ -0,0 +1,22 @@ +%# $Header: /home/cvs/cvsroot/freeside/rt/webrt/Elements/Attic/SelectResultsPerPage,v 1.1 2002-08-12 06:17:08 ivan Exp $ + +%# TODO: Better default handling + +<SELECT NAME ="<%$Name%>"> +% foreach my $value (@values) { +<OPTION VALUE="<%$value%>" <% $value == $Default && 'SELECTED' %>> +<% shift @labels %> +</OPTION> +% } +</SELECT> + +<%INIT> +my @values = qw(0 10 25 50 100); +my @labels = qw(Unlimited 10 25 50 100); +</%INIT> +<%ARGS> + +$Name => undef +$Default => 50 + +</%ARGS> diff --git a/rt/webrt/Elements/SelectSortOrder b/rt/webrt/Elements/SelectSortOrder new file mode 100644 index 000000000..6dc900631 --- /dev/null +++ b/rt/webrt/Elements/SelectSortOrder @@ -0,0 +1,18 @@ +<SELECT NAME="<%$Name%>"> +%foreach my $order (@orders) { +<OPTION VALUE="<%$order%>" <%$order eq $Default && 'SELECTED' %>> +<% shift @order_names %> +</OPTION> +% } +</SELECT> + +<%INIT> +my @orders = qw (ASC DESC); +my @order_names = qw (Ascending Descending); + +</%INIT> + +<%ARGS> +$Name => 'SortOrder' +$Default => 'ASC' +</%ARGS> diff --git a/rt/webrt/Elements/SelectStatus b/rt/webrt/Elements/SelectStatus new file mode 100755 index 000000000..92df7c619 --- /dev/null +++ b/rt/webrt/Elements/SelectStatus @@ -0,0 +1,17 @@ +%# $Header: /home/cvs/cvsroot/freeside/rt/webrt/Elements/Attic/SelectStatus,v 1.1 2002-08-12 06:17:08 ivan Exp $ + +<SELECT NAME ="<%$Name%>"> +<OPTION VALUE="">-</OPTION> +%foreach my $status (@status) { +<OPTION VALUE="<%$status%>" <%($Default eq $status) && 'SELECTED'%>><%$status%></OPTION> +% } +</SELECT> +<%ONCE> +my $queue = new RT::Queue($session{'CurrentUser'}); +my @status = $queue->StatusArray(); +</%ONCE> +<%ARGS> +$Name => undef +$Default => undef + +</%ARGS> diff --git a/rt/webrt/Elements/SelectTicketSortBy b/rt/webrt/Elements/SelectTicketSortBy new file mode 100644 index 000000000..02021decc --- /dev/null +++ b/rt/webrt/Elements/SelectTicketSortBy @@ -0,0 +1,15 @@ +<SELECT NAME="<%$Name%>"> +% foreach my $field (@sortfields) { +<OPTION VALUE="<%$field%>" <%$field eq $Default && 'SELECTED'%>><%$field%></OPTION> +% } +</SELECT> + +<%INIT> +my $tickets = new RT::Tickets($session{'CurrentUser'}); +my @sortfields = $tickets->SortFields(); + +</%INIT> +<%ARGS> +$Name => 'SortTicketsBy' +$Default => 'id' +</%ARGS> diff --git a/rt/webrt/Elements/SelectUsers b/rt/webrt/Elements/SelectUsers new file mode 100755 index 000000000..f517d3510 --- /dev/null +++ b/rt/webrt/Elements/SelectUsers @@ -0,0 +1,8 @@ +<select name="UserField"> +<option value="Name">User Id +<option value="EmailAddress">Email +<option value="RealName">Name +<option value="Organization">Organization +</select> +<& /Elements/SelectMatch, Name=> 'UserOp' &> +<input size=8 name="UserString"> diff --git a/rt/webrt/Elements/SelectWatcherType b/rt/webrt/Elements/SelectWatcherType new file mode 100644 index 000000000..5a855192c --- /dev/null +++ b/rt/webrt/Elements/SelectWatcherType @@ -0,0 +1,26 @@ +%# $Header: /home/cvs/cvsroot/freeside/rt/webrt/Elements/Attic/SelectWatcherType,v 1.1 2002-08-12 06:17:08 ivan Exp $ +%# portions Copyright 2000 Tobias Brox <tobix@fsck.com> +%# Request Tracker is Copyright 1996-2000 Jesse Vincent <jesse@fsck.com> + +<SELECT NAME ="<%$Name%>"> +<OPTION VALUE="none">-</OPTION> +%# Make nice options: +%for my $option (@types) { +<OPTION VALUE="<%$option%>" <%$option eq $Default && "SELECTED"%>><%$option%></OPTION> +%} +</SELECT> + +<%INIT> +my @types; +if ($Scope =~ 'queue') { + @types = qw(Cc AdminCc); +} +else { + @types = qw(Requestor Cc AdminCc); +} +</%INIT> +<%ARGS> +$Default=>undef +$Scope => 'ticket' +$Name => 'WatcherType' +</%ARGS> diff --git a/rt/webrt/Elements/ShadedBox b/rt/webrt/Elements/ShadedBox new file mode 100755 index 000000000..334b57975 --- /dev/null +++ b/rt/webrt/Elements/ShadedBox @@ -0,0 +1,5 @@ +<div align="left"><span class=label><%$title |n %></span><br><b><%$content |n %></b></div> +<%ARGS> +$title => undef +$content => " " +</%ARGS> diff --git a/rt/webrt/Elements/Submit b/rt/webrt/Elements/Submit new file mode 100755 index 000000000..7b75e9e98 --- /dev/null +++ b/rt/webrt/Elements/Submit @@ -0,0 +1,44 @@ +<TABLE WIDTH=100% BGCOLOR="<%$color%>" CELLSPACING=0 BORDER=0 CELLPADDING=0 > +<TR> +% if ($Reset) { +<TD> +<FONT COLOR=#ffd800 > +<INPUT TYPE=RESET VALUE="<%$ResetLabel%>"> +</FONT> +</TD> +%} +<TD> + +</TD> +<TD ALIGN=RIGHT VALIGN=CENTER> + +<FONT COLOR=#ffd800> + +% if ($AlternateLabel) { +<B><%$AlternateCaption%> +<INPUT TYPE=SUBMIT +%if ($Name) { +NAME="<%$Name%>" +%} +VALUE='<%$AlternateLabel%>'></B> +% } + +<B><%$Caption%> +<INPUT TYPE=SUBMIT +%if ($Name) { +NAME="<%$Name%>" +% } + VALUE='<%$Label%>'></B></FONT> +</TD> +</TR> +</TABLE> +<%ARGS> +$color => "#336699" +$Caption => undef +$AlternateCaption => undef +$AlternateLabel => undef +$Label => 'Submit' +$Name => undef +$Reset => undef +$ResetLabel => 'Reset' +</%ARGS> diff --git a/rt/webrt/Elements/Tabs b/rt/webrt/Elements/Tabs new file mode 100755 index 000000000..6eacf391a --- /dev/null +++ b/rt/webrt/Elements/Tabs @@ -0,0 +1,133 @@ +<TABLE WIDTH=100%> + <TR> + <TD VALIGN=TOP> + <TABLE cellspacing=1> + <TR> +% foreach $tab (sort keys %{$toptabs}) { + <TD ALIGN=CENTER> + <font size=+1> + [<A +% if ($current_toptab eq $toptabs->{$tab}->{'path'}) { +class='currenttab' +% } + HREF="<%$RT::WebPath%>/<% $toptabs->{$tab}->{'path'}%>"><% $toptabs->{$tab}->{'title'}%></A>] + + + </font> + </TD> +% } + </TR> + </TABLE> +<BR> +% if ($tabs_scalar) { +<% $tabs_scalar |n%> +% } +% if ($tabs) { + + <TABLE CELLSPACING=0 CELLPADDING=0 BORDER=0> + <TR> +% foreach $tab (sort keys %{$tabs}) { + <TD ALIGN=CENTER VALIGN=TOP> +[<A +% if ($current_tab eq $tabs->{$tab}->{'path'}) { +class='currenttab' +% } +HREF="<%$RT::WebPath%>/<% $tabs->{$tab}->{'path'}%>"><% $tabs->{$tab}->{'title'}%></A>]</TD> +%} + </TR> + </TABLE> +%} + +<BR> +% if ($subtabs_scalar) { +<% $subtabs_scalar |n%> +% } +% if ($subtabs) { + <TABLE> + <TR> +% foreach $tab (sort keys %{$subtabs}) { + <TD ALIGN=CENTER> + [<A HREF="<%$RT::WebPath%>/<% $subtabs->{$tab}->{'path'}%>"><% $subtabs->{$tab}->{'title'}%></A>] + </TD> +%} + </TR> + </TABLE> +%} + </TD> + <TD VALIGN=TOP ALIGN=RIGHT> +<TABLE> +<TR> + +% foreach $action (sort keys %{$topactions}) { +<TD><font size=-1><%$topactions->{"$action"}->{'html'} |n %></font></TD> +% } +</TR> +</TABLE> + + + +% if ($actions) { +<TABLE><TR> +% foreach $action (sort keys %{$actions}) { +<TD> +<FONT SIZE=-1> +% if ($actions->{"$action"}->{'html'}) { +<%$actions->{"$action"}->{'html'} |n%> +% } else { +<A HREF="<%$RT::WebPath%>/<% $actions->{$action}->{'path'}%>"><% $actions->{$action}->{'title'}%></A> +% } +</FONT> +</TD> +% } +</TR></TABLE> +% } + +% if ($subactions_scalar) { +<% $subactions_scalar |n%> +% } +% if ($subactions) { +<BR>| +% foreach $action (sort keys %{$subactions}) { +<%$subactions->{"$action"}->{'html'} |n%> | +% } +% } + </TD> + </TR> + </TABLE> + + +<%INIT> +my ($tab, $action); +my $toptabs = { A => { title => 'Home', + path => '', + }, + B => { title => 'Search', + path => 'Search/Listing.html' + }, + + D => { title => 'Configuration', + path => 'Admin/' + } + }; + + +my $topactions = { + A => { html => $m->scomp('/Elements/CreateTicket') + }, + B => { html => $m->scomp('/Elements/GotoTicket') + } + }; +</%INIT> +<%ARGS> +$current_toptab => "none" +$current_tab => "none" +$current_subtab => "none" +$tabs => undef +$tabs_scalar => undef +$subtabs => undef +$actions => undef +$subactions => undef +$subtabs_scalar => undef +$subactions_scalar => undef +</%ARGS> + diff --git a/rt/webrt/Elements/TitleBoxEnd b/rt/webrt/Elements/TitleBoxEnd new file mode 100755 index 000000000..bdd41065a --- /dev/null +++ b/rt/webrt/Elements/TitleBoxEnd @@ -0,0 +1,10 @@ +</TD></TR></TABLE> +</TD> +</TR> +<TR><TD COLSPAN=4><IMG SRC="<%$RT::WebImagesURL%>spacer.gif" height=1 ALT=" "width=1></TD> +</TABLE> +<%ARGS> +$title => undef +$content => undef +</%ARGS> + diff --git a/rt/webrt/Elements/TitleBoxStart b/rt/webrt/Elements/TitleBoxStart new file mode 100755 index 000000000..6d0f1f91a --- /dev/null +++ b/rt/webrt/Elements/TitleBoxStart @@ -0,0 +1,20 @@ +<TABLE CLASS="<%$class%>" BGCOLOR="<%$color%>" CELLSPACING=0 BORDER=0 CELLPADDING=0 WIDTH="<%$width%>"> +<TR><TD ROWSPAN=2><IMG SRC="<%$RT::WebImagesURL%>spacer.gif" width=1 height=1 ALT=""></TD> +<TD valign=middle align=left bgcolor="<%$color%>"> <font size=-1 color="#ffffff"><b><% $title_href && "<A CLASS=\"$title_class\" HREF=\"$title_href\">"|n%><%$title |n %><% $title_href && "</A>" |n%></b></font></TD> +<TD ALIGN="right" valign=middle bgcolor="<%$color%>"><FONT color="#ffffff" SIZE=-1><%$titleright |n %></FONT> </TD> +<TD ROWSPAN=2><IMG SRC="<%$RT::WebImagesURL%>spacer.gif" width=1 height=1 ALT=""></TD></TR> +<TR><TD COLSPAN=2 bgcolor="<%$contentbg%>" valign=top align=left WIDTH=100%> +<TABLE CELLPADDING=2 WIDTH=100%><TR><TD> +<%ARGS> +$width => "100%" +$class => undef + +$title_href => undef +$title => undef +$title_class => undef + +$titleright_href => undef +$titleright => undef +$contentbg => "#dddddd" +$color => "#336699" +</%ARGS> diff --git a/rt/webrt/Elements/ViewUser b/rt/webrt/Elements/ViewUser new file mode 100644 index 000000000..92446e6ef --- /dev/null +++ b/rt/webrt/Elements/ViewUser @@ -0,0 +1,29 @@ + +<& /Elements/TitleBoxStart, + title => "<a class='inverse' href=\"$RT::WebPath/Search/Listing.html?LimitRequestorById=1&IdOfRequestor=".$User->id."\">Tickets from $name</a>", + titleright=> "<a class='inverse' href=\"$RT::WebPath/EditUserComments.html?id=".$User->id."\">Comments about $name</a>" &> +<TABLE WIDTH="100%"> +<tr> +<td halign=left valign=top> +%while (my $w=$tickets->Next) { +<%$w->Id%>: <a href="<%$RT::WebPath%>/Ticket/Display.html?id=<%$w->id%>"><%$w->Subject%></a> (<%$w->Status%>)<BR> +%} +</td> +<td align=right valign=top> + <% ($User->Comments || "No comment entered about this user") %> +</tr> +</table> +<& /Elements/TitleBoxEnd &> + +<%ARGS> +$User=>undef +</%ARGS> + +<%INIT> +my $name=$User->RealName || $User->EmailAddress; + +my $tickets = new RT::Tickets($session{'CurrentUser'}); +$tickets->LimitRequestor(VALUE => $User->EmailAddress); + + +</%INIT> diff --git a/rt/webrt/Elements/dayMenu b/rt/webrt/Elements/dayMenu new file mode 100755 index 000000000..6591b05d2 --- /dev/null +++ b/rt/webrt/Elements/dayMenu @@ -0,0 +1,19 @@ +<%doc>------------------------------------------------------------------- +dayMenu: Display a pulldown menu of days of the month (1 to 31) + +Optional arguments: +$menu_name - Name of menu, defaults to 'day' +$current - Selected day value (1 to 31) +-------------------------------------------------------------------</%doc> + +<select name="<% $menu_name %>"> +<option value="-1">- +% foreach my $day (1..31) { +<option value="<% $day %>" <% $day==$current ? "selected" : "" %>><% sprintf("%02d",$day) %> +% } +</select> + +<%args> +$menu_name=>'day' +$current=>undef +</%args> diff --git a/rt/webrt/Elements/monthMenu b/rt/webrt/Elements/monthMenu new file mode 100755 index 000000000..b9a71d3f9 --- /dev/null +++ b/rt/webrt/Elements/monthMenu @@ -0,0 +1,37 @@ +<%doc>------------------------------------------------------------------- +monthMenu: Display a pulldown menu of months + +Optional arguments: +$menu_name - Name of menu, defaults to 'month' +$current - Selected month value (1 to 12) +$format - Choice of month labels: + 'full' (January, February, ...) + 'short' (Jan, Feb, ...) + 'numeric' (1, 2, ...) + Defaults to 'full'. The format only affects appearance; the menu + values are always numeric. +-------------------------------------------------------------------</%doc> + +<select name="<% $menu_name %>"> +<option value="-1">- +% foreach my $month (1..12) { +<option value="<% $month %>" <% $month==$current ? "selected" : "" %>> +% if ($format eq 'full') { +<% $month_names[$month-1] %> +% } elsif ($format eq 'short') { +<% substr($month_names[$month-1],0,3) %> +% } elsif ($format eq 'numeric') { +<% sprintf("%02d",$month) %> +% } +% } +</select> + +<%init> +my @month_names = qw(January February March April May June July August September October November December); +</%init> + +<%args> +$menu_name=>'month' +$current=>undef +$format=>'full' +</%args> diff --git a/rt/webrt/Elements/yearMenu b/rt/webrt/Elements/yearMenu new file mode 100755 index 000000000..4a0e7a772 --- /dev/null +++ b/rt/webrt/Elements/yearMenu @@ -0,0 +1,24 @@ +<%doc>------------------------------------------------------------------- +yearMenu: Display a pulldown menu of years. + +Optional arguments: +$menu_name - Name of menu, defaults to 'year' +$current - Selected year value +$min - Minimum year appearing in menu; defaults to current year +$max - Maximum year appearing in menus; defaults to $min plus 10. +-------------------------------------------------------------------</%doc> + +<select name="<% $menu_name %>"> +<option value="-1">- +% foreach my $year ($min..$max) { +<option value="<% $year %>" <% $year==$current ? "selected" : "" %>> +<% $year %> +% } +</select> + +<%args> +$menu_name=>'year' +$current=>(localtime)[5]+1900 +$min=>(localtime)[5]+1900-1 +$max=>$min+10 +</%args> |