From 945721f48f74d5cfffef7c7cf3a3d6bc2521f5dd Mon Sep 17 00:00:00 2001 From: ivan Date: Tue, 15 Jul 2003 13:16:32 +0000 Subject: import of rt 3.0.4 --- rt/html/Elements/BevelBoxRaisedEnd | 26 ++++++++ rt/html/Elements/BevelBoxRaisedStart | 26 ++++++++ rt/html/Elements/Callback | 65 +++++++++++++++++++ rt/html/Elements/Checkbox | 39 +++++++++++ rt/html/Elements/CreateTicket | 26 ++++++++ rt/html/Elements/Error | 62 ++++++++++++++++++ rt/html/Elements/Footer | 60 +++++++++++++++++ rt/html/Elements/GotoTicket | 24 +++++++ rt/html/Elements/Header | 82 +++++++++++++++++++++++ rt/html/Elements/ListActions | 43 ++++++++++++ rt/html/Elements/Login | 101 +++++++++++++++++++++++++++++ rt/html/Elements/Menu | 84 ++++++++++++++++++++++++ rt/html/Elements/MessageBox | 47 ++++++++++++++ rt/html/Elements/MyRequests | 78 ++++++++++++++++++++++ rt/html/Elements/MyTickets | 81 +++++++++++++++++++++++ rt/html/Elements/PageLayout | 99 ++++++++++++++++++++++++++++ rt/html/Elements/Quicksearch | 61 +++++++++++++++++ rt/html/Elements/Refresh | 45 +++++++++++++ rt/html/Elements/Section | 34 ++++++++++ rt/html/Elements/SelectAttachmentField | 31 +++++++++ rt/html/Elements/SelectBoolean | 46 +++++++++++++ rt/html/Elements/SelectCustomFieldOperator | 40 ++++++++++++ rt/html/Elements/SelectCustomFieldValue | 41 ++++++++++++ rt/html/Elements/SelectDate | 48 ++++++++++++++ rt/html/Elements/SelectDateRelation | 36 ++++++++++ rt/html/Elements/SelectDateType | 36 ++++++++++ rt/html/Elements/SelectEqualityOperator | 40 ++++++++++++ rt/html/Elements/SelectGroups | 29 +++++++++ rt/html/Elements/SelectLinkType | 37 +++++++++++ rt/html/Elements/SelectMatch | 53 +++++++++++++++ rt/html/Elements/SelectNewTicketQueue | 56 ++++++++++++++++ rt/html/Elements/SelectOwner | 59 +++++++++++++++++ rt/html/Elements/SelectQueue | 59 +++++++++++++++++ rt/html/Elements/SelectResultsPerPage | 43 ++++++++++++ rt/html/Elements/SelectSortOrder | 41 ++++++++++++ rt/html/Elements/SelectStatus | 37 +++++++++++ rt/html/Elements/SelectTicketSortBy | 38 +++++++++++ rt/html/Elements/SelectTicketTypes | 34 ++++++++++ rt/html/Elements/SelectUsers | 31 +++++++++ rt/html/Elements/SelectWatcherType | 44 +++++++++++++ rt/html/Elements/SetupSessionCookie | 77 ++++++++++++++++++++++ rt/html/Elements/ShadedBox | 33 ++++++++++ rt/html/Elements/ShadedInputRow | 35 ++++++++++ rt/html/Elements/ShadedRow | 31 +++++++++ rt/html/Elements/SimpleSearch | 27 ++++++++ rt/html/Elements/Submit | 62 ++++++++++++++++++ rt/html/Elements/Tabs | 82 +++++++++++++++++++++++ rt/html/Elements/TitleBoxEnd | 31 +++++++++ rt/html/Elements/TitleBoxStart | 60 +++++++++++++++++ rt/html/Elements/ViewUser | 51 +++++++++++++++ 50 files changed, 2451 insertions(+) create mode 100644 rt/html/Elements/BevelBoxRaisedEnd create mode 100644 rt/html/Elements/BevelBoxRaisedStart create mode 100644 rt/html/Elements/Callback create mode 100644 rt/html/Elements/Checkbox create mode 100644 rt/html/Elements/CreateTicket create mode 100644 rt/html/Elements/Error create mode 100644 rt/html/Elements/Footer create mode 100644 rt/html/Elements/GotoTicket create mode 100644 rt/html/Elements/Header create mode 100644 rt/html/Elements/ListActions create mode 100644 rt/html/Elements/Login create mode 100644 rt/html/Elements/Menu create mode 100644 rt/html/Elements/MessageBox create mode 100644 rt/html/Elements/MyRequests create mode 100644 rt/html/Elements/MyTickets create mode 100644 rt/html/Elements/PageLayout create mode 100644 rt/html/Elements/Quicksearch create mode 100644 rt/html/Elements/Refresh create mode 100644 rt/html/Elements/Section create mode 100644 rt/html/Elements/SelectAttachmentField create mode 100644 rt/html/Elements/SelectBoolean create mode 100644 rt/html/Elements/SelectCustomFieldOperator create mode 100644 rt/html/Elements/SelectCustomFieldValue create mode 100644 rt/html/Elements/SelectDate create mode 100644 rt/html/Elements/SelectDateRelation create mode 100644 rt/html/Elements/SelectDateType create mode 100644 rt/html/Elements/SelectEqualityOperator create mode 100644 rt/html/Elements/SelectGroups create mode 100644 rt/html/Elements/SelectLinkType create mode 100644 rt/html/Elements/SelectMatch create mode 100644 rt/html/Elements/SelectNewTicketQueue create mode 100644 rt/html/Elements/SelectOwner create mode 100644 rt/html/Elements/SelectQueue create mode 100644 rt/html/Elements/SelectResultsPerPage create mode 100644 rt/html/Elements/SelectSortOrder create mode 100644 rt/html/Elements/SelectStatus create mode 100644 rt/html/Elements/SelectTicketSortBy create mode 100644 rt/html/Elements/SelectTicketTypes create mode 100644 rt/html/Elements/SelectUsers create mode 100644 rt/html/Elements/SelectWatcherType create mode 100644 rt/html/Elements/SetupSessionCookie create mode 100644 rt/html/Elements/ShadedBox create mode 100644 rt/html/Elements/ShadedInputRow create mode 100644 rt/html/Elements/ShadedRow create mode 100644 rt/html/Elements/SimpleSearch create mode 100644 rt/html/Elements/Submit create mode 100644 rt/html/Elements/Tabs create mode 100644 rt/html/Elements/TitleBoxEnd create mode 100644 rt/html/Elements/TitleBoxStart create mode 100644 rt/html/Elements/ViewUser (limited to 'rt/html/Elements') diff --git a/rt/html/Elements/BevelBoxRaisedEnd b/rt/html/Elements/BevelBoxRaisedEnd new file mode 100644 index 000000000..ebf45df0f --- /dev/null +++ b/rt/html/Elements/BevelBoxRaisedEnd @@ -0,0 +1,26 @@ +%# BEGIN LICENSE BLOCK +%# +%# Copyright (c) 1996-2003 Jesse Vincent +%# +%# (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 + + + diff --git a/rt/html/Elements/BevelBoxRaisedStart b/rt/html/Elements/BevelBoxRaisedStart new file mode 100644 index 000000000..c4e6c55bc --- /dev/null +++ b/rt/html/Elements/BevelBoxRaisedStart @@ -0,0 +1,26 @@ +%# BEGIN LICENSE BLOCK +%# +%# Copyright (c) 1996-2003 Jesse Vincent +%# +%# (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 + + + + + + + +
diff --git a/rt/html/Elements/Callback b/rt/html/Elements/Callback new file mode 100644 index 000000000..93ac4c01b --- /dev/null +++ b/rt/html/Elements/Callback @@ -0,0 +1,65 @@ +%# BEGIN LICENSE BLOCK +%# +%# Copyright (c) 1996-2003 Jesse Vincent +%# +%# (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 +<%once> +my (%cache, $check); + +<%init> +# checks for inode change time for each callback directory +my $new_check = join( + $;, map { $_->[1] => (stat("$_->[1]/Callbacks"))[10] } $m->interp->resolver->comp_root_array +) or return; + +$Page = $m->callers(1)->path unless ($Page); + +my $callbacks; +if ($new_check eq $check) { + $callbacks = $cache{$Page,$_CallbackName}; +} +else { + $check = $new_check; +} + +if (!$callbacks) { + my $path = "/Callbacks/*$Page/$_CallbackName"; + $callbacks = [ $m->interp->resolver->glob_path($path) ]; + @$callbacks = grep !/^\.|~$/, @$callbacks; #skip backup files + + #skip files without a package + my $invalid_base = "/Callbacks/$Page/$_CallbackName"; + @$callbacks = grep !/^$invalid_base$/, @$callbacks; + + + + $cache{$Page,$_CallbackName} = $callbacks; +} + +foreach my $comp (@$callbacks) { + $m->comp($comp, %ARGS) if $m->comp_exists($comp); +} +return(1); + +<%args> +$_CallbackName => 'Default' +$Page => undef + diff --git a/rt/html/Elements/Checkbox b/rt/html/Elements/Checkbox new file mode 100644 index 000000000..ae3d765c2 --- /dev/null +++ b/rt/html/Elements/Checkbox @@ -0,0 +1,39 @@ +%# BEGIN LICENSE BLOCK +%# +%# Copyright (c) 1996-2003 Jesse Vincent +%# +%# (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 +> + +<%ARGS> +$Name => undef +$Default => undef +$True => undef +$False => undef +$IsChecked => undef + + +<%INIT> +$IsChecked = + ($Default && $Default =~ /checked/i) + ? " CHECKED " : ""; +1; + diff --git a/rt/html/Elements/CreateTicket b/rt/html/Elements/CreateTicket new file mode 100644 index 000000000..7e1025d0a --- /dev/null +++ b/rt/html/Elements/CreateTicket @@ -0,0 +1,26 @@ +%# BEGIN LICENSE BLOCK +%# +%# Copyright (c) 1996-2003 Jesse Vincent +%# +%# (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 +
+<&|/l, $m->scomp('/Elements/SelectNewTicketQueue')&> [_1] +
diff --git a/rt/html/Elements/Error b/rt/html/Elements/Error new file mode 100644 index 000000000..dc44f125e --- /dev/null +++ b/rt/html/Elements/Error @@ -0,0 +1,62 @@ +%# BEGIN LICENSE BLOCK +%# +%# Copyright (c) 1996-2003 Jesse Vincent +%# +%# (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/Callback, %ARGS, error => $error &> +<& /Elements/Header, Code => $Code, Why => $Why &> +<& /Elements/Tabs &> +<& /Elements/TitleBoxStart, class=> "error", title => $Title &> +<%$Why%> +
+ +<%$Details%> + +<& /Elements/TitleBoxEnd &> + + + + +<%args> +$Code => undef +$Details => undef +$Title => loc("RT Error") +$Why => loc("the calling component did not specify why") + + +<%INIT> +my $error = "WebRT: $Why ($Details)"; + +# TODO: Log::Dispatch isn't UTF-8 safe. Autrijus needs to talk to dave rolsky about getting this fixed +if ($] >= 5.007001) { + require Encode; + Encode::_utf8_off($error); +} + +$RT::Logger->error($error); + +if ( $session{'SessionType'} eq 'REST' ) { + $r->content_type('text/plain'); + $m->out( "Error: " . $Why . "\n" ); + $m->out( $Details . "\n" ); + $m->abort(); +} + diff --git a/rt/html/Elements/Footer b/rt/html/Elements/Footer new file mode 100644 index 000000000..5c833f886 --- /dev/null +++ b/rt/html/Elements/Footer @@ -0,0 +1,60 @@ +%# BEGIN LICENSE BLOCK +%# +%# Copyright (c) 1996-2003 Jesse Vincent +%# +%# (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 +% if ($Menu) { +
+% } +<& /Elements/Callback, %ARGS &> +
+»|« <&|/l, $RT::VERSION &>RT [_1] from Best Practical Solutions, LLC. +
+% if ($Debug) { +
+<&|/l&>Time to display: <%Time::HiRes::tv_interval( $m->{'rt_base_time'} )%> +% } +% if ($Debug >= 2 ) { +% require Data::Dumper; +% my $d = Data::Dumper->new([\%ARGS], [qw(%ARGS)]); +
+<%$d->Dump() %>
+
+% } +% if ($Menu) { +
+ + + +% } + + +% $m->abort(); + +<%ARGS> +$Debug => 0 +$Menu => 1 + diff --git a/rt/html/Elements/GotoTicket b/rt/html/Elements/GotoTicket new file mode 100644 index 000000000..bb0c04dd1 --- /dev/null +++ b/rt/html/Elements/GotoTicket @@ -0,0 +1,24 @@ +%# BEGIN LICENSE BLOCK +%# +%# Copyright (c) 1996-2003 Jesse Vincent +%# +%# (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 +
 
diff --git a/rt/html/Elements/Header b/rt/html/Elements/Header new file mode 100644 index 000000000..0fd91a2e2 --- /dev/null +++ b/rt/html/Elements/Header @@ -0,0 +1,82 @@ +%# BEGIN LICENSE BLOCK +%# +%# Copyright (c) 1996-2003 Jesse Vincent +%# +%# (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 + + + +<%$Title%> +% if ($Refresh > 0) { + +% } + + + + + + + + + + + + +
   +% if ($session{'CurrentUser'} && $session{'CurrentUser'}->Id && $LoggedIn) { +<&|/l&>Skip Menu | +<&|/l&>Preferences +<& /Elements/Callback, %ARGS &> +% unless ($RT::WebExternalAuth and !$RT::WebFallbackToInternalAuth) { +| <&|/l&>Logout +% } +
+<&|/l, "".$session{'CurrentUser'}->Name."" &>Logged in as [_1] +% } else { +<&|/l&>Not logged in. +% } + +
+<%INIT> + +$r->header_out('Pragma' => 'no-cache'); +$r->header_out('Cache-control' => 'no-cache'); + + +<%ARGS> +$Prefs => '/User/Prefs.html' +$Focus => 'focus' +$Title => undef +$Code => undef +$Refresh => 0 +$Why => undef +$BgColor => '#ffffff' +$ShowBar => 1 +$LoggedIn => 1 +$URL => undef + diff --git a/rt/html/Elements/ListActions b/rt/html/Elements/ListActions new file mode 100644 index 000000000..ffa09e283 --- /dev/null +++ b/rt/html/Elements/ListActions @@ -0,0 +1,43 @@ +%# BEGIN LICENSE BLOCK +%# +%# Copyright (c) 1996-2003 Jesse Vincent +%# +%# (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 +% if ($actions[0] ) { +<& /Elements/TitleBoxStart, title => loc('Results') &> +
    +% foreach my $action (@actions) { +% next unless ($action); +% my $skip = 0; +% $m->comp('/Elements/Callback', _CallbackName => 'ModifyRow', row => \$action, skip => \$skip, %ARGS); +% next if $skip; +
  • <%$action%>
  • +% } +
+<& /Elements/TitleBoxEnd &> +
+% } +<%init> +@actions = grep (/./,@actions); + +<%ARGS> +@actions => undef + diff --git a/rt/html/Elements/Login b/rt/html/Elements/Login new file mode 100644 index 000000000..42c49c4af --- /dev/null +++ b/rt/html/Elements/Login @@ -0,0 +1,101 @@ +%# BEGIN LICENSE BLOCK +%# +%# Copyright (c) 1996-2003 Jesse Vincent +%# +%# (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 +<%INIT> +if ($m->request_comp->path =~ '^/REST/\d+\.\d+/') { + $r->content_type("text/plain"); + $m->error_format("text"); + $m->out("RT/$RT::VERSION 401 Credentials required\n"); + $m->out("\n$Error\n") if $Error; + $m->abort; +} + + +<& /Elements/Callback, %ARGS, _CallbackName => 'Header' &> +<& /Elements/Header, Title => loc('Login'), Focus => 'user' &> + +
+% if ($Error) { +<& /Elements/TitleBoxStart, title => loc('Error') &> +<% $Error %> +<& /Elements/TitleBoxEnd &> +% } +
+<& /Elements/TitleBoxStart, width=> "40%", titleright => loc("RT [_1]", $RT::VERSION), title => loc('Login') , +contentbg=>"#cccccc" &> + +% unless ($RT::WebExternalAuth and !$RT::WebFallbackToInternalAuth) { +
+ + + + + +
<&|/l&>Username:
<&|/l&>Password:
+ +
+ +%# Give callbacks a chance to add more control elements +<& /Elements/Callback, %ARGS &> + +<&/Elements/TitleBoxEnd&> +% # From mason 1.0.1 forward, this doesn't work. in fact, it breaks things. +% # But on Mason 1.15 it's fixed again, so we still use it. +% # 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}}) { + +% } +% } +% else { + +% } +% } +% } +
+% } +
+ +
+ +
+
+
+
+<&|/l, '2003'&>RT is © Copyright 1996-[_1] Jesse Vincent <jesse@bestpractical.com>. It is distributed under Version 2 of the GNU General Public License. + +<%ARGS> +$user => "" +$pass => undef +$goto => undef +$Error => undef + diff --git a/rt/html/Elements/Menu b/rt/html/Elements/Menu new file mode 100644 index 000000000..963be13bf --- /dev/null +++ b/rt/html/Elements/Menu @@ -0,0 +1,84 @@ +%# BEGIN LICENSE BLOCK +%# +%# Copyright (c) 1996-2003 Jesse Vincent +%# +%# (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 +%# font size depends on level +% if ($level ge 3) { +% $size = $basesize-(6); +% } elsif ($level gt 0) { +% $size = $basesize-($level * 2); +% $padding = 2; +% } +% else { +% $size = $basesize; +% $padding = 5; +% } +
    +% my $sep=0; +% my $accesskey="1"; +% foreach $tab (sort keys %{$toptabs}) { +% my $current = $current_toptab || ""; +% my $path = $toptabs->{$tab}->{'path'} || ""; +% $path =~ s#/index.html$##gi; +% $current =~ s#/index.html$##gi; +% if ( $path eq $current) { +% $class="currenttopnav" +% } else { +% $class="topnav" +% } +% my $style=""; +% if ($sep) { +% $style="border-top: solid #999 1px; padding-top: .1em; margin-top: .5em;"; +% } elsif ($level == 0 ) { +% $style="border-bottom: solid white 1px; padding-top: .25em; padding-bottom: .5em;" ; +% } +% if ($toptabs->{$tab}->{'separator'}) { +% $sep=1; +% } else { +% $sep=0; +% } +
  • +<% !$level && "accesskey='".$accesskey++."'" |n%>><% $toptabs->{$tab}->{'title'}%> +%# Second-level items +%# if ($current_toptab eq $toptabs->{$tab}->{'path'}) { +%# commented out by jesse on 4 jan 2003 so that tickets/search and ticket/# can +%# both have menu items +% if ($toptabs->{$tab}->{'subtabs'}) { + <& /Elements/Menu, level => $level+1, + current_toptab => $toptabs->{$tab}->{'current_subtab'}, + toptabs => $toptabs->{$tab}->{'subtabs'} &>
  • +% } +%# } +% } +
+ +<%INIT> +my ($tab, $subtab, $class, $size, $padding); +my $basesize=16; + + +<%ARGS> +$current_toptab => "" +$toptabs => undef +$level => 0 + diff --git a/rt/html/Elements/MessageBox b/rt/html/Elements/MessageBox new file mode 100644 index 000000000..64fdf38b7 --- /dev/null +++ b/rt/html/Elements/MessageBox @@ -0,0 +1,47 @@ +%# BEGIN LICENSE BLOCK +%# +%# Copyright (c) 1996-2003 Jesse Vincent +%# +%# (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 + +<%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; +} + + +<%ARGS> +$QuoteTransaction => undef +$Name => 'Content' +$Default => '' +$Width => 72 + + diff --git a/rt/html/Elements/MyRequests b/rt/html/Elements/MyRequests new file mode 100644 index 000000000..05ae62445 --- /dev/null +++ b/rt/html/Elements/MyRequests @@ -0,0 +1,78 @@ +%# BEGIN LICENSE BLOCK +%# +%# Copyright (c) 1996-2003 Jesse Vincent +%# +%# (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/TitleBoxStart, title => loc("[_1] highest priority tickets I requested...", $rows), bodyclass=> '' &> + + + + + + + + +% my $i; +% while (my $Ticket = $MyTickets->Next) { +% $i++; + + + + + + + +% } +
<&|/l&>#<&|/l&>Subject<&|/l&>Queue<&|/l&>Status<&|/l&>Owner
+<%$Ticket->Id%> + + +<%$Ticket->Subject || loc('(no subject)')%> + + +<%$Ticket->QueueObj->Name%> + +% if ($Ticket->HasUnresolvedDependencies ) { +% if ($Ticket->HasUnresolvedDependencies( Type => 'approval' )) { +<&|/l&>(pending approval) +% } else { +<&|/l&>(pending other tickets) +% } +% } else { +<%loc($Ticket->Status)%> +% } + +<%$Ticket->OwnerObj->Name%> +
+<& /Elements/TitleBoxEnd &> + + +<%INIT> +my $rows = 10; +my $MyTickets; +$MyTickets = new RT::Tickets ($session{'CurrentUser'}); +$MyTickets->LimitWatcher(TYPE => 'Requestor', VALUE => $session{'CurrentUser'}->EmailAddress); +$MyTickets->LimitStatus(VALUE => "open"); +$MyTickets->LimitStatus(VALUE => "new"); +$MyTickets->RowsPerPage($rows); +$MyTickets->OrderBy(FIELD => 'Priority', ORDER => 'DESC'); + + diff --git a/rt/html/Elements/MyTickets b/rt/html/Elements/MyTickets new file mode 100644 index 000000000..6e2ddc6c3 --- /dev/null +++ b/rt/html/Elements/MyTickets @@ -0,0 +1,81 @@ +%# BEGIN LICENSE BLOCK +%# +%# Copyright (c) 1996-2003 Jesse Vincent +%# +%# (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/TitleBoxStart, title => loc("[_1] highest priority tickets I own...", $rows), bodyclass=> '' &> + + + + + + + + + +% my $i; +% while (my $Ticket = $MyTickets->Next) { +% next if $Ticket->HasUnresolvedDependencies( Type => 'approval' ); +% last if $i++ >= $rows; + + + + + + + +% } +
<&|/l&>#<&|/l&>Subject<&|/l&>Queue<&|/l&>Status 
+<%$Ticket->Id%> + + +<%$Ticket->Subject || loc('(no subject)')%> + + +<%$Ticket->QueueObj->Name%> + +% if ($Ticket->HasUnresolvedDependencies ) { +% if ($Ticket->HasUnresolvedDependencies( Type => 'approval' ) or +% $Ticket->HasUnresolvedDependencies( Type => 'code' )) { +<&|/l&>(pending approval) +% } else { +<&|/l&>(pending other tickets) +% } +% } else { +<%loc($Ticket->Status)%> +% } + +[<&|/l&>Update] +
+<& /Elements/TitleBoxEnd &> + + +<%INIT> +my $rows = 10; +my $MyTickets; +$MyTickets = new RT::Tickets ($session{'CurrentUser'}); +$MyTickets->LimitOwner(VALUE => $session{'CurrentUser'}->Id); +$MyTickets->LimitStatus(VALUE => "open"); +$MyTickets->LimitStatus(VALUE => "new"); +$MyTickets->RowsPerPage($rows); +$MyTickets->OrderBy(FIELD => 'Priority', ORDER => 'DESC'); + + diff --git a/rt/html/Elements/PageLayout b/rt/html/Elements/PageLayout new file mode 100644 index 000000000..685317581 --- /dev/null +++ b/rt/html/Elements/PageLayout @@ -0,0 +1,99 @@ +%# BEGIN LICENSE BLOCK +%# +%# Copyright (c) 1996-2003 Jesse Vincent +%# +%# (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 + + + +% foreach my $action (sort keys %{$topactions}) { + +% } + +
<%$AppName%> + + <%$topactions->{"$action"}->{'html'} |n %> +
+ +%# Vertical menu + + + + +
+ <& /Elements/Menu, toptabs => $toptabs, current_toptab => $current_toptab &> + + + + + + + + + + + + + +<%ARGS> +$title => undef +$content => " " +$name => undef +$size => undef + diff --git a/rt/html/Elements/ShadedRow b/rt/html/Elements/ShadedRow new file mode 100644 index 000000000..8947fcd82 --- /dev/null +++ b/rt/html/Elements/ShadedRow @@ -0,0 +1,31 @@ +%# BEGIN LICENSE BLOCK +%# +%# Copyright (c) 1996-2003 Jesse Vincent +%# +%# (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 + + + + +<%ARGS> +$title => undef +$content => " " + diff --git a/rt/html/Elements/SimpleSearch b/rt/html/Elements/SimpleSearch new file mode 100644 index 000000000..69541f801 --- /dev/null +++ b/rt/html/Elements/SimpleSearch @@ -0,0 +1,27 @@ +%# BEGIN LICENSE BLOCK +%# +%# Copyright (c) 1996-2003 Jesse Vincent +%# +%# (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 +
+ +  + diff --git a/rt/html/Elements/Submit b/rt/html/Elements/Submit new file mode 100644 index 000000000..2c35ca0f4 --- /dev/null +++ b/rt/html/Elements/Submit @@ -0,0 +1,62 @@ +%# BEGIN LICENSE BLOCK +%# +%# Copyright (c) 1996-2003 Jesse Vincent +%# +%# (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 +
+ <%$title%> +
+ +% if ($actions) { +% my @actions; +% foreach my $action (sort keys %{$actions}) { +% if ($actions->{"$action"}->{'html'}) { +% push @actions, $actions->{"$action"}->{'html'}; +% } else { +% push @actions, "{$action}->{'path'}."\">".$actions->{$action}->{'title'}.""; +% } +% } +<% join(" | ", @actions) | n %> +% if ($subactions) { +% my @actions; +% foreach my $action (sort keys %{$subactions}) { +% push @actions, $subactions->{"$action"}->{'html'}; +% } +<% join(" | ", @actions) | n %> +% } +% } + +
+ +<%INIT> + + foreach my $tab (sort keys %{$toptabs}) { + if ($toptabs->{$tab}->{'path'} eq $current_toptab) { + $toptabs->{$tab}->{"subtabs"} = $tabs; + $toptabs->{$tab}->{"current_subtab"} = $current_tab; + } + } + +if (! defined($AppName)) { + $AppName = loc("RT for [_1]", $RT::rtname); +} + + +<%ARGS> +$current_toptab => undef +$current_tab => undef +$toptabs => undef +$topactions => undef +$tabs => undef +$actions => undef +$subactions => undef +$title => $m->callers(-1)->path +$AppName => undef + diff --git a/rt/html/Elements/Quicksearch b/rt/html/Elements/Quicksearch new file mode 100644 index 000000000..b1a67ab29 --- /dev/null +++ b/rt/html/Elements/Quicksearch @@ -0,0 +1,61 @@ +%# BEGIN LICENSE BLOCK +%# +%# Copyright (c) 1996-2003 Jesse Vincent +%# +%# (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/TitleBoxStart, title => loc("Quick search"), bodyclass => "" &> + + + + + + + + +<%PERL> +my $i; +while (my $queue = $Queues->Next) { + $Tickets->ClearRestrictions; + $Tickets->LimitStatus(VALUE => "open"); + $Tickets->LimitQueue(VALUE => $queue->Name, OPERATOR => '='); + my $open = $Tickets->Count(); + + $Tickets->ClearRestrictions; + $Tickets->LimitStatus(VALUE => "new"); + $Tickets->LimitQueue(VALUE => $queue->Name, OPERATOR => '='); + my $new = $Tickets->Count(); + + +% $i++; + + + + + +% } +
<&|/l&>Queue<&|/l&>New<&|/l&>Open
<%$queue->Name%><%$new%><%$open%>
+<& /Elements/TitleBoxEnd &> + +<%INIT> +my $Queues = RT::Queues->new($session{'CurrentUser'}); +$Queues->UnLimit(); +my $Tickets = RT::Tickets->new($session{'CurrentUser'}); + diff --git a/rt/html/Elements/Refresh b/rt/html/Elements/Refresh new file mode 100644 index 000000000..2b5376fee --- /dev/null +++ b/rt/html/Elements/Refresh @@ -0,0 +1,45 @@ +%# BEGIN LICENSE BLOCK +%# +%# Copyright (c) 1996-2003 Jesse Vincent +%# +%# (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 + + +<%INIT> +my @refreshevery = qw(120 300 600 1200 3600 7200); + +<%ARGS> +$Name => undef +$Default => 0 + diff --git a/rt/html/Elements/Section b/rt/html/Elements/Section new file mode 100644 index 000000000..691235846 --- /dev/null +++ b/rt/html/Elements/Section @@ -0,0 +1,34 @@ +%# BEGIN LICENSE BLOCK +%# +%# Copyright (c) 1996-2003 Jesse Vincent +%# +%# (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 + + + + +
+<%$title%> +
+ +<%ARGS> +$title => undef + diff --git a/rt/html/Elements/SelectAttachmentField b/rt/html/Elements/SelectAttachmentField new file mode 100644 index 000000000..47bc53211 --- /dev/null +++ b/rt/html/Elements/SelectAttachmentField @@ -0,0 +1,31 @@ +%# BEGIN LICENSE BLOCK +%# +%# Copyright (c) 1996-2003 Jesse Vincent +%# +%# (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 + +<%ARGS> +$Name => 'AttachmentField' + diff --git a/rt/html/Elements/SelectBoolean b/rt/html/Elements/SelectBoolean new file mode 100644 index 000000000..8cf60dc33 --- /dev/null +++ b/rt/html/Elements/SelectBoolean @@ -0,0 +1,46 @@ +%# BEGIN LICENSE BLOCK +%# +%# Copyright (c) 1996-2003 Jesse Vincent +%# +%# (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 + + +<%ARGS> +$Name => undef +$True => loc("is") +$Default => 'true' +$TrueVal => 1 +$FalseVal => 0 +$False => loc("isn't") + + +<%INIT> +my ($TrueDefault, $FalseDefault); +if ($Default && $Default !~ /true/i) { + $FalseDefault = "SELECTED"; +} +else { + $TrueDefault = "SELECTED"; +} + diff --git a/rt/html/Elements/SelectCustomFieldOperator b/rt/html/Elements/SelectCustomFieldOperator new file mode 100644 index 000000000..e886cbe37 --- /dev/null +++ b/rt/html/Elements/SelectCustomFieldOperator @@ -0,0 +1,40 @@ +%# BEGIN LICENSE BLOCK +%# +%# Copyright (c) 1996-2003 Jesse Vincent +%# +%# (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 + + +<%ARGS> +$Name => undef +@Options => ( loc('contains'), loc("doesn't contain"), loc('is'), loc("isn't"), loc('less than'), loc('greater than')) +@Values => ('LIKE', 'NOT LIKE', '=', '!=', '<', '>') +$Default => undef + diff --git a/rt/html/Elements/SelectCustomFieldValue b/rt/html/Elements/SelectCustomFieldValue new file mode 100644 index 000000000..60f65bcf2 --- /dev/null +++ b/rt/html/Elements/SelectCustomFieldValue @@ -0,0 +1,41 @@ +%# BEGIN LICENSE BLOCK +%# +%# Copyright (c) 1996-2003 Jesse Vincent +%# +%# (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/Callback, %ARGS &> +% if ($CustomField->Type =~ /Select/i) { +% my $values = $CustomField->Values; + +% } +% else { + +% } +<%args> +$Name => undef +$CustomField =>undef + diff --git a/rt/html/Elements/SelectDate b/rt/html/Elements/SelectDate new file mode 100644 index 000000000..5f169fc0a --- /dev/null +++ b/rt/html/Elements/SelectDate @@ -0,0 +1,48 @@ +%# BEGIN LICENSE BLOCK +%# +%# Copyright (c) 1996-2003 Jesse Vincent +%# +%# (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 + + +<%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"; +} + + +<%args> + +$ShowTime => undef +$menu_prefix=>'' +$current=>time +$Default => undef +$Name => undef + diff --git a/rt/html/Elements/SelectDateRelation b/rt/html/Elements/SelectDateRelation new file mode 100644 index 000000000..ee26efeaa --- /dev/null +++ b/rt/html/Elements/SelectDateRelation @@ -0,0 +1,36 @@ +%# BEGIN LICENSE BLOCK +%# +%# Copyright (c) 1996-2003 Jesse Vincent +%# +%# (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 + + +<%ARGS> +$Name => undef +$Default => undef +$Before => loc('Before') +$On => loc('On') +$After => loc('After') + diff --git a/rt/html/Elements/SelectDateType b/rt/html/Elements/SelectDateType new file mode 100644 index 000000000..afb9a70e9 --- /dev/null +++ b/rt/html/Elements/SelectDateType @@ -0,0 +1,36 @@ +%# BEGIN LICENSE BLOCK +%# +%# Copyright (c) 1996-2003 Jesse Vincent +%# +%# (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 + +<%ARGS> +$Name => 'DateType' + diff --git a/rt/html/Elements/SelectEqualityOperator b/rt/html/Elements/SelectEqualityOperator new file mode 100644 index 000000000..99c60d554 --- /dev/null +++ b/rt/html/Elements/SelectEqualityOperator @@ -0,0 +1,40 @@ +%# BEGIN LICENSE BLOCK +%# +%# Copyright (c) 1996-2003 Jesse Vincent +%# +%# (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 + + +<%ARGS> +$Name => undef +@Options => (loc('less than'), loc('equal to'), loc('greater than'), loc('not equal to')) +@Values => qw(< = > !=) +$Default => undef + diff --git a/rt/html/Elements/SelectGroups b/rt/html/Elements/SelectGroups new file mode 100644 index 000000000..8f33c1eb3 --- /dev/null +++ b/rt/html/Elements/SelectGroups @@ -0,0 +1,29 @@ +%# BEGIN LICENSE BLOCK +%# +%# Copyright (c) 1996-2003 Jesse Vincent +%# +%# (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/SelectMatch, Name=> 'GroupOp' &> + diff --git a/rt/html/Elements/SelectLinkType b/rt/html/Elements/SelectLinkType new file mode 100644 index 000000000..9ebefda14 --- /dev/null +++ b/rt/html/Elements/SelectLinkType @@ -0,0 +1,37 @@ +%# BEGIN LICENSE BLOCK +%# +%# Copyright (c) 1996-2003 Jesse Vincent +%# +%# (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 + + +<%ARGS> +$Name => "LinkType" +$Default => undef + + +<%INIT> +# TODO handle Default + diff --git a/rt/html/Elements/SelectMatch b/rt/html/Elements/SelectMatch new file mode 100644 index 000000000..d58a9633a --- /dev/null +++ b/rt/html/Elements/SelectMatch @@ -0,0 +1,53 @@ +%# BEGIN LICENSE BLOCK +%# +%# Copyright (c) 1996-2003 Jesse Vincent +%# +%# (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 + + +<%ARGS> +$Name => undef +$Like => loc('contains') +$NotLike => loc("doesn't contain") +$True => loc('is') +$False => loc("isn't") +$Default => undef + +<%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"; +} + diff --git a/rt/html/Elements/SelectNewTicketQueue b/rt/html/Elements/SelectNewTicketQueue new file mode 100644 index 000000000..a629b7bca --- /dev/null +++ b/rt/html/Elements/SelectNewTicketQueue @@ -0,0 +1,56 @@ +%# BEGIN LICENSE BLOCK +%# +%# Copyright (c) 1996-2003 Jesse Vincent +%# +%# (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 + + +<%INIT> +unless ($session{'create_in_queues'}) { + +@{$session{'create_in_queues'}} = (); +my $q=new RT::Queues($session{'CurrentUser'}); +$q->UnLimit; +while (my $queue=$q->Next) { + if ($queue->CurrentUserHasRight('CreateTicket')) { + my $ds = { Name => $queue->Name, Description => $queue->Description, id => $queue->id }; + push (@{$session{'create_in_queues'}}, $ds); + } +} +} + + + +<%ARGS> +$Name => 'Queue' +$Verbose => undef +$Default => undef + diff --git a/rt/html/Elements/SelectOwner b/rt/html/Elements/SelectOwner new file mode 100644 index 000000000..04b078d20 --- /dev/null +++ b/rt/html/Elements/SelectOwner @@ -0,0 +1,59 @@ +%# BEGIN LICENSE BLOCK +%# +%# Copyright (c) 1996-2003 Jesse Vincent +%# +%# (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 + + +<%INIT> +my $Users = RT::Users->new($session{CurrentUser}); +my $object; + + +if ($TicketObj) { + $object = $TicketObj; +} +elsif ($QueueObj) { + $object = $QueueObj; +} +if ($object) { + $Users->WhoHaveRight(Right => 'OwnTicket', + Object => $object, + IncludeSystemRights => 1, + IncludeSuperusers => 1); +} else { + $Users->LimitToPrivileged; +} + + +<%ARGS> +$QueueObj => undef +$Name => undef +$Default => undef +$User => undef +$TicketObj => undef + diff --git a/rt/html/Elements/SelectQueue b/rt/html/Elements/SelectQueue new file mode 100644 index 000000000..c45b9b532 --- /dev/null +++ b/rt/html/Elements/SelectQueue @@ -0,0 +1,59 @@ +%# BEGIN LICENSE BLOCK +%# +%# Copyright (c) 1996-2003 Jesse Vincent +%# +%# (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 +% if ($Lite) { + +% } else { + +% } +<%ARGS> +$ShowNullOption => 1 +$ShowAllQueues => 1 +$Name => undef +$Verbose => undef +$Default => 0 +$Lite => 0 + + +<%INIT> + +my $q=new RT::Queues($session{'CurrentUser'}); +$q->UnLimit; + +my $d = new RT::Queue($session{'CurrentUser'}); +$d->Load($Default); + + diff --git a/rt/html/Elements/SelectResultsPerPage b/rt/html/Elements/SelectResultsPerPage new file mode 100644 index 000000000..1bde71306 --- /dev/null +++ b/rt/html/Elements/SelectResultsPerPage @@ -0,0 +1,43 @@ +%# BEGIN LICENSE BLOCK +%# +%# Copyright (c) 1996-2003 Jesse Vincent +%# +%# (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 +%# TODO: Better default handling + + + +<%INIT> +my @values = qw(0 10 25 50 100); +my @labels = (loc('Unlimited'), qw(10 25 50 100)); + +<%ARGS> + +$Name => undef +$Default => 50 + + diff --git a/rt/html/Elements/SelectSortOrder b/rt/html/Elements/SelectSortOrder new file mode 100644 index 000000000..0ad999a7a --- /dev/null +++ b/rt/html/Elements/SelectSortOrder @@ -0,0 +1,41 @@ +%# BEGIN LICENSE BLOCK +%# +%# Copyright (c) 1996-2003 Jesse Vincent +%# +%# (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 + + +<%INIT> +my @orders = qw (ASC DESC); +my @order_names = (loc('Ascending'), loc('Descending')); + + + +<%ARGS> +$Name => 'SortOrder' +$Default => 'ASC' + diff --git a/rt/html/Elements/SelectStatus b/rt/html/Elements/SelectStatus new file mode 100644 index 000000000..2c1ffad39 --- /dev/null +++ b/rt/html/Elements/SelectStatus @@ -0,0 +1,37 @@ +%# BEGIN LICENSE BLOCK +%# +%# Copyright (c) 1996-2003 Jesse Vincent +%# +%# (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 + +<%ONCE> +my $queue = new RT::Queue($session{'CurrentUser'}); +my @status = $queue->StatusArray(); + +<%ARGS> +$Name => undef +$Default => undef + diff --git a/rt/html/Elements/SelectTicketSortBy b/rt/html/Elements/SelectTicketSortBy new file mode 100644 index 000000000..1d0b3942a --- /dev/null +++ b/rt/html/Elements/SelectTicketSortBy @@ -0,0 +1,38 @@ +%# BEGIN LICENSE BLOCK +%# +%# Copyright (c) 1996-2003 Jesse Vincent +%# +%# (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 + + +<%INIT> +my $tickets = new RT::Tickets($session{'CurrentUser'}); +my @sortfields = $tickets->SortFields(); + + +<%ARGS> +$Name => 'SortTicketsBy' +$Default => 'id' + diff --git a/rt/html/Elements/SelectTicketTypes b/rt/html/Elements/SelectTicketTypes new file mode 100644 index 000000000..80aecac67 --- /dev/null +++ b/rt/html/Elements/SelectTicketTypes @@ -0,0 +1,34 @@ +%# BEGIN LICENSE BLOCK +%# +%# Copyright (c) 1996-2003 Jesse Vincent +%# +%# (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 + + +<%ARGS> +$Name => 'TickType' +$Default => undef +@Types => qw(Approval Ticket) + diff --git a/rt/html/Elements/SelectUsers b/rt/html/Elements/SelectUsers new file mode 100644 index 000000000..7ed3835b6 --- /dev/null +++ b/rt/html/Elements/SelectUsers @@ -0,0 +1,31 @@ +%# BEGIN LICENSE BLOCK +%# +%# Copyright (c) 1996-2003 Jesse Vincent +%# +%# (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/SelectMatch, Name=> 'UserOp' &> + diff --git a/rt/html/Elements/SelectWatcherType b/rt/html/Elements/SelectWatcherType new file mode 100644 index 000000000..26de8f7b9 --- /dev/null +++ b/rt/html/Elements/SelectWatcherType @@ -0,0 +1,44 @@ +%# BEGIN LICENSE BLOCK +%# +%# Copyright (c) 1996-2003 Jesse Vincent +%# +%# (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 + + +<%INIT> +my @types; +if ($Scope =~ 'queue') { + @types = qw(Cc AdminCc); +} +else { + @types = qw(Requestor Cc AdminCc); +} + +<%ARGS> +$Default=>undef +$Scope => 'ticket' +$Name => 'WatcherType' + diff --git a/rt/html/Elements/SetupSessionCookie b/rt/html/Elements/SetupSessionCookie new file mode 100644 index 000000000..4d728ce70 --- /dev/null +++ b/rt/html/Elements/SetupSessionCookie @@ -0,0 +1,77 @@ +%# BEGIN LICENSE BLOCK +%# +%# Copyright (c) 1996-2003 Jesse Vincent +%# +%# (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 +<%init> +my %cookies = CGI::Cookie->fetch(); +my %backends = ( + mysql => 'Apache::Session::MySQL', + Pg => 'Apache::Session::Postgres', + Oracle => 'Apache::Session::Oracle', +) unless $RT::WebSessionClass; +my $session_class = $RT::WebSessionClass || $backends{$RT::DatabaseType} || 'Apache::Session::File'; +my $pm = "$session_class.pm"; $pm =~ s|::|/|g; require $pm; + + eval { + tie %session, $session_class, + $SessionCookie || ( $cookies{'RT_SID'} ? $cookies{'RT_SID'}->value() : undef ), + $backends{$RT::DatabaseType} ? { + Handle => $RT::Handle->dbh, + LockHandle => $RT::Handle->dbh, + } : { + Directory => $RT::MasonSessionDir, + LockDirectory => $RT::MasonSessionDir, + }; + }; + if ($@) { + + # If the session is invalid, create a new session. + if ( $@ =~ /Object does not/i ) { + tie %session, $session_class, undef, + $backends{$RT::DatabaseType} ? { + Handle => $RT::Handle->dbh, + LockHandle => $RT::Handle->dbh, + } : { + Directory => $RT::MasonSessionDir, + LockDirectory => $RT::MasonSessionDir, + }; + undef $cookies{'RT_SID'}; + } + else { + die "RT Couldn't write to session directory '$RT::MasonSessionDir': $@. Check that this dir ectory's permissions are correct."; + } + } + + if ( !$cookies{'RT_SID'} ) { + my $cookie = new CGI::Cookie( + -name => 'RT_SID', + -value => $session{_session_id}, + -path => '/', + ); + $r->header_out('Set-Cookie', $cookie->as_string); + + } + return(); + +<%args> +$SessionCookie => '' + diff --git a/rt/html/Elements/ShadedBox b/rt/html/Elements/ShadedBox new file mode 100644 index 000000000..36b9cae7c --- /dev/null +++ b/rt/html/Elements/ShadedBox @@ -0,0 +1,33 @@ +%# BEGIN LICENSE BLOCK +%# +%# Copyright (c) 1996-2003 Jesse Vincent +%# +%# (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 + + + + + +
<%$title |n %>:<%$content |n %>
+<%ARGS> +$title => undef +$content => " " + diff --git a/rt/html/Elements/ShadedInputRow b/rt/html/Elements/ShadedInputRow new file mode 100644 index 000000000..e9fb69e5f --- /dev/null +++ b/rt/html/Elements/ShadedInputRow @@ -0,0 +1,35 @@ +%# BEGIN LICENSE BLOCK +%# +%# Copyright (c) 1996-2003 Jesse Vincent +%# +%# (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 +
<%$title |n %>: + value="<%$content|h%>" SIZE=<%$size%>> +
<%$title |n %>:<%$content |n %>
+ +% if ($Reset) { + +%} + + + +
+ + + + +  + +% if ($AlternateLabel) { +<%$AlternateCaption%> + +% } +<%$Caption%> +
+<%ARGS> +$color => "#336699" +$Caption => undef +$AlternateCaption => undef +$AlternateLabel => undef +$Label => loc('Submit') +$Name => undef +$Reset => undef +$ResetLabel => loc('Reset') + diff --git a/rt/html/Elements/Tabs b/rt/html/Elements/Tabs new file mode 100644 index 000000000..4db3849c6 --- /dev/null +++ b/rt/html/Elements/Tabs @@ -0,0 +1,82 @@ +%# BEGIN LICENSE BLOCK +%# +%# Copyright (c) 1996-2003 Jesse Vincent +%# +%# (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/PageLayout, + current_toptab => $current_toptab, + current_tab => $current_tab, + toptabs => $toptabs, + topactions => $topactions, + tabs => $tabs, + actions => $actions, + subactions => $subactions, + title => $Title +&> + +<%INIT> +my $action; +my $basetopactions = { + A => { html => $m->scomp('/Elements/CreateTicket') + }, + B => { html => $m->scomp('/Elements/SimpleSearch') + } + }; +my $basetabs = { A => { title => loc('Homepage'), + path => '', + }, + B => { title => loc('Tickets'), + path => 'Search/Listing.html' + }, + E => { title => loc('Configuration'), + path => 'Admin/' + }, + K => { title => loc('Preferences'), + path => 'User/Prefs.html' + }, + P => { title => loc('Approval'), + path => 'Approvals/' + }, + }; + +if (!defined $toptabs) { + $toptabs = $basetabs; +} +if (!defined $topactions) { + $topactions = $basetopactions; +} + + # Now let callbacks add their extra tabs + $m->comp('/Elements/Callback', + topactions => $topactions, + toptabs => $toptabs, %ARGS); + + +<%ARGS> +$current_toptab => undef +$current_tab => undef +$toptabs => undef +$topactions => undef +$tabs => undef +$actions => undef +$subactions => undef +$Title => undef + diff --git a/rt/html/Elements/TitleBoxEnd b/rt/html/Elements/TitleBoxEnd new file mode 100644 index 000000000..37f374466 --- /dev/null +++ b/rt/html/Elements/TitleBoxEnd @@ -0,0 +1,31 @@ +%# BEGIN LICENSE BLOCK +%# +%# Copyright (c) 1996-2003 Jesse Vincent +%# +%# (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 +
+<%ARGS> +$title => undef +$content => undef + + diff --git a/rt/html/Elements/TitleBoxStart b/rt/html/Elements/TitleBoxStart new file mode 100644 index 000000000..02c76a75e --- /dev/null +++ b/rt/html/Elements/TitleBoxStart @@ -0,0 +1,60 @@ +%# BEGIN LICENSE BLOCK +%# +%# Copyright (c) 1996-2003 Jesse Vincent +%# +%# (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 + + + + + + + +
+ <%$class ? "class=\"$class\"" : "class=\"titlebox\""|n%>> + + + <% $title_href && ""|n%><%$title |n %><% $title_href && "" |n%> + + + <%$class ? "class=\"$class\"": "class=\"titleboxright\""|n%>> + <%$titleright ? $titleright : ' ' |n %> +
+<%ARGS> +$width => "100%" +$class => undef +$bodyclass => undef +$title_href => undef +$title => undef +$title_class => undef + +$titleright_href => undef +$titleright => undef +$contentbg => "#dddddd" +$color => "#336699" + diff --git a/rt/html/Elements/ViewUser b/rt/html/Elements/ViewUser new file mode 100644 index 000000000..657272496 --- /dev/null +++ b/rt/html/Elements/ViewUser @@ -0,0 +1,51 @@ +%# BEGIN LICENSE BLOCK +%# +%# Copyright (c) 1996-2003 Jesse Vincent +%# +%# (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/TitleBoxStart, + title => "id."\">".loc("Tickets from [_1]", $name)."", + titleright=> "id."\">".loc("Comments about [_1]", $name)."" &> + + + + +
+%while (my $w=$tickets->Next) { +<%$w->Id%>: <%$w->Subject%> (<%$w->Status%>)
+%} +
+ <% ($User->Comments || loc("No comment entered about this user")) %> +
+<& /Elements/TitleBoxEnd &> + +<%ARGS> +$User=>undef + + +<%INIT> +my $name=$User->RealName || $User->EmailAddress; + +my $tickets = new RT::Tickets($session{'CurrentUser'}); +$tickets->LimitWatcher(TYPE => 'Requestor', VALUE => $User->EmailAddress); + + + -- cgit v1.2.1 From 289340780927b5bac2c7604d7317c3063c6dd8cc Mon Sep 17 00:00:00 2001 From: ivan Date: Thu, 11 Mar 2004 02:05:38 +0000 Subject: import of rt 3.0.9 --- rt/html/Elements/Callback | 7 +++-- rt/html/Elements/MessageBox | 6 ++-- rt/html/Elements/MyTickets | 2 +- rt/html/Elements/SelectLang | 56 +++++++++++++++++++++++++++++++++++++ rt/html/Elements/SelectStatus | 2 ++ rt/html/Elements/SelectWatcherType | 3 ++ rt/html/Elements/SetupSessionCookie | 18 ++++++++---- rt/html/Elements/SimpleSearch | 2 +- 8 files changed, 84 insertions(+), 12 deletions(-) create mode 100644 rt/html/Elements/SelectLang (limited to 'rt/html/Elements') diff --git a/rt/html/Elements/Callback b/rt/html/Elements/Callback index 93ac4c01b..79157e751 100644 --- a/rt/html/Elements/Callback +++ b/rt/html/Elements/Callback @@ -54,10 +54,11 @@ if (!$callbacks) { $cache{$Page,$_CallbackName} = $callbacks; } -foreach my $comp (@$callbacks) { - $m->comp($comp, %ARGS) if $m->comp_exists($comp); +my @rv; +foreach my $comp (sort @$callbacks) { + push @rv, $m->comp($comp, %ARGS) if $m->comp_exists($comp); } -return(1); +return @rv; <%args> $_CallbackName => 'Default' diff --git a/rt/html/Elements/MessageBox b/rt/html/Elements/MessageBox index 64fdf38b7..32f422206 100644 --- a/rt/html/Elements/MessageBox +++ b/rt/html/Elements/MessageBox @@ -21,7 +21,7 @@ %# %# %# END LICENSE BLOCK - + <%INIT> my ($message); @@ -42,6 +42,8 @@ if ($session{'CurrentUser'}->UserObj->Signature) { $QuoteTransaction => undef $Name => 'Content' $Default => '' -$Width => 72 +$Width => $RT::MessageBoxWidth +$Wrap => $RT::MessageBoxWrap +$IncludeSignature => 1 diff --git a/rt/html/Elements/MyTickets b/rt/html/Elements/MyTickets index 6e2ddc6c3..52dae3b8d 100644 --- a/rt/html/Elements/MyTickets +++ b/rt/html/Elements/MyTickets @@ -69,7 +69,7 @@ <%INIT> -my $rows = 10; +my $rows = $RT::MyTicketsLength; my $MyTickets; $MyTickets = new RT::Tickets ($session{'CurrentUser'}); $MyTickets->LimitOwner(VALUE => $session{'CurrentUser'}->Id); diff --git a/rt/html/Elements/SelectLang b/rt/html/Elements/SelectLang new file mode 100644 index 000000000..cc2c357e0 --- /dev/null +++ b/rt/html/Elements/SelectLang @@ -0,0 +1,56 @@ +%# BEGIN LICENSE BLOCK +%# +%# Copyright (c) 1996-2003 Jesse Vincent +%# +%# (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 + +<%ARGS> +$ShowNullOption => 1 +$ShowAllQueues => 1 +$Name => undef +$Verbose => undef +$Default => 0 +$Lite => 0 + + +<%ONCE> +use I18N::LangTags::List; +my (@lang, %lang_to_desc); +foreach my $lang (map { s/:://; s/_/-/g; $_ } grep { /^\w+::$/ } keys %RT::I18N::) { + next if $lang =~ /i-default|en-us/; + my $desc = I18N::LangTags::List::name($lang); + next unless ($desc); + $desc =~ s/(.*) (.*)/$2 ($1)/; + $lang_to_desc{$lang} = $desc; +} +@lang = sort { $lang_to_desc{$a} cmp $lang_to_desc{$b} } keys %lang_to_desc; + diff --git a/rt/html/Elements/SelectStatus b/rt/html/Elements/SelectStatus index 2c1ffad39..16a5f2995 100644 --- a/rt/html/Elements/SelectStatus +++ b/rt/html/Elements/SelectStatus @@ -24,6 +24,7 @@ @@ -34,4 +35,5 @@ my @status = $queue->StatusArray(); <%ARGS> $Name => undef $Default => undef +$SkipDeleted => 0 diff --git a/rt/html/Elements/SelectWatcherType b/rt/html/Elements/SelectWatcherType index 26de8f7b9..82aab2a85 100644 --- a/rt/html/Elements/SelectWatcherType +++ b/rt/html/Elements/SelectWatcherType @@ -22,7 +22,9 @@ %# %# END LICENSE BLOCK +   -- cgit v1.2.1