[Rt-commit] rt branch, 3.9-merge-rtfm, updated. rt-3.9.6-1098-g03aaa94

Alex Vandiver alexmv at bestpractical.com
Wed Dec 8 16:06:55 EST 2010


The branch, 3.9-merge-rtfm has been updated
       via  03aaa945097628b97a3fc7dcd4f98b927f195fed (commit)
       via  444313ae6541e8b9735a01e756d1b996a2545bd7 (commit)
       via  97a6eadc45b32a97e29812f39b094578f5a8b4df (commit)
       via  4aa0aa7eb71bd327fb88e283c9f1e78791f10b4e (commit)
       via  5e876f1edff55ef846bea7da7182d9c2574f7728 (commit)
      from  700874432d7d5f9b950317da2c64415888170488 (commit)

Summary of changes:
 lib/RT/Article_Overlay.pm                       |    8 ++++----
 lib/RT/Topic_Overlay.pm                         |    6 +++---
 lib/RT/URI/fsck_com_article.pm                  |    5 +++--
 share/html/Admin/Articles/Classes/Modify.html   |    2 +-
 share/html/Admin/Articles/Classes/Topics.html   |    2 +-
 share/html/Admin/Articles/Elements/Topics       |    2 +-
 share/html/Admin/CustomFields/Modify.html       |    2 +-
 share/html/Articles/Article/Edit.html           |    2 +-
 share/html/Articles/Article/Elements/EditTopics |    4 ++--
 share/html/Articles/Topics.html                 |    2 +-
 share/html/Elements/Tabs                        |    4 ++--
 t/articles/cfsearch.t                           |    8 ++++----
 t/articles/upload-customfields.t                |    1 -
 13 files changed, 24 insertions(+), 24 deletions(-)

- Log -----------------------------------------------------------------
commit 5e876f1edff55ef846bea7da7182d9c2574f7728
Author: Alex Vandiver <alexmv at bestpractical.com>
Date:   Wed Dec 8 14:52:45 2010 -0500

    SKIP_REQUEST_WORK_AROUND is unnecessary since efe6f39

diff --git a/t/articles/upload-customfields.t b/t/articles/upload-customfields.t
index bc98c54..912c23d 100644
--- a/t/articles/upload-customfields.t
+++ b/t/articles/upload-customfields.t
@@ -4,7 +4,6 @@ use strict;
 use warnings;
 
 use RT::Test tests => 20;
-$RT::Test::SKIP_REQUEST_WORK_AROUND = 1;
 
 use RT;
 my $logo;

commit 4aa0aa7eb71bd327fb88e283c9f1e78791f10b4e
Author: Alex Vandiver <alexmv at bestpractical.com>
Date:   Wed Dec 8 15:06:01 2010 -0500

    Fix old-style config vars

diff --git a/lib/RT/URI/fsck_com_article.pm b/lib/RT/URI/fsck_com_article.pm
index ef52367..b2d83fb 100644
--- a/lib/RT/URI/fsck_com_article.pm
+++ b/lib/RT/URI/fsck_com_article.pm
@@ -62,7 +62,8 @@ Returns the prefix for a local article URI
 
 sub LocalURIPrefix {
     my $self = shift;
-    my $prefix = $self->Scheme. "://$RT::Organization/article/";
+    my $prefix = $self->Scheme. "://". RT->Config->Get('Organization')
+        . "/article/";
     return ($prefix);
 }
 
@@ -186,7 +187,7 @@ Otherwise, return its URI
 sub HREF {
     my $self = shift;
     if ($self->IsLocal && $self->Object) {
-        return ( $RT::WebURL . "/Articles/Article/Display.html?id=".$self->Object->Id);
+        return ( RT->Config->Get('WebURL') . "/Articles/Article/Display.html?id=".$self->Object->Id);
     }   
     else {
         return ($self->URI);

commit 97a6eadc45b32a97e29812f39b094578f5a8b4df
Author: Alex Vandiver <alexmv at bestpractical.com>
Date:   Wed Dec 8 15:21:34 2010 -0500

    Remove more indirect object notation

diff --git a/lib/RT/Article_Overlay.pm b/lib/RT/Article_Overlay.pm
index 3356c9b..e091f4e 100644
--- a/lib/RT/Article_Overlay.pm
+++ b/lib/RT/Article_Overlay.pm
@@ -333,7 +333,7 @@ routine will not recurse and will not find grandchildren, great-grandchildren, u
 
 sub Children {
     my $self = shift;
-    my $kids = new RT::Articles( $self->CurrentUser );
+    my $kids = RT::Articles->new( $self->CurrentUser );
 
     unless ( $self->CurrentUserHasRight('ShowArticle') ) {
         $kids->LimitToParent( $self->Id );
@@ -444,7 +444,7 @@ sub URIObj {
 sub Topics {
     my $self = shift;
 
-    my $topics = new RT::ObjectTopics( $self->CurrentUser );
+    my $topics = RT::ObjectTopics->new( $self->CurrentUser );
     if ( $self->CurrentUserHasRight('ShowArticle') ) {
         $topics->LimitToObject($self);
     }
@@ -462,7 +462,7 @@ sub AddTopic {
         return ( 0, $self->loc("Permission Denied") );
     }
 
-    my $t = new RT::ObjectTopic( $self->CurrentUser );
+    my $t = RT::ObjectTopic->new( $self->CurrentUser );
     my ($tid) = $t->Create(
         Topic      => $args{'Topic'},
         ObjectType => ref($self),
@@ -486,7 +486,7 @@ sub DeleteTopic {
         return ( 0, $self->loc("Permission Denied") );
     }
 
-    my $t = new RT::ObjectTopic( $self->CurrentUser );
+    my $t = RT::ObjectTopic->new( $self->CurrentUser );
     $t->LoadByCols(
         Topic      => $args{'Topic'},
         ObjectId   => $self->Id,
diff --git a/lib/RT/Topic_Overlay.pm b/lib/RT/Topic_Overlay.pm
index e4c19db..0c87b4d 100644
--- a/lib/RT/Topic_Overlay.pm
+++ b/lib/RT/Topic_Overlay.pm
@@ -109,7 +109,7 @@ sub Delete {
         return ( 0, $self->loc("Permission Denied") );
     }
 
-    my $kids = new RT::Topics($self->CurrentUser);
+    my $kids = RT::Topics->new($self->CurrentUser);
     $kids->LimitToKids($self->Id);
     while (my $topic = $kids->Next) {
         $topic->setParent($self->Parent);
@@ -138,7 +138,7 @@ sub DeleteAll {
     }
 
     $self->SUPER::Delete(@_);
-    my $kids = new RT::Topics($self->CurrentUser);
+    my $kids = RT::Topics->new($self->CurrentUser);
     $kids->LimitToKids($self->Id);
     while (my $topic = $kids->Next) {
         $topic->DeleteAll;
@@ -161,7 +161,7 @@ Returns the parent Topic of this one.
 sub ParentObj {
   my $self = shift;
   my $id = $self->Parent;
-  my $obj = new RT::Topic($self->CurrentUser);
+  my $obj = RT::Topic->new($self->CurrentUser);
   $obj->Load($id);
   return $obj;
 }
diff --git a/share/html/Admin/Articles/Classes/Modify.html b/share/html/Admin/Articles/Classes/Modify.html
index e9f01df..9cda843 100644
--- a/share/html/Admin/Articles/Classes/Modify.html
+++ b/share/html/Admin/Articles/Classes/Modify.html
@@ -94,7 +94,7 @@
 
 <%INIT>
 
-my $ClassObj = new RT::Class($session{'CurrentUser'});
+my $ClassObj = RT::Class->new($session{'CurrentUser'});
 my  ($title, @results, $Disabled);
 
 if ($Create) {
diff --git a/share/html/Admin/Articles/Classes/Topics.html b/share/html/Admin/Articles/Classes/Topics.html
index b823a00..b7fe3fa 100644
--- a/share/html/Admin/Articles/Classes/Topics.html
+++ b/share/html/Admin/Articles/Classes/Topics.html
@@ -51,7 +51,7 @@
 
 <%INIT>
 
-my $ClassObj = new RT::Class($session{'CurrentUser'});
+my $ClassObj = RT::Class->new($session{'CurrentUser'});
 $ClassObj->Load($ARGS{'id'}) || $m->comp("/Elements/Error", Why => "Couldn't load class '$id'");
 
 my $title = $Modify 
diff --git a/share/html/Admin/Articles/Elements/Topics b/share/html/Admin/Articles/Elements/Topics
index f3d9ac9..f362f24 100644
--- a/share/html/Admin/Articles/Elements/Topics
+++ b/share/html/Admin/Articles/Elements/Topics
@@ -169,7 +169,7 @@ for my $k (keys %ARGS) {
     }
 }
 
-my $topics = new RT::Topics($session{'CurrentUser'});
+my $topics = RT::Topics->new($session{'CurrentUser'});
 $topics->LimitToObject($RootObj);
 $topics->OrderByCols({FIELD => 'Parent'}, {FIELD => 'id'});
 
diff --git a/share/html/Articles/Article/Edit.html b/share/html/Articles/Article/Edit.html
index a31b519..b1e5691 100644
--- a/share/html/Articles/Article/Edit.html
+++ b/share/html/Articles/Article/Edit.html
@@ -299,7 +299,7 @@ else {
     if ( $ARGS{'EditTopics'} ) {
         $topics{$_}++ for @{ $ARGS{'Topics'} };
         my $objTopics =
-          new RT::ObjectTopics( $session{'CurrentUser'} );
+          RT::ObjectTopics->new( $session{'CurrentUser'} );
         $objTopics->LimitToObject($ArticleObj);
         while ( my $t = $objTopics->Next ) {
             $topics{ $t->Topic }--;
diff --git a/share/html/Articles/Article/Elements/EditTopics b/share/html/Articles/Article/Elements/EditTopics
index 7d9555f..855184c 100644
--- a/share/html/Articles/Article/Elements/EditTopics
+++ b/share/html/Articles/Article/Elements/EditTopics
@@ -66,7 +66,7 @@ unless ($OnlyThisClass) {
     unless ($topic->ObjectId == $class) {
       $class = $topic->ObjectId;
       $m->print("</optgroup>\n");
-      my $c = new RT::Class($session{'CurrentUser'});
+      my $c = RT::Class->new($session{'CurrentUser'});
       $c->Load($topic->ObjectId);
       $m->print("<optgroup label=\"".$c->Name."\">\n");
     }
@@ -139,7 +139,7 @@ sub buildTree {
 
 </%INIT>
 <%ARGS>
-$ArticleObj => new RT::Article($session{'CurrentUser'})
+$ArticleObj => RT::Article->new($session{'CurrentUser'})
 @Classes => ()
 @Topics => ()
 $OnlyThisClass => undef
diff --git a/t/articles/cfsearch.t b/t/articles/cfsearch.t
index 2aa7e58..49420e5 100644
--- a/t/articles/cfsearch.t
+++ b/t/articles/cfsearch.t
@@ -58,12 +58,12 @@ my $cf = RT::CustomField->new( $RT::SystemUser );
 }
 
 my $article1name = 'TestArticle1'.$suffix;
-my $article1 = new RT::Article($RT::SystemUser);
+my $article1 = RT::Article->new($RT::SystemUser);
 $article1->Create( Name => $article1name, Summary => 'Test', Class => $class->Id);
 $article1->AddCustomFieldValue(Field => $cf->Id, Value => 'Value1');
 
 my $article2name = 'TestArticle2'.$suffix;
-my $article2 = new RT::Article($RT::SystemUser);
+my $article2 = RT::Article->new($RT::SystemUser);
 $article2->Create( Name => $article2name, Summary => 'Test', Class => $class->Id);
 $article2->AddCustomFieldValue(Field => $cf->Id, Value => 'Value2');
 
@@ -77,7 +77,7 @@ $article2->AddCustomFieldValue(Field => $cf->Id, Value => 'Value2');
 }
 
 {
-    my $articles = new RT::Articles($RT::SystemUser);
+    my $articles = RT::Articles->new($RT::SystemUser);
     $articles->UnLimit;
     $articles->Limit( FIELD => "Class", SUBCLAUSE => 'ClassMatch', VALUE => $class->Id);
     $articles->LimitCustomField( FIELD => $cf, VALUE => 'Value1' );    
@@ -85,7 +85,7 @@ $article2->AddCustomFieldValue(Field => $cf->Id, Value => 'Value2');
 }
 
 {
-    my $articles = new RT::Articles($RT::SystemUser);
+    my $articles = RT::Articles->new($RT::SystemUser);
     $articles->UnLimit( );
     $articles->Limit( FIELD => "Class", SUBCLAUSE => 'ClassMatch', VALUE => $class->Id);
     $articles->LimitCustomField( FIELD => $cf->Name, VALUE => 'Value1' );

commit 444313ae6541e8b9735a01e756d1b996a2545bd7
Author: Alex Vandiver <alexmv at bestpractical.com>
Date:   Wed Dec 8 15:35:40 2010 -0500

    Fix a quoting issue; method calls, unlike variables, don't interpolate

diff --git a/share/html/Articles/Topics.html b/share/html/Articles/Topics.html
index 6d3172d..7cdb257 100644
--- a/share/html/Articles/Topics.html
+++ b/share/html/Articles/Topics.html
@@ -72,7 +72,7 @@ if (defined $class) {
         .'">'.$c->Name."</a></h2>\n");
         $m->print("\n</li>\n");
     }
-    $m->print(qq|<li><h2><a href="RT->Config->Get('WebPath')/Articles/Topics.html?class=0">Global Topics</a></h2></li>\n|);
+    $m->print(qq|<li><h2><a href="|.RT->Config->Get('WebPath').qq|/Articles/Topics.html?class=0">Global Topics</a></h2></li>\n|);
     $m->print("</ul>\n");
 }
 </%perl>

commit 03aaa945097628b97a3fc7dcd4f98b927f195fed
Author: Alex Vandiver <alexmv at bestpractical.com>
Date:   Wed Dec 8 15:48:22 2010 -0500

    Pass through LookupType so Articles creates CFs linked to articles by default

diff --git a/share/html/Admin/CustomFields/Modify.html b/share/html/Admin/CustomFields/Modify.html
index cecedc5..5f85456 100644
--- a/share/html/Admin/CustomFields/Modify.html
+++ b/share/html/Admin/CustomFields/Modify.html
@@ -89,7 +89,7 @@
 <tr><td class="label"><&|/l&>Applies to</&></td>
 <td><& /Admin/Elements/SelectCustomFieldLookupType, 
         Name => "LookupType", 
-        Default => $CustomFieldObj->LookupType, &>
+        Default => $CustomFieldObj->LookupType || $LookupType, &>
 </td></tr>
 
 <tr class="edit_validation"><td class="label"><&|/l&>Validation</&></td>
diff --git a/share/html/Elements/Tabs b/share/html/Elements/Tabs
index 6e39517..29020d7 100755
--- a/share/html/Elements/Tabs
+++ b/share/html/Elements/Tabs
@@ -183,8 +183,8 @@ if ( $request_path !~ qr{^/SelfService/} ) {
 
 
         my $cfs = $article_admin->child( 'custom-fields' => title => loc('Custom Fields'), path => '/Admin/CustomFields/index.html?'.$m->comp('/Elements/QueryString', type => 'RT::Class-RT::Article') );
-        $cfs->child( select => title => loc('Select'), path   => "/Admin/CustomFields/" );
-        $cfs->child( create => title => loc('Create'), path => "/Admin/CustomFields/Modify.html?Create=1" );
+        $cfs->child( select => title => loc('Select'), path => '/Admin/CustomFields/index.html?'.$m->comp('/Elements/QueryString', type => 'RT::Class-RT::Article') );
+        $cfs->child( create => title => loc('Create'), path => '/Admin/CustomFields/Modify.html?'.$m->comp("/Elements/QueryString", Create=>1, LookupType=> "RT::Class-RT::Article" ));
 
         $admin_global->child( 'group-rights' => title => loc('Group Rights'), path => '/Admin/Global/GroupRights.html', );
         $admin_global->child( 'user-rights' => title => loc('User Rights'), path => '/Admin/Global/UserRights.html', );

-----------------------------------------------------------------------


More information about the Rt-commit mailing list