[Rt-commit] [svn] r1332 - in rtfm/branches/2.1-TESTING: etc etc/upgrade/2.1 html/RTFM/Article/Elements

alexmv at pallas.eruditorum.org alexmv at pallas.eruditorum.org
Fri Aug 13 11:33:52 EDT 2004


Author: alexmv
Date: Fri Aug 13 11:33:51 2004
New Revision: 1332

Modified:
   rtfm/branches/2.1-TESTING/etc/schema.Oracle
   rtfm/branches/2.1-TESTING/etc/schema.Pg
   rtfm/branches/2.1-TESTING/etc/schema.mysql
   rtfm/branches/2.1-TESTING/etc/upgrade/2.1/schema.Oracle
   rtfm/branches/2.1-TESTING/etc/upgrade/2.1/schema.Pg
   rtfm/branches/2.1-TESTING/etc/upgrade/2.1/schema.mysql
   rtfm/branches/2.1-TESTING/html/RTFM/Article/Elements/Preformatted
Log:
 * Add necisary "alter table" instructions to add "Display" to
   ClassCustomFields

 * Hidden and "Hidden when empty" fields should do the right thing
   when inserted into tickets.

 --This line, and those below, will be ignored--

M    2.1-TESTING/html/RTFM/Article/Elements/Preformatted
M    2.1-TESTING/etc/schema.mysql
M    2.1-TESTING/etc/schema.Oracle
M    2.1-TESTING/etc/schema.Pg
M    2.1-TESTING/etc/upgrade/2.1/schema.Oracle
M    2.1-TESTING/etc/upgrade/2.1/schema.mysql
M    2.1-TESTING/etc/upgrade/2.1/schema.Pg


Modified: rtfm/branches/2.1-TESTING/etc/schema.Oracle
==============================================================================
--- rtfm/branches/2.1-TESTING/etc/schema.Oracle	(original)
+++ rtfm/branches/2.1-TESTING/etc/schema.Oracle	Fri Aug 13 11:33:51 2004
@@ -23,7 +23,7 @@
 Creator NUMBER(11,0) DEFAULT 0 NOT NULL,
 Created DATE,
 SortOrder NUMBER(11,0) DEFAULT 0 NOT NULL,
-Display varchar2(255) DEFAULT 'normal' NOT NULL,
+Display varchar2(255) DEFAULT '' NOT NULL,
 LastUpdatedBy NUMBER(11,0) DEFAULT 0 NOT NULL,
 LastUpdated DATE
 );

Modified: rtfm/branches/2.1-TESTING/etc/schema.Pg
==============================================================================
--- rtfm/branches/2.1-TESTING/etc/schema.Pg	(original)
+++ rtfm/branches/2.1-TESTING/etc/schema.Pg	Fri Aug 13 11:33:51 2004
@@ -20,7 +20,7 @@
 Creator integer NOT NULL DEFAULT 0,
 Created TIMESTAMP NULL,
 SortOrder smallint not null default '0',
-Display varchar(255) not null default 'normal',
+Display varchar(255) not null default '',
 LastUpdatedBy integer NOT NULL DEFAULT 0,
 LastUpdated TIMESTAMP NULL,
 PRIMARY KEY (id)

Modified: rtfm/branches/2.1-TESTING/etc/schema.mysql
==============================================================================
--- rtfm/branches/2.1-TESTING/etc/schema.mysql	(original)
+++ rtfm/branches/2.1-TESTING/etc/schema.mysql	Fri Aug 13 11:33:51 2004
@@ -20,7 +20,7 @@
 Creator integer NOT NULL DEFAULT 0,
 Created DATETIME NULL,
 SortOrder int(2) not null default '0',
-Display varchar(255) not null default 'normal',
+Display varchar(255) not null default '',
 LastUpdatedBy integer NOT NULL DEFAULT 0,
 LastUpdated DATETIME NULL,
 PRIMARY KEY (id)

Modified: rtfm/branches/2.1-TESTING/etc/upgrade/2.1/schema.Oracle
==============================================================================
--- rtfm/branches/2.1-TESTING/etc/upgrade/2.1/schema.Oracle	(original)
+++ rtfm/branches/2.1-TESTING/etc/upgrade/2.1/schema.Oracle	Fri Aug 13 11:33:51 2004
@@ -18,3 +18,7 @@
 ObjectType varchar2(64) DEFAULT '' NOT NULL,
 ObjectId NUMBER(11,0) NOT NULL
 );
+
+
+ALTER TABLE FM_ClassCustomFields
+ADD Display varchar2(255) DEFAULT '' NOT NULL;

Modified: rtfm/branches/2.1-TESTING/etc/upgrade/2.1/schema.Pg
==============================================================================
--- rtfm/branches/2.1-TESTING/etc/upgrade/2.1/schema.Pg	(original)
+++ rtfm/branches/2.1-TESTING/etc/upgrade/2.1/schema.Pg	Fri Aug 13 11:33:51 2004
@@ -16,3 +16,7 @@
 ObjectId integer NOT NULL,
 PRIMARY KEY (id)
 );
+
+
+ALTER TABLE FM_ClassCustomFields
+ADD Display varchar(255) not null default '';

Modified: rtfm/branches/2.1-TESTING/etc/upgrade/2.1/schema.mysql
==============================================================================
--- rtfm/branches/2.1-TESTING/etc/upgrade/2.1/schema.mysql	(original)
+++ rtfm/branches/2.1-TESTING/etc/upgrade/2.1/schema.mysql	Fri Aug 13 11:33:51 2004
@@ -16,3 +16,7 @@
 ObjectId integer NOT NULL,
 PRIMARY KEY (id)
 ) TYPE=InnoDB;
+
+
+ALTER TABLE FM_ClassCustomFields
+ADD COLUMN Display varchar(255) not null default '';

Modified: rtfm/branches/2.1-TESTING/html/RTFM/Article/Elements/Preformatted
==============================================================================
--- rtfm/branches/2.1-TESTING/html/RTFM/Article/Elements/Preformatted	(original)
+++ rtfm/branches/2.1-TESTING/html/RTFM/Article/Elements/Preformatted	Fri Aug 13 11:33:51 2004
@@ -24,31 +24,38 @@
 %my $cfs = $Article->ClassObj->CustomFields;  
 % while (my $cf = $cfs->Next) {
 
-% my $values = $Article->CustomFieldValues($cf->Id);
-% if ($cf->Type eq 'TextSingle') {
-% my $value = $values->First; 
-% my $content = $value ? $value->Content : "";
-% if ($content =~ /<(.{1,5})>/) {
-%    $content = de_htmlify($content);
-% }
-<%$cf->Name%>:
-<%'-' x length($cf->Name) %>
-<%$content%>
-% } else {
-% my $val = $values->Next;
-% my $content = $val ? $val->Content : "";
-% if ($content =~ /<(.{1,5})>/) {
-%    $content = de_htmlify($content);
-% }
-<%$cf->Name%>: <%$val && $content%>
-% while ($val = $values->Next) { 
-% my $content = $val->Content;
-% if ($content =~ /<(.{1,5})>/) {
-%    $content = de_htmlify($content);
-% }
-<%' ' x length($cf->Name)%>  <%$content%>
-% } 
-% }
+%   my $ccf = RT::FM::ClassCustomField->new($session{'CurrentUser'});
+%   $ccf->LoadByCols(Class => $Article->ClassObj->Id, CustomField => $cf->Id);
+%   my $values = $Article->CustomFieldValues($cf->Id);
+%   my $display = $ccf->Display;
+%   if ($display eq "Hidden when empty") {
+%     $display = $values->Count ? "Visible" : "Hidden";
+%   }
+%   next if $display eq "Hidden";
+%   if ($cf->Type eq 'TextSingle') {
+%     my $value = $values->First; 
+%     my $content = $value ? $value->Content : "";
+%     if ($content =~ /<(.{1,5})>/) {
+%       $content = de_htmlify($content);
+%     }
+<%    $cf->Name%>:
+<%    '-' x length($cf->Name) %>
+<%    $content%>
+%   } else {
+%     my $val = $values->Next;
+%     my $content = $val ? $val->Content : "";
+%     if ($content =~ /<(.{1,5})>/) {
+%       $content = de_htmlify($content);
+%     }
+<%    $cf->Name%>: <%$val && $content%>
+%     while ($val = $values->Next) { 
+%       my $content = $val->Content;
+%       if ($content =~ /<(.{1,5})>/) {
+%         $content = de_htmlify($content);
+%       }
+<%      ' ' x length($cf->Name)%>  <%$content%>
+%     } 
+%   }
 % }
 
 <%init>


More information about the Rt-commit mailing list