[Rt-commit] r13272 - in rt/branches/3.8-TESTING: share/html/Search/Elements

elacour at bestpractical.com elacour at bestpractical.com
Fri Jun 13 05:30:59 EDT 2008


Author: elacour
Date: Fri Jun 13 05:30:56 2008
New Revision: 13272

Modified:
   rt/branches/3.8-TESTING/   (props changed)
   rt/branches/3.8-TESTING/share/html/Search/Elements/EditSearches

Log:
 r9508 at datura:  manu | 2008-06-13 11:30:44 +0200
 * AutoSave new search when we click on "Copy" for an existing saved search.
 * Add "copy of" for the new search only if Description was unchanged.


Modified: rt/branches/3.8-TESTING/share/html/Search/Elements/EditSearches
==============================================================================
--- rt/branches/3.8-TESTING/share/html/Search/Elements/EditSearches	(original)
+++ rt/branches/3.8-TESTING/share/html/Search/Elements/EditSearches	Fri Jun 13 05:30:56 2008
@@ -177,9 +177,15 @@
     push @results, loc("Deleted saved search");
 }
 elsif ( $ARGS{'SavedSearchCopy'} ) {
+    my ($container, $id ) = _parse_saved_search( $ARGS{'SavedSearchId'} );
+    $SavedSearch->{'Object'} = $container->Attributes->WithId( $id );
+    if ( $ARGS{'SavedSearchDescription'} && $ARGS{'SavedSearchDescription'} ne $SavedSearch->{'Object'}->Description ) {
+        $SavedSearch->{'Description'} = $ARGS{'SavedSearchDescription'};
+    } else {
+        $SavedSearch->{'Description'} = loc( "[_1] copy", $SavedSearch->{'Object'}->Description );
+    }
     $SavedSearch->{'Id'}          = 'new';
     $SavedSearch->{'Object'}      = undef;
-    $SavedSearch->{'Description'} = loc( "[_1] copy", $SavedSearch->{'Description'} );
 }
 
 if ( $SavedSearch->{'Id'} && $SavedSearch->{'Id'} ne 'new'
@@ -203,7 +209,7 @@
 </%ARGS>
 <%INIT>
 
-return unless $ARGS{'SavedSearchSave'};
+return unless $ARGS{'SavedSearchSave'} || $ARGS{'SavedSearchCopy'};
 
 my @results;
 my $obj  = $SavedSearch->{'Object'};


More information about the Rt-commit mailing list