[Rt-commit] r2243 - in rtfm/branches/2.1-TESTING: . html/Admin html/Admin/Global html/Admin/Global/CustomFields html/Callbacks/RTFM/Admin html/Callbacks/RTFM/Admin/Global html/Callbacks/RTFM/Admin/Global/CustomFields html/Callbacks/RTFM/Admin/Global/CustomFields/index.html html/RTFM/Article html/RTFM/Article/Elements

jesse at bestpractical.com jesse at bestpractical.com
Thu Feb 17 02:17:11 EST 2005


Author: jesse
Date: Thu Feb 17 02:17:10 2005
New Revision: 2243

Added:
   rtfm/branches/2.1-TESTING/html/Admin/
   rtfm/branches/2.1-TESTING/html/Admin/Global/
   rtfm/branches/2.1-TESTING/html/Admin/Global/CustomFields/
   rtfm/branches/2.1-TESTING/html/Admin/Global/CustomFields/RTFM-Class-RTFM-Article.html
   rtfm/branches/2.1-TESTING/html/Callbacks/RTFM/Admin/
   rtfm/branches/2.1-TESTING/html/Callbacks/RTFM/Admin/Global/
   rtfm/branches/2.1-TESTING/html/Callbacks/RTFM/Admin/Global/CustomFields/
   rtfm/branches/2.1-TESTING/html/Callbacks/RTFM/Admin/Global/CustomFields/index.html/
   rtfm/branches/2.1-TESTING/html/Callbacks/RTFM/Admin/Global/CustomFields/index.html/Default
Removed:
   rtfm/branches/2.1-TESTING/html/RTFM/Article/Elements/EditCustomField
   rtfm/branches/2.1-TESTING/html/RTFM/Article/Elements/ShowCustomFields
Modified:
   rtfm/branches/2.1-TESTING/   (props changed)
   rtfm/branches/2.1-TESTING/html/RTFM/Article/Display.html
   rtfm/branches/2.1-TESTING/html/RTFM/Article/Elements/EditCustomFields
Log:
 r4836 at hualien:  jesse | 2005-02-17T07:14:24.479718Z
 more refactoring for use of standard RT CFs


Added: rtfm/branches/2.1-TESTING/html/Admin/Global/CustomFields/RTFM-Class-RTFM-Article.html
==============================================================================
--- (empty file)
+++ rtfm/branches/2.1-TESTING/html/Admin/Global/CustomFields/RTFM-Class-RTFM-Article.html	Thu Feb 17 02:17:10 2005
@@ -0,0 +1,5 @@
+<& /Admin/Elements/ObjectCustomFields, 
+    %ARGS, 
+    ObjectType => 'RT::FM::Class',
+    SubType => 'RT::FM::Article' &>
+

Added: rtfm/branches/2.1-TESTING/html/Callbacks/RTFM/Admin/Global/CustomFields/index.html/Default
==============================================================================
--- (empty file)
+++ rtfm/branches/2.1-TESTING/html/Callbacks/RTFM/Admin/Global/CustomFields/index.html/Default	Thu Feb 17 02:17:10 2005
@@ -0,0 +1,11 @@
+<%args>
+$tabs => undef
+</%args>
+<%init>
+$tabs->{'RTFM-A'} = { title => loc('RTFM Articles'),
+                      text => loc('Select custom fields for RTFM articles in all classes'),
+                      path => 'RTFM-Class-RTFM-Article.html' 
+
+                      };
+
+</%init>

Modified: rtfm/branches/2.1-TESTING/html/RTFM/Article/Display.html
==============================================================================
--- rtfm/branches/2.1-TESTING/html/RTFM/Article/Display.html	(original)
+++ rtfm/branches/2.1-TESTING/html/RTFM/Article/Display.html	Thu Feb 17 02:17:10 2005
@@ -24,35 +24,34 @@
 
 <emp><%$article->Summary%></emp>
 <br><br><br>
-  <& Elements/ShowCustomFields, article => $article &>
+<& /Elements/ShowCustomFields, Object => $article &>
 <br>
 <br>
 <& Elements/ShowLinks, article => $article &>
 <%init>
 
-my $article = RT::FM::Article->new($session{'CurrentUser'}); 
+my $article = RT::FM::Article->new( $session{'CurrentUser'} );
 if ($Name) {
-    $article->LoadByCols(Name => $Name);
-} elsif ($id) {
+    $article->LoadByCols( Name => $Name );
+}
+elsif ($id) {
     $article->Load($id);
 }
-unless ($article->Id) {
-    if ($ARGS{'Name'}) {
-        $m->comp('Edit.html',%ARGS );
-        return();
+unless ( $article->Id ) {
+    if ( $ARGS{'Name'} ) {
+        $m->comp( 'Edit.html', %ARGS );
+        return ();
     }
     else {
-        $m->comp("/Elements/Error", Why => loc("Article not found"));
+        $m->comp( "/Elements/Error", Why => loc("Article not found") );
     }
 
 }
 
-unless ($article->CurrentUserHasRight(
-                                        'ShowArticle')) {
-    $m->comp("/RTFM/Elements/Error", Why => loc("Permission Denied"));
+unless ( $article->CurrentUserHasRight('ShowArticle') ) {
+    $m->comp( "/RTFM/Elements/Error", Why => loc("Permission Denied") );
 }
-my $title =  loc( "Article #[_1]: [_2]", $article->Id, $article->Name);
-
+my $title = loc( "Article #[_1]: [_2]", $article->Id, $article->Name );
 
 $id = $article->id;
 

Modified: rtfm/branches/2.1-TESTING/html/RTFM/Article/Elements/EditCustomFields
==============================================================================
--- rtfm/branches/2.1-TESTING/html/RTFM/Article/Elements/EditCustomFields	(original)
+++ rtfm/branches/2.1-TESTING/html/RTFM/Article/Elements/EditCustomFields	Thu Feb 17 02:17:10 2005
@@ -17,32 +17,32 @@
 %# END LICENSE BLOCK
 
 <table>
-% while (my $CustomField = $CustomFields->Next) {
-% my $Content = $CFContent->{$CustomField->Id};
-<tr>
-<td valign="top" align="right">
-<B><%$CustomField->Name%></b><br>
-<small><i>(<%$CustomField->Type%>)</i></small>
-</td>
-<td valign="top">
-<& EditCustomField, CustomFieldObj => $CustomField, 
-                    ClassObj => $ClassObj,
-                    ArticleObj => $ArticleObj, 
-                    Content => $Content,
-                    id => $id,
-                    %ARGS
-                     &>
-</TD>
-</TR>
+% while (my $CustomField = $CustomFields->Next()) {
+  <tr>
+    <td class="labeltop">
+      <b><%$CustomField->Name%></b><br>
+      <i><%$CustomField->FriendlyType%></i>
+    </td>
+    <td class="entry"><& /Elements/EditCustomField, 
+        Object => $ArticleObj, 
+        CustomField => $CustomField, 
+        NamePrefix => $NamePrefix,
+        Content => $CFContent->{$CustomField->Id}
+        &></td>
+  </tr>
 % }
-</TABLE>
+</table>
 <%INIT>
 my $CustomFields;
+my $NamePrefix;
+
 if ($ArticleObj->ClassObj->id) {
     $CustomFields = $ArticleObj->ClassObj->CustomFields();
+    $NamePrefix = "Object-RT::FM::Article-".$ArticleObj->Id."-CustomField-";
 }
 else {
     $CustomFields = $ClassObj->CustomFields();
+    $NamePrefix = "Object-RT::FM::Article--CustomField-";
 }
 </%INIT>
 <%ARGS>


More information about the Rt-commit mailing list