diff options
Diffstat (limited to 'rt/html/Elements')
-rw-r--r-- | rt/html/Elements/Callback | 7 | ||||
-rw-r--r-- | rt/html/Elements/MessageBox | 6 | ||||
-rw-r--r-- | rt/html/Elements/MyTickets | 2 | ||||
-rw-r--r-- | rt/html/Elements/SelectLang | 56 | ||||
-rw-r--r-- | rt/html/Elements/SelectStatus | 2 | ||||
-rw-r--r-- | rt/html/Elements/SelectWatcherType | 3 | ||||
-rw-r--r-- | rt/html/Elements/SetupSessionCookie | 18 | ||||
-rw-r--r-- | rt/html/Elements/SimpleSearch | 2 |
8 files changed, 84 insertions, 12 deletions
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; </%init> <%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 -<TEXTAREA COLS=<%$Width%> ROWS=15 WRAP=HARD NAME="<%$Name%>"><& /Elements/Callback, %ARGS &><% $Default %><%$message%><%$signature%></TEXTAREA> +<TEXTAREA COLS=<%$Width%> ROWS=15 WRAP=<%$Wrap%> NAME="<%$Name%>"><& /Elements/Callback, %ARGS &><% $Default %><%$message%><%$IncludeSignature ? $signature : ''%></TEXTAREA> <%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 </%ARGS> 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 <jesse@bestpractical.com> +%# +%# (Except where explictly superceded by other copyright notices) +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# Unless otherwise specified, all modifications, corrections or +%# extensions to this work which alter its source code become the +%# property of Best Practical Solutions, LLC when submitted for +%# inclusion in the work. +%# +%# +%# END LICENSE BLOCK +<SELECT NAME ="<%$Name%>"> +% if ($ShowNullOption) { +<OPTION VALUE="">-</OPTION> +% } +% foreach my $lang (@lang) { +<OPTION VALUE="<%$lang%>" <%($Default && ($lang eq $Default)) && 'SELECTED'%>><% $lang_to_desc{$lang} %> +% if (($Verbose) and (my $description = I18N::LangTags::List::native_name($lang)) ){ +(<%$description%>) +% } +</OPTION> +% } +</SELECT> +<%ARGS> +$ShowNullOption => 1 +$ShowAllQueues => 1 +$Name => undef +$Verbose => undef +$Default => 0 +$Lite => 0 +</%ARGS> + +<%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; +</%ONCE> 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 @@ <SELECT NAME ="<%$Name%>"> <OPTION VALUE="">-</OPTION> %foreach my $status (@status) { +%next if ($SkipDeleted && $status eq 'deleted'); <OPTION VALUE="<%$status%>" <%($Default eq $status) && 'SELECTED'%>><%loc($status)%></OPTION> % } </SELECT> @@ -34,4 +35,5 @@ my @status = $queue->StatusArray(); <%ARGS> $Name => undef $Default => undef +$SkipDeleted => 0 </%ARGS> 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 <SELECT NAME ="<%$Name%>"> +% if ($AllowNull) { <OPTION VALUE="">-</OPTION> +% } %for my $option (@types) { <OPTION VALUE="<%$option%>" <%$option eq $Default && "SELECTED"%>><%loc($option)%></OPTION> %} @@ -38,6 +40,7 @@ else { } </%INIT> <%ARGS> +$AllowNull => 1 $Default=>undef $Scope => 'ticket' $Name => 'WatcherType' diff --git a/rt/html/Elements/SetupSessionCookie b/rt/html/Elements/SetupSessionCookie index 4d728ce70..7a2ad9ff5 100644 --- a/rt/html/Elements/SetupSessionCookie +++ b/rt/html/Elements/SetupSessionCookie @@ -22,18 +22,25 @@ %# %# END LICENSE BLOCK <%init> +return if $m->is_subrequest; # avoid reentrancy, as suggested by masonbook + my %cookies = CGI::Cookie->fetch(); +my $cookiename = "RT_SID_".$RT::rtname.".".$ENV{'SERVER_PORT'}; my %backends = ( mysql => 'Apache::Session::MySQL', Pg => 'Apache::Session::Postgres', - Oracle => 'Apache::Session::Oracle', +# 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; + # morning bug avoidance attempt -- pdh 20030815 + unless ($RT::Handle->dbh && $RT::Handle->dbh->ping) { + $RT::Handle->Connect(); + } eval { tie %session, $session_class, - $SessionCookie || ( $cookies{'RT_SID'} ? $cookies{'RT_SID'}->value() : undef ), + $SessionCookie || ( $cookies{$cookiename} ? $cookies{$cookiename}->value() : undef ), $backends{$RT::DatabaseType} ? { Handle => $RT::Handle->dbh, LockHandle => $RT::Handle->dbh, @@ -54,22 +61,23 @@ my $pm = "$session_class.pm"; $pm =~ s|::|/|g; require $pm; Directory => $RT::MasonSessionDir, LockDirectory => $RT::MasonSessionDir, }; - undef $cookies{'RT_SID'}; + undef $cookies{$cookiename}; } else { die "RT Couldn't write to session directory '$RT::MasonSessionDir': $@. Check that this dir ectory's permissions are correct."; } } - if ( !$cookies{'RT_SID'} ) { + if ( !$cookies{$cookiename} ) { my $cookie = new CGI::Cookie( - -name => 'RT_SID', + -name => $cookiename, -value => $session{_session_id}, -path => '/', ); $r->header_out('Set-Cookie', $cookie->as_string); } + return(); </%init> <%args> diff --git a/rt/html/Elements/SimpleSearch b/rt/html/Elements/SimpleSearch index 69541f801..4a0d10656 100644 --- a/rt/html/Elements/SimpleSearch +++ b/rt/html/Elements/SimpleSearch @@ -22,6 +22,6 @@ %# %# END LICENSE BLOCK <form action="<% $RT::WebPath %>/index.html"> -<input size="12" name="q" accesskey="0"> +<input size="12" name="q" autocomplete="off" accesskey="0"> <input type="submit" value="<&|/l&>Search</&>"> </form> |