[Rt-commit] [svn] r966 - in rt/branches/rt-3.3: . bin etc etc/upgrade html/Admin/Elements html/Developer html/Elements html/Projects html/Scope html/Search html/Search/Elements html/Ticket/Elements lib/RT lib/RT/Interface

jesse at pallas.eruditorum.org jesse at pallas.eruditorum.org
Thu May 27 23:31:00 EDT 2004


Author: jesse
Date: Thu May 27 23:30:59 2004
New Revision: 966

Removed:
   rt/branches/rt-3.3/etc/upgrade/2.1.71
   rt/branches/rt-3.3/html/Developer/Perldoc.html
   rt/branches/rt-3.3/html/Elements/ShadedBox
   rt/branches/rt-3.3/html/Elements/ShadedInputRow
   rt/branches/rt-3.3/html/Elements/ShadedRow
   rt/branches/rt-3.3/html/Projects/
   rt/branches/rt-3.3/html/Scope/
   rt/branches/rt-3.3/html/Search/Elements/PickRestriction
   rt/branches/rt-3.3/html/Search/Elements/TicketHeader
   rt/branches/rt-3.3/html/Search/Elements/TicketHeaderCell
   rt/branches/rt-3.3/html/Search/Listing.html
   rt/branches/rt-3.3/html/Ticket/Elements/EditLinks
   rt/branches/rt-3.3/html/Ticket/Elements/ShowLink
   rt/branches/rt-3.3/html/Ticket/Elements/ShowLinks
Modified:
   rt/branches/rt-3.3/   (props changed)
   rt/branches/rt-3.3/bin/rt.in
   rt/branches/rt-3.3/configure.ac   (contents, props changed)
   rt/branches/rt-3.3/etc/acl.Pg
   rt/branches/rt-3.3/html/Admin/Elements/ToolTabs   (props changed)
   rt/branches/rt-3.3/html/Elements/EditLinks   (props changed)
   rt/branches/rt-3.3/html/Elements/Footer
   rt/branches/rt-3.3/html/Elements/ShowLinks   (props changed)
   rt/branches/rt-3.3/html/Elements/TicketList
   rt/branches/rt-3.3/html/Search/Build.html
   rt/branches/rt-3.3/html/Search/Elements/PickCFs
   rt/branches/rt-3.3/html/Ticket/Elements/ShowTransactionAttachments
   rt/branches/rt-3.3/html/Ticket/Elements/Tabs
   rt/branches/rt-3.3/lib/RT/Attachment_Overlay.pm
   rt/branches/rt-3.3/lib/RT/CurrentUser.pm
   rt/branches/rt-3.3/lib/RT/Interface/Web.pm
   rt/branches/rt-3.3/lib/RT/Ticket_Overlay.pm
Log:
 ----------------------------------------------------------------------
 r1710 at tinbook:  jesse | 2004-05-28T02:46:23.907073Z
 
 
 ----------------------------------------------------------------------
 r1712 at tinbook:  jesse | 2004-05-28T03:15:12.330227Z
 
  ----------------------------------------------------------------------
  r1669 at tinbook:  jesse | 2004-05-24T02:17:41.959105Z
  
  
  ----------------------------------------------------------------------
  r1672 at tinbook:  jesse | 2004-05-24T03:09:05.156817Z
  
  
  ----------------------------------------------------------------------
  r1673 at tinbook:  jesse | 2004-05-24T03:59:43.181766Z
  
  Bumping to 3.1.16
  ----------------------------------------------------------------------
  r1706 at tinbook:  jesse | 2004-05-28T02:10:56.309297Z
  
  
  ----------------------------------------------------------------------
  r1711 at tinbook:  jesse | 2004-05-28T02:47:49.277131Z
  
  
  ----------------------------------------------------------------------
 
 ----------------------------------------------------------------------
 r1713 at tinbook:  jesse | 2004-05-28T03:27:19.127190Z
 
 Cleaning out things split out into other products
 ----------------------------------------------------------------------


Modified: rt/branches/rt-3.3/bin/rt.in
==============================================================================
--- rt/branches/rt-3.3/bin/rt.in	(original)
+++ rt/branches/rt-3.3/bin/rt.in	Thu May 27 23:30:59 2004
@@ -150,11 +150,11 @@
             my $title = $item->[2]{Title};
             my @titles = ref $title eq 'ARRAY' ? @$title : $title;
 
-        foreach $title (grep $_, @titles) {
-            $help{$title} = $item->[2]{Text};
+            foreach $title (grep $_, @titles) {
+                $help{$title} = $item->[2]{Text};
+            }
         }
     }
-    }
 
     # What does the user want help with?
     undef $action if ($action && $actions{$action} eq \&help);
@@ -197,6 +197,9 @@
     my ($q, $type, %data);
     my $orderby = $config{orderby};
     
+    if ($config{orderby}) {
+         $data{orderby} = $config{orderby};
+    } 
     my $bad = 0;
 
     while (@ARGV) {
@@ -209,7 +212,7 @@
             $bad = 1, last unless get_var_argument(\%data);
         }
         elsif (/^-o$/) {
-            $data{orderby} = shift @ARGV;
+            $data{'orderby'} = shift @ARGV;
         }
         elsif (/^-([isl])$/) {
             $data{format} = $1;
@@ -230,10 +233,8 @@
             $bad = 1; last;
         }
     }
-    
-    if (!defined $q)
-    {
-        $q = $config{query} ; 
+    if (!defined $q) {
+        $q = $config{query}; 
     }
     
     $type ||= "ticket";
@@ -244,7 +245,7 @@
     }
     return help("list", $type) if $bad;
 
-    my $r = submit("$REST/search/$type", { query => $q, %data, orderby => $data{orderby} || "" });
+    my $r = submit("$REST/search/$type", { query => $q, %data });
     print $r->content;
 }
 

Modified: rt/branches/rt-3.3/configure.ac
==============================================================================
--- rt/branches/rt-3.3/configure.ac	(original)
+++ rt/branches/rt-3.3/configure.ac	Thu May 27 23:30:59 2004
@@ -1,3 +1,4 @@
+autoconf; exec ./configure $@
 dnl
 dnl Process this file with autoconf to produce a configure script
 dnl

Modified: rt/branches/rt-3.3/etc/acl.Pg
==============================================================================
--- rt/branches/rt-3.3/etc/acl.Pg	(original)
+++ rt/branches/rt-3.3/etc/acl.Pg	Thu May 27 23:30:59 2004
@@ -5,48 +5,47 @@
 
     my @tables = qw (
 
- attachments_id_seq
- Attachments 
- queues_id_seq
+      attachments_id_seq
+      Attachments
+      Attributes
+      attributes_id_seq
+      queues_id_seq
  Queues 
- links_id_seq
+      links_id_seq
  Links 
- principals_id_seq
+      principals_id_seq
  Principals 
- groups_id_seq
+      groups_id_seq
  Groups 
- scripconditions_id_seq
+      scripconditions_id_seq
  ScripConditions 
- transactions_id_seq
+      transactions_id_seq
  Transactions 
- scrips_id_seq
+      scrips_id_seq
  Scrips 
- acl_id_seq
+      acl_id_seq
  ACL 
- groupmembers_id_seq
+      groupmembers_id_seq
  GroupMembers 
- cachedgroupmembers_id_seq
+      cachedgroupmembers_id_seq
  CachedGroupMembers 
- users_id_seq
+      users_id_seq
  Users 
- tickets_id_seq
+      tickets_id_seq
  Tickets 
- scripactions_id_seq
+      scripactions_id_seq
  ScripActions 
- templates_id_seq
+      templates_id_seq
  Templates 
  objectcustomfieldvalues_id_s
  ObjectCustomFieldValues 
- customfields_id_seq
+      customfields_id_seq
  CustomFields 
  objectcustomfields_id_s
  ObjectCustomFields 
- customfieldvalues_id_seq
- CustomFieldValues 
- attributes_id_seq
- Attributes 
- sessions 
-
+      customfieldvalues_id_seq
+      CustomFieldValues
+      sessions
     );
 
     # if there's already an rt_user, drop it.

Modified: rt/branches/rt-3.3/html/Elements/Footer
==============================================================================
--- rt/branches/rt-3.3/html/Elements/Footer	(original)
+++ rt/branches/rt-3.3/html/Elements/Footer	Thu May 27 23:30:59 2004
@@ -29,7 +29,11 @@
 % }
 <& /Elements/Callback, %ARGS &>
 <div class="bpscredits">
-<&|/l, '&#187;&#124;&#171;', $RT::VERSION, '2004', '<a href="http://www.bestpractical.com?rt='.$RT::VERSION.'">Best Practical Solutions, LLC</a>', &>[_1] RT [_2] Copyright 1996-[_3] [_4].</&><br>
+<&|/l,     '&#187;&#124;&#171;', 
+     $RT::VERSION, 
+     '2004', 
+    '<a href="http://www.bestpractical.com?rt='.$RT::VERSION.'">Best Practical Solutions, LLC</a>',
+&>[_1] RT [_2] Copyright 1996-[_3] [_4].</&><br>
 % if (!$Menu) {
 <&|/l&>Distributed under version 2 <a href="http://www.gnu.org/copyleft/gpl.html"> of the GNU GPL.</a></&><br>
 <&|/l, '<a href="mailto:sales at bestpractical.com">sales at bestpractical.com</a>' &>To inquire about support, training, custom development or licensing, please contact [_1].</&><br>

Modified: rt/branches/rt-3.3/html/Elements/TicketList
==============================================================================
--- rt/branches/rt-3.3/html/Elements/TicketList	(original)
+++ rt/branches/rt-3.3/html/Elements/TicketList	Thu May 27 23:30:59 2004
@@ -40,7 +40,7 @@
 </TABLE>
 % if ($ShowNavigation) {
 <hr>
-<&|/l, $Page, int(($TotalFound-1)/$Rows)+1&>Page [_1] of [_2]</&>
+<&|/l, $Page, int($TotalFound/$Rows)+1&>Page [_1] of [_2]</&>
 
 <%perl>
 my $prev =  $m->comp('/Elements/QueryString', Query => $Query,

Modified: rt/branches/rt-3.3/html/Search/Build.html
==============================================================================
--- rt/branches/rt-3.3/html/Search/Build.html	(original)
+++ rt/branches/rt-3.3/html/Search/Build.html	Thu May 27 23:30:59 2004
@@ -88,6 +88,18 @@
 my $search;
 my $title = loc("Query Builder");
 
+if ($NewQuery) {
+    $Query = '';
+    $Format = '';
+    $Description = '';
+    undef $session{'CurrentSearchHash'};
+} else {
+    $search_hash = $session{'CurrentSearchHash'};
+    $Query ||= $search_hash->{'Query'};
+    $Format ||= $search_hash->{'Format'};
+    $Description ||= $search_hash->{'Description'};
+}
+
 my @actions        = ();
 my %queues;
 
@@ -135,7 +147,7 @@
     $search_hash->{'SearchId'} = $ARGS{'LoadSavedSearch'};
     $ARGS{'Format'} = $Format   = $search->SubValue('Format');
     $ARGS{'Query'} = $Query    = $search->SubValue('Query');
-
+    $SearchId = $ARGS{'LoadSavedSearch'};
 
 
 }
@@ -251,7 +263,7 @@
             }
 
             $currentkey = $key;
-            $key   = nextkey($key);
+            $key = nextkey($key);
         }
     }
 }
@@ -1013,6 +1025,9 @@
 
         $search_hash->{'SearchId'} = $ARGS{'SearchId'};
         $search_hash->{'Object'}   = $search;
+        $search_hash->{'Format'} = $ARGS{'Format'};
+        $search_hash->{'Query'} = $ARGS{'Query'};
+        $search_hash->{'Description'} = $ARGS{'Description'};
 
     }
     elsif ( $ARGS{'SearchId'} eq 'new' && $ARGS{'Owner'} =~ /^(.*?)-(\d+)$/ ) {
@@ -1097,14 +1112,29 @@
 # Build a querystring for the tabs
 
 my $QueryString;
-$QueryString = '?' . $m->comp('/Elements/QueryString', Query => $Query,
-	Format => $Format,
-	Rows =>$ARGS{'Rows'}) if ($Query);
+if ($NewQuery) {
+    $QueryString = '?NewQuery=1';
+} else {
+    $QueryString = '?' . $m->comp('/Elements/QueryString', 
+            Query => $Query,
+	    Format => $Format,
+	    Rows =>$ARGS{'Rows'}) if ($Query);
+}
+
+if (!$search) {
+    $search_hash->{'SearchId'} = $SearchId;
+    $search_hash->{'Format'} = $Format;
+    $search_hash->{'Query'} = $Query;
+    $search_hash->{'Description'} = $Description || $ARGS{'Descripton'};
+}
+
+$session{'CurrentSearchHash'} = $search_hash;
 
 $ARGS{'SearchId'} =$search_hash->{'SearchId'};
 </%INIT>
 
 <%ARGS>
+$NewQuery => 0
 $SearchId => 'new'
 $Query => undef
 $Format => undef 

Modified: rt/branches/rt-3.3/html/Search/Elements/PickCFs
==============================================================================
--- rt/branches/rt-3.3/html/Search/Elements/PickCFs	(original)
+++ rt/branches/rt-3.3/html/Search/Elements/PickCFs	Thu May 27 23:30:59 2004
@@ -27,10 +27,10 @@
 
 % my $name;
 % if ($CustomField->QueueObj) {
-%   $name = "CF." . $CustomField->QueueObj->Name . 
-%	".{" . $CustomField->Name . "}";
+%   $name = "'CF." . $CustomField->QueueObj->Name . 
+%	".{" . $CustomField->Name . "}'";
 % } else {
-%   $name = "CF." . $CustomField->Name;
+%   $name = "'CF." . $CustomField->Name . "'";
 % }
 <% $CustomField->Name %> 
         <& /Elements/SelectCustomFieldOperator, Name => $name . "Op", 

Modified: rt/branches/rt-3.3/html/Ticket/Elements/ShowTransactionAttachments
==============================================================================
--- rt/branches/rt-3.3/html/Ticket/Elements/ShowTransactionAttachments	(original)
+++ rt/branches/rt-3.3/html/Ticket/Elements/ShowTransactionAttachments	Thu May 27 23:30:59 2004
@@ -25,6 +25,7 @@
 # Find all the attachments which have parent $Parent
 # For each of these attachments
 foreach my $message ( grep { $_->Parent == $Parent } @$Attachments ) {
+
     # {{{    show the headers
     my $headers = $message->Headers;
     chomp $headers;

Modified: rt/branches/rt-3.3/html/Ticket/Elements/Tabs
==============================================================================
--- rt/branches/rt-3.3/html/Ticket/Elements/Tabs	(original)
+++ rt/branches/rt-3.3/html/Ticket/Elements/Tabs	Thu May 27 23:30:59 2004
@@ -162,9 +162,9 @@
     Query  => $ARGS{'Query'},
     Format => $ARGS{'Format'},
     Rows   => $ARGS{'Rows'}
-  );
+  ) if ($ARGS{'Query'});
 
-$tabs->{"f"} = { path      => "Search/Build.html",
+$tabs->{"f"} = { path      => "Search/Build.html?NewQuery=1",
                  title     => loc('New Query'),
                  subtabs   => $searchtabs };
 $tabs->{"g"} = { path      => "Search/Build.html$args",

Modified: rt/branches/rt-3.3/lib/RT/Attachment_Overlay.pm
==============================================================================
--- rt/branches/rt-3.3/lib/RT/Attachment_Overlay.pm	(original)
+++ rt/branches/rt-3.3/lib/RT/Attachment_Overlay.pm	Thu May 27 23:30:59 2004
@@ -384,7 +384,7 @@
 Returns this object's headers as a string.  This method specifically
 removes the RT-Send-Bcc: header, so as to never reveal to whom RT sent a Bcc.
 We need to record the RT-Send-Cc and RT-Send-Bcc values so that we can actually send
-out mail. (The mailing rules are seperated from the ticket update code by
+out mail. (The mailing rules are separated from the ticket update code by
 an abstraction barrier that makes it impossible to pass this data directly
 
 =cut

Modified: rt/branches/rt-3.3/lib/RT/CurrentUser.pm
==============================================================================
--- rt/branches/rt-3.3/lib/RT/CurrentUser.pm	(original)
+++ rt/branches/rt-3.3/lib/RT/CurrentUser.pm	Thu May 27 23:30:59 2004
@@ -59,11 +59,11 @@
 # to be a CurrentUser object. but that's hard to do when we're trying to load
 # the CurrentUser object
 
-sub _Init  {
-  my $self = shift;
+sub _Init {
+    my $self = shift;
     my $User = shift;
 
-  $self->{'table'} = "Users";
+    $self->{'table'} = "Users";
 
     if ( defined($User) ) {
 
@@ -80,7 +80,7 @@
         else {
             $self->Load($User);
         }
-  }
+    }
 
     $self->_BuildTableAttributes();
 

Modified: rt/branches/rt-3.3/lib/RT/Interface/Web.pm
==============================================================================
--- rt/branches/rt-3.3/lib/RT/Interface/Web.pm	(original)
+++ rt/branches/rt-3.3/lib/RT/Interface/Web.pm	Thu May 27 23:30:59 2004
@@ -124,7 +124,7 @@
 
 sub EscapeUTF8  {
         my  $ref = shift;
-        my $val = $$ref;                                                                                                                                
+        my $val = (Encode::is_utf8($$ref) ? Encode::encode_utf8($$ref) : $$ref);                                                                                                                                
         $val =~ s/&/&#38;/g;
         $val =~ s/</&lt;/g; 
         $val =~ s/>/&gt;/g;
@@ -1095,12 +1095,12 @@
 	    if (!$Object or ref($Object) ne $class or $Object->id != $id) {
 		$Object = $class->new( $session{'CurrentUser'} );
 		$Object->Load($id);
-	    }
+	}
 
 	    # For each custom field  
 	    foreach my $cf ( keys %{ $custom_fields_to_mod{$class}{$id} } ) {
-		my $CustomFieldObj = RT::CustomField->new($session{'CurrentUser'});
-		$CustomFieldObj->LoadById($cf);
+	    my $CustomFieldObj = RT::CustomField->new($session{'CurrentUser'});
+	    $CustomFieldObj->LoadById($cf);
 
 		foreach my $arg ( keys %{$ARGSRef} ) {
 		    # since http won't pass in a form element with a null value, we need
@@ -1195,27 +1195,27 @@
 		    elsif ( $arg =~ /-Values$/ ) {
 			my $cf_values = $Object->CustomFieldValues($cf);
 
-			# keep everything up to the point of difference, delete the rest
-			my $delete_flag;
-			foreach my $old_cf (@{$cf_values->ItemsArrayRef}) {
-			    if (!$delete_flag and @values and $old_cf->Content eq $values[0]) {
-				shift @values;
-				next;
-			    }
-
-			    $delete_flag ||= 1;
-			    $old_cf->Delete;
+		    # keep everything up to the point of difference, delete the rest
+		    my $delete_flag;
+		    foreach my $old_cf (@{$cf_values->ItemsArrayRef}) {
+			if (!$delete_flag and @values and $old_cf->Content eq $values[0]) {
+			    shift @values;
+			    next;
 			}
 
-			# now add/replace extra things, if any
-			foreach my $value (@values) {
+			$delete_flag ||= 1;
+			$old_cf->Delete;
+		    }
+
+		    # now add/replace extra things, if any
+		    foreach my $value (@values) {
 			    my ( $val, $msg ) = $Object->AddCustomFieldValue(
-				Field => $cf,
-				Value => $value
-			    );
-			    push ( @results, $msg );
-			}
+			    Field => $cf,
+			    Value => $value
+			);
+			push ( @results, $msg );
 		    }
+		}
 		    else {
 			push ( @results, loc("User asked for an unknown update type for custom field [_1] for [_2] object #[_3]", $cf->Name, $class, $Object->id ) );
 		    }

Modified: rt/branches/rt-3.3/lib/RT/Ticket_Overlay.pm
==============================================================================
--- rt/branches/rt-3.3/lib/RT/Ticket_Overlay.pm	(original)
+++ rt/branches/rt-3.3/lib/RT/Ticket_Overlay.pm	Thu May 27 23:30:59 2004
@@ -338,7 +338,6 @@
         Resolved           => undef,
         MIMEObj            => undef,
         _RecordTransaction => 1,
-
         @_
     );
 
@@ -468,7 +467,6 @@
               . $self->loc( "User '[_1]' could not be found.", $args{'Owner'} )
           )
           unless ( $Owner->Id );
-
     }
 
     #If we have a proposed owner and they don't have the right
@@ -555,10 +553,9 @@
           unless ( exists $params{$attr} && $params{$attr} );
     }
 
-
-    my ($id,$ticket_message) = $self->SUPER::Create( %params);
+    my ( $id, $ticket_message ) = $self->SUPER::Create(%params);
     unless ($id) {
-        $RT::Logger->crit( "Couldn't create a ticket: " . $ticket_message);
+        $RT::Logger->crit( "Couldn't create a ticket: " . $ticket_message );
         $RT::Handle->Rollback();
         return ( 0, 0,
             $self->loc("Ticket could not be created due to an internal error")
@@ -667,9 +664,11 @@
         next unless ( $arg =~ /^CustomField-(\d+)$/i );
         my $cfid = $1;
         foreach
-      my $value ( UNIVERSAL::isa($args{$arg}, 'ARRAY') ? @{ $args{$arg} } : ( $args{$arg} ) ) {
-        next unless (length($value));
-        $self->_AddCustomFieldValue( Field => $cfid,
+          my $value ( ref( $args{$arg} ) ? @{ $args{$arg} } : ( $args{$arg} ) )
+        {
+            next unless ( length($value) );
+            $self->_AddCustomFieldValue(
+                Field             => $cfid,
                 Value             => $value,
                 RecordTransaction => 0
             );
@@ -688,7 +687,7 @@
         );
 
         if ( $self->Id && $Trans ) {
-	       $TransObj->UpdateCustomFields( ARGSRef => \%args );
+
             $RT::Logger->info( "Ticket " . $self->Id . " created in queue '" . $QueueObj->Name . "' by " . $self->CurrentUser->Name );
             $ErrStr = $self->loc( "Ticket [_1] created in queue '[_2]'", $self->Id, $QueueObj->Name );
             $ErrStr = join( "\n", $ErrStr, @non_fatal_errors );
@@ -2715,7 +2714,7 @@
 
     # We use EffectiveId here even though it duplicates information from
     # the links table becasue of the massive performance hit we'd take
-    # by trying to do a seperate database query for merge info everytime 
+    # by trying to do a separate database query for merge info everytime 
     # loaded a ticket. 
 
     #update this ticket's effective id to the new ticket's id.


More information about the Rt-commit mailing list