From 3a651bfd3784bdbb4367b3d6385ccee33e8ebe5c Mon Sep 17 00:00:00 2001 From: ivan Date: Fri, 3 Aug 2007 21:49:03 +0000 Subject: [PATCH] merging RT_3_6_4 to HEAD --- rt/FREESIDE_MODIFIED | 4 +- rt/etc/RT_SiteConfig.pm | 2 +- rt/html/Elements/CollectionAsTable/Row | 18 +- rt/html/Elements/Footer | 47 +- rt/html/Elements/Header | 119 ++++-- rt/html/Elements/Menu | 128 +++--- rt/html/Elements/PageLayout | 222 +++++++--- rt/html/Elements/QuickCreate | 37 +- rt/html/Elements/SimpleSearch | 12 +- rt/html/Elements/Tabs | 13 +- rt/html/Elements/TicketList | 46 +- rt/html/Elements/TitleBoxStart | 49 +-- rt/html/NoAuth/images/space.gif | Bin 43 -> 0 bytes rt/html/NoAuth/printrt.css | 77 ---- rt/html/NoAuth/webrt.css | 759 --------------------------------- rt/html/Search/Bulk.html | 482 +++++++++++++-------- rt/html/Ticket/Elements/ShowMemberOf | 57 --- rt/html/Ticket/Elements/ShowReferences | 72 ---- rt/html/Ticket/Elements/ShowSummary | 98 +++-- rt/html/Ticket/Elements/Tabs | 94 ++-- rt/html/Widgets/TitleBoxStart | 2 +- rt/lib/RT/SearchBuilder.pm | 9 +- rt/sbin/rt-setup-database.in | 261 +++++++----- 23 files changed, 987 insertions(+), 1621 deletions(-) delete mode 100644 rt/html/NoAuth/images/space.gif delete mode 100644 rt/html/NoAuth/printrt.css delete mode 100644 rt/html/NoAuth/webrt.css delete mode 100644 rt/html/Ticket/Elements/ShowMemberOf delete mode 100644 rt/html/Ticket/Elements/ShowReferences diff --git a/rt/FREESIDE_MODIFIED b/rt/FREESIDE_MODIFIED index 7e6d8df47..d87abd288 100644 --- a/rt/FREESIDE_MODIFIED +++ b/rt/FREESIDE_MODIFIED @@ -10,6 +10,7 @@ lib/RT/URI/freeside/XMLRPC.pm html/Elements/Header html/Elements/Menu html/Elements/PageLayout + html/Elements/QuickCreate html/Elements/SimpleSearch html/Elements/Tabs html/Elements/Footer @@ -23,9 +24,6 @@ html/Ticket/ModifyCustomers.html html/NoAuth/images/small-logo.png html/NoAuth/webrt.css -html/Elements/TitleBoxStart -html/Search/Bulk.html - html/Elements/FreesideNewCust html/Elements/FreesideSearch html/Elements/FreesideSvcSearch diff --git a/rt/etc/RT_SiteConfig.pm b/rt/etc/RT_SiteConfig.pm index 5e3dc8081..ef110db0e 100644 --- a/rt/etc/RT_SiteConfig.pm +++ b/rt/etc/RT_SiteConfig.pm @@ -17,7 +17,7 @@ #Set( $rtname, 'example.com'); # These settings should have been inserted by the initial Freeside install. -# Somtimes you may want to change domain, timezone, or freeside::URL later, +# Sometimes you may want to change domain, timezone, or freeside::URL later, # everything else should probably stay untouched. $RT::rtname = '%%%RT_DOMAIN%%%'; diff --git a/rt/html/Elements/CollectionAsTable/Row b/rt/html/Elements/CollectionAsTable/Row index 0de362ea8..64ecef41c 100644 --- a/rt/html/Elements/CollectionAsTable/Row +++ b/rt/html/Elements/CollectionAsTable/Row @@ -2,7 +2,7 @@ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2007 Best Practical Solutions, LLC %# %# %# (Except where explicitly superseded by other copyright notices) @@ -22,7 +22,9 @@ %# %# 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., 675 Mass Ave, Cambridge, MA 02139, USA. +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/copyleft/gpl.html. %# %# %# CONTRIBUTION SUBMISSION POLICY: @@ -53,17 +55,17 @@ $Warning => undef <%PERL> -$m->out('' ); +$m->out('' ); my $item; foreach my $column (@Format) { - if ( $column->{title} eq 'NEWLINE' ) { + if ( defined $column->{title} && $column->{title} eq 'NEWLINE' ) { while ( $item < $maxitems ) { $m->out(qq{ \n}); $item++; } $item = 0; - $m->out(''); - $m->out('' ); next; @@ -99,7 +101,7 @@ foreach my $column (@Format) { # Simple value; just escape it. @out = $m->interp->apply_escapes( $value => 'h' ); } - s/\n/
/gs for @out; + s/\n/
/gs for @out; $m->out( @out ); } else { @@ -108,5 +110,5 @@ foreach my $column (@Format) { } $m->out(''); } -$m->out(''); +$m->out(''); diff --git a/rt/html/Elements/Footer b/rt/html/Elements/Footer index 78a116f38..00a3c33d0 100644 --- a/rt/html/Elements/Footer +++ b/rt/html/Elements/Footer @@ -2,7 +2,7 @@ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2007 Best Practical Solutions, LLC %# %# %# (Except where explicitly superseded by other copyright notices) @@ -22,7 +22,9 @@ %# %# 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., 675 Mass Ave, Cambridge, MA 02139, USA. +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/copyleft/gpl.html. %# %# %# CONTRIBUTION SUBMISSION POLICY: @@ -43,20 +45,27 @@ %# those contributions and any derivatives thereof. %# %# END BPS TAGGED BLOCK }}} -% if ($Menu) { - - - - -% } +%# End of div#body from /Elements/PageLayout + <& /Elements/Callback, %ARGS &> + <%INIT> -my ($tab, $subtab, $class, $size, $padding); -my $basesize=16; +my ($tab, $class, $count); +my @ul; +push @ul, 'last-menu-level' + if $last_level; +push @ul, 'odd' + if $level % 2; +my $menu_class = join ' ', @ul; <%ARGS> $current_toptab => "" $toptabs => undef $level => 0 +$last_level => 0 diff --git a/rt/html/Elements/PageLayout b/rt/html/Elements/PageLayout index f13ee0dda..493f2275f 100644 --- a/rt/html/Elements/PageLayout +++ b/rt/html/Elements/PageLayout @@ -2,7 +2,7 @@ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2007 Best Practical Solutions, LLC %# %# %# (Except where explicitly superseded by other copyright notices) @@ -22,7 +22,9 @@ %# %# 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., 675 Mass Ave, Cambridge, MA 02139, USA. +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/copyleft/gpl.html. %# %# %# CONTRIBUTION SUBMISSION POLICY: @@ -43,72 +45,124 @@ %# those contributions and any derivatives thereof. %# %# END BPS TAGGED BLOCK }}} - - - - - -%# - -% my $notfirst = 0; foreach my $action (sort keys %{$topactions}) { - +
+% foreach my $action (reverse sort keys %{$topactions}) { + +% $m->out($topactions->{"$action"}->{'html'}); + % } - -
-
<%$AppName%> -%# - <%$topactions->{"$action"}->{'html'} |n %> -
- - - - - - -%# Vertical menu - - - -
- <& /Elements/Menu, toptabs => $toptabs, current_toptab => $current_toptab &> - - - - - - - - - -
- <%$title%> -
- -% if ($actions) { -% my @actions; -% foreach my $action (sort keys %{$actions}) { -% if ($actions->{"$action"}->{'html'}) { -% push @actions, $actions->{"$action"}->{'html'}; + + +%# End of div#quickbar from /Elements/Header + + + + +
+ + +% } + + +
<& /Elements/Callback, _CallbackName => 'BeforeBody', %ARGS &> %$m->flush_buffer(); # we've got the page laid out, let's flush the buffer; -<%INIT> +<%INIT> foreach my $tab (sort keys %{$toptabs}) { if ($current_toptab && $toptabs->{$tab}->{'path'} eq $current_toptab) { $toptabs->{$tab}->{"subtabs"} = $tabs; @@ -120,7 +174,53 @@ if (! defined($AppName)) { $AppName = loc("RT for [_1]", $RT::rtname); } +my ($menu_depth, $almost_last, $page_tabs); + +if ($RT::WebDefaultStylesheet ne '3.4-compat') { + ($menu_depth, $almost_last) = @{$m->comp('.menu_recurse', data => $toptabs)}; + + if (defined $almost_last->{subtabs} and %{$almost_last->{subtabs}}) { + $page_tabs = { + current_toptab => $almost_last->{current_subtab}, + %{$almost_last->{subtabs}}, + }; + + delete $almost_last->{subtabs}; + delete $almost_last->{current_subtab}; + } +} + +%# There's probably a better way to do this that involves three times as +%# much work and redoing the whole menu/tab system... which would seem a +%# bit out of scope. +%# +%# This function recurses through the menu and returns the second to +%# last menu, that is, the menu holding the last reference to +%# and submenu. It also returns the number of menu levels minus +%# the last submenu. +<%def .menu_recurse> + <%args> + $data => { } + $pdata => { } + $ppdata => { } + $level => 0 + + <%init> + for my $key (keys %$data) { + return $m->comp('.menu_recurse', data => $data->{$key}->{subtabs}, + pdata => $data->{$key}, + ppdata => $pdata, + level => $level+1) + if ref($data->{$key}) eq 'HASH' + and defined $data->{$key}->{subtabs} + and %{$data->{$key}->{subtabs}}; + } + $ppdata->{last_system_menu_level}++; + return [$level, $pdata]; + + + <%ARGS> $current_toptab => undef $current_tab => undef @@ -130,5 +230,5 @@ $tabs => undef $actions => undef $subactions => undef $title => $m->callers(-1)->path -$AppName => '' +$AppName => undef diff --git a/rt/html/Elements/QuickCreate b/rt/html/Elements/QuickCreate index 0b97121a4..75b3a4598 100644 --- a/rt/html/Elements/QuickCreate +++ b/rt/html/Elements/QuickCreate @@ -2,7 +2,7 @@ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2007 Best Practical Solutions, LLC %# %# %# (Except where explicitly superseded by other copyright notices) @@ -22,7 +22,9 @@ %# %# 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., 675 Mass Ave, Cambridge, MA 02139, USA. +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/copyleft/gpl.html. %# %# %# CONTRIBUTION SUBMISSION POLICY: @@ -43,28 +45,27 @@ %# those contributions and any derivatives thereof. %# %# END BPS TAGGED BLOCK }}} -<& /Elements/TitleBoxStart, title => loc('Quick ticket creation') &> +
+<&| /Widgets/TitleBox, title => loc('Quick ticket creation') &>
- + - - - - -%# +%#
-<&|/l&>Subject:
-
-<&|/l&>Queue:
<& /Elements/SelectQueue, Name => 'Queue', ShowNullOption => 0 &>
-
-<&|/l&>Owner:
+
+<&|/l&>Subject:
+
+<&|/l&>Queue:
<& /Elements/SelectNewTicketQueue, Name => 'Queue', ShowNullOption => 0 &> +
+<&|/l&>Owner:
-
-
+
-<& /Elements/TitleBoxEnd &> + +
+ diff --git a/rt/html/Elements/SimpleSearch b/rt/html/Elements/SimpleSearch index e9fc5c6ed..a4fd7e270 100644 --- a/rt/html/Elements/SimpleSearch +++ b/rt/html/Elements/SimpleSearch @@ -2,7 +2,7 @@ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2007 Best Practical Solutions, LLC %# %# %# (Except where explicitly superseded by other copyright notices) @@ -22,7 +22,9 @@ %# %# 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., 675 Mass Ave, Cambridge, MA 02139, USA. +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/copyleft/gpl.html. %# %# %# CONTRIBUTION SUBMISSION POLICY: @@ -43,14 +45,14 @@ %# those contributions and any derivatives thereof. %# %# END BPS TAGGED BLOCK }}} -
+ -
+
Advanced - +
diff --git a/rt/html/Elements/Tabs b/rt/html/Elements/Tabs index bbea3fe9a..f94711c3c 100644 --- a/rt/html/Elements/Tabs +++ b/rt/html/Elements/Tabs @@ -2,7 +2,7 @@ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2007 Best Practical Solutions, LLC %# %# %# (Except where explicitly superseded by other copyright notices) @@ -22,7 +22,9 @@ %# %# 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., 675 Mass Ave, Cambridge, MA 02139, USA. +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/copyleft/gpl.html. %# %# %# CONTRIBUTION SUBMISSION POLICY: @@ -78,11 +80,14 @@ my $basetabs = { title => 'Ticketing Main', path => '', }, - B => { title => loc('Search Tickets'), + Ab => { title => loc('Simple Ticket Search'), + path => 'Search/Simple.html' + }, + B => { title => loc('Adv. Ticket Search'), path => 'Search/Build.html' }, C => { title => loc('Tools'), - path => 'Tools/Offline.html' + path => 'Tools/index.html' }, P => { title => loc('Approval'), path => 'Approvals/' diff --git a/rt/html/Elements/TicketList b/rt/html/Elements/TicketList index 4195d6320..02b071624 100644 --- a/rt/html/Elements/TicketList +++ b/rt/html/Elements/TicketList @@ -2,7 +2,7 @@ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2007 Best Practical Solutions, LLC %# %# %# (Except where explicitly superseded by other copyright notices) @@ -22,7 +22,9 @@ %# %# 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., 675 Mass Ave, Cambridge, MA 02139, USA. +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/copyleft/gpl.html. %# %# %# CONTRIBUTION SUBMISSION POLICY: @@ -43,7 +45,7 @@ %# those contributions and any derivatives thereof. %# %# END BPS TAGGED BLOCK }}} - +
% if ($ShowHeader) { <& /Elements/CollectionAsTable/Header, @@ -69,7 +71,7 @@ <& /Elements/CollectionAsTable/Row, Format => \@Format, i => $i, record => $record, maxitems => $maxitems &> % } -
+
% if ($Rows && $ShowNavigation) {
@@ -77,7 +79,9 @@ % if (($TotalFound % $Rows) == 0) { % $oddRows = 0; % } else { $oddRows = 1; } -<&|/l, $Page, int($TotalFound/$Rows)+$oddRows&>Page [_1] of [_2] +% my $pages = int($TotalFound/$Rows)+$oddRows; +% $pages = 1 if $pages < 1; +<&|/l, $Page, $pages &>Page [_1] of [_2] <%perl> my $prev = $m->comp( @@ -100,18 +104,27 @@ my $next = $m->comp( ); % if ($Page > 1) { -<&|/l&>Previous Page +<&|/l&>Previous Page % } % if (($Page * $Rows) < $TotalFound) { -<&|/l&>Next Page +<&|/l&>Next Page % } % } <%INIT> my $maxitems = 0; $Format ||= $RT::DefaultSearchResultFormat; + +# DisplayFormat lets us use a "temporary" format for display, while +# still using our original format for next/prev page links. +# bulk update uses this feature to add checkboxes + + +$DisplayFormat ||= $Format; + # Scrub the html of the format string to remove any potential nasties. $Format = $m->comp('/Elements/ScrubHTML', Content => $Format); +$DisplayFormat = $m->comp('/Elements/ScrubHTML', Content => $DisplayFormat); unless ($Collection) { @@ -119,13 +132,13 @@ unless ($Collection) { $Collection->FromSQL($Query); } -my (@Format) = $m->comp('/Elements/CollectionAsTable/ParseFormat', Format => $Format); +my (@Format) = $m->comp('/Elements/CollectionAsTable/ParseFormat', Format => $DisplayFormat); # Find the maximum number of items in any row, so we can pad the table. my $item = 0; foreach my $col (@Format) { $item++; - if ( $col->{title} eq 'NEWLINE' ) { + if ( $col->{title} && ($col->{title} eq 'NEWLINE') ) { $item = 0; } else { @@ -133,10 +146,20 @@ foreach my $col (@Format) { } } +if ($OrderBy =~ /\|/) { + # Multiple Sorts + my @OrderBy = split /\|/,$OrderBy; + my @Order = split /\|/,$Order; + $Collection->OrderByCols( + map { { FIELD => $OrderBy[$_], ORDER => $Order[$_] } } ( 0 + .. $#OrderBy ) );; +} else { + $Collection->OrderBy(FIELD => $OrderBy, ORDER => $Order); +} -$Collection->OrderBy(FIELD => $OrderBy, ORDER => $Order); $Collection->RowsPerPage($Rows) if ($Rows); -$Collection->GotoPage($Page-1); # SB uses page 0 as the first page +$Page = 1 unless $Page > 0; # workaround problems with Page = '' or undef +$Collection->GotoPage( $Page - 1 ); # SB uses page 0 as the first page my $TotalFound = $Collection->CountAll(); @@ -151,6 +174,7 @@ $Order => undef $OrderBy => undef $BaseURL => undef $Format => $RT::DefaultSearchResultFormat +$DisplayFormat => undef $ShowNavigation => 1 $ShowHeader => 1 diff --git a/rt/html/Elements/TitleBoxStart b/rt/html/Elements/TitleBoxStart index d98fe2744..ba24fd92e 100644 --- a/rt/html/Elements/TitleBoxStart +++ b/rt/html/Elements/TitleBoxStart @@ -2,7 +2,7 @@ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2007 Best Practical Solutions, LLC %# %# %# (Except where explicitly superseded by other copyright notices) @@ -22,7 +22,9 @@ %# %# 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., 675 Mass Ave, Cambridge, MA 02139, USA. +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/copyleft/gpl.html. %# %# %# CONTRIBUTION SUBMISSION POLICY: @@ -43,46 +45,7 @@ %# those contributions and any derivatives thereof. %# %# END BPS TAGGED BLOCK }}} - - - - - - - -
- <%$class ? "class=\"$class\"" : "class=\"titlebox\""|n%>> - - X  - - <% $title_href && ""|n%><%$title |n %><% $title_href && "" |n%> - - - <%$class ? "class=\"$class\"": "class=\"titleboxright\""|n%>> - <%$titleright ? $titleright : ' ' |n %> -
-<%ARGS> -$width => "100%" -$class => undef -$bodyclass => undef -$title_href => undef -$title => undef -$title_class => '' - -$titleright_href => undef -$titleright => undef -$contentbg => "#d4d4d4" -$color => "#336699" - <%init> -my $id = rand(2000); - -$title_class = "CLASS=\"$title_class\"" if $title_class; +# For compatibility with 3.4 +$m->comp('/Widgets/TitleBoxStart', %ARGS ); diff --git a/rt/html/NoAuth/images/space.gif b/rt/html/NoAuth/images/space.gif deleted file mode 100644 index 1d11fa9ada9e93505b3d736acb204083f45d5fbf..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 43 scmZ?wbhEHbWMp7uX!y@?;J^U}1_s5SEQ~;kK?g*DWEhy3To@Uw0n;G|I{*Lx diff --git a/rt/html/NoAuth/printrt.css b/rt/html/NoAuth/printrt.css deleted file mode 100644 index 72e7e8b7e..000000000 --- a/rt/html/NoAuth/printrt.css +++ /dev/null @@ -1,77 +0,0 @@ -%# {{{ BEGIN BPS TAGGED BLOCK -%# -%# -%# -%# 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., 675 Mass Ave, Cambridge, MA 02139, USA. -%# -%# -%# 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 -%# -%# Special stylesheet for printing tickets -%# Koos van den Hout koos@cs.uu.nl 2005-11-21 -%# - -SPAN.nav { display: none !important; } -.nav2 { display: none !important; } -.nav { display: none !important; } -.topnav { display: none !important; } -.blue { display: none !important; } -.darkblue { display: none !important; } -.blueright { display: none !important; } -.currentnav { display: none !important; } -th.titlebox { border-top: none; border-bottom: none; } -th.titleboxright { display:none !important; border-top: none; border-bottom: none; } -.titlebox { border-top: none; border-bottom: none; } - -div.downloadattachment, div.downloadcontenttype { - display: none !important; -} - - -a[href$="Respond"], a[href$="Comment"], a[href*="ShowEmailRecord"] { - display: none !important; -} - - -%# Provide a callback for adding/modifying the style sheet. -%# http://www.w3.org/TR/REC-CSS1 - section 3.2, says: -%# "latter specified rule wins" -<& /Elements/Callback &> -<%flags> -inherit => undef - -<%init> -$r->content_type('text/css'); -$r->headers_out->{'Expires'} = '+30m'; - diff --git a/rt/html/NoAuth/webrt.css b/rt/html/NoAuth/webrt.css deleted file mode 100644 index 5da0f8310..000000000 --- a/rt/html/NoAuth/webrt.css +++ /dev/null @@ -1,759 +0,0 @@ -/* -%# BEGIN BPS TAGGED BLOCK {{{ -%# -%# COPYRIGHT: -%# -%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC -%# -%# -%# (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., 675 Mass Ave, Cambridge, MA 02139, USA. -%# -%# -%# 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 }}} -*/ - -/* * { - font-family: Arial, Verdana, Helvetica, sans-serif; - font-size: 1.2em; -} */ - -SPAN.nav { font-family: Arial, Verdana, Helvetica, sans-serif; - font-size: 12px; - color: #FFFFFF; - text-decoration: none; - white-space: nowrap} -.nav2 { font-size: 10px; - white-space: nowrap} -.nav { font-family: Arial, Verdana, Helvetica, sans-serif; - font-size: 13px; - font-weight: bold; - color: #FFFFFF; - text-decoration: none; - white-space: nowrap} -.currentnav { font-family: Arial, Verdana, Helvetica, sans-serif; - font-size: 13px; - font-weight: bold; - color: #FFFF66; - text-decoration: none; - white-space: nowrap} -.topnav { font-family: Arial, Verdana, Helvetica, sans-serif; - font-size: 16px; - font-weight: normal; - color: #FFFFFF; - text-decoration: none; - white-space: nowrap} - -/* -%# .topnav is the original RT class for the sidebar navigation tabs. -%# Font-sizing by level depth was originally hard-coded into Elements/Menu. -%# This modification sets a different class name for each level, allowing -%# style sheet control over the formats. -*/ - -a.topnav-0 { font-family: Verdana, Arial, Helvetica, sans-serif; - font-size: 16px; - font-weight: normal; - color: #FFFFFF; - text-decoration: none; - white-space: nowrap} -a.topnav-1 { font-family: Verdana, Arial, Helvetica, sans-serif; - font-size: 14px; - font-weight: normal; - color: #FFFFFF; - text-decoration: none; - white-space: nowrap} -a.topnav-2 { font-family: Verdana, Arial, Helvetica, sans-serif; - font-size: 12px; - font-weight: normal; - color: #FFFFFF; - text-decoration: none; - white-space: nowrap} -a.topnav-3 { font-family: Verdana, Arial, Helvetica, sans-serif; - font-size: 11px; - font-weight: normal; - color: #FFFFFF; - text-decoration: none; - white-space: nowrap} -a.topnav-4 { font-family: Verdana, Arial, Helvetica, sans-serif; - font-size: 11px; - font-weight: normal; - color: #FFFFFF; - text-decoration: none; - white-space: nowrap} -a.topnav-5 { font-family: Verdana, Arial, Helvetica, sans-serif; - font-size: 11px; - font-weight: normal; - color: #FFFFFF; - text-decoration: none; - white-space: nowrap} -li.topnav-0-minor { - border-top: solid #777777 1px; - padding-top: .1em; - margin-top: .5em; -} -li.topnav-1-minor { - border-top: solid #777777 1px; - padding-top: .1em; - margin-top: .5em; -} -li.topnav-2-minor { - border-top: solid #777777 1px; - padding-top: .1em; - margin-top: .5em; -} -li.topnav-3-minor { - border-top: solid #777777 1px; - padding-top: .1em; - margin-top: .5em; -} -li.topnav-4-minor { - border-top: solid #777777 1px; - padding-top: .1em; - margin-top: .5em; -} -li.topnav-5-minor { - border-top: solid #777777 1px; - padding-top: .1em; - margin-top: .5em; -} -li.topnav-0-major { - border-bottom: solid black 1px; - padding-top: .25em; - padding-bottom: .5em; -} -li.topnav-1-major { - border-bottom: solid black 1px; - padding-top: .25em; - padding-bottom: .5em; -} -li.topnav-2-major { - border-bottom: solid black 1px; - padding-top: .25em; - padding-bottom: .5em; -} -li.topnav-3-major { - border-bottom: solid black 1px; - padding-top: .25em; - padding-bottom: .5em; -} -li.topnav-4-major { - border-bottom: solid black 1px; - padding-top: .25em; - padding-bottom: .5em; -} -li.topnav-5-major { - border-bottom: solid black 1px; - padding-top: .25em; - padding-bottom: .5em; -} - -.currenttopnav { font-family: Arial, Verdana, Helvetica, sans-serif; - font-size: 16px; - font-weight: bold; - color: #ffffff; background-color: #7e0079; - text-decoration: none; - white-space: nowrap} - -/* -%# .currenttopnav is the original RT class for the sidebar navigation tabs. -%# Font-sizing by level depth was originally hard-coded into Elements/Menu. -%# This modification sets a different class name for each level, allowing -%# style sheet control over the formats -*/ - -a.currenttopnav-0 { font-family: Verdana, Arial, Helvetica, sans-serif; - font-size: 16px; - font-weight: bold; - color: #ffffff; background-color: #7e0079; - text-decoration: none; - white-space: nowrap} -a.currenttopnav-1 { font-family: Verdana, Arial, Helvetica, sans-serif; - font-size: 14px; - font-weight: bold; - color: #ffffff; background-color: #7e0079; - text-decoration: none; - white-space: nowrap} -a.currenttopnav-2 { font-family: Verdana, Arial, Helvetica, sans-serif; - font-size: 12px; - font-weight: normal; - color: #ffffff; background-color: #7e0079; - text-decoration: none; - white-space: nowrap} -a.currenttopnav-3 { font-family: Verdana, Arial, Helvetica, sans-serif; - font-size: 11px; - font-weight: normal; - color: #ffffff; background-color: #7e0079; - text-decoration: none; - white-space: nowrap} -a.currenttopnav-4 { font-family: Verdana, Arial, Helvetica, sans-serif; - font-size: 11px; - font-weight: normal; - color: #ffffff; background-color: #7e0079; - text-decoration: none; - white-space: nowrap} -a.currenttopnav-5 { font-family: Verdana, Arial, Helvetica, sans-serif; - font-size: 11px; - font-weight: normal; - color: #ffffff; background-color: #7e0079; - text-decoration: none; - white-space: nowrap} -li.currenttopnav-0-minor { - border-top: solid #999999 1px; - padding-top: .1em; - margin-top: .5em; -} -li.currenttopnav-1-minor { - border-top: solid #777777 1px; - padding-top: .1em; - margin-top: .5em; -} -li.currenttopnav-2-minor { - border-top: solid #777777 1px; - padding-top: .1em; - margin-top: .5em; -} -li.currenttopnav-3-minor { - border-top: solid #777777 1px; - padding-top: .1em; - margin-top: .5em; -} -li.currenttopnav-4-minor { - border-top: solid #777777 1px; - padding-top: .1em; - margin-top: .5em; -} -li.currenttopnav-5-minor { - border-top: solid #777777 1px; - padding-top: .1em; - margin-top: .5em; -} -li.currenttopnav-0-major { - border-bottom: solid black 1px; - padding-top: .25em; - padding-bottom: .5em; -} -li.currenttopnav-1-major { - border-bottom: solid black 1px; - padding-top: .25em; - padding-bottom: .5em; -} -li.currenttopnav-2-major { - border-bottom: solid black 1px; - padding-top: .25em; - padding-bottom: .5em; -} -li.currenttopnav-3-major { - border-bottom: solid black 1px; - padding-top: .25em; - padding-bottom: .5em; -} -li.currenttopnav-4-major { - border-bottom: solid black 1px; - padding-top: .25em; - padding-bottom: .5em; -} -li.currenttopnav-5-major { - border-bottom: solid black 1px; - padding-top: .25em; - padding-bottom: .5em; -} - -.topactions { font-family: Arial, Verdana, Helvetica, sans-serif; - font-size: 10px; - color: #FFFFFF; - text-decoration: none; - white-space: nowrap} -.subnav { font-family: Arial, Verdana, Helvetica, sans-serif; - font-size: 11px; - font-weight: normal; - color: #FFFFFF; - text-decoration: none; - white-space: nowrap} -.currentsubnav { font-family: Arial, Verdana, Helvetica, sans-serif; - font-size: 11px; - font-weight: bold; - color: #FFFF66; - text-decoration: none; - white-space: nowrap} -.error { background-color: #ff0000; - background-position: left top; - vertical-align: top; - text-align: left; - } -.oldblue { background-color: #0066CC; - background-position: left top; - vertical-align: top; - text-align: left; - } -.blue { - background-color: #4682B4; -/* %# background-color: #eeeeee; */ - background-position: left top; - vertical-align: top; - text-align: left; - } -/* %# Actually the "topactions" section */ -.blueright { background-color: #4682B4; - background-position: left top; - vertical-align: top; - text-align: right; - padding-right: 1em; - } -.olddarkblue { background-color: #003399; - background-position: left top; - vertical-align: top; - text-align: left; - } -.darkblue { - background-color: #000080; - background-position: left top; - vertical-align: top; - text-align: left; - } -.darkblueright { - background-color: #000080; - background-position: left top; - vertical-align: top; - text-align: right; - } -.lightgray { - background-color: #eeeeee; - background-position: left top; - vertical-align: top; - text-align: left; - } -.lightgrayright { - background-color: #eeeeee; - background-position: left top; - vertical-align: top; - text-align: right; - } -.black { - background-color: #000000; - color: #ffffff; - background-position: left top; - vertical-align: top; - text-align: left; - } -.blackright { - background-color: #000000; - color: #ffffff; - background-position: left top; - vertical-align: center; - text-align: right; - font-size:16px; - padding-right:4px - } - -input.fsblackbutton { - background-color:#333333; - color: #ffffff; - border:1px solid; - border-top-color:#cccccc; - border-left-color:#cccccc; - border-right-color:#aaaaaa; - border-bottom-color:#aaaaaa; - font-family: Arial, Verdana, Helvetica, sans-serif; - font-weight:bold; - padding-left:12px; - padding-right:12px; - overflow:visible; - filter:progid:DXImageTransform.Microsoft.Gradient(GradientType=0,StartColorStr='#ff333333',EndColorStr='#ff666666') -} - -input.fsblackbuttonselected { - background-color:#7e0079; - color: #ffffff; - border:1px solid; - border-top-color:#cccccc; - border-left-color:#cccccc; - border-right-color:#aaaaaa; - border-bottom-color:#aaaaaa; - font-family: Arial, Verdana, Helvetica, sans-serif; - font-weight:bold; - padding-left:12px; - padding-right:12px; - overflow:visible; - filter:progid:DXImageTransform.Microsoft.Gradient(GradientType=0,StartColorStr='#ff330033',EndColorStr='#ff7e0079') -} - -.mediumgray { - background-color: #cccccc; - background-position: left top; - vertical-align: top; - text-align: left; - } -.mediumgrayright { - background-color: #cccccc; - background-position: left top; - vertical-align: top; - text-align: right; - } -.darkmediumgray { - background-color: #aaaaaa; - background-position: left top; - vertical-align: top; - text-align: left; - } -.darkmediumgrayright { - background-color: #aaaaaa; - background-position: left top; - vertical-align: top; - text-align: right; - } -.bggray { - background-color: #e8e8e8; - background-position: left top; - vertical-align: top; - text-align: left; - } -.bggrayright { - background-color: #e8e8e8; - background-position: left top; - vertical-align: top; - text-align: right; - } -.white { - background-color: #ffffff; - background-position: left top; - vertical-align: top; - text-align: left; - } -.whiteright { - background-color: #ffffff; - background-position: left top; - vertical-align: top; - text-align: right; - } -.overdue { - color: red; -} - -div.messagebody { - padding: 2em; - -} - - -div.downloadattachment { - font-size: 10px; - text-align: right; - -} - - -td { font-family: Arial, Verdana, Helvetica, sans-serif; - font-size: 12px; - background-position: left top; - } -.black { background-color: #000000; - background-position: left top; - } -span.rtname { font-family: Arial, Verdana, Helvetica, sans-serif; - font-size: 18px; - font-weight: normal; - color: #ffffff} -span.title { font-family: Arial, Verdana, Helvetica, sans-serif; - font-size: 20px; - font-weight: bold; - color: #ffffff} -.header { font-family: Arial, Verdana, Helvetica, sans-serif; - font-size: 12px; - font-weight: bold; - color: #0066CC} -.subheader { font-family: Arial, Verdana, Helvetica, sans-serif; - font-size: 11px; - font-weight: bold; - color: #0066CC } -.value { font-weight: bold; } -.entry { font-weight: normal; } -.label { font-weight: normal; - text-align: right; } -.labeltop { font-weight: normal; - text-align: right; - vertical-align: top } -.productnav { font-family: Arial, Verdana, Helvetica, sans-serif; - font-size: 11px; - color: #FFFFFF; - text-align: center; - vertical-align: middle; - text-decoration: none} -.rtblue { background-color: #3399FF; - margin-top: 0.2em; - background-position: left top; - vertical-align: top } - - -.currenttab { margin: 0.2em; background: #336699; } -.othertab { margin: 0.2em; background: #efefef; } -.oddline { background-color : #ccccee; } - -UL.topnav LI :focus { text-decoration: underline; } - -TD.mainbody { - padding-top: 0.5em; - padding-left: 1em; - padding-right: 1em; - margin-left: 1em; - margin-right: 1em; - background-color: #e8e8e8; -} - -td.boxcontainer + td.boxcontainer { - margin-left: 1em; - padding-left: 1em; - border-collapse: collapse; -} - -th.ticketheader { font-size: 80%; - font-weight: bold; - color: #336699; - background: #cccccc; -} - -th.titlebox { - text-align: left; - padding-left: 0.5em; - padding-right: 0.5em; - margin-left: 0.5em; - margin-right: 0.5em; - border-top: solid black 1px; - border-bottom: solid black 1px; -} -th.titleboxright { - text-align: right; - padding-left: 0.5em; - padding-right: 0.5em; - margin-left: 0.5em; - margin-right: 0.5em; - border-top: solid black 1px; - border-bottom: solid black 1px; -} - -TD.titlebox { - padding-left: 1em; - padding-right: 1em; - padding-top: 1em; - padding-bottom: 1em; -} - -SPAN.message { - font-size: 100%; - font-family: Arial, Verdana, Helvetica, sans-serif; -} - - -BODY { - color: #000; - background: #FFFFFF; - font-family: Verdana, Arial, Helvetica, sans-serif; - margin-top: 0px; - margin-bottom: 0px; - margin-left: 0px; - margin-right: 0px; - border-top: 0px; - border-bottom: 0px; - border-left: 0px; - border-right: 0px; -} - - -TR.oddline { - background-color : #ffffff; -} - -TR.evenline { - background-color : #ccccee; -} - -H1, H2, H3 { - margin-top: 0.2em; - color: #336699; - font-family: Verdana, Arial, Helvetica, sans-serif; - - clear: both; -} - - -DIV.endmatter { margin-left: -7% } -.bpscredits {margin-top: 1em; - text-align: right; - color: #666666; - } - - -A { font-weight: bold; color: #000000 - } - -.currenttab { color: #ffffff;} -.othertab { color: #336699; } - -.inverse { color: #ffffff; } - - - -A:link IMG, A:visited IMG { border-style: none } -a:focus {text-decoration: underline } -A IMG { color: white } /* The only way to hide the border in NS 4.x */ - -/* a:link { text-decoration: none} */ -/* a:visited { text-decoration: none} */ - -a:hover { text-decoration: underline} -/* a:focus { background-color: #ccccee } */ - -.hide { - display: none; - color: white; -} - -SPAN.date { font-size: 0.8em } - -span.title { font-size: 1.6em; - vertical-align: middle; -/* %# color: #ffffff; */ - color: #000000; - } -span.productname { font-size: 2em; - color: #0066cc;} -SPAN.titleboxtitle, SPAN.titleboxclose { - font-size: 80%; - color: #ffffff; - vertical-align: middle; - text-align: left; - } -SPAN.titleboxtitle a { - color: #ffffff; -} -SPAN.titleboxtitle a:after { - content: "..."; -} - -SPAN.titleboxright { - font-size: 0.8em; - color: #ffffff; - vertical-align: middle; - text-align: right; - } - -SPAN.attribution { - font-weight: bold; -} - -SPAN.label { font-size: 0.8em; -} - -DIV.page-stats { font-size: 0.8em; - color: #cccccc; - text-align: right; - } - - -BLOCKQUOTE { - font-style: italic; -} - -.emphasized { - font-weight: bold -} - - -.oddline { - background-color : #ccccee; -} - -ul.topnav { - list-style: none; - margin-left: 0; - margin-right: 0.25em; - padding-left: 0.25em; - padding-bottom: 0; - padding-top:0; - margin-top: 0; - margin-bottom:0; -} - -.menu-major-separator { - border-bottom: solid white 1px; - padding-top: .25em; - padding-bottom: .5em; -} - -.menu-minor-separator { - border-top: solid #999999 1px; - padding-top: .1em; - margin-top: .5em; -} - -TH.collection-as-table { text-align: center; - font-size: 0.8em; - padding-left: .5em; - padding-right: .5em; - color: #333333; - background-color: #cccccc; - white-space: nowrap; - } - -TD.collection-as-table { text-align: left; - padding-left: .5em; - padding-right: .5em; - } - -textarea.signature { - width: 100%; -} -textarea.comments { - width: 100%; -} - -textarea.messagebox { - width: 100%; -} - -/* -%# Provide a callback for adding/modifying the style sheet. -%# http://www.w3.org/TR/REC-CSS1 - section 3.2, says: -%# "latter specified rule wins" -<& /Elements/Callback &> -<%flags> -inherit => undef - -<%init> -$r->content_type('text/css'); -#$r->headers_out->{'Expires'} = '+30m'; - -*/ diff --git a/rt/html/Search/Bulk.html b/rt/html/Search/Bulk.html index b7c64e3f8..9742df5ae 100644 --- a/rt/html/Search/Bulk.html +++ b/rt/html/Search/Bulk.html @@ -2,7 +2,7 @@ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2007 Best Practical Solutions, LLC %# %# %# (Except where explicitly superseded by other copyright notices) @@ -22,7 +22,9 @@ %# %# 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., 675 Mass Ave, Cambridge, MA 02139, USA. +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/copyleft/gpl.html. %# %# %# CONTRIBUTION SUBMISSION POLICY: @@ -43,185 +45,220 @@ %# those contributions and any derivatives thereof. %# %# END BPS TAGGED BLOCK }}} -<& /Elements/Header, Title => loc("Bulk ticket update") &> -<& /Elements/Tabs, Title => loc("Bulk ticket update") &> +<& /Elements/Header, Title => $title &> +<& /Ticket/Elements/Tabs, + current_tab => "Search/Bulk.html", + Title => $title, + Format => $ARGS{'Format'}, # we don't want the locally modified one + Query => $Query, + Rows => $Rows, + OrderBy => $OrderBy, + Order => $Order &> <& /Elements/ListActions, actions => \@results &> -
- - - - -%foreach my $col (@cols) { -% my $colalias = $col; -% $colalias =~ s/(Obj\-\>|)(Name|AsString)//; - - + +% foreach my $var qw(Query Format OrderBy Order Rows Page) { + %} - - -<%PERL> - -my $i; - -$Tickets->RedoSearch(); -while (my $Ticket = $Tickets->Next) { - $i++; - if ($i % 2) { - $bgcolor = "#d4d4d4"; - } - else { - $bgcolor = "#ffffff"; - } - - - -%foreach my $col (@cols) { - -%} - -%} - - - -
<&|/l&>Update<% loc($colalias) %> 
-% if ($col eq 'id') { -<%$Ticket->Id()%> -% } -%else { -<% eval "\$Ticket->$col()" %>  -%} -
- -
- - -<& /Elements/TitleBoxStart, title => loc('Update selected tickets') &> - - -
+<& /Elements/TicketList, Query => $Query, + DisplayFormat => $Format, + Format => $ARGS{'Format'}, + Verbatim => 1, + AllowSorting => 1, + OrderBy => $OrderBy, + Order => $Order, + Rows => $Rows, + Page => $Page, + BaseURL => $RT::WebPath."/Search/Bulk.html?" + &> + +
+ +<& /Elements/Submit, Label => loc('Update'), CheckAll => 1, ClearAll => 1 &> +
+<&|/Widgets/TitleBox, title => $title &> + + + - + - + +
- - - - - - - - - - - - - - + + + + + + + + + + + + + +
<&|/l&>Make Owner: <& /Elements/SelectOwner, Name => "Owner" &> ( <&|/l&>Force change)
<&|/l&>Add Requestor:
<&|/l&>Remove Requestor:
<&|/l&>Add Cc:
<&|/l&>Remove Cc:
<&|/l&>Add AdminCc:
<&|/l&>Remove AdminCc:
<&|/l&>Make Owner: <& /Elements/SelectOwner, Name => "Owner" &> ( <&|/l&>Force change)
<&|/l&>Add Requestor:
<&|/l&>Remove Requestor:
<&|/l&>Add Cc:
<&|/l&>Remove Cc:
<&|/l&>Add AdminCc:
<&|/l&>Remove AdminCc:
-
+ - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + +
<&|/l&>Make subject:
<&|/l&>Make priority:
<&|/l&>Make queue: <& /Elements/SelectQueue, Name => "Queue" &>
<&|/l&>Make Status: <& /Elements/SelectStatus, Name => "Status" &>
<&|/l&>Make date Starts: <& /Elements/SelectDate, Name => "Starts_Date", ShowTime => 0, Default => '' &>
<&|/l&>Make date Started: <& /Elements/SelectDate, Name => "Started_Date", ShowTime => 0, Default => '' &>
<&|/l&>Make date Told: <& /Elements/SelectDate, Name => "Told_Date", ShowTime => 0, Default => '' &>
<&|/l&>Make date Due: <& /Elements/SelectDate, Name => "Due_Date", ShowTime => 0, Default => '' &>
<&|/l&>Make date Resolved: <& /Elements/SelectDate, Name => "Resolved_Date", ShowTime => 0, Default => '' &>
<&|/l&>Make subject:
<&|/l&>Make priority:
<&|/l&>Make queue: <& /Elements/SelectQueue, Name => "Queue" &>
<&|/l&>Make Status: <& /Elements/SelectStatus, Name => "Status" &>
<&|/l&>Make date Starts: <& /Elements/SelectDate, Name => "Starts_Date", ShowTime => 0, Default => '' &>
<&|/l&>Make date Started: <& /Elements/SelectDate, Name => "Started_Date", ShowTime => 0, Default => '' &>
<&|/l&>Make date Told: <& /Elements/SelectDate, Name => "Told_Date", ShowTime => 0, Default => '' &>
<&|/l&>Make date Due: <& /Elements/SelectDate, Name => "Due_Date", ShowTime => 0, Default => '' &>
<&|/l&>Make date Resolved: <& /Elements/SelectDate, Name => "Resolved_Date", ShowTime => 0, Default => '' &>
-
-<& /Elements/TitleBoxEnd&> -<& /Elements/TitleBoxStart, title => loc('Add comments or replies to selected tickets') &> + +<&| /Widgets/TitleBox, title => loc('Add comments or replies to selected tickets') &> - + - + % while (my $CF = $TxnCFs->Next()) { - - - + + - + &><% $CF->FriendlyType %> + % } # end if while - - +
<&|/l&>Update Type:
<&|/l&>Update Type:
<&|/l&>Subject:
<&|/l&>Subject:
<% $CF->Name %>:<& /Elements/EditCustomField, +
<% $CF->Name %>:<& /Elements/EditCustomField, CustomField => $CF, NamePrefix => "Object-RT::Transaction--CustomField-" - &><% $CF->FriendlyType %>
<&|/l&>Attach:
<&|/l&>Message: +
<&|/l&>Attach:
<&|/l&>Message: <& /Elements/MessageBox, Name=>"UpdateContent"&>
-<& /Elements/TitleBoxEnd &> - + +<&|/Widgets/TitleBox, title => loc('Edit Custom Fields'), color => "#336633"&> +<%perl> +my $cfs = RT::CustomFields->new($session{'CurrentUser'}); +$cfs->LimitToGlobal(); +$cfs->LimitToQueue($_) for keys %$seen_queues; + + + + + + + +% while (my $cf = $cfs->Next()) { + + +% my $rows = 5; +% my @add = (NamePrefix => 'Bulk-Add-CustomField-', CustomField => $cf, Rows => $rows, Multiple => ($cf->MaxValues ==1 ? 0 : 1) , Cols => 25); +% my @del = (NamePrefix => 'Bulk-Delete-CustomField-', CustomField => $cf, Rows => $rows, Multiple => 1, Cols => 25); +% if ($cf->Type eq 'Select') { + + +% } elsif ($cf->Type eq 'Combobox') { + + +% } elsif ($cf->Type eq 'Freeform') { + + +% } elsif ($cf->Type eq 'Text') { + + +% } else { +% $RT::Logger->crit("Unknown CustomField type: " . $cf->Type); +% } + +% } +
<&|/l&>Name<&|/l&>Add values<&|/l&>Delete values
<%$cf->Name%>
+(<%$cf->FriendlyType%>)
<& /Elements/EditCustomFieldSelect, @add &><& /Elements/EditCustomFieldSelect, @del &><& /Elements/EditCustomFieldCombobox, @add &><& /Elements/EditCustomFieldCombobox, @del &><& /Elements/EditCustomFieldFreeform, @add &><& /Elements/EditCustomFieldFreeform, @del &><& /Elements/EditCustomFieldText, @add &> 
+ -<& /Elements/TitleBoxStart, title => loc('Edit Links'), color => "#336633"&> -<&|/l&>Enter tickets or URIs to link tickets to. Separate multiple entries with spaces.
+<&|/Widgets/TitleBox, title => loc('Edit Links'), color => "#336633"&> +<&|/l&>Enter tickets or URIs to link tickets to. Separate multiple entries with spaces.
<& /Ticket/Elements/BulkLinks &> -<& /Elements/TitleBoxEnd &> + + +<& /Elements/Submit, Label => loc('Update') &> + -<& /Elements/Submit, Label => loc('Update All') &> + - <%INIT> +my $title = loc("Update multiple tickets"); # Iterate through the ARGS hash and remove anything with a null value. -map ($ARGS{$_} =~ /^$/ && (delete $ARGS{$_}), keys %ARGS); - -my ($bgcolor, @results); -my @cols = qw(id Status Priority Subject QueueObj->Name OwnerObj->Name RequestorAddresses DueAsString ); - - -my $Tickets = RT::Tickets->new($session{'CurrentUser'}); -$Tickets->FromSQL($ARGS{'Query'}); - -Abort(loc("No search to operate on.")) unless ($Tickets); - -my %allcfs; -my %cfqnames; -my %cfqs; -my $count = 0; -while (my $Ticket = $Tickets->Next) { - my $cfq = $Ticket->QueueObj; - my $cfqid = $cfq->Id; - my $cfqn = $cfq->Name; - unless ( exists $cfqs{$cfqid} ) { - $cfqs{$cfqid} = 1; - $count++; - my $cfs = $cfq->TicketCustomFields; - while (my $cf = $cfs->Next) { - $allcfs{$cf->Id} = $cf; - $cfqnames{$cf->Id} = $cfqn; - } +map ( $ARGS{$_} =~ /^$/ && ( delete $ARGS{$_} ), keys %ARGS ); + +my (@results); + +$Page ||= 1; + +$Format ||= $RT::DefaultSearchResultFormat; + +# inject _CHECKBOX to the first field. +$Format =~ s/'?([^']+)'?,/'___CHECKBOX__$1',/; + +my $Tickets = RT::Tickets->new( $session{'CurrentUser'} ); +$Tickets->FromSQL($Query); +if ( $OrderBy =~ /\|/ ) { + + # Multiple Sorts + my @OrderBy = split /\|/, $OrderBy; + my @Order = split /\|/, $Order; + $Tickets->OrderByCols( + map { { FIELD => $OrderBy[$_], ORDER => $Order[$_] } } + ( 0 .. $#OrderBy ) ); +} +else { + $Tickets->OrderBy( FIELD => $OrderBy, ORDER => $Order ); +} + +$Tickets->RowsPerPage($Rows) if ($Rows); +$Tickets->GotoPage( $Page - 1 ); # SB uses page 0 as the first page + +Abort( loc("No search to operate on.") ) unless ($Tickets); + +# build up a list of all custom fields for tickets that we're displaying, so +# we can display sane edit widgets. + +my $fields = {}; +my $seen_queues = {}; +while ( my $ticket = $Tickets->Next ) { + next if $seen_queues->{ $ticket->Queue }++; + + my $custom_fields = $ticket->QueueObj->TicketCustomFields; + while ( my $field = $custom_fields->Next ) { + $fields->{ $field->id } = $field; } } -my $do_comment_reply=0; +my $do_comment_reply = 0; + # Prepare for ticket updates -$ARGS{'UpdateContent'} =~ s/\r\n/\n/g; -chomp ($ARGS{'UpdateContent'}) ; - -if ($ARGS{'UpdateContent'} && - $ARGS{'UpdateContent'} ne '' && - $ARGS{'UpdateContent'} ne "-- \n" . - $session{'CurrentUser'}->UserObj->Signature) { - $do_comment_reply=1; +if ($ARGS{'UpdateContent'}) { + $ARGS{'UpdateContent'} =~ s/\r\n/\n/g; + chomp( $ARGS{'UpdateContent'} ); + + if ($ARGS{'UpdateContent'} ne '' + && $ARGS{'UpdateContent'} ne "-- \n" + . $session{'CurrentUser'}->UserObj->Signature ) { + $do_comment_reply = 1; + } } #Iterate through each ticket we've been handed @@ -229,50 +266,131 @@ my @linkresults; my %queues; $Tickets->RedoSearch(); -while (my $Ticket = $Tickets->Next) { - $queues{$Ticket->QueueObj->Id}++; - $RT::Logger->debug( "Checking Ticket ".$Ticket->Id ."\n"); - next unless ($ARGS{"UpdateTicket".$Ticket->Id}); - $RT::Logger->debug ("Matched\n"); - my @updateresults; + +# pull out the labels for any custom fields we want to update + +my $cf_del_keys; +@$cf_del_keys = grep { /^Bulk-Delete-CustomField/ } keys %ARGS; +my $cf_add_keys; +@$cf_add_keys = grep { /^Bulk-Add-CustomField/ } keys %ARGS; + + +while ( my $Ticket = $Tickets->Next ) { + next unless ( $ARGS{ "UpdateTicket" . $Ticket->Id } ); + + #Update the links + $ARGS{'id'} = $Ticket->id; + $queues{ $Ticket->QueueObj->Id }++; + + my @updateresults; if ($do_comment_reply) { - ProcessUpdateMessage(TicketObj => $Ticket, ARGSRef => \%ARGS, Actions => \@updateresults); + ProcessUpdateMessage( + TicketObj => $Ticket, + ARGSRef => \%ARGS, + Actions => \@updateresults + ); } #Update the basics. - my @basicresults = ProcessTicketBasics(TicketObj => $Ticket, ARGSRef => \%ARGS); - my @dateresults = ProcessTicketDates(TicketObj => $Ticket, ARGSRef => \%ARGS); + my @basicresults = + ProcessTicketBasics( TicketObj => $Ticket, ARGSRef => \%ARGS ); + my @dateresults = + ProcessTicketDates( TicketObj => $Ticket, ARGSRef => \%ARGS ); + #Update the watchers - my @watchresults = ProcessTicketWatchers(TicketObj => $Ticket, ARGSRef => \%ARGS); + my @watchresults = + ProcessTicketWatchers( TicketObj => $Ticket, ARGSRef => \%ARGS ); + foreach my $type qw(MergeInto DependsOn MemberOf RefersTo) { + $ARGS{ $Ticket->id . "-" . $type } = $ARGS{"Ticket-$type"}; + $ARGS{ $type . "-" . $Ticket->id } = $ARGS{"$type-Ticket"}; + } + @linkresults = + ProcessTicketLinks( TicketObj => $Ticket, ARGSRef => \%ARGS ); + foreach my $type qw(MergeInto DependsOn MemberOf RefersTo) { + delete $ARGS{ $type . "-" . $Ticket->id }; + delete $ARGS{ $Ticket->id . "-" . $type }; + } - #Update the links - $ARGS{'id'} = $Ticket; - $ARGS{$Ticket->Id.'-MergeInto'} = $ARGS{'Ticket-MergeInto'}; - $ARGS{$Ticket->Id.'-DependsOn'} = $ARGS{'Ticket-DependsOn'}; - $ARGS{'DependsOn-'.$Ticket->Id} = $ARGS{'DependsOn-Ticket'}; - $ARGS{$Ticket->Id.'-MemberOf'} = $ARGS{'Ticket-MemberOf'}; - $ARGS{'MemberOf-'.$Ticket->Id} = $ARGS{'MemberOf-Ticket'}; - $ARGS{$Ticket->Id.'-RefersTo'} = $ARGS{'Ticket-RefersTo'}; - $ARGS{'RefersTo-'.$Ticket->Id} = $ARGS{'RefersTo-Ticket'}; - @linkresults = ProcessTicketLinks( TicketObj => $Ticket, ARGSRef => \%ARGS); - delete $ARGS{'id'}; - delete $ARGS{$Ticket->Id.'-MergeInto'}; - delete $ARGS{$Ticket->Id.'-DependsOn'}; - delete $ARGS{'DependsOn-'.$Ticket->Id}; - delete $ARGS{$Ticket->Id.'-MemberOf'}; - delete $ARGS{'MemberOf-'.$Ticket->Id}; - delete $ARGS{$Ticket->Id.'-RefersTo'}; - delete $ARGS{'RefersTo-'.$Ticket->Id}; - my @tempresults = (@watchresults, @basicresults, @dateresults, - @updateresults, @linkresults); - @tempresults = map { loc("Ticket [_1]: [_2]",$Ticket->Id,$_) } @tempresults; - - @results = (@results, @tempresults); + my @cfresults; + + foreach my $list ( $cf_add_keys, $cf_del_keys ) { + next unless $list->[0]; + + + my $op; + if ( $list->[0] =~ /Add/ ) { + $op = 'add'; + + } + elsif ( $list->[0] =~ /Del/ ) { + $op = 'del'; + } + else { + $RT::Logger->crit( + "Got an op that was neither add nor delete. can never happen" + . $list->[0] ); + last; + } + + foreach my $key (@$list) { + my ( $cfid, $cf ); + if ( $key =~ /CustomField-(\d+)-/ ) { + $cfid = $1; + $cf = RT::CustomField->new( $session{'CurrentUser'} ); + $cf->Load($cfid); + } + else {next} + my @values = + ref( $ARGS{$key} ) eq 'ARRAY' + ? @{ $ARGS{$key} } + : ( $ARGS{$key} ); + map { s/(\r\n|\r)/\n/g; } @values; # fix the newlines + # now break the multiline values into multivalues + @values = map { split( /\n/, $_ ) } @values + unless ( $cf->SingleValue ); + + my $current_values = $Ticket->CustomFieldValues($cfid); + foreach my $value (@values) { + if ( $op eq 'del' && $current_values->HasEntry($value) ) { + my ( $id, $msg ) = $Ticket->DeleteCustomFieldValue( + Field => $cfid, + Value => $value + ); + push @cfresults, $msg; + } + + elsif ( $op eq 'add' && !$current_values->HasEntry($value) ) { + my ( $id, $msg ) = $Ticket->AddCustomFieldValue( + Field => $cfid, + Value => $value + ); + push @cfresults, $msg; + } + } + } + } + my @tempresults = ( + @watchresults, @basicresults, @dateresults, + @updateresults, @linkresults, @cfresults + ); + + @tempresults = + map { loc( "Ticket [_1]: [_2]", $Ticket->Id, $_ ) } @tempresults; + + @results = ( @results, @tempresults ); } -my $TxnCFs = RT::CustomFields->new($session{CurrentUser}); -$TxnCFs->LimitToLookupType("RT::Queue-RT::Ticket-RT::Transaction"); -$TxnCFs->LimitToGlobalOrObjectId(sort keys %queues); +my $TxnCFs = RT::CustomFields->new( $session{CurrentUser} ); +$TxnCFs->LimitToLookupType( RT::Transaction->CustomFieldLookupType ); +$TxnCFs->LimitToGlobalOrObjectId( sort keys %queues ); +<%args> +$Format => undef +$Page => 1 +$Rows => undef +$Order => 'ASC' +$OrderBy => 'id' +$Query => undef + diff --git a/rt/html/Ticket/Elements/ShowMemberOf b/rt/html/Ticket/Elements/ShowMemberOf deleted file mode 100644 index e443132bc..000000000 --- a/rt/html/Ticket/Elements/ShowMemberOf +++ /dev/null @@ -1,57 +0,0 @@ -%# BEGIN BPS TAGGED BLOCK {{{ -%# -%# COPYRIGHT: -%# -%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC -%# -%# -%# (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., 675 Mass Ave, Cambridge, MA 02139, USA. -%# -%# -%# 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 }}} -
    -% my $memberof = $Ticket->MemberOf; -% while (my $member_of = $memberof->Next) { -
  • <%$member_of->Id%>: <%$member_of->Subject%> [<%$member_of->Status%>] -% } -
- -<%INIT> - -<%ARGS> -$Ticket => undef - diff --git a/rt/html/Ticket/Elements/ShowReferences b/rt/html/Ticket/Elements/ShowReferences deleted file mode 100644 index bb323f66c..000000000 --- a/rt/html/Ticket/Elements/ShowReferences +++ /dev/null @@ -1,72 +0,0 @@ -%# BEGIN BPS TAGGED BLOCK {{{ -%# -%# COPYRIGHT: -%# -%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC -%# -%# -%# (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., 675 Mass Ave, Cambridge, MA 02139, USA. -%# -%# -%# 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 }}} -
    -% while (my $Link = $Ticket->RefersTo->Next) { -
  • -% if ($Link->TargetURI->IsLocal) { -% my $member = $Link->TargetObj; - -<%$member->Id%>: (<%$member->OwnerObj->Name%>) <%$member->Subject%> [<%$member->Status%>]
    -% } else { -<%$Link->Target%> -% } -%} - - - -% while (my $Link = $Ticket->ReferredToBy->Next) { -
  • -% if ($Link->BaseURI->IsLocal) { -% my $member = $Link->BaseObj; -<%$member->Id%>: (<%$member->OwnerObj->Name%>) <%$member->Subject%> [<%$member->Status%>]
    -% } else { -<%$Link->Base%> -%} -% } -
-<%ARGS> -$Ticket => undef - diff --git a/rt/html/Ticket/Elements/ShowSummary b/rt/html/Ticket/Elements/ShowSummary index 5a6e7e099..d171f408e 100644 --- a/rt/html/Ticket/Elements/ShowSummary +++ b/rt/html/Ticket/Elements/ShowSummary @@ -2,7 +2,7 @@ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2007 Best Practical Solutions, LLC %# %# %# (Except where explicitly superseded by other copyright notices) @@ -22,7 +22,9 @@ %# %# 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., 675 Mass Ave, Cambridge, MA 02139, USA. +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/copyleft/gpl.html. %# %# %# CONTRIBUTION SUBMISSION POLICY: @@ -43,67 +45,71 @@ %# those contributions and any derivatives thereof. %# %# END BPS TAGGED BLOCK }}} - - - + +
- <& /Elements/TitleBoxStart, title => loc('The Basics'), + + + - + - -
+ <&| /Widgets/TitleBox, title => loc('The Basics'), title_href =>"$RT::WebPath/Ticket/Modify.html?id=".$Ticket->Id, - title_class=> 'inverse', - color => "#993333" &> + class => 'ticket-info-basics' &> <& /Ticket/Elements/ShowBasics, Ticket => $Ticket &> - <& /Elements/TitleBoxEnd &> -
+ + % if ($Ticket->QueueObj->TicketCustomFields->First) { - <& /Elements/TitleBoxStart, title => loc('Custom Fields'), + <&| /Widgets/TitleBox, title => loc('Custom Fields'), title_href =>"$RT::WebPath/Ticket/Modify.html?id=".$Ticket->Id, - title_class=> 'inverse', - color => "#993333" &> + class => 'ticket-info-cfs' &> <& /Ticket/Elements/ShowCustomFields, Ticket => $Ticket &> - <& /Elements/TitleBoxEnd &> - -
+ % } - <& /Elements/TitleBoxStart, title => loc('People'), + <&| /Widgets/TitleBox, title => loc('People'), title_href =>"$RT::WebPath/Ticket/ModifyPeople.html?id=".$Ticket->Id, - title_class=> 'inverse', - color => "#333399" &> - <& /Ticket/Elements/ShowPeople, Ticket => $Ticket &> - <& /Elements/TitleBoxEnd &> -
+ class => 'ticket-info-people' &> + <& /Ticket/Elements/ShowPeople, Ticket => $Ticket &> + - <& /Elements/TitleBoxStart, title => loc('Customers'), + <& /Widgets/TitleBoxStart, title => loc('Customers'), title_href =>"$RT::WebPath/Ticket/ModifyCustomers.html?id=".$Ticket->Id, - title_class=> 'inverse', - color => "#7f007b" &> + class=> 'ticket-info-customers' &> <& /Ticket/Elements/ShowCustomers, Ticket => $Ticket &> - <& /Elements/TitleBoxEnd &> + -
-
+ <& /Ticket/Elements/ShowAttachments, Ticket => $Ticket, Attachments => $Attachments &> +
+ <& /Ticket/Elements/ShowRequestor, Ticket => $Ticket &> - <& /Elements/TitleBoxStart, title => loc("Dates"), + <& /Elements/Callback, %ARGS, _CallbackName => 'LeftColumn' &> +
+ <&|/Widgets/TitleBox, title => loc("Reminders"), + title_href =>"$RT::WebPath/Ticket/Reminders.html?id=".$Ticket->Id, + class => 'ticket-info-reminders' &> + + + + +
+
+ <& /Ticket/Elements/Reminders, Ticket => $Ticket, ShowCompleted => 0 &> +
+
+
+ + <&| /Widgets/TitleBox, title => loc("Dates"), title_href =>"$RT::WebPath/Ticket/ModifyDates.html?id=".$Ticket->Id, - title_class=> 'inverse', - color => "#663366" &> + class => 'ticket-info-dates' &> <& /Ticket/Elements/ShowDates, Ticket => $Ticket &> - <& /Elements/TitleBoxEnd &> -
- <& /Elements/TitleBoxStart, title => loc('Links'), + + + <&| /Widgets/TitleBox, title => loc('Links'), title_href => "$RT::WebPath/Ticket/ModifyLinks.html?id=".$Ticket->Id, - title_class=> 'inverse', - titleright => '', color=> "#336633" &> + class => 'ticket-info-links' &> <& /Elements/ShowLinks, Ticket => $Ticket &> - <& /Elements/TitleBoxEnd &> -
- <& /Ticket/Elements/ShowAttachments, Ticket => $Ticket, Attachments => $Attachments &> - - <& /Ticket/Elements/ShowRequestor, Ticket => $Ticket &> - + + <& /Elements/Callback, %ARGS, _CallbackName => 'RightColumn' &> -
+
<%ARGS> $Ticket => undef $Attachments => undef diff --git a/rt/html/Ticket/Elements/Tabs b/rt/html/Ticket/Elements/Tabs index 46e1d4a27..3dee8dff6 100644 --- a/rt/html/Ticket/Elements/Tabs +++ b/rt/html/Ticket/Elements/Tabs @@ -2,7 +2,7 @@ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2007 Best Practical Solutions, LLC %# %# %# (Except where explicitly superseded by other copyright notices) @@ -22,7 +22,9 @@ %# %# 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., 675 Mass Ave, Cambridge, MA 02139, USA. +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/copyleft/gpl.html. %# %# %# CONTRIBUTION SUBMISSION POLICY: @@ -121,9 +123,11 @@ my $ticket_page_tabs = { path => "Ticket/ModifyLinks.html?id=" . $id, }, _Eb=> { title => loc('Customers'), path => "Ticket/ModifyCustomers.html?id=" . $id, }, - _F => { title => loc('Jumbo'), - path => "Ticket/ModifyAll.html?id=" . $id, - separator => 1 + _F => { title => loc('Reminders'), + path => "Ticket/Reminders.html?id=" . $id, + separator => 1, }, + _X => { title => loc('Jumbo'), + path => "Ticket/ModifyAll.html?id=" . $id, }, }; @@ -138,76 +142,102 @@ foreach my $tab ( sort keys %{$ticket_page_tabs} ) { $tabs->{'this'}->{"subtabs"} = $ticket_page_tabs; $current_tab = "Ticket/Display.html?id=" . $id; +my %can = ( + ModifyTicket => $Ticket->CurrentUserHasRight('ModifyTicket'), +); - - - -if ( $Ticket->CurrentUserHasRight('ModifyTicket') - or $Ticket->CurrentUserHasRight('ReplyToTicket') ) { - $actions->{'A'} = { title => loc('Reply'), - path => "Ticket/Update.html?Action=Respond&id=" . $id, +if ( $can{'ModifyTicket'} or $Ticket->CurrentUserHasRight('ReplyToTicket') ) { + $actions->{'F'} = { + title => loc('Reply'), + path => "Ticket/Update.html?Action=Respond&id=" . $id, }; } -if ( $Ticket->CurrentUserHasRight('ModifyTicket') ) { +if ( $can{'ModifyTicket'} ) { if ( $Ticket->Status ne 'resolved' ) { - $actions->{'B'} = { - + $actions->{'G'} = { path => "Ticket/Update.html?Action=Comment&DefaultStatus=resolved&id=" . $id, title => loc('Resolve') }; } if ( $Ticket->Status ne 'open' ) { - $actions->{'C'} = { path => "Ticket/Display.html?Status=open&id=" . $id, + $actions->{'A'} = { path => "Ticket/Display.html?Status=open&id=" . $id, title => loc('Open it') }; } } if ( $Ticket->CurrentUserHasRight('OwnTicket') ) { - if ( $Ticket->OwnerObj->id == $RT::Nobody->id ) { - $actions->{'D'} = { path => "Ticket/Display.html?Action=Take&id=" . $id, - title => loc('Take') }; + if ( $Ticket->OwnerObj->Id == $RT::Nobody->id + and ( $can{'ModifyTicket'} or $Ticket->CurrentUserHasRight('TakeTicket') ) ) + { + $actions->{'B'} = { + path => "Ticket/Display.html?Action=Take&id=" . $id, + title => loc('Take'), + }; } - elsif ( $Ticket->OwnerObj->id != $session{CurrentUser}->id ) { - $actions->{'E'} = {path => "Ticket/Display.html?Action=Steal&id=" . $id, - title => loc('Steal') }; + elsif ( $Ticket->OwnerObj->id != $session{CurrentUser}->id + and ( $can{'ModifyTicket'} or $Ticket->CurrentUserHasRight('StealTicket') ) ) + { + $actions->{'C'} = { + path => "Ticket/Display.html?Action=Steal&id=" . $id, + title => loc('Steal'), + }; } } -if ( $Ticket->CurrentUserHasRight('ModifyTicket') - or $Ticket->CurrentUserHasRight('CommentOnTicket') ) { - $actions->{'F'} = { title => loc('Comment'), - path => "Ticket/Update.html?Action=Comment&id=" . $id, +if ( $can{'ModifyTicket'} or $Ticket->CurrentUserHasRight('CommentOnTicket') ) { + $actions->{'E'} = { + title => loc('Comment'), + path => "Ticket/Update.html?Action=Comment&id=" . $id, }; } } -my $args = "?" . $m->comp( +if ( (defined $actions->{A} || defined $actions->{B} || defined $actions->{C}) + && (defined $actions->{E} || defined $actions->{F} || defined $actions->{G}) ) { + + if (defined $actions->{C}) { $actions->{C}->{separator} = 1 } + elsif (defined $actions->{B}) { $actions->{B}->{separator} = 1 } + elsif (defined $actions->{A}) { $actions->{A}->{separator} = 1 } +} + +my $args; +$args= "?" . $m->comp( '/Elements/QueryString', Query => $ARGS{'Query'} || $session{'CurrentSearchHash'}->{'Query'}, Format => $ARGS{'Format'} || $session{'CurrentSearchHash'}->{'Format'}, OrderBy => $ARGS{'OrderBy'} || $session{'CurrentSearchHash'}->{'OrderBy'}, Order => $ARGS{'Order'} || $session{'CurrentSearchHash'}->{'Order'}, + Page => $ARGS{'Page'} || $session{'CurrentSearchHash'}->{'Page'}, Rows => $ARGS{'Rows'}, ) if ($ARGS{'Query'} or $session{'CurrentSearchHash'}->{'Query'}); $args ||= ''; $tabs->{"f"} = { path => "Search/Build.html?NewQuery=1", - title => loc('New Query')}; + title => loc('New Search')}; $tabs->{"g"} = { path => "Search/Build.html$args", - title => loc('Query Builder')}; + title => loc('Edit Search')}; $tabs->{"h"} = { path => "Search/Edit.html$args", title => loc('Advanced'), separator => 1 }; -if (defined $session{'tickets'} and $session{'tickets'}->Count) { +if ($args) { $tabs->{"i"} = { path => "Search/Results.html$args", title => loc('Show Results'), - separator => 1, - subtabs => $searchtabs }; + }; if ($current_tab =~ "Search/Results.html") { $current_tab = "Search/Results.html$args"; } + $tabs->{"j"} = { path => "Search/Bulk.html$args", + title => loc('Bulk Update'), + }; + if ($current_tab =~ "Search/Bulk.html") { + $current_tab = "Search/Bulk.html$args"; + } + foreach my $searchtab (keys %{$searchtabs}) { + ($searchtab =~ /^_/) ? $tabs->{"s".$searchtab} = $searchtabs->{$searchtab} : $tabs->{"z_".$searchtab} = $searchtabs->{$searchtab}; + } } + diff --git a/rt/html/Widgets/TitleBoxStart b/rt/html/Widgets/TitleBoxStart index 7edc8a154..1320b8f66 100755 --- a/rt/html/Widgets/TitleBoxStart +++ b/rt/html/Widgets/TitleBoxStart @@ -64,7 +64,7 @@ $title => '' $title_class => '' $titleright_href => undef $titleright => undef -$contentbg => "#dddddd" +$contentbg => "#d4d4d4" $color => "#336699" $id => '' $hideable => 1 diff --git a/rt/lib/RT/SearchBuilder.pm b/rt/lib/RT/SearchBuilder.pm index b6d980d4a..178b66b43 100644 --- a/rt/lib/RT/SearchBuilder.pm +++ b/rt/lib/RT/SearchBuilder.pm @@ -2,7 +2,7 @@ # # COPYRIGHT: # -# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC +# This software is Copyright (c) 1996-2007 Best Practical Solutions, LLC # # # (Except where explicitly superseded by other copyright notices) @@ -22,7 +22,9 @@ # # 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., 675 Mass Ave, Cambridge, MA 02139, USA. +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +# 02110-1301 or visit their web page on the internet at +# http://www.gnu.org/copyleft/gpl.html. # # # CONTRIBUTION SUBMISSION POLICY: @@ -43,7 +45,6 @@ # those contributions and any derivatives thereof. # # END BPS TAGGED BLOCK }}} - =head1 NAME RT::SearchBuilder - a baseclass for RT collection objects @@ -68,7 +69,7 @@ ok (require RT::SearchBuilder); package RT::SearchBuilder; use RT::Base; -use DBIx::SearchBuilder 1.36; +use DBIx::SearchBuilder "1.40"; use strict; use vars qw(@ISA); diff --git a/rt/sbin/rt-setup-database.in b/rt/sbin/rt-setup-database.in index 06c04dcf1..98d965c31 100644 --- a/rt/sbin/rt-setup-database.in +++ b/rt/sbin/rt-setup-database.in @@ -3,7 +3,7 @@ # # COPYRIGHT: # -# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC +# This software is Copyright (c) 1996-2007 Best Practical Solutions, LLC # # # (Except where explicitly superseded by other copyright notices) @@ -23,7 +23,9 @@ # # 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., 675 Mass Ave, Cambridge, MA 02139, USA. +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +# 02110-1301 or visit their web page on the internet at +# http://www.gnu.org/copyleft/gpl.html. # # # CONTRIBUTION SUBMISSION POLICY: @@ -47,8 +49,9 @@ use strict; use vars qw($PROMPT $VERSION $Handle $Nobody $SystemUser $item); use vars - qw(@Groups @Users @ACL @Queues @ScripActions @ScripConditions @Templates @CustomFields @Scrips); + qw(@Groups @Users @ACL @Queues @ScripActions @ScripConditions @Templates @CustomFields @Scrips @Attributes); +use lib "@LOCAL_LIB_PATH@"; use lib "@RT_LIB_PATH@"; #This drags in RT's config.pm @@ -81,6 +84,11 @@ GetOptions( 'datadir=s' ); +unless ( $args{'action'} ) { + help(); + exit(-1); +} + $| = 1; #unbuffer that output. require RT::Handle; @@ -93,56 +101,50 @@ if ( $args{'prompt-for-dba-password'} ) { chomp( $args{'dba-password'} ); } -unless ( $args{'action'} ) { - help(); - die; -} if ( $args{'action'} eq 'init' ) { $dbh = DBI->connect( get_system_dsn(), $args{'dba'}, $args{'dba-password'} ) || die "Failed to connect to " . get_system_dsn() . " as $args{'dba'}: $DBI::errstr"; print "Now creating a database for RT.\n"; - if ($RT::DatabaseType ne 'Oracle' || - $args{'dba'} ne $RT::DatabaseUser) { - create_db(); + if ( $RT::DatabaseType ne 'Oracle' || $args{'dba'} ne $RT::DatabaseUser ) { + create_db(); } else { print "...skipped as ".$args{'dba'} ." is not " . $RT::DatabaseUser . " or we're working with Oracle.\n"; } - if ($RT::DatabaseType eq "mysql") { + if ( $RT::DatabaseType eq "mysql" ) { # Check which version we're running my ($version) = $dbh->selectrow_hashref("show variables like 'version'")->{Value} =~ /^(\d\.\d+)/; print "*** Warning: RT is unsupported on MySQL versions before 4.0.x\n" if $version < 4; # MySQL must have InnoDB support my $innodb = $dbh->selectrow_hashref("show variables like 'have_innodb'")->{Value}; - if ($innodb eq "NO") { + if ( $innodb eq "NO" ) { die "RT requires that MySQL be compiled with InnoDB table support.\n". "See http://dev.mysql.com/doc/mysql/en/InnoDB.html\n"; - } elsif ($innodb eq "DISABLED") { + } elsif ( $innodb eq "DISABLED" ) { die "RT requires that MySQL InnoDB table support be enabled.\n". ($version < 4 ? "Add 'innodb_data_file_path=ibdata1:10M:autoextend' to the [mysqld] section of my.cnf\n" : "Remove the 'skip-innodb' line from your my.cnf file, restart MySQL, and try again.\n"); } } - + # SQLite can't deal with the disconnect/reconnect - unless ($RT::DatabaseType eq 'SQLite') { + unless ( $RT::DatabaseType eq 'SQLite' ) { $dbh->disconnect; - if ($RT::DatabaseType eq "Oracle") { - $RT::DatabasePassword = $RT::DatabasePassword; #Warning avidance - $dbh = DBI->connect( $Handle->DSN, ${RT::DatabaseUser}, ${RT::DatabasePassword} ) || die $DBI::errstr; - } else { - - $dbh = DBI->connect( $Handle->DSN, $args{'dba'}, $args{'dba-password'} ) || die $DBI::errstr; - } + if ( $RT::DatabaseType eq "Oracle" ) { + $RT::DatabasePassword = $RT::DatabasePassword; #Warning avidance + $dbh = DBI->connect( $Handle->DSN, ${RT::DatabaseUser}, ${RT::DatabasePassword} ) || die $DBI::errstr; + } else { + $dbh = DBI->connect( $Handle->DSN, $args{'dba'}, $args{'dba-password'} ) || die $DBI::errstr; + } } print "Now populating database schema.\n"; insert_schema(); print "Now inserting database ACLs\n"; - insert_acl() unless ($RT::DatabaseType eq 'Oracle'); + insert_acl() unless $RT::DatabaseType eq 'Oracle'; print "Now inserting RT core system objects\n"; insert_initial_data(); print "Now inserting RT data\n"; @@ -150,11 +152,11 @@ if ( $args{'action'} eq 'init' ) { } elsif ( $args{'action'} eq 'drop' ) { unless ( $dbh = - DBI->connect( get_system_dsn(), $args{'dba'}, $args{'dba-password'} ) ) + DBI->connect( get_system_dsn(), $args{'dba'}, $args{'dba-password'} ) ) { warn $DBI::errstr; warn "Database doesn't appear to exist. Aborting database drop."; - exit(0); + exit; } drop_db(); } @@ -162,38 +164,43 @@ elsif ( $args{'action'} eq 'insert_initial' ) { insert_initial_data(); } elsif ( $args{'action'} eq 'insert' ) { - insert_data( $args{'datafile'} || ($args{'datadir'}."/content")); + insert_data( $args{'datafile'} || ($args{'datadir'}."/content") ); } -elsif ($args{'action'} eq 'acl') { +elsif ( $args{'action'} eq 'acl' ) { $dbh = DBI->connect( $Handle->DSN, $args{'dba'}, $args{'dba-password'} ) || die "Failed to connect to " . get_system_dsn() . " as $args{'dba'}: $DBI::errstr"; - insert_acl($args{'datadir'}); + insert_acl($args{'datadir'}); } -elsif ($args{'action'} eq 'schema') { +elsif ( $args{'action'} eq 'schema' ) { $dbh = DBI->connect( $Handle->DSN, $args{'dba'}, $args{'dba-password'} ) || die "Failed to connect to " . get_system_dsn() . " as $args{'dba'}: $DBI::errstr"; - insert_schema($args{'datadir'}); + insert_schema($args{'datadir'}); } - else { - print STDERR '$0 called with an invalid --action parameter'; + print STDERR "$0 called with an invalid --action parameter\n"; exit(-1); } # {{{ sub insert_schema sub insert_schema { - my $base_path = (shift || $RT::EtcPath); + my $base_path = (shift || $RT::EtcPath); my (@schema); print "Creating database schema.\n"; - if ( -f $base_path . "/schema." . $RT::DatabaseType ) { - no warnings 'unopened'; + my $schema_file = $base_path . "/schema." . $RT::DatabaseType; + if ( -f $schema_file ) { + open( SCHEMA, "<$schema_file" ) or die "Can't open $schema_file: $!"; + my @lines = ; - open( SCHEMA, "<" . $base_path . "/schema." . $RT::DatabaseType ); - open( SCHEMA_LOCAL, "<" . $RT::LocalEtcPath . "/schema." . $RT::DatabaseType ); + my $local_schema_file = $RT::LocalEtcPath . "/schema." . $RT::DatabaseType; + if (-f $local_schema_file) { + open( SCHEMA_LOCAL, "<$local_schema_file" ) + or die "Can't open $local_schema_file: $!"; + push @lines, ';;', ; + } my $statement = ""; - foreach my $line (, ($_ = ';;'), ) { + foreach my $line (@lines) { $line =~ s/\#.*//g; $line =~ s/--.*//g; $statement .= $line; @@ -204,11 +211,12 @@ sub insert_schema { } } - local $SIG{__WARN__} = sub {}; - my $is_local = 0; # local/etc/schema needs to be nonfatal. + local $SIG{__WARN__} = sub {}; + my $is_local = 0; # local/etc/schema needs to be nonfatal. $dbh->begin_work or die $dbh->errstr; foreach my $statement (@schema) { - if ($statement =~ /^\s*;$/) { $is_local = 1; next; } + if ( $statement =~ /^\s*;$/ ) { $is_local = 1; next; } + print STDERR "SQL: $statement\n" if defined $args{'debug'}; my $sth = $dbh->prepare($statement) or die $dbh->errstr; unless ( $sth->execute or $is_local ) { @@ -216,13 +224,11 @@ sub insert_schema { } } $dbh->commit or die $dbh->errstr; - } else { die "Couldn't find schema file for " . $RT::DatabaseType . "\n"; } print "Done setting up database schema.\n"; - } # }}} @@ -232,13 +238,13 @@ sub drop_db { if ( $RT::DatabaseType eq 'Oracle' ) { print <do("Drop DATABASE $RT::DatabaseName") or warn $DBI::errstr; } @@ -269,15 +275,15 @@ sub create_db { } elsif ( $RT::DatabaseType eq 'Pg' ) { $dbh->do("CREATE DATABASE $RT::DatabaseName WITH ENCODING='UNICODE'"); - if ($DBI::errstr) { + if ( $DBI::errstr ) { $dbh->do("CREATE DATABASE $RT::DatabaseName") || die $DBI::errstr; } } - elsif ($RT::DatabaseType eq 'Oracle') { + elsif ( $RT::DatabaseType eq 'Oracle' ) { insert_acl(); } elsif ( $RT::DatabaseType eq 'Informix' ) { - $ENV{DB_LOCALE} = 'en_us.utf8'; + $ENV{DB_LOCALE} = 'en_us.utf8'; $dbh->do("CREATE DATABASE $RT::DatabaseName WITH BUFFERED LOG"); } else { @@ -315,8 +321,7 @@ sub _yesno { # {{{ insert_acls sub insert_acl { - - my $base_path = (shift || $RT::EtcPath); + my $base_path = (shift || $RT::EtcPath); if ( $RT::DatabaseType =~ /^oracle$/i ) { do $base_path . "/acl.Oracle" @@ -378,8 +383,8 @@ sub get_system_dsn { $dsn =~ s/dbname=$RT::DatabaseName/dbname=template1/; } elsif ( $RT::DatabaseType eq 'Informix' ) { - # with Informix, you want to connect sans database: - $dsn =~ s/Informix:$RT::DatabaseName/Informix:/; + # with Informix, you want to connect sans database: + $dsn =~ s/Informix:$RT::DatabaseName/Informix:/; } return $dsn; } @@ -418,14 +423,15 @@ sub insert_initial_data { Comments => 'Do not delete or modify this user. It is integral to RT\'s internal database structures', Creator => '1', - LastUpdatedBy => '1' ); + LastUpdatedBy => '1', + ); - unless ($val) { + unless ( $val ) { print "$msg\n"; - exit(1); + exit(-1); } print "done.\n"; - $RT::Handle->Disconnect() unless ($RT::DatabaseType eq 'SQLite'); + $RT::Handle->Disconnect() unless $RT::DatabaseType eq 'SQLite'; } @@ -461,77 +467,78 @@ sub insert_data { require $datafile || die "Couldn't find initial data for import\n" . $@; - if (@Groups) { + if ( @Groups ) { print "Creating groups..."; foreach $item (@Groups) { my $new_entry = RT::Group->new($CurrentUser); my ( $return, $msg ) = $new_entry->_Create(%$item); - print "(Error: $msg)" unless ($return); + print "(Error: $msg)" unless $return; print $return. "."; } print "done.\n"; } - if (@Users) { + if ( @Users ) { print "Creating users..."; foreach $item (@Users) { my $new_entry = new RT::User($CurrentUser); my ( $return, $msg ) = $new_entry->Create(%$item); - print "(Error: $msg)" unless ($return); + print "(Error: $msg)" unless $return; print $return. "."; } print "done.\n"; } - if (@Queues) { + if ( @Queues ) { print "Creating queues..."; for $item (@Queues) { my $new_entry = new RT::Queue($CurrentUser); my ( $return, $msg ) = $new_entry->Create(%$item); - print "(Error: $msg)" unless ($return); + print "(Error: $msg)" unless $return; print $return. "."; } print "done.\n"; } - if (@ACL) { + if ( @ACL ) { print "Creating ACL..."; for my $item (@ACL) { - my ($princ, $object); + my ($princ, $object); - # Global rights or Queue rights? - if ($item->{'Queue'}) { + # Global rights or Queue rights? + if ( $item->{'Queue'} ) { $object = RT::Queue->new($CurrentUser); $object->Load( $item->{'Queue'} ); - } else { - $object = $RT::System; - } + } else { + $object = $RT::System; + } - # Group rights or user rights? - if ($item->{'GroupDomain'}) { + # Group rights or user rights? + if ( $item->{'GroupDomain'} ) { $princ = RT::Group->new($CurrentUser); - if ($item->{'GroupDomain'} eq 'UserDefined') { + if ( $item->{'GroupDomain'} eq 'UserDefined' ) { $princ->LoadUserDefinedGroup( $item->{'GroupId'} ); - } elsif ($item->{'GroupDomain'} eq 'SystemInternal') { + } elsif ( $item->{'GroupDomain'} eq 'SystemInternal' ) { $princ->LoadSystemInternalGroup( $item->{'GroupType'} ); - } elsif ($item->{'GroupDomain'} eq 'RT::System-Role') { + } elsif ( $item->{'GroupDomain'} eq 'RT::System-Role' ) { $princ->LoadSystemRoleGroup( $item->{'GroupType'} ); - } elsif ($item->{'GroupDomain'} eq 'RT::Queue-Role' && - $item->{'Queue'}) { + } elsif ( $item->{'GroupDomain'} eq 'RT::Queue-Role' && + $item->{'Queue'} ) + { $princ->LoadQueueRoleGroup( Type => $item->{'GroupType'}, - Queue => $object->id); - } else { + Queue => $object->id); + } else { $princ->Load( $item->{'GroupId'} ); - } - } else { - $princ = RT::User->new($CurrentUser); - $princ->Load( $item->{'UserId'} ); - } - - # Grant it - my ( $return, $msg ) = $princ->PrincipalObj->GrantRight( + } + } else { + $princ = RT::User->new($CurrentUser); + $princ->Load( $item->{'UserId'} ); + } + + # Grant it + my ( $return, $msg ) = $princ->PrincipalObj->GrantRight( Right => $item->{'Right'}, Object => $object ); - if ($return) { + if ( $return ) { print $return. "."; } else { @@ -542,65 +549,68 @@ sub insert_data { } print "done.\n"; } - if (@CustomFields) { + if ( @CustomFields ) { print "Creating custom fields..."; for $item (@CustomFields) { my $new_entry = new RT::CustomField($CurrentUser); my $values = $item->{'Values'}; delete $item->{'Values'}; - my $q = $item->{'Queue'}; - my $q_obj = RT::Queue->new($CurrentUser); - $q_obj->Load($q); - if ( $q_obj->Id ) { - $item->{'Queue'} = $q_obj->Id; - } - elsif ( $q == 0 ) { - $item->{'Queue'} = 0; - } - else { - print "(Error: Could not find queue " . $q . ")\n" - unless ( $q_obj->Id ); + my ( $return, $msg ) = $new_entry->Create(%$item); + unless( $return ) { + print "(Error: $msg)\n"; next; } - my ( $return, $msg ) = $new_entry->Create(%$item); foreach my $value ( @{$values} ) { my ( $eval, $emsg ) = $new_entry->AddValue(%$value); - print "(Error: $emsg)\n" unless ($eval); + print "(Error: $emsg)\n" unless $eval; + } + + if ( $item->{LookupType} && !exists $item->{'Queue'} ) { # enable by default + my $ocf = RT::ObjectCustomField->new($CurrentUser); + $ocf->Create( CustomField => $new_entry->Id ); } - print "(Error: $msg)\n" unless ($return); + print "(Error: $msg)\n" unless $return; print $return. "."; } print "done.\n"; } - if (@ScripActions) { + if ( @ScripActions ) { print "Creating ScripActions..."; for $item (@ScripActions) { my $new_entry = RT::ScripAction->new($CurrentUser); - my $return = $new_entry->Create(%$item); + my ($return,$msg) = $new_entry->Create(%$item); + unless ($return) { + print "(Error: $msg)\n"; + exit; + } print $return. "."; } print "done.\n"; } - if (@ScripConditions) { + if ( @ScripConditions ) { print "Creating ScripConditions..."; for $item (@ScripConditions) { my $new_entry = RT::ScripCondition->new($CurrentUser); - my $return = $new_entry->Create(%$item); + my ($return,$msg) = $new_entry->Create(%$item); + unless ($return) { + print "(Error: $msg)\n"; + exit; + } print $return. "."; } print "done.\n"; } - if (@Templates) { + if ( @Templates ) { print "Creating templates..."; for $item (@Templates) { @@ -610,13 +620,30 @@ sub insert_data { } print "done.\n"; } - if (@Scrips) { + if ( @Scrips ) { print "Creating scrips..."; for $item (@Scrips) { my $new_entry = new RT::Scrip($CurrentUser); my ( $return, $msg ) = $new_entry->Create(%$item); - if ($return) { + if ( $return ) { + print $return. "."; + } + else { + print "(Error: $msg)\n"; + } + } + print "done.\n"; + } + if ( @Attributes ) { + print "Creating predefined searches..."; + my $sys = RT::System->new($CurrentUser); + + for $item (@Attributes) { + my $obj = delete $item->{Object}; # XXX: make this something loadable + $obj ||= $sys; + my ( $return, $msg ) = $obj->AddAttribute (%$item); + if ( $return ) { print $return. "."; } else { @@ -625,7 +652,7 @@ sub insert_data { } print "done.\n"; } - $RT::Handle->Disconnect() unless ($RT::DatabaseType eq 'SQLite'); + $RT::Handle->Disconnect() unless $RT::DatabaseType eq 'SQLite'; print "Done setting up database content.\n"; } @@ -651,7 +678,7 @@ sub help { $0: Set up RT's database --action init Initialize the database - drop Drop the database. + drop Drop the database. This will ERASE ALL YOUR DATA insert_initial Insert RT's core system objects @@ -659,11 +686,11 @@ $0: Set up RT's database By default, will use RT's installation data. To use a local or supplementary datafile, specify it using the '--datafile' option below. - + acl Initialize only the database ACLs To use a local or supplementary datafile, specify it using the '--datadir' option below. - + schema Initialize only the database schema To use a local or supplementary datafile, specify it using the '--datadir' option below. -- 2.11.0