summaryrefslogtreecommitdiff
path: root/rt/share/html/Search
diff options
context:
space:
mode:
authorIvan Kohler <ivan@freeside.biz>2014-05-27 15:20:05 -0700
committerIvan Kohler <ivan@freeside.biz>2014-05-27 15:20:05 -0700
commitc5922713bc199600bc8c203155a4016c9d24cbbc (patch)
tree1b9ec8323fdab801c4ca6aaf74234bfe8f74c56c /rt/share/html/Search
parent7c841dec307feed06ee532ac18e4114ef68243a8 (diff)
rt 4.0.20 (RT#13852)
Diffstat (limited to 'rt/share/html/Search')
-rwxr-xr-xrt/share/html/Search/Bulk.html29
-rw-r--r--rt/share/html/Search/Chart2
-rw-r--r--rt/share/html/Search/Chart.html2
-rw-r--r--rt/share/html/Search/Elements/BuildFormatString10
-rw-r--r--rt/share/html/Search/Elements/Chart2
-rwxr-xr-xrt/share/html/Search/Results.html4
6 files changed, 39 insertions, 10 deletions
diff --git a/rt/share/html/Search/Bulk.html b/rt/share/html/Search/Bulk.html
index a215eac8e..38ca64248 100755
--- a/rt/share/html/Search/Bulk.html
+++ b/rt/share/html/Search/Bulk.html
@@ -202,6 +202,13 @@ $cfs->LimitToQueue($_) for keys %$seen_queues;
% } elsif ($cf->Type eq 'Text') {
<td><& /Elements/EditCustomFieldText, @add &></td>
<td>&nbsp;</td>
+% } elsif ($cf->Type eq 'Date') {
+<td><& /Elements/EditCustomFieldDate, @add, Default => undef &></td>
+<td><& /Elements/EditCustomFieldDate, @del, Default => undef &></td>
+% } elsif ($cf->Type eq 'DateTime') {
+% # Pass datemanip format to prevent another tz date conversion
+<td><& /Elements/EditCustomFieldDateTime, @add, Default => undef, Format => 'datemanip' &></td>
+<td><& /Elements/EditCustomFieldDateTime, @del, Default => undef, Format => 'datemanip' &></td>
% } else {
% $RT::Logger->crit("Unknown CustomField type: " . $cf->Type);
% }
@@ -372,7 +379,27 @@ unless ( $ARGS{'AddMoreAttach'} ) {
unless ( $cf->SingleValue );
my $current_values = $Ticket->CustomFieldValues($cfid);
+
+ if ( $cf->Type eq 'DateTime' || $cf->Type eq 'Date' ){
+ # Clear out empty string submissions to avoid
+ # Not set changed to Not set
+ @values = grep length, @values;
+ }
+
foreach my $value (@values) {
+
+ # Convert for timezone. Without converstion,
+ # HasEntry and DeleteCustomFieldValue fail because
+ # the value in the DB is converted.
+ if ( $op eq 'del'
+ && ($cf->Type eq 'DateTime' || $cf->Type eq 'Date') ){
+ my $DateObj = RT::Date->new( $session{'CurrentUser'} );
+ $DateObj->Set( Format => 'unknown',
+ Value => $value );
+ $value = $cf->Type eq 'DateTime' ? $DateObj->ISO
+ : $DateObj->ISO(Time => 0, Seconds => 0);
+ }
+
if ( $op eq 'del' && $current_values->HasEntry($value) ) {
my ( $id, $msg ) = $Ticket->DeleteCustomFieldValue(
Field => $cfid,
@@ -411,6 +438,8 @@ unless ( $ARGS{'AddMoreAttach'} ) {
# Cleanup WebUI
delete $session{'Attachments'};
+
+ $Tickets->RedoSearch();
}
my $TxnCFs = RT::CustomFields->new( $session{CurrentUser} );
diff --git a/rt/share/html/Search/Chart b/rt/share/html/Search/Chart
index 4be28abd6..7256106e3 100644
--- a/rt/share/html/Search/Chart
+++ b/rt/share/html/Search/Chart
@@ -48,7 +48,7 @@
<%args>
$Query => "id > 0"
$PrimaryGroupBy => 'Queue'
-$ChartStyle => 'bars'
+$ChartStyle => 'bar'
</%args>
<%init>
my $chart_class;
diff --git a/rt/share/html/Search/Chart.html b/rt/share/html/Search/Chart.html
index 952f09cf4..ab25745f8 100644
--- a/rt/share/html/Search/Chart.html
+++ b/rt/share/html/Search/Chart.html
@@ -47,7 +47,7 @@
%# END BPS TAGGED BLOCK }}}
<%args>
$PrimaryGroupBy => 'Queue'
-$ChartStyle => 'bars'
+$ChartStyle => 'bar'
$Description => undef
</%args>
<%init>
diff --git a/rt/share/html/Search/Elements/BuildFormatString b/rt/share/html/Search/Elements/BuildFormatString
index 14e3a7105..66fd14763 100644
--- a/rt/share/html/Search/Elements/BuildFormatString
+++ b/rt/share/html/Search/Elements/BuildFormatString
@@ -109,6 +109,8 @@ my @fields = (
)
); # loc_qw
+# This callback will only run once and will be removed in 4.4
+# If you want to add a new item to @fields, use the Default callback below.
$m->callback( CallbackOnce => 1, CallbackName => 'SetFieldsOnce', Fields => \@fields );
my $CustomFields = RT::CustomFields->new( $session{'CurrentUser'});
@@ -227,17 +229,17 @@ my @format_string;
foreach my $field (@seen) {
next unless $field;
my $row = "";
- if ( $field->{'output'} ) {
- $row = join '', @{$field->{'output'}};
+ if ( $field->{'original_string'} ) {
+ $row = $field->{'original_string'};
}
else {
$row .= $field->{'Prefix'} if defined $field->{'Prefix'};
$row .= "__$field->{'Column'}__"
unless ( $field->{'Column'} eq "<blank>" );
$row .= $field->{'Suffix'} if defined $field->{'Suffix'};
+ $row =~ s!([\\'])!\\$1!g;
+ $row = "'$row'";
}
- $row =~ s!([\\'])!\\$1!g;
- $row = "'$row'";
push( @format_string, $row );
}
diff --git a/rt/share/html/Search/Elements/Chart b/rt/share/html/Search/Elements/Chart
index 05a0422b1..f0d1e4a0f 100644
--- a/rt/share/html/Search/Elements/Chart
+++ b/rt/share/html/Search/Elements/Chart
@@ -48,7 +48,7 @@
<%args>
$Query => "id > 0"
$PrimaryGroupBy => 'Queue'
-$ChartStyle => 'bars'
+$ChartStyle => 'bar'
</%args>
<%init>
use RT::Report::Tickets;
diff --git a/rt/share/html/Search/Results.html b/rt/share/html/Search/Results.html
index 601786f10..3c3187c1f 100755
--- a/rt/share/html/Search/Results.html
+++ b/rt/share/html/Search/Results.html
@@ -111,7 +111,6 @@ if ( !defined($Rows) ) {
}
$Page = 1 unless $Page && $Page > 0;
-my ($title, $ticketcount);
$session{'i'}++;
$session{'tickets'} = RT::Tickets->new($session{'CurrentUser'}) ;
my ($ok, $msg) = $Query ? $session{'tickets'}->FromSQL($Query) : (1, "Vacuously OK");
@@ -141,11 +140,10 @@ $session{'CurrentSearchHash'} = {
};
+my ($title, $ticketcount) = (loc("Found tickets"), 0);
if ( $session{'tickets'}->Query()) {
$ticketcount = $session{tickets}->CountAll();
$title = loc('Found [quant,_1,ticket]', $ticketcount);
-} else {
- $title = loc("Find tickets");
}
my $QueryString = "?".$m->comp('/Elements/QueryString',