diff options
author | Ivan Kohler <ivan@freeside.biz> | 2013-06-04 00:16:28 -0700 |
---|---|---|
committer | Ivan Kohler <ivan@freeside.biz> | 2013-06-04 00:16:28 -0700 |
commit | 7588a4ac90a9b07c08a3107cd1107d773be1c991 (patch) | |
tree | 55b8bedb5f899e705da0ba7f608267943bf89e94 /rt/share/html/Elements | |
parent | 98d2b25256055abb0dfcb9f586b434474fa97afd (diff) |
RT 4.0.13
Diffstat (limited to 'rt/share/html/Elements')
133 files changed, 538 insertions, 375 deletions
diff --git a/rt/share/html/Elements/BevelBoxRaisedEnd b/rt/share/html/Elements/BevelBoxRaisedEnd index 369dc9560..eb97f32fb 100755 --- a/rt/share/html/Elements/BevelBoxRaisedEnd +++ b/rt/share/html/Elements/BevelBoxRaisedEnd @@ -2,7 +2,7 @@ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2012 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2013 Best Practical Solutions, LLC %# <sales@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) diff --git a/rt/share/html/Elements/BevelBoxRaisedStart b/rt/share/html/Elements/BevelBoxRaisedStart index 51038b89b..e87c84af5 100755 --- a/rt/share/html/Elements/BevelBoxRaisedStart +++ b/rt/share/html/Elements/BevelBoxRaisedStart @@ -2,7 +2,7 @@ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2012 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2013 Best Practical Solutions, LLC %# <sales@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) diff --git a/rt/share/html/Elements/CSRF b/rt/share/html/Elements/CSRF index a3c19430e..b62b321d9 100644 --- a/rt/share/html/Elements/CSRF +++ b/rt/share/html/Elements/CSRF @@ -2,7 +2,7 @@ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2012 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2013 Best Practical Solutions, LLC %# <sales@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) diff --git a/rt/share/html/Elements/Callback b/rt/share/html/Elements/Callback index bd48bc5cd..f9508abea 100755 --- a/rt/share/html/Elements/Callback +++ b/rt/share/html/Elements/Callback @@ -2,7 +2,7 @@ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2012 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2013 Best Practical Solutions, LLC %# <sales@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) diff --git a/rt/share/html/Elements/Checkbox b/rt/share/html/Elements/Checkbox index c72b40126..dd82a245b 100755 --- a/rt/share/html/Elements/Checkbox +++ b/rt/share/html/Elements/Checkbox @@ -2,7 +2,7 @@ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2012 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2013 Best Practical Solutions, LLC %# <sales@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) diff --git a/rt/share/html/Elements/CollectionAsTable/Header b/rt/share/html/Elements/CollectionAsTable/Header index 20586f9c3..ffb7441f0 100644 --- a/rt/share/html/Elements/CollectionAsTable/Header +++ b/rt/share/html/Elements/CollectionAsTable/Header @@ -2,7 +2,7 @@ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2012 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2013 Best Practical Solutions, LLC %# <sales@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) diff --git a/rt/share/html/Elements/CollectionAsTable/ParseFormat b/rt/share/html/Elements/CollectionAsTable/ParseFormat index c2c1c5364..e00370487 100644 --- a/rt/share/html/Elements/CollectionAsTable/ParseFormat +++ b/rt/share/html/Elements/CollectionAsTable/ParseFormat @@ -2,7 +2,7 @@ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2012 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2013 Best Practical Solutions, LLC %# <sales@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) diff --git a/rt/share/html/Elements/CollectionAsTable/Row b/rt/share/html/Elements/CollectionAsTable/Row index f91520952..bbcfd2227 100644 --- a/rt/share/html/Elements/CollectionAsTable/Row +++ b/rt/share/html/Elements/CollectionAsTable/Row @@ -2,7 +2,7 @@ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2012 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2013 Best Practical Solutions, LLC %# <sales@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) diff --git a/rt/share/html/Elements/CollectionList b/rt/share/html/Elements/CollectionList index 402a272b4..b47c7aabd 100644 --- a/rt/share/html/Elements/CollectionList +++ b/rt/share/html/Elements/CollectionList @@ -2,7 +2,7 @@ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2012 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2013 Best Practical Solutions, LLC %# <sales@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -111,7 +111,7 @@ if ($Class =~ /::/) { # older passed in value $Class =~ s/:/_/g; } -$m->out('<table class="' . +$m->out('<table cellspacing="0" class="' . ($Collection->isa('RT::Tickets') ? 'ticket-list' : 'collection') . ' collection-as-table">'); if ( $ShowHeader ) { diff --git a/rt/share/html/Elements/CollectionListPaging b/rt/share/html/Elements/CollectionListPaging index 26c082348..8e6aebde7 100644 --- a/rt/share/html/Elements/CollectionListPaging +++ b/rt/share/html/Elements/CollectionListPaging @@ -2,7 +2,7 @@ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2012 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2013 Best Practical Solutions, LLC %# <sales@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) diff --git a/rt/share/html/Elements/ColumnMap b/rt/share/html/Elements/ColumnMap index 878950bff..7b127e90e 100644 --- a/rt/share/html/Elements/ColumnMap +++ b/rt/share/html/Elements/ColumnMap @@ -2,7 +2,7 @@ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2012 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2013 Best Practical Solutions, LLC %# <sales@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -96,24 +96,34 @@ my $COLUMN_MAP = { attribute => sub { return shift @_ }, title => sub { return pop @_ }, value => sub { + # Cache the CF object on a per-request basis, to avoid + # having to load it for every row + my $key = join("-","CF", + $_[0]->CustomFieldLookupType, + $_[0]->CustomFieldLookupId, + $_[-1]); + + my $cf = $m->notes($key); + unless ($cf) { + $cf = $_[0]->LoadCustomFieldByIdentifier($_[-1]); + $m->notes($key, $cf); + } + # Display custom field contents, separated by newlines. # For Image custom fields we also show a thumbnail here. - my $object = shift; - my $cfname = pop; - my $values = $object->CustomFieldValues( $cfname ); + my $values = $cf->ValuesForObject( $_[0] ); return if $values->Count == 0; my @values; # it is guaranteed to be the same type for all fields, right? my $v = $values->First; - my $cftype = $v->CustomFieldObj->Type; do { - if ($cftype eq 'Image') { + if ($v->Type eq 'Image') { push @values, \($m->scomp( '/Elements/ShowCustomFieldImage', Object => $v )); - } elsif ( $cftype eq 'Date' or $cftype eq 'DateTime' ) { + } elsif ( $v->Type eq 'Date' or $v->Type eq 'DateTime' ) { # then actually return the date object; # ProcessColumnMapValue will stringify it my $DateObj = RT::Date->new( $session{'CurrentUser'} ); @@ -186,8 +196,10 @@ $m->callback( COLUMN_MAP => $COLUMN_MAP, CallbackName => 'Once', CallbackOnce => $m->callback( COLUMN_MAP => $COLUMN_MAP ); # first deal with class specific things -my $class_map = $m->comp("/Elements/$Class/ColumnMap", Attr => $Attr, Name => $Name ); -return $class_map if defined $class_map; +if (RT::Interface::Web->ComponentPathIsSafe($Class) and $m->comp_exists("/Elements/$Class/ColumnMap")) { + my $class_map = $m->comp("/Elements/$Class/ColumnMap", Attr => $Attr, Name => $Name ); + return $class_map if defined $class_map; +} return GetColumnMapEntry( Map => $COLUMN_MAP, Name => $Name, Attribute => $Attr ); </%INIT> diff --git a/rt/share/html/Elements/CreateTicket b/rt/share/html/Elements/CreateTicket index 6702abcbf..ed15cd76b 100755 --- a/rt/share/html/Elements/CreateTicket +++ b/rt/share/html/Elements/CreateTicket @@ -2,7 +2,7 @@ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2012 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2013 Best Practical Solutions, LLC %# <sales@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) diff --git a/rt/share/html/Elements/Dashboards b/rt/share/html/Elements/Dashboards index 4867a75a0..e271bf1c8 100644 --- a/rt/share/html/Elements/Dashboards +++ b/rt/share/html/Elements/Dashboards @@ -2,7 +2,7 @@ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2012 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2013 Best Practical Solutions, LLC %# <sales@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) diff --git a/rt/share/html/Elements/EditCustomField b/rt/share/html/Elements/EditCustomField index 8b87fd425..e8de7afb1 100644 --- a/rt/share/html/Elements/EditCustomField +++ b/rt/share/html/Elements/EditCustomField @@ -2,7 +2,7 @@ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2012 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2013 Best Practical Solutions, LLC %# <sales@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) diff --git a/rt/share/html/Elements/EditCustomFieldAutocomplete b/rt/share/html/Elements/EditCustomFieldAutocomplete index 911e60707..32a3b9fa0 100644 --- a/rt/share/html/Elements/EditCustomFieldAutocomplete +++ b/rt/share/html/Elements/EditCustomFieldAutocomplete @@ -2,7 +2,7 @@ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2012 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2013 Best Practical Solutions, LLC %# <sales@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) diff --git a/rt/share/html/Elements/EditCustomFieldBinary b/rt/share/html/Elements/EditCustomFieldBinary index 0a2098556..c74bfd0bc 100644 --- a/rt/share/html/Elements/EditCustomFieldBinary +++ b/rt/share/html/Elements/EditCustomFieldBinary @@ -2,7 +2,7 @@ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2012 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2013 Best Practical Solutions, LLC %# <sales@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -47,7 +47,7 @@ %# END BPS TAGGED BLOCK }}} % while ( $Values and my $value = $Values->Next ) { %# XXX - let user download the file(s) here? -<input type="checkbox" class="checkbox" name="<%$NamePrefix%><%$CustomField->Id%>-DeleteValueIds" class="CF-<%$CustomField->id%>-Edit" value="<% $value->Id %>" /><a href="<%RT->Config->Get('WebPath')%>/Download/CustomFieldValue/<% $value->Id %>/<% $value->Content %>"><% $value->Content %></a><br /> +<input type="checkbox" class="checkbox" name="<%$NamePrefix%><%$CustomField->Id%>-DeleteValueIds" class="CF-<%$CustomField->id%>-Edit" value="<% $value->Id %>" /><a href="<%RT->Config->Get('WebPath')%>/Download/CustomFieldValue/<% $value->Id %>/<% $value->Content |un %>"><% $value->Content %></a><br /> % } % if (!$MaxValues || !$Values || $Values->Count < $MaxValues) { <input type="file" name="<% $NamePrefix %><% $CustomField->Id %>-Upload" class="CF-<%$CustomField->id%>-Edit" /> diff --git a/rt/share/html/Elements/EditCustomFieldCombobox b/rt/share/html/Elements/EditCustomFieldCombobox index 6d8f74376..f382a4084 100644 --- a/rt/share/html/Elements/EditCustomFieldCombobox +++ b/rt/share/html/Elements/EditCustomFieldCombobox @@ -2,7 +2,7 @@ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2012 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2013 Best Practical Solutions, LLC %# <sales@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) diff --git a/rt/share/html/Elements/EditCustomFieldDate b/rt/share/html/Elements/EditCustomFieldDate index c66640fab..9e190be5d 100644 --- a/rt/share/html/Elements/EditCustomFieldDate +++ b/rt/share/html/Elements/EditCustomFieldDate @@ -2,7 +2,7 @@ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2012 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2013 Best Practical Solutions, LLC %# <sales@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -46,11 +46,11 @@ %# %# END BPS TAGGED BLOCK }}} % my $name = $NamePrefix.$CustomField->Id.'-Values'; -<& /Elements/SelectDate, Name => "$name", current => 0, ShowTime => 0 &> (<%$DateObj->AsString(Time => 0)%>) +<& /Elements/SelectDate, Name => "$name", current => 0, ShowTime => 0 &> (<%$DateObj->AsString(Time => 0, Timezone => 'utc')%>) <%INIT> my $DateObj = RT::Date->new ( $session{'CurrentUser'} ); -$DateObj->Set( Format => 'unknown', Value => $Default ); +$DateObj->Set( Format => 'unknown', Value => $Default, Timezone => 'utc' ); </%INIT> <%ARGS> $Object => undef diff --git a/rt/share/html/Elements/EditCustomFieldDateTime b/rt/share/html/Elements/EditCustomFieldDateTime index a558884b0..3d94855f7 100644 --- a/rt/share/html/Elements/EditCustomFieldDateTime +++ b/rt/share/html/Elements/EditCustomFieldDateTime @@ -2,7 +2,7 @@ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2012 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2013 Best Practical Solutions, LLC %# <sales@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) diff --git a/rt/share/html/Elements/EditCustomFieldFreeform b/rt/share/html/Elements/EditCustomFieldFreeform index 7a5a458bb..b6810b6ec 100644 --- a/rt/share/html/Elements/EditCustomFieldFreeform +++ b/rt/share/html/Elements/EditCustomFieldFreeform @@ -2,7 +2,7 @@ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2012 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2013 Best Practical Solutions, LLC %# <sales@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) diff --git a/rt/share/html/Elements/EditCustomFieldIPAddress b/rt/share/html/Elements/EditCustomFieldIPAddress index ae57fce87..9fcc264ef 100644 --- a/rt/share/html/Elements/EditCustomFieldIPAddress +++ b/rt/share/html/Elements/EditCustomFieldIPAddress @@ -2,7 +2,7 @@ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2012 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2013 Best Practical Solutions, LLC %# <sales@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) diff --git a/rt/share/html/Elements/EditCustomFieldIPAddressRange b/rt/share/html/Elements/EditCustomFieldIPAddressRange index ae57fce87..9fcc264ef 100644 --- a/rt/share/html/Elements/EditCustomFieldIPAddressRange +++ b/rt/share/html/Elements/EditCustomFieldIPAddressRange @@ -2,7 +2,7 @@ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2012 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2013 Best Practical Solutions, LLC %# <sales@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) diff --git a/rt/share/html/Elements/EditCustomFieldImage b/rt/share/html/Elements/EditCustomFieldImage index 09cbf85f3..9316fbc71 100644 --- a/rt/share/html/Elements/EditCustomFieldImage +++ b/rt/share/html/Elements/EditCustomFieldImage @@ -2,7 +2,7 @@ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2012 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2013 Best Practical Solutions, LLC %# <sales@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) diff --git a/rt/share/html/Elements/EditCustomFieldSelect b/rt/share/html/Elements/EditCustomFieldSelect index ed6bb146f..8668bc427 100644 --- a/rt/share/html/Elements/EditCustomFieldSelect +++ b/rt/share/html/Elements/EditCustomFieldSelect @@ -2,7 +2,7 @@ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2012 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2013 Best Practical Solutions, LLC %# <sales@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) diff --git a/rt/share/html/Elements/EditCustomFieldText b/rt/share/html/Elements/EditCustomFieldText index 65a5e3bcf..c169740d5 100644 --- a/rt/share/html/Elements/EditCustomFieldText +++ b/rt/share/html/Elements/EditCustomFieldText @@ -2,7 +2,7 @@ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2012 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2013 Best Practical Solutions, LLC %# <sales@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) diff --git a/rt/share/html/Elements/EditCustomFieldWikitext b/rt/share/html/Elements/EditCustomFieldWikitext index a07317e2f..ac2de26a7 100644 --- a/rt/share/html/Elements/EditCustomFieldWikitext +++ b/rt/share/html/Elements/EditCustomFieldWikitext @@ -2,7 +2,7 @@ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2012 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2013 Best Practical Solutions, LLC %# <sales@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) diff --git a/rt/share/html/Elements/EditLinks b/rt/share/html/Elements/EditLinks index 40667a869..6a3f4b6b5 100755 --- a/rt/share/html/Elements/EditLinks +++ b/rt/share/html/Elements/EditLinks @@ -2,7 +2,7 @@ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2012 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2013 Best Practical Solutions, LLC %# <sales@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) diff --git a/rt/share/html/Elements/EditPassword b/rt/share/html/Elements/EditPassword index 06e816d9e..d7f48bf40 100644 --- a/rt/share/html/Elements/EditPassword +++ b/rt/share/html/Elements/EditPassword @@ -2,7 +2,7 @@ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2012 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2013 Best Practical Solutions, LLC %# <sales@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) diff --git a/rt/share/html/Elements/EditTimeValue b/rt/share/html/Elements/EditTimeValue index 40e3b677a..fc8781322 100644 --- a/rt/share/html/Elements/EditTimeValue +++ b/rt/share/html/Elements/EditTimeValue @@ -2,7 +2,7 @@ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2012 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2013 Best Practical Solutions, LLC %# <sales@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) diff --git a/rt/share/html/Elements/EmailInput b/rt/share/html/Elements/EmailInput index 67eb57c2c..2830a721d 100644 --- a/rt/share/html/Elements/EmailInput +++ b/rt/share/html/Elements/EmailInput @@ -2,7 +2,7 @@ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2012 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2013 Best Practical Solutions, LLC %# <sales@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) diff --git a/rt/share/html/Elements/Error b/rt/share/html/Elements/Error index 87dfd0245..838432069 100755 --- a/rt/share/html/Elements/Error +++ b/rt/share/html/Elements/Error @@ -2,7 +2,7 @@ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2012 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2013 Best Practical Solutions, LLC %# <sales@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -52,6 +52,8 @@ <& /Elements/Tabs &> % } +<& /Elements/ListActions, actions => $Actions &> + <div class="error"> <%$Why%> <br /> @@ -64,6 +66,7 @@ $m->abort(); </%cleanup> <%args> +$Actions => [] $Code => undef $Details => '' $Title => loc("RT Error") diff --git a/rt/share/html/Elements/Footer b/rt/share/html/Elements/Footer index 76819747c..15e96c9b2 100755 --- a/rt/share/html/Elements/Footer +++ b/rt/share/html/Elements/Footer @@ -2,7 +2,7 @@ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2012 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2013 Best Practical Solutions, LLC %# <sales@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) diff --git a/rt/share/html/Elements/Framekiller b/rt/share/html/Elements/Framekiller index 3b54da192..8d04b7f30 100644 --- a/rt/share/html/Elements/Framekiller +++ b/rt/share/html/Elements/Framekiller @@ -2,7 +2,7 @@ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2012 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2013 Best Practical Solutions, LLC %# <sales@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) diff --git a/rt/share/html/Elements/GnuPG/KeyIssues b/rt/share/html/Elements/GnuPG/KeyIssues index 23276c251..f19e02684 100644 --- a/rt/share/html/Elements/GnuPG/KeyIssues +++ b/rt/share/html/Elements/GnuPG/KeyIssues @@ -2,7 +2,7 @@ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2012 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2013 Best Practical Solutions, LLC %# <sales@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) diff --git a/rt/share/html/Elements/GnuPG/SelectKeyForEncryption b/rt/share/html/Elements/GnuPG/SelectKeyForEncryption index d61cde513..6d287176c 100644 --- a/rt/share/html/Elements/GnuPG/SelectKeyForEncryption +++ b/rt/share/html/Elements/GnuPG/SelectKeyForEncryption @@ -2,7 +2,7 @@ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2012 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2013 Best Practical Solutions, LLC %# <sales@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) diff --git a/rt/share/html/Elements/GnuPG/SelectKeyForSigning b/rt/share/html/Elements/GnuPG/SelectKeyForSigning index 244b46464..a930a3ecd 100644 --- a/rt/share/html/Elements/GnuPG/SelectKeyForSigning +++ b/rt/share/html/Elements/GnuPG/SelectKeyForSigning @@ -2,7 +2,7 @@ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2012 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2013 Best Practical Solutions, LLC %# <sales@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) diff --git a/rt/share/html/Elements/GnuPG/SignEncryptWidget b/rt/share/html/Elements/GnuPG/SignEncryptWidget index 2f3f1035d..7e0aa2d1b 100644 --- a/rt/share/html/Elements/GnuPG/SignEncryptWidget +++ b/rt/share/html/Elements/GnuPG/SignEncryptWidget @@ -2,7 +2,7 @@ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2012 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2013 Best Practical Solutions, LLC %# <sales@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) diff --git a/rt/share/html/Elements/GotoTicket b/rt/share/html/Elements/GotoTicket index 52db37532..a602d8843 100755 --- a/rt/share/html/Elements/GotoTicket +++ b/rt/share/html/Elements/GotoTicket @@ -2,7 +2,7 @@ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2012 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2013 Best Practical Solutions, LLC %# <sales@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) diff --git a/rt/share/html/Elements/Header b/rt/share/html/Elements/Header index 65d06f879..d97e626a1 100755 --- a/rt/share/html/Elements/Header +++ b/rt/share/html/Elements/Header @@ -2,7 +2,7 @@ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2012 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2013 Best Practical Solutions, LLC %# <sales@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) diff --git a/rt/share/html/Elements/HeaderJavascript b/rt/share/html/Elements/HeaderJavascript index d5741f4e6..bfb4a8cbb 100644 --- a/rt/share/html/Elements/HeaderJavascript +++ b/rt/share/html/Elements/HeaderJavascript @@ -2,7 +2,7 @@ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2012 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2013 Best Practical Solutions, LLC %# <sales@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) diff --git a/rt/share/html/Elements/ListActions b/rt/share/html/Elements/ListActions index 8929ff731..805bd2ef2 100755 --- a/rt/share/html/Elements/ListActions +++ b/rt/share/html/Elements/ListActions @@ -2,7 +2,7 @@ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2012 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2013 Best Practical Solutions, LLC %# <sales@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -59,16 +59,19 @@ # backward compatibility, don't use array in new code, but use keyed hash if ( ref( $session{'Actions'} ) eq 'ARRAY' ) { unshift @actions, @{ delete $session{'Actions'} }; + $session{'i'}++; } if ( ref( $session{'Actions'}{''} ) eq 'ARRAY' ) { unshift @actions, @{ delete $session{'Actions'}{''} }; + $session{'i'}++; } my $actions_pointer = $DECODED_ARGS->{'results'}; if ($actions_pointer && ref( $session{'Actions'}->{$actions_pointer} ) eq 'ARRAY' ) { unshift @actions, @{ delete $session{'Actions'}->{$actions_pointer} }; + $session{'i'}++; } # XXX: run callbacks per row really crazy idea diff --git a/rt/share/html/Elements/ListMenu b/rt/share/html/Elements/ListMenu index 7c9af5c5d..34ef1c705 100644 --- a/rt/share/html/Elements/ListMenu +++ b/rt/share/html/Elements/ListMenu @@ -2,7 +2,7 @@ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2012 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2013 Best Practical Solutions, LLC %# <sales@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) diff --git a/rt/share/html/Elements/Login b/rt/share/html/Elements/Login index b3f1a24ab..c1b358880 100755 --- a/rt/share/html/Elements/Login +++ b/rt/share/html/Elements/Login @@ -2,7 +2,7 @@ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2012 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2013 Best Practical Solutions, LLC %# <sales@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) diff --git a/rt/share/html/Elements/LoginRedirectWarning b/rt/share/html/Elements/LoginRedirectWarning index 891e38114..d6156894c 100644 --- a/rt/share/html/Elements/LoginRedirectWarning +++ b/rt/share/html/Elements/LoginRedirectWarning @@ -1,3 +1,50 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2013 Best Practical Solutions, LLC +%# <sales@bestpractical.com> +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} <%args> $next => undef </%args> diff --git a/rt/share/html/Elements/Logo b/rt/share/html/Elements/Logo index 8b4be4c81..a00f6bdfa 100644 --- a/rt/share/html/Elements/Logo +++ b/rt/share/html/Elements/Logo @@ -2,7 +2,7 @@ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2012 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2013 Best Practical Solutions, LLC %# <sales@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) diff --git a/rt/share/html/Elements/MakeClicky b/rt/share/html/Elements/MakeClicky index 57964f7a9..dabe3bb33 100644 --- a/rt/share/html/Elements/MakeClicky +++ b/rt/share/html/Elements/MakeClicky @@ -2,7 +2,7 @@ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2012 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2013 Best Practical Solutions, LLC %# <sales@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -48,20 +48,27 @@ <%ONCE> use Regexp::Common qw(URI); +my $escaper = sub { + my $content = shift; + RT::Interface::Web::EscapeUTF8( \$content ); + return $content; +}; + my %actions = ( default => sub { my %args = @_; - return $args{value}; + return $escaper->($args{value}); }, url => sub { my %args = @_; + $args{value} = $escaper->($args{value}); my $result = qq{[<a target="new" href="$args{value}">}. loc('Open URL') .qq{</a>]}; return $args{value} . qq{ <span class="clickylink">$result</span>}; }, url_overwrite => sub { my %args = @_; - my $result = qq{<a target="new" href="$args{'value'}">}; - $result .= qq{$args{'value'}</a>}; + $args{value} = $escaper->($args{value}); + my $result = qq{<a target="new" href="$args{value}">$args{value}</a>}; return qq{<span class="clickylink">$result</span>}; }, ); @@ -89,12 +96,6 @@ my $handle = sub { } }; -my $escaper = sub { - my $content = shift; - RT::Interface::Web::EscapeUTF8( \$content ); - return $content; -}; - # Hook to add more Clicky types # XXX Have to have Page argument, as Mason gets caller wrong in Callback? # This happens as we are in <%ONCE> block diff --git a/rt/share/html/Elements/Menu b/rt/share/html/Elements/Menu index b56bacda8..b2a2fb638 100755 --- a/rt/share/html/Elements/Menu +++ b/rt/share/html/Elements/Menu @@ -2,7 +2,7 @@ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2012 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2013 Best Practical Solutions, LLC %# <sales@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -61,8 +61,8 @@ % if ($child->raw_html) { <% $child->raw_html |n %> % } else { -% my $url = (not $child->path or $child->path =~ m{^\w+:/}) ? $child->path : RT->Config->Get('WebPath').$child->path; -<a id="<%$item_id%>" class="menu-item <% $child->class || '' %>"<% $child->path ? ' href="'.$url.'"' : '' |n%><% $child->target ? ' target="'.$child->target.'"' : '' |n %>>\ +% my $url = $m->interp->apply_escapes((not $child->path or $child->path =~ m{^\w+:/}) ? $child->path : RT->Config->Get('WebPath').$child->path, 'h'); +<a id="<%$item_id%>" class="menu-item <% $child->class || '' %>"<% $child->path ? ' href="'.$url.'"' : '' |n%><% $child->target ? ' target="'.$m->interp->apply_escapes($child->target, 'h').'"' : '' |n %>>\ <% $child->escape_title ? $m->interp->apply_escapes($child->title, 'h') : $child->title |n %>\ </a>\ % } @@ -82,3 +82,6 @@ $toplevel => 1 $parent_id => '' $depth => 0 </%ARGS> +<%init> +$id = $m->interp->apply_escapes($id, 'h'); +</%init> diff --git a/rt/share/html/Elements/MessageBox b/rt/share/html/Elements/MessageBox index 69227bfa9..6f55b2704 100755 --- a/rt/share/html/Elements/MessageBox +++ b/rt/share/html/Elements/MessageBox @@ -2,7 +2,7 @@ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2012 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2013 Best Practical Solutions, LLC %# <sales@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) diff --git a/rt/share/html/Elements/MyAdminQueues b/rt/share/html/Elements/MyAdminQueues index 92c87b53a..880ef3c8c 100644 --- a/rt/share/html/Elements/MyAdminQueues +++ b/rt/share/html/Elements/MyAdminQueues @@ -2,7 +2,7 @@ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2012 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2013 Best Practical Solutions, LLC %# <sales@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) diff --git a/rt/share/html/Elements/MyRT b/rt/share/html/Elements/MyRT index 2447fed04..9abfe955c 100644 --- a/rt/share/html/Elements/MyRT +++ b/rt/share/html/Elements/MyRT @@ -2,7 +2,7 @@ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2012 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2013 Best Practical Solutions, LLC %# <sales@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) diff --git a/rt/share/html/Elements/MyReminders b/rt/share/html/Elements/MyReminders index 2de4b530f..62eae563b 100755 --- a/rt/share/html/Elements/MyReminders +++ b/rt/share/html/Elements/MyReminders @@ -2,7 +2,7 @@ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2012 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2013 Best Practical Solutions, LLC %# <sales@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) diff --git a/rt/share/html/Elements/MyRequests b/rt/share/html/Elements/MyRequests index 2ceb7f5b8..4c0445437 100755 --- a/rt/share/html/Elements/MyRequests +++ b/rt/share/html/Elements/MyRequests @@ -2,7 +2,7 @@ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2012 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2013 Best Practical Solutions, LLC %# <sales@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) diff --git a/rt/share/html/Elements/MySupportQueues b/rt/share/html/Elements/MySupportQueues index a098d5e8e..6537ea12e 100644 --- a/rt/share/html/Elements/MySupportQueues +++ b/rt/share/html/Elements/MySupportQueues @@ -2,7 +2,7 @@ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2012 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2013 Best Practical Solutions, LLC %# <sales@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) diff --git a/rt/share/html/Elements/MyTickets b/rt/share/html/Elements/MyTickets index 2b9423299..e27450be5 100755 --- a/rt/share/html/Elements/MyTickets +++ b/rt/share/html/Elements/MyTickets @@ -2,7 +2,7 @@ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2012 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2013 Best Practical Solutions, LLC %# <sales@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) diff --git a/rt/share/html/Elements/PageLayout b/rt/share/html/Elements/PageLayout index 5956a3bed..c8ca0905e 100755 --- a/rt/share/html/Elements/PageLayout +++ b/rt/share/html/Elements/PageLayout @@ -2,7 +2,7 @@ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2012 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2013 Best Practical Solutions, LLC %# <sales@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) diff --git a/rt/share/html/Elements/PersonalQuickbar b/rt/share/html/Elements/PersonalQuickbar index d9b152879..feab1fe1a 100644 --- a/rt/share/html/Elements/PersonalQuickbar +++ b/rt/share/html/Elements/PersonalQuickbar @@ -2,7 +2,7 @@ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2012 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2013 Best Practical Solutions, LLC %# <sales@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) diff --git a/rt/share/html/Elements/QueriesAsComment b/rt/share/html/Elements/QueriesAsComment index 2658cc444..f8f67044b 100644 --- a/rt/share/html/Elements/QueriesAsComment +++ b/rt/share/html/Elements/QueriesAsComment @@ -2,7 +2,7 @@ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2012 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2013 Best Practical Solutions, LLC %# <sales@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) diff --git a/rt/share/html/Elements/QueryString b/rt/share/html/Elements/QueryString index 35a579c1a..bb5cf9102 100644 --- a/rt/share/html/Elements/QueryString +++ b/rt/share/html/Elements/QueryString @@ -2,7 +2,7 @@ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2012 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2013 Best Practical Solutions, LLC %# <sales@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) diff --git a/rt/share/html/Elements/QueueSummaryByLifecycle b/rt/share/html/Elements/QueueSummaryByLifecycle index 1410e82ef..44d6b5a8f 100644 --- a/rt/share/html/Elements/QueueSummaryByLifecycle +++ b/rt/share/html/Elements/QueueSummaryByLifecycle @@ -2,7 +2,7 @@ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2012 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2013 Best Practical Solutions, LLC %# <sales@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -66,20 +66,16 @@ for my $queue (@queues) { next if lc($queue->{Lifecycle} || '') ne lc $lifecycle->Name; $i++; - my $name = $queue->{Name}; - $name =~ s/(['\\])/\\$1/g; - my $queue_cond = "Queue = '$name' AND "; - my $all_q = $queue_cond . '(' . join( " OR ", map "Status = '$_'", @cur_statuses ) . ')'; </%PERL> <tr class="<% $i%2 ? 'oddline' : 'evenline'%>" > <td> - <a href="<% RT->Config->Get('WebPath') %>/Search/Results.html?Query=<% $all_q |u,n %>" title="<% $queue->{Description} %>"><% $queue->{Name} %></a> + <a href="<% $link_all->($queue, \@cur_statuses) %>" title="<% $queue->{Description} %>"><% $queue->{Name} %></a> </td> % for my $status (@cur_statuses) { <td align="right"> - <a href="<% RT->Config->Get('WebPath') %>/Search/Results.html?Query=<% $queue_cond ."Status = '$status'" |u,n %>"><% $data->{$queue->{id}}->{$status } || '-' %></a> + <a href="<% $link_status->($queue, $status) %>"><% $data->{$queue->{id}}->{$status } || '-' %></a> </td> % } </tr> @@ -87,6 +83,31 @@ for my $queue (@queues) { </table> % } <%INIT> +my $build_search_link = sub { + my ($queue_name, $extra_query) = @_; + $queue_name =~ s/(['\\])/\\$1/g; #' + + return RT->Config->Get('WebPath') + . "/Search/Results.html?Query=" + . $m->interp->apply_escapes("Queue = '$queue_name' AND $extra_query", 'u'); +}; + +my $link_all = sub { + my ($queue, $all_statuses) = @_; + return $build_search_link->($queue->{Name}, "(".join(" OR ", map "Status = '$_'", @$all_statuses).")"); +}; + +my $link_status = sub { + my ($queue, $status) = @_; + return $build_search_link->($queue->{Name}, "Status = '$status'"); +}; + +$m->callback( + CallbackName => 'LinkBuilders', + build_search_link => \$build_search_link, + link_all => \$link_all, + link_status => \$link_status, +); my $Queues = RT::Queues->new( $session{'CurrentUser'} ); $Queues->UnLimit(); diff --git a/rt/share/html/Elements/QueueSummaryByStatus b/rt/share/html/Elements/QueueSummaryByStatus index f649d2850..2a8dc5396 100644 --- a/rt/share/html/Elements/QueueSummaryByStatus +++ b/rt/share/html/Elements/QueueSummaryByStatus @@ -2,7 +2,7 @@ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2012 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2013 Best Practical Solutions, LLC %# <sales@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -58,16 +58,13 @@ my $i = 0; for my $queue (@queues) { $i++; - my $name = $queue->{Name}; - $name =~ s/(['\\])/\\$1/g; - my $queue_cond = "Queue = '$name' AND "; my $lifecycle = $lifecycle{ lc $queue->{'Lifecycle'} }; - my $all_q = $queue_cond . '(' . join( " OR ", map "Status = '$_'", grep $lifecycle->IsValid($_), @statuses ) . ')'; + my @queue_statuses = grep { $lifecycle->IsValid($_) } @statuses; </%PERL> <tr class="<% $i%2 ? 'oddline' : 'evenline'%>" > <td> - <a href="<% RT->Config->Get('WebPath') %>/Search/Results.html?Query=<% $all_q |u,n %>" title="<% $queue->{Description} %>"><% $queue->{Name} %></a> + <a href="<% $link_all->($queue, \@queue_statuses) %>" title="<% $queue->{Description} %>"><% $queue->{Name} %></a> </td> <%perl> @@ -75,7 +72,7 @@ for my $queue (@queues) { if ( $lifecycle->IsValid( $status ) ) { </%perl> <td align="right"> - <a href="<% RT->Config->Get('WebPath') %>/Search/Results.html?Query=<% $queue_cond ."Status = '$status'" |u,n %>"><% $data->{$queue->{id}}->{$status } || '-' %></a> + <a href="<% $link_status->($queue, $status) %>"><% $data->{$queue->{id}}->{$status } || '-' %></a> </td> % } else { <td align="right">-</td> @@ -85,6 +82,31 @@ for my $queue (@queues) { % } </table> <%INIT> +my $build_search_link = sub { + my ($queue_name, $extra_query) = @_; + $queue_name =~ s/(['\\])/\\$1/g; #' + + return RT->Config->Get('WebPath') + . "/Search/Results.html?Query=" + . $m->interp->apply_escapes("Queue = '$queue_name' AND $extra_query", 'u'); +}; + +my $link_all = sub { + my ($queue, $all_statuses) = @_; + return $build_search_link->($queue->{Name}, "(".join(" OR ", map "Status = '$_'", @$all_statuses).")"); +}; + +my $link_status = sub { + my ($queue, $status) = @_; + return $build_search_link->($queue->{Name}, "Status = '$status'"); +}; + +$m->callback( + CallbackName => 'LinkBuilders', + build_search_link => \$build_search_link, + link_all => \$link_all, + link_status => \$link_status, +); my $Queues = RT::Queues->new( $session{'CurrentUser'} ); $Queues->UnLimit(); diff --git a/rt/share/html/Elements/QuickCreate b/rt/share/html/Elements/QuickCreate index 94be7eb9c..4925168c1 100644 --- a/rt/share/html/Elements/QuickCreate +++ b/rt/share/html/Elements/QuickCreate @@ -2,7 +2,7 @@ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2012 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2013 Best Practical Solutions, LLC %# <sales@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) diff --git a/rt/share/html/Elements/Quicksearch b/rt/share/html/Elements/Quicksearch index abc859b7d..77814edbc 100755 --- a/rt/share/html/Elements/Quicksearch +++ b/rt/share/html/Elements/Quicksearch @@ -2,7 +2,7 @@ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2012 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2013 Best Practical Solutions, LLC %# <sales@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) diff --git a/rt/share/html/Elements/RT__Article/ColumnMap b/rt/share/html/Elements/RT__Article/ColumnMap index 133f3d463..e900e1975 100644 --- a/rt/share/html/Elements/RT__Article/ColumnMap +++ b/rt/share/html/Elements/RT__Article/ColumnMap @@ -2,7 +2,7 @@ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2012 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2013 Best Practical Solutions, LLC %# <sales@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) diff --git a/rt/share/html/Elements/RT__Class/ColumnMap b/rt/share/html/Elements/RT__Class/ColumnMap index 3875d96e8..114e333a5 100644 --- a/rt/share/html/Elements/RT__Class/ColumnMap +++ b/rt/share/html/Elements/RT__Class/ColumnMap @@ -2,7 +2,7 @@ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2012 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2013 Best Practical Solutions, LLC %# <sales@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) diff --git a/rt/share/html/Elements/RT__CustomField/ColumnMap b/rt/share/html/Elements/RT__CustomField/ColumnMap index b04398434..9df091d01 100644 --- a/rt/share/html/Elements/RT__CustomField/ColumnMap +++ b/rt/share/html/Elements/RT__CustomField/ColumnMap @@ -2,7 +2,7 @@ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2012 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2013 Best Practical Solutions, LLC %# <sales@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -162,10 +162,10 @@ my $COLUMN_MAP = { my @res = ( \'<a href="', $uri .'?'. $m->comp("/Elements/QueryString", %pass, MoveCustomFieldUp => $id ), - \'">', loc('[Up]'), \'</a>', + \'">', loc('~[Up~]'), \'</a>', \' <a href="', $uri .'?'. $m->comp("/Elements/QueryString", %pass, MoveCustomFieldDown => $id ), - \'">', loc('[Down]'), \'</a>' + \'">', loc('~[Down~]'), \'</a>' ); return @res; diff --git a/rt/share/html/Elements/RT__Dashboard/ColumnMap b/rt/share/html/Elements/RT__Dashboard/ColumnMap index 6c366ec78..2d971635a 100644 --- a/rt/share/html/Elements/RT__Dashboard/ColumnMap +++ b/rt/share/html/Elements/RT__Dashboard/ColumnMap @@ -2,7 +2,7 @@ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2012 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2013 Best Practical Solutions, LLC %# <sales@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) diff --git a/rt/share/html/Elements/RT__Group/ColumnMap b/rt/share/html/Elements/RT__Group/ColumnMap index bfc520b0f..3c22debf8 100644 --- a/rt/share/html/Elements/RT__Group/ColumnMap +++ b/rt/share/html/Elements/RT__Group/ColumnMap @@ -2,7 +2,7 @@ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2012 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2013 Best Practical Solutions, LLC %# <sales@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) diff --git a/rt/share/html/Elements/RT__Queue/ColumnMap b/rt/share/html/Elements/RT__Queue/ColumnMap index e08dd7c91..47a673e66 100644 --- a/rt/share/html/Elements/RT__Queue/ColumnMap +++ b/rt/share/html/Elements/RT__Queue/ColumnMap @@ -2,7 +2,7 @@ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2012 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2013 Best Practical Solutions, LLC %# <sales@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -74,6 +74,7 @@ my $COLUMN_MAP = { # SubjectTag is special as we can not sort SubjectTag => { title => 'SubjectTag', # loc + attribute => 'SubjectTag', value => sub { return $_[0]->SubjectTag }, }, Sign => { diff --git a/rt/share/html/Elements/RT__SavedSearch/ColumnMap b/rt/share/html/Elements/RT__SavedSearch/ColumnMap index 381e120f7..296787bb1 100644 --- a/rt/share/html/Elements/RT__SavedSearch/ColumnMap +++ b/rt/share/html/Elements/RT__SavedSearch/ColumnMap @@ -2,7 +2,7 @@ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2012 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2013 Best Practical Solutions, LLC %# <sales@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) diff --git a/rt/share/html/Elements/RT__Scrip/ColumnMap b/rt/share/html/Elements/RT__Scrip/ColumnMap index 776a2d8a3..976d76205 100644 --- a/rt/share/html/Elements/RT__Scrip/ColumnMap +++ b/rt/share/html/Elements/RT__Scrip/ColumnMap @@ -2,7 +2,7 @@ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2012 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2013 Best Practical Solutions, LLC %# <sales@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) diff --git a/rt/share/html/Elements/RT__Template/ColumnMap b/rt/share/html/Elements/RT__Template/ColumnMap index 5a8c6f2c7..5da71b146 100644 --- a/rt/share/html/Elements/RT__Template/ColumnMap +++ b/rt/share/html/Elements/RT__Template/ColumnMap @@ -2,7 +2,7 @@ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2012 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2013 Best Practical Solutions, LLC %# <sales@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) diff --git a/rt/share/html/Elements/RT__Ticket/ColumnMap b/rt/share/html/Elements/RT__Ticket/ColumnMap index 239e58183..202a11a5e 100644 --- a/rt/share/html/Elements/RT__Ticket/ColumnMap +++ b/rt/share/html/Elements/RT__Ticket/ColumnMap @@ -2,7 +2,7 @@ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2012 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2013 Best Practical Solutions, LLC %# <sales@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) diff --git a/rt/share/html/Elements/RT__User/ColumnMap b/rt/share/html/Elements/RT__User/ColumnMap index 1f8fc20cb..7a6eb25d1 100644 --- a/rt/share/html/Elements/RT__User/ColumnMap +++ b/rt/share/html/Elements/RT__User/ColumnMap @@ -2,7 +2,7 @@ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2012 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2013 Best Practical Solutions, LLC %# <sales@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) diff --git a/rt/share/html/Elements/Refresh b/rt/share/html/Elements/Refresh index ee51fb3af..432bc8041 100755 --- a/rt/share/html/Elements/Refresh +++ b/rt/share/html/Elements/Refresh @@ -2,7 +2,7 @@ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2012 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2013 Best Practical Solutions, LLC %# <sales@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) diff --git a/rt/share/html/Elements/RefreshHomepage b/rt/share/html/Elements/RefreshHomepage index 2cdaf4af9..5729f4042 100644 --- a/rt/share/html/Elements/RefreshHomepage +++ b/rt/share/html/Elements/RefreshHomepage @@ -2,7 +2,7 @@ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2012 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2013 Best Practical Solutions, LLC %# <sales@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) diff --git a/rt/share/html/Elements/SavedSearches b/rt/share/html/Elements/SavedSearches index b18d86c52..20e9903b5 100644 --- a/rt/share/html/Elements/SavedSearches +++ b/rt/share/html/Elements/SavedSearches @@ -2,7 +2,7 @@ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2012 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2013 Best Practical Solutions, LLC %# <sales@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) diff --git a/rt/share/html/Elements/ScrubHTML b/rt/share/html/Elements/ScrubHTML index 47d125d89..ecc3fbb5f 100644 --- a/rt/share/html/Elements/ScrubHTML +++ b/rt/share/html/Elements/ScrubHTML @@ -2,7 +2,7 @@ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2012 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2013 Best Practical Solutions, LLC %# <sales@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) diff --git a/rt/share/html/Elements/Section b/rt/share/html/Elements/Section index 8929d9e0e..4655f78ee 100755 --- a/rt/share/html/Elements/Section +++ b/rt/share/html/Elements/Section @@ -2,7 +2,7 @@ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2012 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2013 Best Practical Solutions, LLC %# <sales@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) diff --git a/rt/share/html/Elements/SelectAttachmentField b/rt/share/html/Elements/SelectAttachmentField index 41477427e..a74a46a76 100755 --- a/rt/share/html/Elements/SelectAttachmentField +++ b/rt/share/html/Elements/SelectAttachmentField @@ -2,7 +2,7 @@ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2012 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2013 Best Practical Solutions, LLC %# <sales@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) diff --git a/rt/share/html/Elements/SelectBoolean b/rt/share/html/Elements/SelectBoolean index 2de10246f..c328ae23c 100755 --- a/rt/share/html/Elements/SelectBoolean +++ b/rt/share/html/Elements/SelectBoolean @@ -2,7 +2,7 @@ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2012 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2013 Best Practical Solutions, LLC %# <sales@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) diff --git a/rt/share/html/Elements/SelectCustomFieldOperator b/rt/share/html/Elements/SelectCustomFieldOperator index 73243dae4..48538adaa 100755 --- a/rt/share/html/Elements/SelectCustomFieldOperator +++ b/rt/share/html/Elements/SelectCustomFieldOperator @@ -2,7 +2,7 @@ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2012 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2013 Best Practical Solutions, LLC %# <sales@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) diff --git a/rt/share/html/Elements/SelectCustomFieldValue b/rt/share/html/Elements/SelectCustomFieldValue index 5c2e2ceb7..3e1bdbe60 100755 --- a/rt/share/html/Elements/SelectCustomFieldValue +++ b/rt/share/html/Elements/SelectCustomFieldValue @@ -2,7 +2,7 @@ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2012 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2013 Best Practical Solutions, LLC %# <sales@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) diff --git a/rt/share/html/Elements/SelectDate b/rt/share/html/Elements/SelectDate index 46178b059..ed8c9e46a 100755 --- a/rt/share/html/Elements/SelectDate +++ b/rt/share/html/Elements/SelectDate @@ -2,7 +2,7 @@ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2012 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2013 Best Practical Solutions, LLC %# <sales@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) diff --git a/rt/share/html/Elements/SelectDateRelation b/rt/share/html/Elements/SelectDateRelation index 654806e99..1fe424a3d 100755 --- a/rt/share/html/Elements/SelectDateRelation +++ b/rt/share/html/Elements/SelectDateRelation @@ -2,7 +2,7 @@ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2012 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2013 Best Practical Solutions, LLC %# <sales@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) diff --git a/rt/share/html/Elements/SelectDateType b/rt/share/html/Elements/SelectDateType index 68f6ffe66..59a7b1543 100755 --- a/rt/share/html/Elements/SelectDateType +++ b/rt/share/html/Elements/SelectDateType @@ -2,7 +2,7 @@ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2012 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2013 Best Practical Solutions, LLC %# <sales@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) diff --git a/rt/share/html/Elements/SelectEqualityOperator b/rt/share/html/Elements/SelectEqualityOperator index 1295b3951..4cb56ca57 100755 --- a/rt/share/html/Elements/SelectEqualityOperator +++ b/rt/share/html/Elements/SelectEqualityOperator @@ -2,7 +2,7 @@ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2012 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2013 Best Practical Solutions, LLC %# <sales@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) diff --git a/rt/share/html/Elements/SelectGroups b/rt/share/html/Elements/SelectGroups index 302f73e77..f9910a205 100755 --- a/rt/share/html/Elements/SelectGroups +++ b/rt/share/html/Elements/SelectGroups @@ -2,7 +2,7 @@ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2012 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2013 Best Practical Solutions, LLC %# <sales@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) diff --git a/rt/share/html/Elements/SelectIPRelation b/rt/share/html/Elements/SelectIPRelation index ec9f58d13..19c9a1f69 100644 --- a/rt/share/html/Elements/SelectIPRelation +++ b/rt/share/html/Elements/SelectIPRelation @@ -2,7 +2,7 @@ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2012 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2013 Best Practical Solutions, LLC %# <sales@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) diff --git a/rt/share/html/Elements/SelectLang b/rt/share/html/Elements/SelectLang index df98a1309..41e56e651 100755 --- a/rt/share/html/Elements/SelectLang +++ b/rt/share/html/Elements/SelectLang @@ -2,7 +2,7 @@ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2012 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2013 Best Practical Solutions, LLC %# <sales@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) diff --git a/rt/share/html/Elements/SelectLinkType b/rt/share/html/Elements/SelectLinkType index cc6f852dc..240a5d61d 100755 --- a/rt/share/html/Elements/SelectLinkType +++ b/rt/share/html/Elements/SelectLinkType @@ -2,7 +2,7 @@ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2012 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2013 Best Practical Solutions, LLC %# <sales@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) diff --git a/rt/share/html/Elements/SelectMatch b/rt/share/html/Elements/SelectMatch index 692b0efca..edabefb56 100755 --- a/rt/share/html/Elements/SelectMatch +++ b/rt/share/html/Elements/SelectMatch @@ -2,7 +2,7 @@ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2012 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2013 Best Practical Solutions, LLC %# <sales@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) diff --git a/rt/share/html/Elements/SelectNewTicketQueue b/rt/share/html/Elements/SelectNewTicketQueue index 03644187b..2afe34ba1 100755 --- a/rt/share/html/Elements/SelectNewTicketQueue +++ b/rt/share/html/Elements/SelectNewTicketQueue @@ -2,7 +2,7 @@ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2012 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2013 Best Practical Solutions, LLC %# <sales@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) diff --git a/rt/share/html/Elements/SelectOwner b/rt/share/html/Elements/SelectOwner index 37a5971ac..9a351dfee 100755 --- a/rt/share/html/Elements/SelectOwner +++ b/rt/share/html/Elements/SelectOwner @@ -2,7 +2,7 @@ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2012 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2013 Best Practical Solutions, LLC %# <sales@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) diff --git a/rt/share/html/Elements/SelectOwnerAutocomplete b/rt/share/html/Elements/SelectOwnerAutocomplete index 81b38386c..d5aad4d25 100644 --- a/rt/share/html/Elements/SelectOwnerAutocomplete +++ b/rt/share/html/Elements/SelectOwnerAutocomplete @@ -2,7 +2,7 @@ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2012 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2013 Best Practical Solutions, LLC %# <sales@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) diff --git a/rt/share/html/Elements/SelectOwnerDropdown b/rt/share/html/Elements/SelectOwnerDropdown index 5dd642960..a051d57f2 100644 --- a/rt/share/html/Elements/SelectOwnerDropdown +++ b/rt/share/html/Elements/SelectOwnerDropdown @@ -2,7 +2,7 @@ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2012 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2013 Best Practical Solutions, LLC %# <sales@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) diff --git a/rt/share/html/Elements/SelectPriority b/rt/share/html/Elements/SelectPriority index 1b4dac148..c49182816 100644 --- a/rt/share/html/Elements/SelectPriority +++ b/rt/share/html/Elements/SelectPriority @@ -2,7 +2,7 @@ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2012 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2013 Best Practical Solutions, LLC %# <sales@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) diff --git a/rt/share/html/Elements/SelectQueue b/rt/share/html/Elements/SelectQueue index b0a191a7e..e5b053b05 100755 --- a/rt/share/html/Elements/SelectQueue +++ b/rt/share/html/Elements/SelectQueue @@ -2,7 +2,7 @@ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2012 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2013 Best Practical Solutions, LLC %# <sales@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) diff --git a/rt/share/html/Elements/SelectResultsPerPage b/rt/share/html/Elements/SelectResultsPerPage index eababedd9..c39ea37f3 100755 --- a/rt/share/html/Elements/SelectResultsPerPage +++ b/rt/share/html/Elements/SelectResultsPerPage @@ -2,7 +2,7 @@ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2012 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2013 Best Practical Solutions, LLC %# <sales@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) diff --git a/rt/share/html/Elements/SelectSortOrder b/rt/share/html/Elements/SelectSortOrder index 0515ab18e..33d03b6f5 100755 --- a/rt/share/html/Elements/SelectSortOrder +++ b/rt/share/html/Elements/SelectSortOrder @@ -2,7 +2,7 @@ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2012 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2013 Best Practical Solutions, LLC %# <sales@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) diff --git a/rt/share/html/Elements/SelectStatus b/rt/share/html/Elements/SelectStatus index af1ff615f..7e3e0cc67 100755 --- a/rt/share/html/Elements/SelectStatus +++ b/rt/share/html/Elements/SelectStatus @@ -2,7 +2,7 @@ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2012 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2013 Best Practical Solutions, LLC %# <sales@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -50,21 +50,29 @@ % if ( $DefaultValue ) { <option value=""<% !$Default && qq[ selected="selected"] |n %>><% $DefaultLabel %></option> % } -% foreach my $status (@status) { -% next if ($SkipDeleted && $status eq 'deleted'); -% my $selected = defined $Default && $status eq $Default ? 'selected="selected"' : ''; +% for my $lifecycle (sort keys %statuses_by_lifecycle) { +% if ($group_by_lifecycle) { +<optgroup label="<% $lifecycle %>"> +% } +% foreach my $status (@{$statuses_by_lifecycle{$lifecycle}}) { +% next if ($SkipDeleted && $status eq 'deleted'); +% my $selected = defined $Default && $status eq $Default ? 'selected="selected"' : ''; <option value="<% $status %>" <% $selected |n %>><% loc($status) %></option> +% } +% if ($group_by_lifecycle) { +</optgroup> +% } % } </select> <%INIT> ### XXX: no cover for Tools/MyDay.html - -my @status; +my %statuses_by_lifecycle; if ( @Statuses ) { - @status = @Statuses; + $statuses_by_lifecycle{''} = \@Statuses; } elsif ( $TicketObj ) { + my @status; my $current = $TicketObj->Status; push @status, $current; @@ -77,20 +85,50 @@ elsif ( $TicketObj ) { unless exists $has{ $check }; push @status, $next if $has{ $check }; } + $statuses_by_lifecycle{$lifecycle->Name} = \@status; } elsif ( $QueueObj ) { - @status = $QueueObj->Lifecycle->Transitions(''); + my $lifecycle = $QueueObj->Lifecycle; + $statuses_by_lifecycle{$lifecycle->Name} = [ $lifecycle->Transitions('') ]; } elsif ( %Queues ) { for my $id (keys %Queues) { my $queue = RT::Queue->new($session{'CurrentUser'}); $queue->Load($id); - push @status, $queue->Lifecycle->Valid if $queue->id; + if ($queue->id) { + my $lifecycle = $queue->Lifecycle; + $statuses_by_lifecycle{$lifecycle->Name} = [ $lifecycle->Valid ]; + } } - my %seen; - @status = grep { not $seen{$_}++ } @status; } else { - @status = RT::Queue->Lifecycle->Valid; + for my $lifecycle (map { RT::Lifecycle->Load($_) } RT::Lifecycle->List) { + $statuses_by_lifecycle{$lifecycle->Name} = [ $lifecycle->Valid ]; + } +} + +if (keys %statuses_by_lifecycle) { + my %simplified; + my $key = sub { + join "\0", sort @{$_[0]}; + }; + for my $name (sort keys %statuses_by_lifecycle) { + my $matched; + my $statuses = $statuses_by_lifecycle{$name}; + for my $simple (sort keys %simplified) { + if ($key->($statuses) eq $key->($simplified{$simple})) { + # Statuses are the same, join 'em! + $simplified{"$simple, $name"} = delete $simplified{$simple}; + $matched++; + last; + } + } + unless ($matched) { + $simplified{$name} = $statuses; + } + } + %statuses_by_lifecycle = %simplified; } + +my $group_by_lifecycle = keys %statuses_by_lifecycle > 1; </%INIT> <%ARGS> $Name => undef diff --git a/rt/share/html/Elements/SelectTicketSortBy b/rt/share/html/Elements/SelectTicketSortBy index 29db77f84..7fc294099 100755 --- a/rt/share/html/Elements/SelectTicketSortBy +++ b/rt/share/html/Elements/SelectTicketSortBy @@ -2,7 +2,7 @@ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2012 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2013 Best Practical Solutions, LLC %# <sales@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) diff --git a/rt/share/html/Elements/SelectTicketTypes b/rt/share/html/Elements/SelectTicketTypes index d83c6c93f..4f4cf2c01 100755 --- a/rt/share/html/Elements/SelectTicketTypes +++ b/rt/share/html/Elements/SelectTicketTypes @@ -2,7 +2,7 @@ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2012 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2013 Best Practical Solutions, LLC %# <sales@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) diff --git a/rt/share/html/Elements/SelectTimeUnits b/rt/share/html/Elements/SelectTimeUnits index 3ac6a12dc..f6e7c9bd0 100755 --- a/rt/share/html/Elements/SelectTimeUnits +++ b/rt/share/html/Elements/SelectTimeUnits @@ -2,7 +2,7 @@ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2012 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2013 Best Practical Solutions, LLC %# <sales@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) diff --git a/rt/share/html/Elements/SelectTimezone b/rt/share/html/Elements/SelectTimezone index c77311e8f..5f5bd5a38 100644 --- a/rt/share/html/Elements/SelectTimezone +++ b/rt/share/html/Elements/SelectTimezone @@ -2,7 +2,7 @@ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2012 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2013 Best Practical Solutions, LLC %# <sales@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) diff --git a/rt/share/html/Elements/SelectUsers b/rt/share/html/Elements/SelectUsers index 2522a92ed..311e3e1b9 100755 --- a/rt/share/html/Elements/SelectUsers +++ b/rt/share/html/Elements/SelectUsers @@ -2,7 +2,7 @@ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2012 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2013 Best Practical Solutions, LLC %# <sales@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) diff --git a/rt/share/html/Elements/SelectWatcherType b/rt/share/html/Elements/SelectWatcherType index 4f1df60b2..dc9f02015 100755 --- a/rt/share/html/Elements/SelectWatcherType +++ b/rt/share/html/Elements/SelectWatcherType @@ -2,7 +2,7 @@ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2012 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2013 Best Practical Solutions, LLC %# <sales@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) diff --git a/rt/share/html/Elements/SetupSessionCookie b/rt/share/html/Elements/SetupSessionCookie index 6c024c248..7cfcf9557 100755 --- a/rt/share/html/Elements/SetupSessionCookie +++ b/rt/share/html/Elements/SetupSessionCookie @@ -2,7 +2,7 @@ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2012 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2013 Best Practical Solutions, LLC %# <sales@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) diff --git a/rt/share/html/Elements/ShowCustomFieldBinary b/rt/share/html/Elements/ShowCustomFieldBinary index 04e6877dc..306f46314 100644 --- a/rt/share/html/Elements/ShowCustomFieldBinary +++ b/rt/share/html/Elements/ShowCustomFieldBinary @@ -2,7 +2,7 @@ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2012 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2013 Best Practical Solutions, LLC %# <sales@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -45,7 +45,7 @@ %# those contributions and any derivatives thereof. %# %# END BPS TAGGED BLOCK }}} -<a href="<%RT->Config->Get('WebPath')%>/Download/CustomFieldValue/<% $Object->Id %>/<% $Object->Content |u %>"><% $Object->Content %></a> +<a href="<%RT->Config->Get('WebPath')%>/Download/CustomFieldValue/<% $Object->Id %>/<% $Object->Content |un %>"><% $Object->Content %></a> <%ARGS> $Object => undef </%ARGS> diff --git a/rt/share/html/Elements/ShowCustomFieldDate b/rt/share/html/Elements/ShowCustomFieldDate index 8c94c131c..4cfb96596 100644 --- a/rt/share/html/Elements/ShowCustomFieldDate +++ b/rt/share/html/Elements/ShowCustomFieldDate @@ -2,7 +2,7 @@ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2012 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2013 Best Practical Solutions, LLC %# <sales@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -48,8 +48,8 @@ <%INIT> my $content = $Object->Content; my $DateObj = RT::Date->new ( $session{'CurrentUser'} ); - $DateObj->Set( Format => 'unknown', Value => $content ); - $content = $DateObj->AsString(Time => 0); + $DateObj->Set( Format => 'unknown', Value => $content, Timezone => 'utc' ); + $content = $DateObj->AsString(Time => 0, Timezone => 'utc'); </%INIT> <%$content|n%> <%ARGS> diff --git a/rt/share/html/Elements/ShowCustomFieldDateTime b/rt/share/html/Elements/ShowCustomFieldDateTime index e7a9a2bdc..61a430d7d 100644 --- a/rt/share/html/Elements/ShowCustomFieldDateTime +++ b/rt/share/html/Elements/ShowCustomFieldDateTime @@ -2,7 +2,7 @@ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2012 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2013 Best Practical Solutions, LLC %# <sales@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) diff --git a/rt/share/html/Elements/ShowCustomFieldImage b/rt/share/html/Elements/ShowCustomFieldImage index 0272b409d..07796966c 100644 --- a/rt/share/html/Elements/ShowCustomFieldImage +++ b/rt/share/html/Elements/ShowCustomFieldImage @@ -2,7 +2,7 @@ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2012 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2013 Best Practical Solutions, LLC %# <sales@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) diff --git a/rt/share/html/Elements/ShowCustomFieldText b/rt/share/html/Elements/ShowCustomFieldText index 2b0fd3e14..0e061ee6d 100644 --- a/rt/share/html/Elements/ShowCustomFieldText +++ b/rt/share/html/Elements/ShowCustomFieldText @@ -2,7 +2,7 @@ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2012 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2013 Best Practical Solutions, LLC %# <sales@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) diff --git a/rt/share/html/Elements/ShowCustomFieldWikitext b/rt/share/html/Elements/ShowCustomFieldWikitext index 337606139..31391ee5c 100644 --- a/rt/share/html/Elements/ShowCustomFieldWikitext +++ b/rt/share/html/Elements/ShowCustomFieldWikitext @@ -2,7 +2,7 @@ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2012 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2013 Best Practical Solutions, LLC %# <sales@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) diff --git a/rt/share/html/Elements/ShowCustomFields b/rt/share/html/Elements/ShowCustomFields index 6059f4ee7..6a6fb9c79 100644 --- a/rt/share/html/Elements/ShowCustomFields +++ b/rt/share/html/Elements/ShowCustomFields @@ -2,7 +2,7 @@ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2012 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2013 Best Practical Solutions, LLC %# <sales@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) diff --git a/rt/share/html/Elements/ShowLink b/rt/share/html/Elements/ShowLink index 1727fa397..1f8568ae9 100644 --- a/rt/share/html/Elements/ShowLink +++ b/rt/share/html/Elements/ShowLink @@ -2,7 +2,7 @@ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2012 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2013 Best Practical Solutions, LLC %# <sales@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) diff --git a/rt/share/html/Elements/ShowLinks b/rt/share/html/Elements/ShowLinks index 61628de4d..c06c6f7ef 100755 --- a/rt/share/html/Elements/ShowLinks +++ b/rt/share/html/Elements/ShowLinks @@ -2,7 +2,7 @@ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2012 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2013 Best Practical Solutions, LLC %# <sales@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) diff --git a/rt/share/html/Elements/ShowMemberships b/rt/share/html/Elements/ShowMemberships index 07fcdc67b..0dbe67c80 100644 --- a/rt/share/html/Elements/ShowMemberships +++ b/rt/share/html/Elements/ShowMemberships @@ -2,7 +2,7 @@ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2012 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2013 Best Practical Solutions, LLC %# <sales@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) diff --git a/rt/share/html/Elements/ShowRelationLabel b/rt/share/html/Elements/ShowRelationLabel index 9e6ea97a3..b486b7fed 100644 --- a/rt/share/html/Elements/ShowRelationLabel +++ b/rt/share/html/Elements/ShowRelationLabel @@ -2,7 +2,7 @@ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2012 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2013 Best Practical Solutions, LLC %# <sales@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) diff --git a/rt/share/html/Elements/ShowReminders b/rt/share/html/Elements/ShowReminders index 34cde464a..ca5b33835 100644 --- a/rt/share/html/Elements/ShowReminders +++ b/rt/share/html/Elements/ShowReminders @@ -2,7 +2,7 @@ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2012 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2013 Best Practical Solutions, LLC %# <sales@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -60,6 +60,7 @@ my $dueobj = $reminder->DueObj; my $overdue = $dueobj->Unix > 0 && $dueobj->Diff < 0 ? 1 : 0; my $targets = RT::Tickets->new($session{'CurrentUser'}); +$targets->{'allow_deleted_search'} = 1; $targets->FromSQL( "ReferredToBy = " . $reminder->id ); if ( my $ticket= $targets->First ) { diff --git a/rt/share/html/Elements/ShowSearch b/rt/share/html/Elements/ShowSearch index 4b96bbfda..8bdbd8aae 100644 --- a/rt/share/html/Elements/ShowSearch +++ b/rt/share/html/Elements/ShowSearch @@ -2,7 +2,7 @@ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2012 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2013 Best Practical Solutions, LLC %# <sales@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -46,7 +46,7 @@ %# %# END BPS TAGGED BLOCK }}} <&|/Widgets/TitleBox, - title => loc($desc, $ProcessedSearchArg->{'Rows'}), + title => loc(RT::SavedSearch->EscapeDescription($search->Description), $ProcessedSearchArg->{'Rows'}), title_href => $query_link_url.$QueryString, titleright => $customize ? loc('Edit') : '', titleright_href => $customize, @@ -141,14 +141,6 @@ foreach ( $SearchArg, $ProcessedSearchArg ) { } my $QueryString = '?' . $m->comp( '/Elements/QueryString', %$SearchArg ); - -my $desc = $search->Description; - -# we only use [_1] here, let's escape other "[" and "]" unless they are -# escaped already -$desc =~ s/(?<!~)\[(?!_1\])/~[/g; -$desc =~ s/(?<!~)(?<!\[_1)\]/~]/g; - </%init> <%ARGS> $Name => undef diff --git a/rt/share/html/Elements/ShowUser b/rt/share/html/Elements/ShowUser index 365497765..678a45cd8 100644 --- a/rt/share/html/Elements/ShowUser +++ b/rt/share/html/Elements/ShowUser @@ -2,7 +2,7 @@ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2012 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2013 Best Practical Solutions, LLC %# <sales@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) diff --git a/rt/share/html/Elements/ShowUserConcise b/rt/share/html/Elements/ShowUserConcise index b56ba8372..a68ba4fee 100644 --- a/rt/share/html/Elements/ShowUserConcise +++ b/rt/share/html/Elements/ShowUserConcise @@ -2,7 +2,7 @@ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2012 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2013 Best Practical Solutions, LLC %# <sales@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) diff --git a/rt/share/html/Elements/ShowUserEmailFrequency b/rt/share/html/Elements/ShowUserEmailFrequency index 4a02e124c..b18961dd4 100644 --- a/rt/share/html/Elements/ShowUserEmailFrequency +++ b/rt/share/html/Elements/ShowUserEmailFrequency @@ -2,7 +2,7 @@ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2012 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2013 Best Practical Solutions, LLC %# <sales@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) diff --git a/rt/share/html/Elements/ShowUserVerbose b/rt/share/html/Elements/ShowUserVerbose index 9ff8cbbc8..f805b575a 100644 --- a/rt/share/html/Elements/ShowUserVerbose +++ b/rt/share/html/Elements/ShowUserVerbose @@ -2,7 +2,7 @@ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2012 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2013 Best Practical Solutions, LLC %# <sales@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -54,8 +54,9 @@ my $comment = ''; if ($User) { $address = $User->EmailAddress; - $phrase = $User->RealName if $User->RealName && lc $User->RealName ne lc $address; - $comment = $User->Name if lc $User->Name ne lc $address; + $phrase = $User->RealName + if $User->RealName && ( !$address || lc $User->RealName ne lc $address ); + $comment = $User->Name if !$address || lc $User->Name ne lc $address; } else { $address = $Address; } diff --git a/rt/share/html/Elements/SimpleSearch b/rt/share/html/Elements/SimpleSearch index 533698d67..6d9bce84c 100755 --- a/rt/share/html/Elements/SimpleSearch +++ b/rt/share/html/Elements/SimpleSearch @@ -2,7 +2,7 @@ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2012 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2013 Best Practical Solutions, LLC %# <sales@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) diff --git a/rt/share/html/Elements/Submit b/rt/share/html/Elements/Submit index b7840d34b..d1bf0a53b 100755 --- a/rt/share/html/Elements/Submit +++ b/rt/share/html/Elements/Submit @@ -2,7 +2,7 @@ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2012 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2013 Best Practical Solutions, LLC %# <sales@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) diff --git a/rt/share/html/Elements/Tabs b/rt/share/html/Elements/Tabs index d899071fa..a82cdd1be 100755 --- a/rt/share/html/Elements/Tabs +++ b/rt/share/html/Elements/Tabs @@ -2,7 +2,7 @@ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2012 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2013 Best Practical Solutions, LLC %# <sales@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -270,29 +270,31 @@ my $build_admin_menu = sub { my $queue_obj = RT::Queue->new( $session{'CurrentUser'} ); $queue_obj->Load($id); - my $queue = PageMenu(); - $queue->child( basics => title => loc('Basics'), path => "/Admin/Queues/Modify.html?id=" . $id ); - $queue->child( people => title => loc('Watchers'), path => "/Admin/Queues/People.html?id=" . $id ); + if ( $queue_obj and $queue_obj->id ) { + my $queue = PageMenu(); + $queue->child( basics => title => loc('Basics'), path => "/Admin/Queues/Modify.html?id=" . $id ); + $queue->child( people => title => loc('Watchers'), path => "/Admin/Queues/People.html?id=" . $id ); - my $templates = $queue->child(templates => title => loc('Templates'), path => "/Admin/Queues/Templates.html?id=" . $id); - $templates->child( select => title => loc('Select'), path => "/Admin/Queues/Templates.html?id=".$id); - $templates->child( create => title => loc('Create'), path => "/Admin/Queues/Template.html?Create=1;Queue=".$id); + my $templates = $queue->child(templates => title => loc('Templates'), path => "/Admin/Queues/Templates.html?id=" . $id); + $templates->child( select => title => loc('Select'), path => "/Admin/Queues/Templates.html?id=".$id); + $templates->child( create => title => loc('Create'), path => "/Admin/Queues/Template.html?Create=1;Queue=".$id); - my $scrips = $queue->child( scrips => title => loc('Scrips'), path => "/Admin/Queues/Scrips.html?id=" . $id); - $scrips->child( select => title => loc('Select'), path => "/Admin/Queues/Scrips.html?id=" . $id ); - $scrips->child( create => title => loc('Create'), path => "/Admin/Queues/Scrip.html?Create=1;Queue=" . $id); + my $scrips = $queue->child( scrips => title => loc('Scrips'), path => "/Admin/Queues/Scrips.html?id=" . $id); + $scrips->child( select => title => loc('Select'), path => "/Admin/Queues/Scrips.html?id=" . $id ); + $scrips->child( create => title => loc('Create'), path => "/Admin/Queues/Scrip.html?Create=1;Queue=" . $id); - my $ticket_cfs = $queue->child( 'ticket-custom-fields' => title => loc('Ticket Custom Fields'), - path => '/Admin/Queues/CustomFields.html?SubType=RT::Ticket&id=' . $id ); + my $ticket_cfs = $queue->child( 'ticket-custom-fields' => title => loc('Ticket Custom Fields'), + path => '/Admin/Queues/CustomFields.html?SubType=RT::Ticket&id=' . $id ); - my $txn_cfs = $queue->child( 'transaction-custom-fields' => title => loc('Transaction Custom Fields'), - path => '/Admin/Queues/CustomFields.html?SubType=RT::Ticket-RT::Transaction&id='.$id ); + my $txn_cfs = $queue->child( 'transaction-custom-fields' => title => loc('Transaction Custom Fields'), + path => '/Admin/Queues/CustomFields.html?SubType=RT::Ticket-RT::Transaction&id='.$id ); - $queue->child( 'group-rights' => title => loc('Group Rights'), path => "/Admin/Queues/GroupRights.html?id=".$id ); - $queue->child( 'user-rights' => title => loc('User Rights'), path => "/Admin/Queues/UserRights.html?id=" . $id ); + $queue->child( 'group-rights' => title => loc('Group Rights'), path => "/Admin/Queues/GroupRights.html?id=".$id ); + $queue->child( 'user-rights' => title => loc('User Rights'), path => "/Admin/Queues/UserRights.html?id=" . $id ); + $queue->child( 'history' => title => loc('History'), path => "/Admin/Queues/History.html?id=" . $id ); - - $m->callback( CallbackName => 'PrivilegedQueue', queue_id => $id, page_menu => $queue); + $m->callback( CallbackName => 'PrivilegedQueue', queue_id => $id, page_menu => $queue); + } } } if ( $request_path =~ m{^/Admin/Users} ) { @@ -301,13 +303,15 @@ my $build_admin_menu = sub { my $obj = RT::User->new( $session{'CurrentUser'} ); $obj->Load($id); - my $tabs = PageMenu(); - $tabs->child( basics => title => loc('Basics'), path => "/Admin/Users/Modify.html?id=" . $id ); - $tabs->child( memberships => title => loc('Memberships'), path => "/Admin/Users/Memberships.html?id=" . $id ); - $tabs->child( history => title => loc('History'), path => "/Admin/Users/History.html?id=" . $id ); - $tabs->child( 'my-rt' => title => loc('RT at a glance'), path => "/Admin/Users/MyRT.html?id=" . $id ); - if ( RT->Config->Get('GnuPG')->{'Enable'} ) { - $tabs->child( pgp => title => loc('GnuPG'), path => "/Admin/Users/GnuPG.html?id=" . $id ); + if ( $obj and $obj->id ) { + my $tabs = PageMenu(); + $tabs->child( basics => title => loc('Basics'), path => "/Admin/Users/Modify.html?id=" . $id ); + $tabs->child( memberships => title => loc('Memberships'), path => "/Admin/Users/Memberships.html?id=" . $id ); + $tabs->child( history => title => loc('History'), path => "/Admin/Users/History.html?id=" . $id ); + $tabs->child( 'my-rt' => title => loc('RT at a glance'), path => "/Admin/Users/MyRT.html?id=" . $id ); + if ( RT->Config->Get('GnuPG')->{'Enable'} ) { + $tabs->child( pgp => title => loc('GnuPG'), path => "/Admin/Users/GnuPG.html?id=" . $id ); + } } } @@ -319,12 +323,14 @@ my $build_admin_menu = sub { my $obj = RT::Group->new( $session{'CurrentUser'} ); $obj->Load($id); - my $tabs = PageMenu(); - $tabs->child( basics => title => loc('Basics'), path => "/Admin/Groups/Modify.html?id=" . $obj->id ); - $tabs->child( members => title => loc('Members'), path => "/Admin/Groups/Members.html?id=" . $obj->id ); - $tabs->child( 'group-rights' => title => loc('Group Rights'), path => "/Admin/Groups/GroupRights.html?id=" . $obj->id ); - $tabs->child( 'user-rights' => title => loc('User Rights'), path => "/Admin/Groups/UserRights.html?id=" . $obj->id ); - $tabs->child( history => title => loc('History'), path => "/Admin/Groups/History.html?id=" . $obj->id ); + if ( $obj and $obj->id ) { + my $tabs = PageMenu(); + $tabs->child( basics => title => loc('Basics'), path => "/Admin/Groups/Modify.html?id=" . $obj->id ); + $tabs->child( members => title => loc('Members'), path => "/Admin/Groups/Members.html?id=" . $obj->id ); + $tabs->child( 'group-rights' => title => loc('Group Rights'), path => "/Admin/Groups/GroupRights.html?id=" . $obj->id ); + $tabs->child( 'user-rights' => title => loc('User Rights'), path => "/Admin/Groups/UserRights.html?id=" . $obj->id ); + $tabs->child( history => title => loc('History'), path => "/Admin/Groups/History.html?id=" . $obj->id ); + } } } @@ -334,11 +340,13 @@ my $build_admin_menu = sub { my $obj = RT::CustomField->new( $session{'CurrentUser'} ); $obj->Load($id); - my $tabs = PageMenu(); - $tabs->child( basics => title => loc('Basics'), path => "/Admin/CustomFields/Modify.html?id=".$id ); - $tabs->child( 'group-rights' => title => loc('Group Rights'), path => "/Admin/CustomFields/GroupRights.html?id=" . $id ); - $tabs->child( 'user-rights' => title => loc('User Rights'), path => "/Admin/CustomFields/UserRights.html?id=" . $id ); - $tabs->child( 'applies-to' => title => loc('Applies to'), path => "/Admin/CustomFields/Objects.html?id=" . $id ); + if ( $obj and $obj->id ) { + my $tabs = PageMenu(); + $tabs->child( basics => title => loc('Basics'), path => "/Admin/CustomFields/Modify.html?id=".$id ); + $tabs->child( 'group-rights' => title => loc('Group Rights'), path => "/Admin/CustomFields/GroupRights.html?id=" . $id ); + $tabs->child( 'user-rights' => title => loc('User Rights'), path => "/Admin/CustomFields/UserRights.html?id=" . $id ); + $tabs->child( 'applies-to' => title => loc('Applies to'), path => "/Admin/CustomFields/Objects.html?id=" . $id ); + } } } @@ -356,19 +364,21 @@ my $build_admin_menu = sub { if ( $request_path =~ m{^/Admin/Articles/Classes/} ) { my $tabs = PageMenu(); if ( my $id = $DECODED_ARGS->{'id'} ) { - my $obj = RT::CustomField->new( $session{'CurrentUser'} ); + my $obj = RT::Class->new( $session{'CurrentUser'} ); $obj->Load($id); - my $section = $tabs->child( select => title => loc("Classes"), path => "/Admin/Articles/Classes/" ); - $section->child( select => title => loc('Select'), path => "/Admin/Articles/Classes/" ); - $section->child( create => title => loc('Create'), path => "/Admin/Articles/Classes/Modify.html?Create=1" ); - - $tabs->child( basics => title => loc('Basics'), path => "/Admin/Articles/Classes/Modify.html?id=".$id ); - $tabs->child( topics => title => loc('Topics'), path => "/Admin/Articles/Classes/Topics.html?id=".$id ); - $tabs->child( 'custom-fields' => title => loc('Custom Fields'), path => "/Admin/Articles/Classes/CustomFields.html?id=".$id ); - $tabs->child( 'group-rights' => title => loc('Group Rights'), path => "/Admin/Articles/Classes/GroupRights.html?id=".$id ); - $tabs->child( 'user-rights' => title => loc('User Rights'), path => "/Admin/Articles/Classes/UserRights.html?id=".$id ); - $tabs->child( 'applies-to' => title => loc('Applies to'), path => "/Admin/Articles/Classes/Objects.html?id=$id" ); + if ( $obj and $obj->id ) { + my $section = $tabs->child( select => title => loc("Classes"), path => "/Admin/Articles/Classes/" ); + $section->child( select => title => loc('Select'), path => "/Admin/Articles/Classes/" ); + $section->child( create => title => loc('Create'), path => "/Admin/Articles/Classes/Modify.html?Create=1" ); + + $tabs->child( basics => title => loc('Basics'), path => "/Admin/Articles/Classes/Modify.html?id=".$id ); + $tabs->child( topics => title => loc('Topics'), path => "/Admin/Articles/Classes/Topics.html?id=".$id ); + $tabs->child( 'custom-fields' => title => loc('Custom Fields'), path => "/Admin/Articles/Classes/CustomFields.html?id=".$id ); + $tabs->child( 'group-rights' => title => loc('Group Rights'), path => "/Admin/Articles/Classes/GroupRights.html?id=".$id ); + $tabs->child( 'user-rights' => title => loc('User Rights'), path => "/Admin/Articles/Classes/UserRights.html?id=".$id ); + $tabs->child( 'applies-to' => title => loc('Applies to'), path => "/Admin/Articles/Classes/Objects.html?id=$id" ); + } } else { $tabs->child( select => title => loc('Select'), path => "/Admin/Articles/Classes/" ); $tabs->child( create => title => loc('Create'), path => "/Admin/Articles/Classes/Modify.html?Create=1" ); @@ -379,6 +389,9 @@ my $build_admin_menu = sub { my $build_main_nav = sub { + PageWidgets()->child( simple_search => raw_html => $m->scomp('SimpleSearch') ); + PageWidgets()->child( create_ticket => raw_html => $m->scomp('CreateTicket') ); + my $home = Menu->child( home => title => loc('Homepage'), path => '/' ); # We explicitly exclude superusers; otherwise the dashboards for # groups you're not in (but can see the dashboards of by dint of @@ -479,9 +492,9 @@ my $build_main_nav = sub { for my $search (@$searches) { $search_menu->child( "search-" . $i++ => - title => $search->[0], + title => $search->[1], path => "/Prefs/Search.html?" - . $query_string->( name => ref( $search->[1] ) . '-' . $search->[1]->Id ), + . $query_string->( name => ref( $search->[2] ) . '-' . $search->[2]->Id ), ); } @@ -513,141 +526,143 @@ my $build_main_nav = sub { my $obj = RT::Ticket->new( $session{'CurrentUser'} ); $obj->Load($id); - my $actions = PageMenu()->child( actions => title => loc('Actions'), sort_order => 95 ); - my $tabs = PageMenu(); - $tabs->child( bookmark => raw_html => $m->scomp( '/Ticket/Elements/Bookmark', id => $id ), sort_order => 99 ); - $tabs->child( display => title => loc('Display'), path => "/Ticket/Display.html?id=" . $id ); - $tabs->child( history => title => loc('History'), path => "/Ticket/History.html?id=" . $id ); - - my %can = %{ $obj->CurrentUser->PrincipalObj->HasRights( Object => $obj ) }; - $can{'_ModifyOwner'} = $can{'OwnTicket'} || $can{'TakeTicket'} || $can{'StealTicket'}; - my $can = sub { - unless ($_[0] eq 'ExecuteCode') { - return $can{$_[0]} || $can{'SuperUser'}; - } else { - return !RT->Config->Get('DisallowExecuteCode') - && ( $can{'ExecuteCode'} || $can{'SuperUser'} ); + if ( $obj and $obj->id ) { + my $actions = PageMenu()->child( actions => title => loc('Actions'), sort_order => 95 ); + my $tabs = PageMenu(); + $tabs->child( bookmark => raw_html => $m->scomp( '/Ticket/Elements/Bookmark', id => $id ), sort_order => 99 ); + $tabs->child( display => title => loc('Display'), path => "/Ticket/Display.html?id=" . $id ); + $tabs->child( history => title => loc('History'), path => "/Ticket/History.html?id=" . $id ); + + my %can = %{ $obj->CurrentUser->PrincipalObj->HasRights( Object => $obj ) }; + $can{'_ModifyOwner'} = $can{'OwnTicket'} || $can{'TakeTicket'} || $can{'StealTicket'}; + my $can = sub { + unless ($_[0] eq 'ExecuteCode') { + return $can{$_[0]} || $can{'SuperUser'}; + } else { + return !RT->Config->Get('DisallowExecuteCode') + && ( $can{'ExecuteCode'} || $can{'SuperUser'} ); + } + }; + + # comment out until we can do it for an individual custom field + #if ( $can->('ModifyTicket') || $can->('ModifyCustomField') ) { + $tabs->child( basics => title => loc('Basics'), path => "/Ticket/Modify.html?id=" . $id ); + + #} + + #ACL? + $tabs->child( customers => title => loc('Customers'), path => "/Ticket/ModifyCustomers.html?id=" . $id ); + + if ( $can->('ModifyTicket') || $can->('_ModifyOwner') || $can->('Watch') || $can->('WatchAsAdminCc') ) { + $tabs->child( people => title => loc('People'), path => "/Ticket/ModifyPeople.html?id=" . $id ); } - }; - - # comment out until we can do it for an individual custom field - #if ( $can->('ModifyTicket') || $can->('ModifyCustomField') ) { - $tabs->child( basics => title => loc('Basics'), path => "/Ticket/Modify.html?id=" . $id ); - - #} - - #ACL? - $tabs->child( customers => title => loc('Customers'), path => "/Ticket/ModifyCustomers.html?id=" . $id ); - - if ( $can->('ModifyTicket') || $can->('_ModifyOwner') || $can->('Watch') || $can->('WatchAsAdminCc') ) { - $tabs->child( people => title => loc('People'), path => "/Ticket/ModifyPeople.html?id=" . $id ); - } - - if ( $can->('ModifyTicket') ) { - $tabs->child( dates => title => loc('Dates'), path => "/Ticket/ModifyDates.html?id=" . $id ); - $tabs->child( links => title => loc('Links'), path => "/Ticket/ModifyLinks.html?id=" . $id ); - } - #if ( $can->('ModifyTicket') || $can->('ModifyCustomField') || $can->('_ModifyOwner') ) { - $tabs->child( jumbo => title => loc('Jumbo'), path => "/Ticket/ModifyAll.html?id=" . $id ); - #} - - if ( RT->Config->Get('EnableReminders') ) { - $tabs->child( reminders => title => loc('Reminders'), path => "/Ticket/Reminders.html?id=" . $id ); - } - - if ( $can->('ModifyTicket') or $can->('ReplyToTicket') ) { - $actions->child( reply => title => loc('Reply'), path => "/Ticket/Update.html?Action=Respond;id=" . $id ); - } + if ( $can->('ModifyTicket') ) { + $tabs->child( dates => title => loc('Dates'), path => "/Ticket/ModifyDates.html?id=" . $id ); + $tabs->child( links => title => loc('Links'), path => "/Ticket/ModifyLinks.html?id=" . $id ); + } - if ( $can->('ModifyTicket') or $can->('CommentOnTicket') ) { - $actions->child( comment => title => loc('Comment'), path => "/Ticket/Update.html?Action=Comment;id=" . $id ); - } + #if ( $can->('ModifyTicket') || $can->('ModifyCustomField') || $can->('_ModifyOwner') ) { + $tabs->child( jumbo => title => loc('Jumbo'), path => "/Ticket/ModifyAll.html?id=" . $id ); + #} - if ( $can->('ForwardMessage') ) { - $actions->child( forward => title => loc('Forward'), path => "/Ticket/Forward.html?id=" . $id ); - } - - my $hide_resolve_with_deps = RT->Config->Get('HideResolveActionsWithDependencies') - && $obj->HasUnresolvedDependencies; - - my $current = $obj->Status; - my $lifecycle = $obj->QueueObj->Lifecycle; - my $i = 1; - foreach my $info ( $lifecycle->Actions($current) ) { - my $next = $info->{'to'}; - next unless $lifecycle->IsTransition( $current => $next ); - - my $check = $lifecycle->CheckRight( $current => $next ); - next unless $can->($check); - - next if $hide_resolve_with_deps - && $lifecycle->IsInactive($next) - && !$lifecycle->IsInactive($current); - - my $action = $info->{'update'} || ''; - my $url = '/Ticket/'; - if ($action) { - $url .= "Update.html?" - . $query_string->( - Action => $action, - DefaultStatus => $next, - id => $id, - ); - } else { - $url .= "Display.html?" - . $query_string->( - Status => $next, - id => $id, - ); + if ( RT->Config->Get('EnableReminders') ) { + $tabs->child( reminders => title => loc('Reminders'), path => "/Ticket/Reminders.html?id=" . $id ); } - my $key = $info->{'label'} || ucfirst($next); - $actions->child( $key => title => loc( $key ), path => $url); - } - if ( $can->('OwnTicket') ) { - if ( $obj->OwnerObj->Id == RT->Nobody->id - && ( $can->('ModifyTicket') or $can->('TakeTicket') ) ) { - $actions->child( take => title => loc('Take'), path => "/Ticket/Display.html?Action=Take;id=" . $id ); + if ( $can->('ModifyTicket') or $can->('ReplyToTicket') ) { + $actions->child( reply => title => loc('Reply'), path => "/Ticket/Update.html?Action=Respond;id=" . $id ); } - elsif ( $obj->OwnerObj->id != RT->Nobody->id - && $obj->OwnerObj->id != $session{CurrentUser}->id - && ( $can->('ModifyTicket') or $can->('StealTicket') ) ) { - $actions->child( steal => title => loc('Steal'), path => "/Ticket/Display.html?Action=Steal;id=" . $id ); + if ( $can->('ModifyTicket') or $can->('CommentOnTicket') ) { + $actions->child( comment => title => loc('Comment'), path => "/Ticket/Update.html?Action=Comment;id=" . $id ); } - } - - # TODO needs a "Can extract article into a class applied to this queue" check - $actions->child( 'extract-article' => - title => loc('Extract Article'), - path => "/Articles/Article/ExtractIntoClass.html?Ticket=".$obj->id, - ); - - if ( defined $session{"tickets"} ) { - # we have to update session data if we get new ItemMap - my $updatesession = 1 unless ( $session{"tickets"}->{'item_map'} ); - my $item_map = $session{"tickets"}->ItemMap; + if ( $can->('ForwardMessage') ) { + $actions->child( forward => title => loc('Forward'), path => "/Ticket/Forward.html?id=" . $id ); + } - if ($updatesession) { - $session{"tickets"}->PrepForSerialization(); + my $hide_resolve_with_deps = RT->Config->Get('HideResolveActionsWithDependencies') + && $obj->HasUnresolvedDependencies; + + my $current = $obj->Status; + my $lifecycle = $obj->QueueObj->Lifecycle; + my $i = 1; + foreach my $info ( $lifecycle->Actions($current) ) { + my $next = $info->{'to'}; + next unless $lifecycle->IsTransition( $current => $next ); + + my $check = $lifecycle->CheckRight( $current => $next ); + next unless $can->($check); + + next if $hide_resolve_with_deps + && $lifecycle->IsInactive($next) + && !$lifecycle->IsInactive($current); + + my $action = $info->{'update'} || ''; + my $url = '/Ticket/'; + if ($action) { + $url .= "Update.html?" + . $query_string->( + Action => $action, + DefaultStatus => $next, + id => $id, + ); + } else { + $url .= "Display.html?" + . $query_string->( + Status => $next, + id => $id, + ); + } + my $key = $info->{'label'} || ucfirst($next); + $actions->child( $key => title => loc( $key ), path => $url); } - my $search = Menu()->child('search'); - # Don't display prev links if we're on the first ticket - if ( $item_map->{$id}->{prev} ) { - $search->child( first => - title => '<< ' . loc('First'), class => "nav", path => "/Ticket/Display.html?id=" . $item_map->{first}); - $search->child( prev => - title => '< ' . loc('Prev'), class => "nav", path => "/Ticket/Display.html?id=" . $item_map->{$id}->{prev}); + if ( $can->('OwnTicket') ) { + if ( $obj->OwnerObj->Id == RT->Nobody->id + && ( $can->('ModifyTicket') or $can->('TakeTicket') ) ) { + $actions->child( take => title => loc('Take'), path => "/Ticket/Display.html?Action=Take;id=" . $id ); + } + + elsif ( $obj->OwnerObj->id != RT->Nobody->id + && $obj->OwnerObj->id != $session{CurrentUser}->id + && ( $can->('ModifyTicket') or $can->('StealTicket') ) ) { + $actions->child( steal => title => loc('Steal'), path => "/Ticket/Display.html?Action=Steal;id=" . $id ); + } } - # Don't display next links if we're on the last ticket - if ( $item_map->{$id}->{next} ) { - $search->child( next => - title => loc('Next') . ' >', class => "nav", path => "/Ticket/Display.html?id=" . $item_map->{$id}->{next}); - $search->child( last => - title => loc('Last') . ' >>', class => "nav", path => "/Ticket/Display.html?id=" . $item_map->{last}); + + # TODO needs a "Can extract article into a class applied to this queue" check + $actions->child( 'extract-article' => + title => loc('Extract Article'), + path => "/Articles/Article/ExtractIntoClass.html?Ticket=".$obj->id, + ); + + if ( defined $session{"tickets"} ) { + # we have to update session data if we get new ItemMap + my $updatesession = 1 unless ( $session{"tickets"}->{'item_map'} ); + + my $item_map = $session{"tickets"}->ItemMap; + + if ($updatesession) { + $session{"tickets"}->PrepForSerialization(); + } + + my $search = Menu()->child('search'); + # Don't display prev links if we're on the first ticket + if ( $item_map->{$id}->{prev} ) { + $search->child( first => + title => '<< ' . loc('First'), class => "nav", path => "/Ticket/Display.html?id=" . $item_map->{first}); + $search->child( prev => + title => '< ' . loc('Prev'), class => "nav", path => "/Ticket/Display.html?id=" . $item_map->{$id}->{prev}); + } + # Don't display next links if we're on the last ticket + if ( $item_map->{$id}->{next} ) { + $search->child( next => + title => loc('Next') . ' >', class => "nav", path => "/Ticket/Display.html?id=" . $item_map->{$id}->{next}); + $search->child( last => + title => loc('Last') . ' >>', class => "nav", path => "/Ticket/Display.html?id=" . $item_map->{last}); + } } } } @@ -770,8 +785,8 @@ my $build_main_nav = sub { && #XXX TODO better abstraction $session{'CurrentUser'}->HasRight( Right => 'SuperUser', Object => RT->System )) { my $shred_args = $query_string->( - search => 1, - plugin => 'Tickets', + Search => 1, + Plugin => 'Tickets', 'Tickets:query' => $rss_data{'Query'}, 'Tickets:limit' => $QueryArgs->{'Rows'}, ); @@ -795,6 +810,10 @@ my $build_main_nav = sub { } if ( $request_path =~ m{^/Articles/} ) { + PageWidgets()->child( article_search => raw_html => $m->scomp('/Articles/Elements/GotoArticle') ); + PageWidgets()->delete('create_ticket'); + PageWidgets()->delete('simple_search'); + my $tabs = PageMenu(); $tabs->child( search => title => loc("Search"), path => "/Articles/Article/Search.html" ); $tabs->child( create => title => loc("New Article" ), path => "/Articles/Article/PreCreate.html" ); @@ -803,14 +822,16 @@ my $build_main_nav = sub { my $obj = RT::Article->new( $session{'CurrentUser'} ); $obj->Load($id); - $tabs->child( display => title => loc("Display"), path => "/Articles/Article/Display.html?id=" . $id ); - $tabs->child( history => title => loc('History'), path => '/Articles/Article/History.html?id=' . $id ); + if ( $obj and $obj->id ) { + $tabs->child( display => title => loc("Display"), path => "/Articles/Article/Display.html?id=" . $id ); + $tabs->child( history => title => loc('History'), path => '/Articles/Article/History.html?id=' . $id ); - if ( $obj->CurrentUserHasRight('ModifyArticle') ) { - $tabs->child(modify => title => loc('Modify'), path => '/Articles/Article/Edit.html?id=' . $id ); - } - if ( $obj->CurrentUserHasRight('DeleteArticle') ) { - $tabs->child(delete => title => loc('Delete'), path => '/Articles/Article/Delete.html?id=' . $id ); + if ( $obj->CurrentUserHasRight('ModifyArticle') ) { + $tabs->child(modify => title => loc('Modify'), path => '/Articles/Article/Edit.html?id=' . $id ); + } + if ( $obj->CurrentUserHasRight('DeleteArticle') ) { + $tabs->child(delete => title => loc('Delete'), path => '/Articles/Article/Delete.html?id=' . $id ); + } } } @@ -820,9 +841,6 @@ my $build_main_nav = sub { PageMenu()->child( edit => title => loc('Edit'), path => '/Prefs/MyRT.html' ); } - PageWidgets()->child( simple_search => raw_html => $m->scomp('SimpleSearch') ); - PageWidgets()->child( create_ticket => raw_html => $m->scomp('CreateTicket') ); - $m->callback( CallbackName => 'Privileged' ); }; diff --git a/rt/share/html/Elements/TicketList b/rt/share/html/Elements/TicketList index 66253ae7d..498759572 100644 --- a/rt/share/html/Elements/TicketList +++ b/rt/share/html/Elements/TicketList @@ -2,7 +2,7 @@ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2012 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2013 Best Practical Solutions, LLC %# <sales@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) diff --git a/rt/share/html/Elements/TitleBox b/rt/share/html/Elements/TitleBox index fa81a32f4..bbb55ebcd 100644 --- a/rt/share/html/Elements/TitleBox +++ b/rt/share/html/Elements/TitleBox @@ -2,7 +2,7 @@ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2012 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2013 Best Practical Solutions, LLC %# <sales@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) diff --git a/rt/share/html/Elements/TitleBoxEnd b/rt/share/html/Elements/TitleBoxEnd index 96d2076e1..f1ac68250 100644 --- a/rt/share/html/Elements/TitleBoxEnd +++ b/rt/share/html/Elements/TitleBoxEnd @@ -2,7 +2,7 @@ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2012 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2013 Best Practical Solutions, LLC %# <sales@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) diff --git a/rt/share/html/Elements/TitleBoxStart b/rt/share/html/Elements/TitleBoxStart index cc1a55f68..cb746c491 100644 --- a/rt/share/html/Elements/TitleBoxStart +++ b/rt/share/html/Elements/TitleBoxStart @@ -2,7 +2,7 @@ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2012 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2013 Best Practical Solutions, LLC %# <sales@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) diff --git a/rt/share/html/Elements/ValidateCustomFields b/rt/share/html/Elements/ValidateCustomFields index 922b885f2..7b0469bde 100644 --- a/rt/share/html/Elements/ValidateCustomFields +++ b/rt/share/html/Elements/ValidateCustomFields @@ -2,7 +2,7 @@ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2012 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2013 Best Practical Solutions, LLC %# <sales@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) diff --git a/rt/share/html/Elements/WidgetBar b/rt/share/html/Elements/WidgetBar index 35e7fe215..cf59bfc78 100644 --- a/rt/share/html/Elements/WidgetBar +++ b/rt/share/html/Elements/WidgetBar @@ -2,7 +2,7 @@ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2012 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2013 Best Practical Solutions, LLC %# <sales@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) |