[Rt-commit] r4979 - in rt/branches/3.7-EXPERIMENTAL: .

ruz at bestpractical.com ruz at bestpractical.com
Wed Apr 5 13:41:28 EDT 2006


Author: ruz
Date: Wed Apr  5 13:41:18 2006
New Revision: 4979

Modified:
   rt/branches/3.7-EXPERIMENTAL/   (props changed)
   rt/branches/3.7-EXPERIMENTAL/html/Search/Elements/EditSearches

Log:
 r2345 at cubic-pc:  cubic | 2006-04-05 17:39:42 +0400
 * when we init saved search we should load SS object
   when users works with some search, otherwise we loosing
   this information on subcequent queries


Modified: rt/branches/3.7-EXPERIMENTAL/html/Search/Elements/EditSearches
==============================================================================
--- rt/branches/3.7-EXPERIMENTAL/html/Search/Elements/EditSearches	(original)
+++ rt/branches/3.7-EXPERIMENTAL/html/Search/Elements/EditSearches	Wed Apr  5 13:41:18 2006
@@ -81,8 +81,8 @@
 <%INIT>
 
 return unless $session{'CurrentUser'}->HasRight(
-    Right => 'LoadSavedSearch',
-    Object=> $RT::System,
+    Right  => 'LoadSavedSearch',
+    Object => $RT::System,
 );
 
 # If we're modifying an old query, check if it has changed
@@ -138,12 +138,11 @@
     $SavedSearch->{'Id'}          = $ARGS{'SavedSearchLoad'};
     $SavedSearch->{'Object'}      = $search;
     $SavedSearch->{'Description'} = $search->Description;
-
     $Query->{$_} = $search->SubValue($_) foreach @FIELDS;
 }
 elsif ( $ARGS{'SavedSearchDelete'} ) {
     # We set $SearchId to 'new' above already, so peek into the %ARGS
-    my ($container, $id) = _parse_saved_search( $ARGS{'SearchId'} );
+    my ($container, $id) = _parse_saved_search( $SavedSearch->{'Id'} );
     if ( $container && $container->id ) {
         # We have the object the entry is an attribute on; delete the entry...
         $container->Attributes->DeleteEntry( Name => 'SavedSearch', id => $id );
@@ -157,6 +156,13 @@
     $SavedSearch->{'Description'} = loc( "[_1] copy", $SavedSearch->{'Description'} );
 }
 
+if ( $SavedSearch->{'Id'} && $SavedSearch->{'Id'} ne 'new'
+     && !$SavedSearch->{'Object'} )
+{
+    my ($container, $id ) = _parse_saved_search( $ARGS{'SavedSearchId'} );
+    $SavedSearch->{'Object'} = $container->Attributes->WithId( $id );
+}
+
 </%INIT>
 </%METHOD>
 


More information about the Rt-commit mailing list